Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » How to load MagicDraw .uml file?
How to load MagicDraw .uml file? [message #627925] Thu, 03 September 2009 19:43
Scott is currently offline ScottFriend
Messages: 33
Registered: July 2009
Member
Hi,
I have hard time to load a MagicDraw (16.5) .uml file.
I followed most threads about this topic but still with no luck.

I’m not sure if it’s a big or small issue. Here is the code I’m struggling
with, can anyone please help?

=======
ResourceSet resourceSet = new ResourceSetImpl();
resourceSet.getPackageRegistry().put(UMLPackage.eNS_URI,
UMLPackage.eINSTANCE);
resourceSet.getPackageRegistry().put(UML212UMLResource.UML_M ETAMODEL_NS_URI,
UMLPackage.eINSTANCE);

resourceSet.getResourceFactoryRegistry().getExtensionToFacto ryMap().put(UMLResource.FILE_EXTENSION,
UMLResource.Factory.INSTANCE);
Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();
URI uri =
URI.createURI(" jar:file:/C:/Eclipse-3.5/plugins/org.eclipse.uml2.uml.resour ces_3.0.0.v200906011111.jar!/ ");
uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP),
uri.appendSegment("libraries").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
uri.appendSegment("metamodels").appendSegment(""));
uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP),
uri.appendSegment("profiles").appendSegment(""));

Resource model = resourceSet.getResource(URI.createURI(inputFile), true);
==========

And here is the .uml file I want to load:

==========
<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.1"
xmlns:xmi="http://schema.omg.org/spec/XMI/2.1"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"

xmlns:MagicDrawProfile="http:///schemas/MagicDrawProfile/_1_2C0Ji9Ed6q1qHohKbyGg/0"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmlns:uml="http://www.eclipse.org/uml2/2.1.0/UML"

xsi:schemaLocation="http:///schemas/MagicDrawProfile/_1_2C0Ji9Ed6q1qHohKbyGg/0
UML_Standard_Profile.MagicDraw_Profile.profile.uml#_1__z05i9 Ed6q1qHohKbyGg "
>

<uml:Model xmi:id="eee_1045467100313_135436_1" name="Model1"
viewpoint="">
<ownedComment xmi:id="_16_5_3_abd02bc_1251701109265_804173_327"
body="Author:Scott.&#xA;Created:8/31/09 2:45
AM.&#xA;Title:.&#xA;Comment:.&#xA;"
annotatedElement="eee_1045467100313_135436_1"/>
<packageImport xmi:id="_0primitiveTypesModel1">
<importedPackage xmi:type="uml:Model"
href="pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#_0"/>
</packageImport>

<packageImport xmi:id="_0javaPrimitiveTypesModel1">
<importedPackage xmi:type="uml:Model"
href="pathmap://UML_LIBRARIES/JavaPrimitiveTypes.library.uml#_0"/>
</packageImport>

<packagedElement xmi:type="uml:Class"
xmi:id="_16_5_3_abd02bc_1251701135265_504936_485" name="Party">
<ownedAttribute xmi:id="_16_5_3_abd02bc_1252003262984_28701_344"
name="id" visibility="private">
<type xmi:type="uml:PrimitiveType"
href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
</ownedAttribute>
</packagedElement>

<packagedElement xmi:type="uml:Class"
xmi:id="_16_5_3_abd02bc_1251701181265_269840_527" name="Person">
<generalization xmi:id="_16_5_3_abd02bc_1251701230265_212164_567"
isSubstitutable="true" general="_16_5_3_abd02bc_1251701135265_504936_485"/>
<ownedAttribute xmi:id="_16_5_3_abd02bc_1252003424078_454269_346"
name="firstName" visibility="private">
<type xmi:type="uml:PrimitiveType"
href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
</ownedAttribute>
<ownedAttribute xmi:id="_16_5_3_abd02bc_1252003476765_223420_348"
name="lastName" visibility="private">
<type xmi:type="uml:PrimitiveType"
href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
</ownedAttribute>
</packagedElement>

