Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » EMF » Date attribute in Ecore model
Date attribute in Ecore model [message #423494] Wed, 01 October 2008 12:17 Go to next message
Andy Carpenter is currently offline Andy CarpenterFriend
Messages: 145
Registered: July 2009
Senior Member
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"'

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?

thanks
Andy.

--
-- ------------------------------------------------------------ -------------
Dr Andy Carpenter
School of Computer Science,
University of Manchester, Manchester M13 9PL, UK
Email: Andy.Carpenter@manchester.ac.uk
Tel: +44 161 275 6168
Fax: +44 161 275 6280
Re: Date attribute in Ecore model [message #423495 is a reply to message #423494] Wed, 01 October 2008 12:33 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30825
Registered: July 2009
Senior Member
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.
> 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.
>
>
Re: Date attribute in Ecore model [message #423500 is a reply to message #423495] Wed, 01 October 2008 13:45 Go to previous messageGo to next message
Andy Carpenter is currently offline Andy CarpenterFriend
Messages: 145
Registered: July 2009
Senior Member
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.
>>
>>
Re: Date attribute in Ecore model [message #423509 is a reply to message #423500] Wed, 01 October 2008 15:32 Go to previous messageGo to next message
Ed Merks is currently offline Ed MerksFriend
Messages: 30825
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.&nbsp; These
XML Schema-style formats are supported:<br>
<blockquote><small>&nbsp; protected static final DateFormat [] EDATE_FORMATS
= </small><br>
<small>&nbsp; {</small><br>
<small>&nbsp;&nbsp;&nbsp; new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSSZ"),</small ><br>
<small>&nbsp;&nbsp;&nbsp; new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'.'SSS"),</small ><br>
<small>&nbsp;&nbsp;&nbsp; new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss"),</small><br >
<small>&nbsp;&nbsp;&nbsp; new SafeSimpleDateFormat("yyyy-MM-dd'T'HH:mm"),</small><br>
<small>&nbsp;&nbsp;&nbsp; new SafeSimpleDateFormat("yyyy-MM-dd")</small><br>
<small>&nbsp; };</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">&lt;Ed.Merks@gmail.com&gt;</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--
Re: Date attribute in Ecore model [message #423512 is a reply to message #423509] Wed, 01 October 2008 15:49 Go to previous message
Andy Carpenter is currently offline Andy CarpenterFriend
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.
>>>>
>>>>
>>>>
>>
>>
>>
>
Previous Topic:[CDO] maybe some mistakes about CDO and Teneo
Next Topic:[CDO] NOOP store problems
Goto Forum:
  


Current Time: Wed Jan 29 18:09:39 GMT 2020

Powered by FUDForum. Page generated in 0.02223 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top