Home » Modeling » UML2 » Serialize a UMLResource as OMG XMI
| | | |
Re: Serialize a UMLResource as OMG XMI [message #477633 is a reply to message #477632] |
Wed, 23 July 2008 14:01 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Joachim,
You can have a look at this article
http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_Guide/guide.html
at the section entitled programmatic migration and use a similar technique
to save to the .xmi extension ( the registerExtensions() method would have
to be modified slightly in addition to other small changes .. but that
should do it for you ). In addition, the code there shows how to properly
update references.
Cheers,
- James.
"Joachim Back" <j.back@mid.de> wrote in message
news:700c7a70d8fbe41c969453714bfc9a96$1@www.eclipse.org...
> Hi James,
>
> thanks for the quick answer.
> I tried it and it really worked. Awesome.
>
> How can I achieve this programmatically?
> I tried with setting "xmi" as file extension and failed.
> UMLResource umlTarget = ...
> sUri = sUri.replace(".profile.uml", ".xmi");
> sUri = sUri.replace(".uml", ".xmi");
> URI xmiUri = URI.createFileURI(sUri);
> umlTarget.setURI(xmiUri);
> umlTarget.save(mapOption);
> I assume that this is because, I have
> RESSET.getResourceFactoryRegistry().getExtensionToFactoryMap ().
> put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
> but I have not registered the file extension "xmi".
>
> Regards,
> Joachim
>
|
|
|
Re: Serialize a UMLResource as OMG XMI [message #477776 is a reply to message #477633] |
Thu, 02 October 2008 13:30 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
James,
I think we need to add an article that explains, in detail, how to convert
from an Eclipse UML model to an OMG UML or CMOF model and back, both via the
editor and programmatically. I'll be providing better support for this kind
of thing in the soon-to-be-proposed MST project (see
http://wiki.eclipse.org/MDT/MST-Proposal), but an article would also help
(and I'd be willing to write it)...
Kenn
"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:g67djv$olq$1@build.eclipse.org...
> Hi Joachim,
>
>
> You can have a look at this article
> http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_Guide/guide.html
> at the section entitled programmatic migration and use a similar technique
> to save to the .xmi extension ( the registerExtensions() method would have
> to be modified slightly in addition to other small changes .. but that
> should do it for you ). In addition, the code there shows how to properly
> update references.
>
> Cheers,
> - James.
>
>
>
>
>
> "Joachim Back" <j.back@mid.de> wrote in message
> news:700c7a70d8fbe41c969453714bfc9a96$1@www.eclipse.org...
>> Hi James,
>>
>> thanks for the quick answer.
>> I tried it and it really worked. Awesome.
>>
>> How can I achieve this programmatically?
>> I tried with setting "xmi" as file extension and failed.
>> UMLResource umlTarget = ...
>> sUri = sUri.replace(".profile.uml", ".xmi");
>> sUri = sUri.replace(".uml", ".xmi");
>> URI xmiUri = URI.createFileURI(sUri);
>> umlTarget.setURI(xmiUri);
>> umlTarget.save(mapOption);
>> I assume that this is because, I have
>> RESSET.getResourceFactoryRegistry().getExtensionToFactoryMap ().
>> put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
>> but I have not registered the file extension "xmi".
>>
>> Regards,
>> Joachim
>>
>
>
|
|
|
Re: Serialize a UMLResource as OMG XMI [message #477777 is a reply to message #477776] |
Thu, 02 October 2008 14:17 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Kenn,
Yes I agree, there should be some article explaining the ins and outs of
..cmof vs. .xmi vs .uml and how to convert back and forth.
Perhaps even explaining the differences between XMI and XML and the pros and
cons of both (inheritance etc.).
I also am a little uncertain about how to manage the overlap between
proposed features of the MST project and what is already supported in the
UML2 project.
Would moving existing xmi and cmof functionality from the UML2 project and
moving to the MST project make sense?
Cheers,
- James.
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
news:gc2ie8$gv9$1@build.eclipse.org...
> James,
>
> I think we need to add an article that explains, in detail, how to convert
> from an Eclipse UML model to an OMG UML or CMOF model and back, both via
> the editor and programmatically. I'll be providing better support for this
> kind of thing in the soon-to-be-proposed MST project (see
> http://wiki.eclipse.org/MDT/MST-Proposal), but an article would also help
> (and I'd be willing to write it)...
>
> Kenn
>
> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> news:g67djv$olq$1@build.eclipse.org...
>> Hi Joachim,
>>
>>
>> You can have a look at this article
>> http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_Guide/guide.html
>> at the section entitled programmatic migration and use a similar
>> technique to save to the .xmi extension ( the registerExtensions() method
>> would have to be modified slightly in addition to other small changes ..
>> but that should do it for you ). In addition, the code there shows how
>> to properly update references.
>>
>> Cheers,
>> - James.
>>
>>
>>
>>
>>
>> "Joachim Back" <j.back@mid.de> wrote in message
>> news:700c7a70d8fbe41c969453714bfc9a96$1@www.eclipse.org...
>>> Hi James,
>>>
>>> thanks for the quick answer.
>>> I tried it and it really worked. Awesome.
>>>
>>> How can I achieve this programmatically?
>>> I tried with setting "xmi" as file extension and failed.
>>> UMLResource umlTarget = ...
>>> sUri = sUri.replace(".profile.uml", ".xmi");
>>> sUri = sUri.replace(".uml", ".xmi");
>>> URI xmiUri = URI.createFileURI(sUri);
>>> umlTarget.setURI(xmiUri);
>>> umlTarget.save(mapOption);
>>> I assume that this is because, I have
>>> RESSET.getResourceFactoryRegistry().getExtensionToFactoryMap ().
>>> put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
>>> but I have not registered the file extension "xmi".
>>>
>>> Regards,
>>> Joachim
>>>
>>
>>
>
>
|
|
|
Re: Serialize a UMLResource as OMG XMI [message #477781 is a reply to message #477777] |
Fri, 03 October 2008 01:17 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Well, I already have some code that extends editors in EMF and UML2 to ease
the conversion. The support for XMI and CMOF is useful in UML2, but its
approach is from a UML2 perspective, e.g. things that don't belong in OMG
UML or CMOF are preserved in annotations. In MST, support would be from a
CMOF perspective, so stuff that isn't needed is simply discarded. Basically,
I think there's a need for this kind of support in both projects.
Kenn
"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:gc2l39$so7$1@build.eclipse.org...
> Hi Kenn,
>
> Yes I agree, there should be some article explaining the ins and outs of
> .cmof vs. .xmi vs .uml and how to convert back and forth.
> Perhaps even explaining the differences between XMI and XML and the pros
> and cons of both (inheritance etc.).
>
> I also am a little uncertain about how to manage the overlap between
> proposed features of the MST project and what is already supported in the
> UML2 project.
> Would moving existing xmi and cmof functionality from the UML2 project and
> moving to the MST project make sense?
>
> Cheers,
> - James.
>
>
> "Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
> news:gc2ie8$gv9$1@build.eclipse.org...
>> James,
>>
>> I think we need to add an article that explains, in detail, how to
>> convert from an Eclipse UML model to an OMG UML or CMOF model and back,
>> both via the editor and programmatically. I'll be providing better
>> support for this kind of thing in the soon-to-be-proposed MST project
>> (see http://wiki.eclipse.org/MDT/MST-Proposal), but an article would also
>> help (and I'd be willing to write it)...
>>
>> Kenn
>>
>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
>> news:g67djv$olq$1@build.eclipse.org...
>>> Hi Joachim,
>>>
>>>
>>> You can have a look at this article
>>> http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_Guide/guide.html
>>> at the section entitled programmatic migration and use a similar
>>> technique to save to the .xmi extension ( the registerExtensions()
>>> method would have to be modified slightly in addition to other small
>>> changes .. but that should do it for you ). In addition, the code there
>>> shows how to properly update references.
>>>
>>> Cheers,
>>> - James.
>>>
>>>
>>>
>>>
>>>
>>> "Joachim Back" <j.back@mid.de> wrote in message
>>> news:700c7a70d8fbe41c969453714bfc9a96$1@www.eclipse.org...
>>>> Hi James,
>>>>
>>>> thanks for the quick answer.
>>>> I tried it and it really worked. Awesome.
>>>>
>>>> How can I achieve this programmatically?
>>>> I tried with setting "xmi" as file extension and failed.
>>>> UMLResource umlTarget = ...
>>>> sUri = sUri.replace(".profile.uml", ".xmi");
>>>> sUri = sUri.replace(".uml", ".xmi");
>>>> URI xmiUri = URI.createFileURI(sUri);
>>>> umlTarget.setURI(xmiUri);
>>>> umlTarget.save(mapOption);
>>>> I assume that this is because, I have
>>>> RESSET.getResourceFactoryRegistry().getExtensionToFactoryMap ().
>>>> put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
>>>> but I have not registered the file extension "xmi".
>>>>
>>>> Regards,
>>>> Joachim
>>>>
>>>
>>>
>>
>>
>
>
|
|
| | | |
Re: Serialize a UMLResource as OMG XMI [message #626824 is a reply to message #477632] |
Wed, 23 July 2008 14:01 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Joachim,
You can have a look at this article
http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_Guide/guide.html
at the section entitled programmatic migration and use a similar technique
to save to the .xmi extension ( the registerExtensions() method would have
to be modified slightly in addition to other small changes .. but that
should do it for you ). In addition, the code there shows how to properly
update references.
Cheers,
- James.
"Joachim Back" <j.back@mid.de> wrote in message
news:700c7a70d8fbe41c969453714bfc9a96$1@www.eclipse.org...
> Hi James,
>
> thanks for the quick answer.
> I tried it and it really worked. Awesome.
>
> How can I achieve this programmatically?
> I tried with setting "xmi" as file extension and failed.
> UMLResource umlTarget = ...
> sUri = sUri.replace(".profile.uml", ".xmi");
> sUri = sUri.replace(".uml", ".xmi");
> URI xmiUri = URI.createFileURI(sUri);
> umlTarget.setURI(xmiUri);
> umlTarget.save(mapOption);
> I assume that this is because, I have
> RESSET.getResourceFactoryRegistry().getExtensionToFactoryMap ().
> put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
> but I have not registered the file extension "xmi".
>
> Regards,
> Joachim
>
|
|
|
Re: Serialize a UMLResource as OMG XMI [message #626974 is a reply to message #477633] |
Thu, 02 October 2008 13:30 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
James,
I think we need to add an article that explains, in detail, how to convert
from an Eclipse UML model to an OMG UML or CMOF model and back, both via the
editor and programmatically. I'll be providing better support for this kind
of thing in the soon-to-be-proposed MST project (see
http://wiki.eclipse.org/MDT/MST-Proposal), but an article would also help
(and I'd be willing to write it)...
Kenn
"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:g67djv$olq$1@build.eclipse.org...
> Hi Joachim,
>
>
> You can have a look at this article
> http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_Guide/guide.html
> at the section entitled programmatic migration and use a similar technique
> to save to the .xmi extension ( the registerExtensions() method would have
> to be modified slightly in addition to other small changes .. but that
> should do it for you ). In addition, the code there shows how to properly
> update references.
>
> Cheers,
> - James.
>
>
>
>
>
> "Joachim Back" <j.back@mid.de> wrote in message
> news:700c7a70d8fbe41c969453714bfc9a96$1@www.eclipse.org...
>> Hi James,
>>
>> thanks for the quick answer.
>> I tried it and it really worked. Awesome.
>>
>> How can I achieve this programmatically?
>> I tried with setting "xmi" as file extension and failed.
>> UMLResource umlTarget = ...
>> sUri = sUri.replace(".profile.uml", ".xmi");
>> sUri = sUri.replace(".uml", ".xmi");
>> URI xmiUri = URI.createFileURI(sUri);
>> umlTarget.setURI(xmiUri);
>> umlTarget.save(mapOption);
>> I assume that this is because, I have
>> RESSET.getResourceFactoryRegistry().getExtensionToFactoryMap ().
>> put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
>> but I have not registered the file extension "xmi".
>>
>> Regards,
>> Joachim
>>
>
>
|
|
|
Re: Serialize a UMLResource as OMG XMI [message #626976 is a reply to message #477776] |
Thu, 02 October 2008 14:17 |
james bruck Messages: 1724 Registered: July 2009 |
Senior Member |
|
|
Hi Kenn,
Yes I agree, there should be some article explaining the ins and outs of
..cmof vs. .xmi vs .uml and how to convert back and forth.
Perhaps even explaining the differences between XMI and XML and the pros and
cons of both (inheritance etc.).
I also am a little uncertain about how to manage the overlap between
proposed features of the MST project and what is already supported in the
UML2 project.
Would moving existing xmi and cmof functionality from the UML2 project and
moving to the MST project make sense?
Cheers,
- James.
"Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
news:gc2ie8$gv9$1@build.eclipse.org...
> James,
>
> I think we need to add an article that explains, in detail, how to convert
> from an Eclipse UML model to an OMG UML or CMOF model and back, both via
> the editor and programmatically. I'll be providing better support for this
> kind of thing in the soon-to-be-proposed MST project (see
> http://wiki.eclipse.org/MDT/MST-Proposal), but an article would also help
> (and I'd be willing to write it)...
>
> Kenn
>
> "James Bruck" <jbruck@ca.ibm.com> wrote in message
> news:g67djv$olq$1@build.eclipse.org...
>> Hi Joachim,
>>
>>
>> You can have a look at this article
>> http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_Guide/guide.html
>> at the section entitled programmatic migration and use a similar
>> technique to save to the .xmi extension ( the registerExtensions() method
>> would have to be modified slightly in addition to other small changes ..
>> but that should do it for you ). In addition, the code there shows how
>> to properly update references.
>>
>> Cheers,
>> - James.
>>
>>
>>
>>
>>
>> "Joachim Back" <j.back@mid.de> wrote in message
>> news:700c7a70d8fbe41c969453714bfc9a96$1@www.eclipse.org...
>>> Hi James,
>>>
>>> thanks for the quick answer.
>>> I tried it and it really worked. Awesome.
>>>
>>> How can I achieve this programmatically?
>>> I tried with setting "xmi" as file extension and failed.
>>> UMLResource umlTarget = ...
>>> sUri = sUri.replace(".profile.uml", ".xmi");
>>> sUri = sUri.replace(".uml", ".xmi");
>>> URI xmiUri = URI.createFileURI(sUri);
>>> umlTarget.setURI(xmiUri);
>>> umlTarget.save(mapOption);
>>> I assume that this is because, I have
>>> RESSET.getResourceFactoryRegistry().getExtensionToFactoryMap ().
>>> put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
>>> but I have not registered the file extension "xmi".
>>>
>>> Regards,
>>> Joachim
>>>
>>
>>
>
>
|
|
|
Re: Serialize a UMLResource as OMG XMI [message #626980 is a reply to message #477777] |
Fri, 03 October 2008 01:17 |
Kenn Hussey Messages: 1620 Registered: July 2009 |
Senior Member |
|
|
Well, I already have some code that extends editors in EMF and UML2 to ease
the conversion. The support for XMI and CMOF is useful in UML2, but its
approach is from a UML2 perspective, e.g. things that don't belong in OMG
UML or CMOF are preserved in annotations. In MST, support would be from a
CMOF perspective, so stuff that isn't needed is simply discarded. Basically,
I think there's a need for this kind of support in both projects.
Kenn
"James Bruck" <jbruck@ca.ibm.com> wrote in message
news:gc2l39$so7$1@build.eclipse.org...
> Hi Kenn,
>
> Yes I agree, there should be some article explaining the ins and outs of
> .cmof vs. .xmi vs .uml and how to convert back and forth.
> Perhaps even explaining the differences between XMI and XML and the pros
> and cons of both (inheritance etc.).
>
> I also am a little uncertain about how to manage the overlap between
> proposed features of the MST project and what is already supported in the
> UML2 project.
> Would moving existing xmi and cmof functionality from the UML2 project and
> moving to the MST project make sense?
>
> Cheers,
> - James.
>
>
> "Kenn Hussey" <Kenn.Hussey@embarcadero.com> wrote in message
> news:gc2ie8$gv9$1@build.eclipse.org...
>> James,
>>
>> I think we need to add an article that explains, in detail, how to
>> convert from an Eclipse UML model to an OMG UML or CMOF model and back,
>> both via the editor and programmatically. I'll be providing better
>> support for this kind of thing in the soon-to-be-proposed MST project
>> (see http://wiki.eclipse.org/MDT/MST-Proposal), but an article would also
>> help (and I'd be willing to write it)...
>>
>> Kenn
>>
>> "James Bruck" <jbruck@ca.ibm.com> wrote in message
>> news:g67djv$olq$1@build.eclipse.org...
>>> Hi Joachim,
>>>
>>>
>>> You can have a look at this article
>>> http://www.eclipse.org/modeling/mdt/uml2/docs/guides/UML2_2. 0_Migration_Guide/guide.html
>>> at the section entitled programmatic migration and use a similar
>>> technique to save to the .xmi extension ( the registerExtensions()
>>> method would have to be modified slightly in addition to other small
>>> changes .. but that should do it for you ). In addition, the code there
>>> shows how to properly update references.
>>>
>>> Cheers,
>>> - James.
>>>
>>>
>>>
>>>
>>>
>>> "Joachim Back" <j.back@mid.de> wrote in message
>>> news:700c7a70d8fbe41c969453714bfc9a96$1@www.eclipse.org...
>>>> Hi James,
>>>>
>>>> thanks for the quick answer.
>>>> I tried it and it really worked. Awesome.
>>>>
>>>> How can I achieve this programmatically?
>>>> I tried with setting "xmi" as file extension and failed.
>>>> UMLResource umlTarget = ...
>>>> sUri = sUri.replace(".profile.uml", ".xmi");
>>>> sUri = sUri.replace(".uml", ".xmi");
>>>> URI xmiUri = URI.createFileURI(sUri);
>>>> umlTarget.setURI(xmiUri);
>>>> umlTarget.save(mapOption);
>>>> I assume that this is because, I have
>>>> RESSET.getResourceFactoryRegistry().getExtensionToFactoryMap ().
>>>> put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);
>>>> but I have not registered the file extension "xmi".
>>>>
>>>> Regards,
>>>> Joachim
>>>>
>>>
>>>
>>
>>
>
>
|
|
|
Goto Forum:
Current Time: Wed Apr 24 16:38:17 GMT 2024
Powered by FUDForum. Page generated in 0.04173 seconds
|