Home » Modeling » UML2 » How to get diagram information from XMI2.1 file exported by Enterprise Architect
How to get diagram information from XMI2.1 file exported by Enterprise Architect [message #871471] |
Mon, 14 May 2012 02:39 |
jy zhang Messages: 20 Registered: May 2012 |
Junior Member |
|
|
I've got model information from xmi2.1 file exported by EA successfully.
But when I want to get diagram information from the xmi2.1 file,
I can only get extensionMap(EObject,AnyType),
and no idea how to get the diagram from the extensionMap.
should I analyse the extensionMap by myself?
anybody can help me? Thanks!
public static void main(String[] args) {
ResourceSet resourceSet = createResourceSet();
URI uri = URI.createURI("er.xmi");
Package model = UML2Util.load(resourceSet, uri, UMLPackage.Literals.PACKAGE);
//try to get diagram and notation information
XMIResource res = (XMIResource) resourceSet.getResource(uri, true);
Map<EObject, AnyType> extensionMap = res.getEObjectToExtensionMap();
}
er.xmi contains extension like below:
<xmi:Extension extender="Enterprise Architect" extenderID="6.5">
<elements></elements>
<connectors></connectors>
<primitivetypes></primitivetypes>
<profiles/>
<diagrams></diagrams>
</xmi:Extension>
-
Attachment: er.xmi
(Size: 10.34KB, Downloaded 461 times)
[Updated on: Mon, 14 May 2012 06:40] Report message to a moderator
|
|
| | | |
Re: How to get diagram information from XMI2.1 file exported by Enterprise Architect [message #873385 is a reply to message #873380] |
Fri, 18 May 2012 05:27 |
Ed Willink Messages: 7670 Registered: July 2009 |
Senior Member |
|
|
Hi Ed
I'm not sure what you mean. The original message had a follow on message
containing:
"When I load the xmi file, it seems it didn't dealt Integer as EClass
(general of EA "int").
org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Value
mailto:'org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl@5c0662
(eProxyURI: http:||schema.omg.org/spec/UML/2.1/uml.xml#Integer eClass:
mailto:org.eclipse.emf.ecore.impl.EClassImpl@1a728d6 (name: Classifier)
(instanceClassName: null) (abstract: false, interface: false))' is not
legal.
at
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:83)"
which is what I call an unresolved proxy. Is my terminology incorrect?
Regards
Ed
On 18/05/2012 06:15, Ed Merks wrote:
> Ed,
>
> AnyTypeImpl's are generally used to represent unrecognized content
> (something that couldn't be matched to a model), or things like XMI
> extensions for which there is no corresponding model). They're not
> likely to be proxies; object of the feature's expected type with a
> proxy URI will appear for that...
>
> On 17/05/2012 6:57 PM, Ed Willink wrote:
>> Hi
>>
>> I've no idea what you're really asking.
>>
>> In my experience, AnyTypeImpl's are often unresolved proxies, so far
>> from OK.
>>
>> Diagram Interchange is not supported between UML tools. UML 2.5 will
>> introduce a UML DI model.
>>
>> Since DI is based on GMF Notation, and Papyrus uses GMF Notation, it
>> may not be too hard for Papyrus to support the eventual UML 2.5 DI.
>>
>> Regards
>>
>> Ed Willink
>>
>> On 16/05/2012 03:16, jy zhang wrote:
>>> I tried to anylyse and parse the AnyTypeImpl of the EA extension
>>> information.
>>> It seems OK but a little complex.
>>
|
|
|
Re: How to get diagram information from XMI2.1 file exported by Enterprise Architect [message #873387 is a reply to message #873385] |
Fri, 18 May 2012 05:36 |
Ed Merks Messages: 33217 Registered: July 2009 |
Senior Member |
|
|
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Ed,<br>
<br>
I see code like this that's dealing with extensions.<br>
<br>
<pre wrap=""> //try to get diagram and notation information
XMIResource res = (XMIResource) resourceSet.getResource(uri, true);
Map<EObject, AnyType> extensionMap = res.getEObjectToExtensionMap();
And XMI the looks like this:
<xmi:Extension extender="Enterprise Architect" extenderID="6.5">
<elements></elements>
<connectors></connectors>
<primitivetypes></primitivetypes>
<profiles/>
<diagrams></diagrams>
</xmi:Extension>
</pre>
<br>
This article is useful for understanding how AnyType is analogous to
DOM Element.<b><br>
</b>
<blockquote><a target="_out"
href="http://www.theserverside.com/tt/articles/article.tss?l=BindingXMLJava">Binding
XML to Java</a><br>
</blockquote>
What you quote below is in a different thread titled "how to load
int generals from Integer<b>".<br>
<br>
<br>
</b>On 18/05/2012 7:27 AM, Ed Willink wrote:
<blockquote cite="mid:jp4mjh$2b0$1@xxxxxxxxe.org" type="cite">Hi
Ed
<br>
<br>
I'm not sure what you mean. The original message had a follow on
message containing:
<br>
<br>
"When I load the xmi file, it seems it didn't dealt Integer as
EClass (general of EA "int").
<br>
org.eclipse.emf.ecore.resource.Resource$IOWrappedException: Value
<a class="moz-txt-link-freetext" href="mailto:'org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl@5c0662">mailto:'org.eclipse.emf.ecore.xml.type.impl.AnyTypeImpl@5c0662</a>
(eProxyURI: http:||schema.omg.org/spec/UML/2.1/uml.xml#Integer
eClass: <a class="moz-txt-link-freetext" href="mailto:org.eclipse.emf.ecore.impl.EClassImpl@1a728d6">mailto:org.eclipse.emf.ecore.impl.EClassImpl@1a728d6</a>
(name: Classifier) (instanceClassName: null) (abstract: false,
interface: false))' is not legal.
<br>
at
org.eclipse.emf.ecore.xmi.impl.XMLLoadImpl.handleErrors(XMLLoadImpl.java:83)"<br>
<br>
which is what I call an unresolved proxy. Is my terminology
incorrect?
<br>
<br>
Regards
<br>
<br>
Ed
<br>
<br>
<br>
<br>
On 18/05/2012 06:15, Ed Merks wrote:
<br>
<blockquote type="cite">Ed,
<br>
<br>
AnyTypeImpl's are generally used to represent unrecognized
content (something that couldn't be matched to a model), or
things like XMI extensions for which there is no corresponding
model). They're not likely to be proxies; object of the
feature's expected type with a proxy URI will appear for that...
<br>
<br>
On 17/05/2012 6:57 PM, Ed Willink wrote:
<br>
<blockquote type="cite">Hi
<br>
<br>
I've no idea what you're really asking.
<br>
<br>
In my experience, AnyTypeImpl's are often unresolved proxies,
so far from OK.
<br>
<br>
Diagram Interchange is not supported between UML tools. UML
2.5 will introduce a UML DI model.
<br>
<br>
Since DI is based on GMF Notation, and Papyrus uses GMF
Notation, it may not be too hard for Papyrus to support the
eventual UML 2.5 DI.
<br>
<br>
Regards
<br>
<br>
Ed Willink
<br>
<br>
On 16/05/2012 03:16, jy zhang wrote:
<br>
<blockquote type="cite">I tried to anylyse and parse the
AnyTypeImpl of the EA extension information.
<br>
It seems OK but a little complex.
<br>
</blockquote>
<br>
</blockquote>
</blockquote>
<br>
</blockquote>
</body>
</html>
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
| | | |
Goto Forum:
Current Time: Tue Sep 24 00:56:18 GMT 2024
Powered by FUDForum. Page generated in 0.05476 seconds
|