EMF to XML Persistence [message #403755] |
Fri, 22 September 2006 03:54  |
Eclipse User |
|
|
|
Hi ,
I have a small issue while persisting EMF (XMI) as XML .I have an EMF
model I want that model to be persisted as XML
E.g I have Struts EMF model and it needs to be persisted as
Struts-config.xml
I have a set of Mappings EMF Feature to XML element , but i get errors
while loading the model
Say for e.g my Root Feature StrutsConfigType of EMF is mapped to a XML
element <struts-config> , its saving properly but when i try to load the
same in the editor its searching for the struts-config as feature rather
than my actual StrutsConfigType EClass .
Any pointers and help in this Regard will be highly apperiaciated.Also
some examples on using EXTENDED_META_DATA option and its sub classes
Thanks,
Kamesh
|
|
|
|
|
Re: EMF to XML Persistence [message #403766 is a reply to message #403765] |
Fri, 22 September 2006 10:47   |
Eclipse User |
|
|
|
Kamesh,
One of the things you can do is Generate Test Code and that will produce
an XyzExample.java in the *.tests project. With that you should be able
to reproduce any problems in a minimal environment. If you could zip up
your model project and your *.tests project for that model, modified to
reproduce the problem you are seeing, then I can much more easily answer
your question via such a concrete example. You can send it to my e-mail
directly if you don't wish to make it public in the newsgroup as an
attachment. My e-mail is merks at ca dot ibm dot com.
Kamesh Sampath wrote:
> Ed Merks wrote:
>> Kamesh,
>>
>> Does your model have a DocumentRoot EClass? Is it based on a schema
>> originally, i.e., did you import the model from a .xsd? If there is
>> a document root present, the root element of the instance must match
>> one of the element-based features in the document root; only if there
>> is no document root will the element name be used to look up an
>> EClass. The files org.eclipse.emf.ecore.xmi.impl.EMOF*.java show we
>> use this to serialize .ecore as .emof.
>>
>>
>> Kamesh Sampath wrote:
>>> Hi ,
>>>
>>> I have a small issue while persisting EMF (XMI) as XML .I have an
>>> EMF model I want that model to be persisted as XML
>>> E.g I have Struts EMF model and it needs to be persisted as
>>> Struts-config.xml
>>>
>>> I have a set of Mappings EMF Feature to XML element , but i get
>>> errors while loading the model
>>> Say for e.g my Root Feature StrutsConfigType of EMF is mapped to a
>>> XML element <struts-config> , its saving properly but when i try to
>>> load the same in the editor its searching for the struts-config as
>>> feature rather than my actual StrutsConfigType EClass .
>>> Any pointers and help in this Regard will be highly
>>> apperiaciated.Also some examples on using EXTENDED_META_DATA option
>>> and its sub classes
>>>
>>> Thanks,
>>> Kamesh
>>>
>>>
> Ed:
> I dont have the document root I just used the DTD and generate the
> *.ecore file from scratch matching the DTD . When i save the model its
> saving it properly but when i load the same in the Editor it sucks !
> I followed the IBM Redbook on EMF and GEF to do the Custom serilization.
> Please let me know what are all the things i need to take care when
> saving and loding the document.
>
> I want to simulate somthing like the plugin.xml editor for Struts
> configuation file editing .
>
> Thanks
> Kamesh
|
|
|
Re: EMF to XML Persistence [message #403767 is a reply to message #403766] |
Fri, 22 September 2006 10:55  |
Eclipse User |
|
|
|
Ed Merks wrote:
> Kamesh,
>
> One of the things you can do is Generate Test Code and that will produce
> an XyzExample.java in the *.tests project. With that you should be able
> to reproduce any problems in a minimal environment. If you could zip up
> your model project and your *.tests project for that model, modified to
> reproduce the problem you are seeing, then I can much more easily answer
> your question via such a concrete example. You can send it to my e-mail
> directly if you don't wish to make it public in the newsgroup as an
> attachment. My e-mail is merks at ca dot ibm dot com.
>
>
> Kamesh Sampath wrote:
>> Ed Merks wrote:
>>> Kamesh,
>>>
>>> Does your model have a DocumentRoot EClass? Is it based on a schema
>>> originally, i.e., did you import the model from a .xsd? If there is
>>> a document root present, the root element of the instance must match
>>> one of the element-based features in the document root; only if there
>>> is no document root will the element name be used to look up an
>>> EClass. The files org.eclipse.emf.ecore.xmi.impl.EMOF*.java show we
>>> use this to serialize .ecore as .emof.
>>>
>>>
>>> Kamesh Sampath wrote:
>>>> Hi ,
>>>>
>>>> I have a small issue while persisting EMF (XMI) as XML .I have an
>>>> EMF model I want that model to be persisted as XML
>>>> E.g I have Struts EMF model and it needs to be persisted as
>>>> Struts-config.xml
>>>>
>>>> I have a set of Mappings EMF Feature to XML element , but i get
>>>> errors while loading the model
>>>> Say for e.g my Root Feature StrutsConfigType of EMF is mapped to a
>>>> XML element <struts-config> , its saving properly but when i try to
>>>> load the same in the editor its searching for the struts-config as
>>>> feature rather than my actual StrutsConfigType EClass .
>>>> Any pointers and help in this Regard will be highly
>>>> apperiaciated.Also some examples on using EXTENDED_META_DATA option
>>>> and its sub classes
>>>>
>>>> Thanks,
>>>> Kamesh
>>>>
>>>>
>> Ed:
>> I dont have the document root I just used the DTD and generate the
>> *.ecore file from scratch matching the DTD . When i save the model its
>> saving it properly but when i load the same in the Editor it sucks !
>> I followed the IBM Redbook on EMF and GEF to do the Custom serilization.
>> Please let me know what are all the things i need to take care when
>> saving and loding the document.
>>
>> I want to simulate somthing like the plugin.xml editor for Struts
>> configuation file editing .
>>
>> Thanks
>> Kamesh
Ed:
Thanks for the input . Will try to do the way you told ,if am not
successfull will send it across to your email.
Regards,
Kamesh
|
|
|
Powered by
FUDForum. Page generated in 0.04089 seconds