[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.mdt.uml2] Re: Serialize a UMLResource as OMG XMI

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@xxxxxxxxxx> wrote in message 
news:gc2l39$so7$1@xxxxxxxxxxxxxxxxxxxx
> 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@xxxxxxxxxxxxxxx> wrote in message 
> news:gc2ie8$gv9$1@xxxxxxxxxxxxxxxxxxxx
>> 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@xxxxxxxxxx> wrote in message 
>> news:g67djv$olq$1@xxxxxxxxxxxxxxxxxxxx
>>> 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@xxxxxx> wrote in message 
>>> news:700c7a70d8fbe41c969453714bfc9a96$1@xxxxxxxxxxxxxxxxxx
>>>> 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
>>>>
>>>
>>>
>>
>>
>
>