<packagedElement xmi:type="uml:Class"
xmi:id="_16_5_3_abd02bc_1251701207828_514562_547" name="Organization">
<generalization xmi:id="_16_5_3_abd02bc_1251701234796_430688_570"
isSubstitutable="true" general="_16_5_3_abd02bc_1251701135265_504936_485"/>
<ownedAttribute xmi:id="_16_5_3_abd02bc_1252003514750_486856_350"
name="type" visibility="private">
<type xmi:type="uml:PrimitiveType"
href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#String"/>
</ownedAttribute>
<ownedAttribute xmi:id="_16_5_3_abd02bc_1252003533921_850191_352"
name="taxId" visibility="private">
<type xmi:type="uml:PrimitiveType"
href=" pathmap://UML_LIBRARIES/UMLPrimitiveTypes.library.uml#Intege r"/>
</ownedAttribute>
</packagedElement>

<packagedElement xmi:type="uml:Package"
xmi:id="magicdraw_uml_standard_profile_v_0001" name="UML Standard Profile">
<ownedComment xmi:id="_be00301_1078843546940_242228_131" body="UML
Standard Profile contains several popular stereotypes, tag definitions and
constraints described in UML 2 Specifications."
annotatedElement="magicdraw_uml_standard_profile_v_0001"/>
</packagedElement>

<profileApplication
xmi:id=" _11_5_be00301_1153310565718_226811_161profileApplicationMode l1 ">
<eAnnotations xmi:id="_2AJDhJi9Ed6q1qHohKbyGg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href=" UML_Standard_Profile.MagicDraw_Profile.DSL_Customization.pro file.uml#_2AJCtJi9Ed6q1qHohKbyGg "/>
</eAnnotations>
<appliedProfile
href=" UML_Standard_Profile.MagicDraw_Profile.DSL_Customization.pro file.uml#_11_5_be00301_1153310565718_226811_161 "/>
</profileApplication>

<profileApplication
xmi:id="_be00301_1073394351331_445580_2profileApplicationModel1 ">
<eAnnotations xmi:id="_2ASuwZi9Ed6q1qHohKbyGg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href=" UML_Standard_Profile.MagicDraw_Profile.profile.uml#_1__z05i9 Ed6q1qHohKbyGg "/>
</eAnnotations>
<appliedProfile
href=" UML_Standard_Profile.MagicDraw_Profile.profile.uml#_be00301_ 1073394351331_445580_2 "/>
</profileApplication>

<profileApplication
xmi:id=" _11_5_f720368_1159529670215_231387_1profileApplicationModel1 ">
<eAnnotations xmi:id="_2ASuw5i9Ed6q1qHohKbyGg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href=" UML_Standard_Profile.Validation_Profile.profile.uml#_2AJArZi 9Ed6q1qHohKbyGg "/>
</eAnnotations>
<appliedProfile
href=" UML_Standard_Profile.Validation_Profile.profile.uml#_11_5_f7 20368_1159529670215_231387_1 "/>
</profileApplication>

<profileApplication
xmi:id=" _9_0_be00301_1108050582343_527400_10847profileApplicationMod el1 ">
<eAnnotations xmi:id="_2ASuxZi9Ed6q1qHohKbyGg"
source="http://www.eclipse.org/uml2/2.0.0/UML">
<references xmi:type="ecore:EPackage"
href=" UML_Standard_Profile.UML_Standard_Profile.profile.uml#_2AI-8 5i9Ed6q1qHohKbyGg "/>
</eAnnotations>
<appliedProfile
href=" UML_Standard_Profile.UML_Standard_Profile.profile.uml#_9_0_b e00301_1108050582343_527400_10847 "/>
</profileApplication>
</uml:Model>

<MagicDrawProfile:auxiliaryResource xmi:id="_2FW1Dpi9Ed6q1qHohKbyGg"
base_Element="magicdraw_uml_standard_profile_v_0001"
base_Package="magicdraw_uml_standard_profile_v_0001"/>
</xmi:XMI>
===========


Thanks,

Scott
Previous Topic:stereotype's attribute and DynamicEObjectImpl
Next Topic:stereotype's attribute and DynamicEObjectImpl
Goto Forum:
  


Current Time: Fri Apr 26 06:22:52 GMT 2024

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

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

Back to the top