[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Newsgroup Home]
[news.eclipse.modeling.m2m] Re: [ATL]Loading UML models

Thanks john, thanks a lot.

I neeeded register the uri.

my solution was:

ResourceSet resourceSet = ASMEMFModel.getResourceSet();

resourceSet.getPackageRegistry().put("http://www.eclipse.org/uml2/2.0.0/UML";, UMLPackage.eINSTANCE);
resourceSet.getPackageRegistry().put("http:///schemas/MagicDrawProfile/_J72JQCGrEd2cVNUYIoYh2A/0";, UMLPackage.eINSTANCE);

URI uri = URI.createURI("jar:file:///Z:/<<path>>/lib/org.eclipse.uml2.uml.resources_2.2.0.v20080309.jar!/");


resourceSet.getURIConverter().URI_MAP.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP), uri.appendSegment("libraries").appendSegment(""));

resourceSet.getURIConverter().URI_MAP.put(URI.createURI(UMLResource.METAMODELS_PATHMAP), uri.appendSegment("metamodels").appendSegment(""));

resourceSet.getURIConverter().URI_MAP.put(URI.createURI(UMLResource.PROFILES_PATHMAP), uri.appendSegment("profiles").appendSegment(""));
resourceSet.getResourceFactoryRegistry().getExtensionToFactoryMap().put(UMLResource.FILE_EXTENSION, UMLResource.Factory.INSTANCE);



Now i have another doubt. When the magicDraw create the file of the model, it put the xsi:schemaLocation attribute as "http:///schemas/MagicDrawProfile/_J72JQCGrEd2cVNUYIoYh2A/0"; and it add a node on xmi the <MagicDrawProfile:auxiliaryResource>. You know how can i ignorate this information?


for now, i m pre-processing the xmi altering these infomation.

Well, Thanks again