Home » Modeling » EMF » Date attribute in Ecore model
| | |
Re: Date attribute in Ecore model [message #423509 is a reply to message #423500] |
Wed, 01 October 2008 15:32 |
Ed Merks Messages: 33140 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------000604000903070200070405
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
Andy,
In that case, you need to conform to how EDate serializes dates. These
XML Schema-style formats are supported:
protected static final DateFormat [] EDATE_FORMATS =
{
new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSSZ"),
new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSS"),
new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"),
new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm"),
new SafeSimpleDateFormat("yyyy-MM-dd")
};
Andy Carpenter wrote:
> Ed,
>
> Comments below
>
> "Ed Merks" <Ed.Merks@gmail.com> wrote in message
> news:gbvqml$vfo$1@build.eclipse.org...
>
>> Andy,
>>
>> Comments below.
>>
>> Andy Carpenter wrote:
>>
>>> I have an Ecore model that includes an attribute with the type
>>> Date. As part of the early stages of my development, I've generated
>>> the model, edit and editor code for this model. Now when I run the
>>> editor code to create an instance of the model the status bar for the
>>> editor shows 'WrappedException : java.text.ParseException:
>>> Unparsable date: "Tuesday, April 12, 1952"'
>>>
>>>
>> Did you use Ecore's EDate data type? It looks like maybe you defined
>> your own EDataType and then didn't specialize the XyzFactoryImpl's
>> createAbcFromString/convertAbcToString for that data type.
>>
>
> I used Date in my Emfatic model which appears to have been
> mapped to EDate in the resource used to generate the EMF model.
> The XyzFactoryImpl contains no 'date' type.
>
>
>>> Does anyone know if a date can be set via the properties field of
>>> the editor, or do I need to wait until I integrate my model into a more
>>> complete environment before I can set the value of a date attribute?
>>>
>>>
>> It really comes down to what data type you are using to support your
>> string round tripping..
>>
>>> thanks
>>> Andy.
>>>
>>>
>>>
>
>
>
--------------000604000903070200070405
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: 7bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Andy,<br>
<br>
In that case, you need to conform to how EDate serializes dates. These
XML Schema-style formats are supported:<br>
<blockquote><small> protected static final DateFormat [] EDATE_FORMATS
= </small><br>
<small> {</small><br>
<small> new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSSZ"),</small ><br>
<small> new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSS"),</small ><br>
<small> new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"),</small><br >
<small> new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm"),</small><br>
<small> new SafeSimpleDateFormat("yyyy-MM-dd")</small><br>
<small> };</small><br>
</blockquote>
<br>
Andy Carpenter wrote:
<blockquote cite="mid:gbvvaq$7ip$1@build.eclipse.org" type="cite">
<pre wrap="">Ed,
Comments below
"Ed Merks" <a class="moz-txt-link-rfc2396E" href="mailto:Ed.Merks@gmail.com"><Ed.Merks@gmail.com></a> wrote in message
<a class="moz-txt-link-freetext" href="news:gbvqml$vfo$1@build.eclipse.org">news:gbvqml$vfo$1@build.eclipse.org</a>...
</pre>
<blockquote type="cite">
<pre wrap="">Andy,
Comments below.
Andy Carpenter wrote:
</pre>
<blockquote type="cite">
<pre wrap="">I have an Ecore model that includes an attribute with the type
Date. As part of the early stages of my development, I've generated
the model, edit and editor code for this model. Now when I run the
editor code to create an instance of the model the status bar for the
editor shows 'WrappedException : java.text.ParseException:
Unparsable date: "Tuesday, April 12, 1952"'
</pre>
</blockquote>
<pre wrap="">Did you use Ecore's EDate data type? It looks like maybe you defined
your own EDataType and then didn't specialize the XyzFactoryImpl's
createAbcFromString/convertAbcToString for that data type.
</pre>
</blockquote>
<pre wrap=""><!---->
I used Date in my Emfatic model which appears to have been
mapped to EDate in the resource used to generate the EMF model.
The XyzFactoryImpl contains no 'date' type.
</pre>
<blockquote type="cite">
<blockquote type="cite">
<pre wrap="">Does anyone know if a date can be set via the properties field of
the editor, or do I need to wait until I integrate my model into a more
complete environment before I can set the value of a date attribute?
</pre>
</blockquote>
<pre wrap="">It really comes down to what data type you are using to support your
string round tripping..
</pre>
<blockquote type="cite">
<pre wrap=""> thanks
Andy.
</pre>
</blockquote>
</blockquote>
<pre wrap=""><!---->
</pre>
</blockquote>
</body>
</html>
--------------000604000903070200070405--
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
Re: Date attribute in Ecore model [message #423512 is a reply to message #423509] |
Wed, 01 October 2008 15:49 |
Andy Carpenter Messages: 145 Registered: July 2009 |
Senior Member |
|
|
Ed,
Thanks, that enabled me to enter a value.
Andy.
"Ed Merks" <Ed.Merks@gmail.com> wrote in message
news:gc0561$8sq$1@build.eclipse.org...
> Andy,
>
> In that case, you need to conform to how EDate serializes dates. These
> XML Schema-style formats are supported:
>
> protected static final DateFormat [] EDATE_FORMATS =
> {
> new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSSZ"),
> new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSS"),
> new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"),
> new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm"),
> new SafeSimpleDateFormat("yyyy-MM-dd")
> };
>
>
> Andy Carpenter wrote:
>> Ed,
>>
>> Comments below
>>
>> "Ed Merks" <Ed.Merks@gmail.com> wrote in message
>> news:gbvqml$vfo$1@build.eclipse.org...
>>
>>> Andy,
>>>
>>> Comments below.
>>>
>>> Andy Carpenter wrote:
>>>
>>>> I have an Ecore model that includes an attribute with the type
>>>> Date. As part of the early stages of my development, I've generated
>>>> the model, edit and editor code for this model. Now when I run the
>>>> editor code to create an instance of the model the status bar for the
>>>> editor shows 'WrappedException : java.text.ParseException:
>>>> Unparsable date: "Tuesday, April 12, 1952"'
>>>>
>>>>
>>> Did you use Ecore's EDate data type? It looks like maybe you defined
>>> your own EDataType and then didn't specialize the XyzFactoryImpl's
>>> createAbcFromString/convertAbcToString for that data type.
>>>
>>
>> I used Date in my Emfatic model which appears to have been
>> mapped to EDate in the resource used to generate the EMF model.
>> The XyzFactoryImpl contains no 'date' type.
>>
>>
>>>> Does anyone know if a date can be set via the properties field of
>>>> the editor, or do I need to wait until I integrate my model into a more
>>>> complete environment before I can set the value of a date attribute?
>>>>
>>>>
>>> It really comes down to what data type you are using to support your
>>> string round tripping..
>>>
>>>> thanks
>>>> Andy.
>>>>
>>>>
>>>>
>>
>>
>>
>
|
|
|
Goto Forum:
Current Time: Wed Apr 24 19:26:29 GMT 2024
Powered by FUDForum. Page generated in 0.03131 seconds
|