Community
Participate
Working Groups
Build ID: R200803051200 Steps To Reproduce: 1) Browse the Eclipse org.eclipse.uml2.uml implementation of the UML2 metamodel here: http://dev.eclipse.org/viewcvs/index.cgi/org.eclipse.mdt/org.eclipse.uml2/plugins/org.eclipse.uml2.uml/model/?root=Modeling_Project 2) Find which CVS tag corresponds to the official OMG artifacts here: http://www.omg.org/spec/UML/2.1.1/ http://www.omg.org/spec/UML/2.1.2/ More information: Suggestions: 1) Tag explicitly which versions of the Eclipse artifacts correspond with specific revisions from the OMG Example: Kenn Hussey seems to have done that partially in his comments on 10/18/06 with: "[16119] Updating source models based on UML 2.1.1." How about adding a tag: ECLIPSE_UML_2_1_1 and the corresponding URL for the OMG revision? 2) The same needs to be done for UML 2.1.2 3) The UML revisions from the OMG provide *.cmof files whereas the Eclipse sources are UML models (in IBM Rational Software Architect *.emx format and in Eclipse *.uml format) At EclipseCon 2008, Kenn Husssey said that all of the mechanisms for extracting the OMG *.cmof files are available in the Eclipse UML2 API. On the CVS head, I can see that the org.eclipse.uml2.uml plugin.xml registers org.eclipse.emf.ecore.content_parser for content type id org.eclipse.uml2.uml_2_0_0 and org.eclipse.uml2.uml_2_1_1 but not for the content type id defined for cmof, i.e., org.omg.mof.cmof_2_0 Can you please document how to load/save cmof artifacts to/from Eclipse *.uml models?
1. Specific releases of UML2 correspond to specific versions of UML. This question has been answered in the newsgroup several times, but here it is again (from memory): UML 2.0 ~ UML2 1.x (R1_0_maintenance, R1_1_maintenance) UML 2.1 ~ UML2 2.0.x (R2_0_maintenance) UML 2.1.1 ~ UML2 2.1.x (R_2_1_maintenance) 2. UML 2.1.2 ~ UML2 2.2 (HEAD) 3. James (the component lead) has promised several times to update the New & Noteworthy page (http://wiki.eclipse.org/index.php/MDT_1.1_New_and_Noteworthy), so it should be documented soon. In the meantime, to save a UML model as a CMOF model (using a recent UML2 2.2 build), open it using the sample (tree) editor, invoke the 'File > Save As...' menu item, and specify a file with a .cmof extension. To open a .cmof file with the UML editor, select the file in the explorer view an select 'Open With > UML Editor' from the context menu.
How do you handle import/export of mutually-dependent resources? Consider this: http://www.omg.org/spec/UML/20061001/Infrastructure.cmof http://www.omg.org/spec/UML/20061001/L0.cmof Note that L0.cmof merges Infrastructure::Core::{Basic,PrimitiveTypes} packages from Infrastructure.cmof Converting cmof-to-uml, one resource at a time produces: Infrastructure.cmof => Infrastructure.uml L0.cmof => L0.uml Now, we have L0.uml defined as the merge of Infrastructure::Core::{Basic,PrimitiveTypes} from Infrastructure.cmof instead of Infrastructure.uml Is it possible to define import/export conversion of various resources (*.ecore, *.xmi, *.cmof, *.uml, ...) as a self-contained EMF ResourceSet instead of a single EMF Resource?
Created attachment 95886 [details] Patch to org.eclipse.uml2.uml.editor to save multiple *.cmof as *.uml
With the attached patch, there is a new popup menu action that is enabled when one or more CMOF2UMLResources are selected. The action is similar to UMLEditor.doSaveAs() except that instead of saving the first resource, the new action saves all of the selected resources. Instead of prompting the user for a filename, the new action simply replaces the "cmof" extension from the original resource with the "uml" extension. I've tested this against workspace *.cmof resources imported from http://www.omg.org/spec/UML/2.1.2/
Created attachment 96034 [details] alternative changes Thanks for the contribution? I wondering, though, if the attached patch would equally meet your needs? It's a little more generic and fits a bit better with existing functionality... I also uncovered (and fixed) a bug while testing it.
Thanks indeed for cleaning this up! I also found that somewhere around the commits for [204200], the magic for opening *.cmof files broke. I managed to make a patch on top of yours by registering the extension factories in UMLEditor.createModel() before the call to createModelGen().
Created attachment 96696 [details] alternative changes, part deux
Use Kenn's alternative changes and then apply alternative chnages, part deux which patches just org.eclipse.uml2.uml.editor.presentation.UMLEditor.java
Thanks, Nicolas. I'm not sure why the "magic" was lost, as it's always worked in my workspace. I've committed the remaining changes in response to the content type support that's been added to the EMF code generator recently, as well as my changes for this bug. Please take a look at the latest code in CVS, and if the magic hasn't returned, let me know!
The changes are available in build I200804241720.