Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » UML2 » UML2 Versions
UML2 Versions [message #873876] Sat, 19 May 2012 10:18 Go to next message
Eclipse UserFriend
Hello,

suddenly i've realized, that i don't really understand version of what
specifies number 3.0.0 in the jar file name

org.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar

is that a version number of uml2 release, i.e. version of uml 2.x
metamodel implementation?

and what does 3.0.0 and 2.0.0 mean in the following namespace uri's?

http://www.eclipse.org/uml2/3.0.0/UML
http://www.eclipse.org/uml2/2.0.0/UML

Thanks in advance
Re: UML2 Versions [message #873890 is a reply to message #873876] Sat, 19 May 2012 11:26 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

3.0.0 is the Eclipse MDT/UML2 release number, which supports OMG UML
versions 2.1* and 2.2*.

4.0.0 for Juno adds OMG UML 2.4*

If you use plugins rather than Java projects you can just use
org.eclipse.uml2.uml.resources and forget about the suffixes.

Regards

Ed Willink

On 19/05/2012 11:18, Emil Huseynli wrote:
> Hello,
>
> suddenly i've realized, that i don't really understand version of what
> specifies number 3.0.0 in the jar file name
>
> org.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar
>
> is that a version number of uml2 release, i.e. version of uml 2.x
> metamodel implementation?
>
> and what does 3.0.0 and 2.0.0 mean in the following namespace uri's?
>
> http://www.eclipse.org/uml2/3.0.0/UML
> http://www.eclipse.org/uml2/2.0.0/UML
>
> Thanks in advance
Re: UML2 Versions [message #873904 is a reply to message #873890] Sat, 19 May 2012 12:24 Go to previous messageGo to next message
Eclipse UserFriend
i'm using emf and uml2 in a standalone app

then, how about

Registry packageRegistry = resourceSet.getPackageRegistry();
packageRegistry.put("http://www.eclipse.org/uml2/3.0.0/UML",
UMLPackage.eINSTANCE);
packageRegistry.put("http://www.eclipse.org/uml2/2.0.0/UML",
UMLPackage.eINSTANCE);

i.e. do i still have to register those namespaces in package registry?

On 19.05.2012 13:26, Ed Willink wrote:
>
> If you use plugins rather than Java projects you can just use
> org.eclipse.uml2.uml.resources and forget about the suffixes.
>
Re: UML2 Versions [message #873914 is a reply to message #873904] Sat, 19 May 2012 13:06 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

UML standalone init can be hard and varies according to how much
functionality you want.

Have you looked at
http://wiki.eclipse.org/index.php/MDT-UML2-FAQ#What.27s_required_to_load_a_UML_.28.uml.29_resource_from_a_standalone_application.3F

Juno introduces a UMLResourcesUtil.init() that does all the required
hard work.

Regards

Ed Willink

On 19/05/2012 13:24, Emil Huseynli wrote:
> i'm using emf and uml2 in a standalone app
>
> then, how about
>
> Registry packageRegistry = resourceSet.getPackageRegistry();
> packageRegistry.put("http://www.eclipse.org/uml2/3.0.0/UML",
> UMLPackage.eINSTANCE);
> packageRegistry.put("http://www.eclipse.org/uml2/2.0.0/UML",
> UMLPackage.eINSTANCE);
>
> i.e. do i still have to register those namespaces in package registry?
>
> On 19.05.2012 13:26, Ed Willink wrote:
>>
>> If you use plugins rather than Java projects you can just use
>> org.eclipse.uml2.uml.resources and forget about the suffixes.
>>
Re: UML2 Versions [message #873919 is a reply to message #873914] Sat, 19 May 2012 13:26 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

yes, i've already use that in my app, and it seems that i'm able to
handle xmi files with uml models inside, but i'm not sure whether code
i've used is generic enough to handle most used xmi formats/uml models.
And i also not really understand that code fully. Below is the method
which creates and configures resource set. I have a feeling that this
code is a bit silly and some statements seem superfluous to me
(especially adding all those elements to package registry). It would
greatly help me, if i would get a some feedback on that code.

Thanks in advance.

> private static ResourceSet getResourceSet() throws XMIHandlerException {
>
> if (resourceSet == null) {
> resourceSet = new ResourceSetImpl();
>
> String path = "lib/xmihandlerjars/org.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar";
>
> Map<String, Object> extensionToFactoryMap = resourceSet
> .getResourceFactoryRegistry().getExtensionToFactoryMap();
> Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();
>
> try {
> FileInputStream in = new FileInputStream(path);
> in.close();
> } catch (IOException e) {
> throw (new XMIHandlerException(e));
> }
>
> path = path.replace('\\', '/');
>
> URI uri = URI.createURI("jar:file:" + path + "!/");
> debug("resource URI --> " + uri);
>
> Registry packageRegistry = resourceSet.getPackageRegistry();
> packageRegistry.put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
> packageRegistry.put(EcorePackage.eNS_URI, EcorePackage.eINSTANCE);
> // for other xmi files with further namespaces:
> packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_1_NS_URI,
> UMLPackage.eINSTANCE);
> packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_1_URI,
> UMLPackage.eINSTANCE);
> packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_NS_URI,
> UMLPackage.eINSTANCE);
> packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_URI,
> UMLPackage.eINSTANCE);
> packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_2_NS_URI,
> UMLPackage.eINSTANCE);
> packageRegistry.put(XMI212UMLResource.UML_METAMODEL_NS_URI,
> UMLPackage.eINSTANCE);
> packageRegistry.put(XMI212UMLResource.UML_METAMODEL_URI,
> UMLPackage.eINSTANCE);
> // eclipse namespaces:
> packageRegistry.put(UML212UMLResource.UML_METAMODEL_NS_URI,
> UMLPackage.eINSTANCE);
> packageRegistry.put("http://www.eclipse.org/uml2/3.0.0/UML",
> UMLPackage.eINSTANCE);
> packageRegistry.put("http://www.eclipse.org/uml2/2.0.0/UML",
> UMLPackage.eINSTANCE);
>
> // For the .uml files in the eclipse jar files, we need this:
> extensionToFactoryMap.put(UMLResource.FILE_EXTENSION,
> UMLResource.Factory.INSTANCE);
> 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(""));
>
> extensionToFactoryMap.put(UML22UMLResource.FILE_EXTENSION,
> UML22UMLResource.Factory.INSTANCE);
> extensionToFactoryMap.put(XMI2UMLResource.FILE_EXTENSION,
> XMI2UMLResource.Factory.INSTANCE);
>
> uriMap.putAll(UML22UMLExtendedMetaData.getURIMap());
> uriMap.putAll(XMI2UMLExtendedMetaData.getURIMap());
> }
>
> return resourceSet;
>
> }



On 19.05.2012 15:06, Ed Willink wrote:
>
> Have you looked at
> http://wiki.eclipse.org/index.php/MDT-UML2-FAQ#What.27s_required_to_load_a_UML_.28.uml.29_resource_from_a_standalone_application.3F
>
Re: UML2 Versions [message #873926 is a reply to message #873919] Sat, 19 May 2012 13:51 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
Hi

You're getting there but you have no content type declarations so
inadequate handling of old and future namespaces.

For complete coverage use Juno's UMLResourcesUtil.init() and trim all
the 2.4 declarations.

Regards

Ed Willink

On 19/05/2012 14:26, Emil Huseynli wrote:
> Hi,
>
> yes, i've already use that in my app, and it seems that i'm able to
> handle xmi files with uml models inside, but i'm not sure whether code
> i've used is generic enough to handle most used xmi formats/uml
> models. And i also not really understand that code fully. Below is the
> method which creates and configures resource set. I have a feeling
> that this code is a bit silly and some statements seem superfluous to
> me (especially adding all those elements to package registry). It
> would greatly help me, if i would get a some feedback on that code.
>
> Thanks in advance.
>
>> private static ResourceSet getResourceSet() throws
>> XMIHandlerException {
>>
>> if (resourceSet == null) {
>> resourceSet = new ResourceSetImpl();
>>
>> String path =
>> "lib/xmihandlerjars/org.eclipse.uml2.uml.resources_3.0.0.v200906011111.jar";
>>
>> Map<String, Object> extensionToFactoryMap = resourceSet
>> .getResourceFactoryRegistry().getExtensionToFactoryMap();
>> Map<URI, URI> uriMap = resourceSet.getURIConverter().getURIMap();
>>
>> try {
>> FileInputStream in = new FileInputStream(path);
>> in.close();
>> } catch (IOException e) {
>> throw (new XMIHandlerException(e));
>> }
>>
>> path = path.replace('\\', '/');
>>
>> URI uri = URI.createURI("jar:file:" + path + "!/");
>> debug("resource URI --> " + uri);
>>
>> Registry packageRegistry = resourceSet.getPackageRegistry();
>> packageRegistry.put(UMLPackage.eNS_URI, UMLPackage.eINSTANCE);
>> packageRegistry.put(EcorePackage.eNS_URI, EcorePackage.eINSTANCE);
>> // for other xmi files with further namespaces:
>> packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_1_NS_URI,
>> UMLPackage.eINSTANCE);
>> packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_1_URI,
>> UMLPackage.eINSTANCE);
>> packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_NS_URI,
>> UMLPackage.eINSTANCE);
>> packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_1_URI,
>> UMLPackage.eINSTANCE);
>> packageRegistry.put(XMI212UMLResource.UML_METAMODEL_2_2_NS_URI,
>> UMLPackage.eINSTANCE);
>> packageRegistry.put(XMI212UMLResource.UML_METAMODEL_NS_URI,
>> UMLPackage.eINSTANCE);
>> packageRegistry.put(XMI212UMLResource.UML_METAMODEL_URI,
>> UMLPackage.eINSTANCE);
>> // eclipse namespaces:
>> packageRegistry.put(UML212UMLResource.UML_METAMODEL_NS_URI,
>> UMLPackage.eINSTANCE);
>> packageRegistry.put("http://www.eclipse.org/uml2/3.0.0/UML",
>> UMLPackage.eINSTANCE);
>> packageRegistry.put("http://www.eclipse.org/uml2/2.0.0/UML",
>> UMLPackage.eINSTANCE);
>>
>> // For the .uml files in the eclipse jar files, we need this:
>> extensionToFactoryMap.put(UMLResource.FILE_EXTENSION,
>> UMLResource.Factory.INSTANCE);
>> 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(""));
>>
>> extensionToFactoryMap.put(UML22UMLResource.FILE_EXTENSION,
>> UML22UMLResource.Factory.INSTANCE);
>> extensionToFactoryMap.put(XMI2UMLResource.FILE_EXTENSION,
>> XMI2UMLResource.Factory.INSTANCE);
>>
>> uriMap.putAll(UML22UMLExtendedMetaData.getURIMap());
>> uriMap.putAll(XMI2UMLExtendedMetaData.getURIMap());
>> }
>>
>> return resourceSet;
>>
>> }
>
>
>
> On 19.05.2012 15:06, Ed Willink wrote:
>>
>> Have you looked at
>> http://wiki.eclipse.org/index.php/MDT-UML2-FAQ#What.27s_required_to_load_a_UML_.28.uml.29_resource_from_a_standalone_application.3F
>>
>>
Re: UML2 Versions [message #873933 is a reply to message #873926] Sat, 19 May 2012 14:06 Go to previous messageGo to next message
Eclipse UserFriend
ok, thanks a lot for quick responses!

On 19.05.2012 15:51, Ed Willink wrote:
>
> For complete coverage use Juno's UMLResourcesUtil.init() and trim all
> the 2.4 declarations.
>
Re: UML2 Versions [message #873943 is a reply to message #873926] Sat, 19 May 2012 14:45 Go to previous messageGo to next message
Eclipse UserFriend
i've downloaded UML2 SDK(runtime, sources, examples)

http://www.eclipse.org/modeling/mdt/downloads/?project=uml2

but seems jars contained in that download don't contain class
UMLResourcesUtil. In which jar is it located?

I've found source code itself in github repo

https://github.com/eclipse/uml2/blob/531bfc48b9a6fce3523af33a379467aa8c8892a5/plugins/org.eclipse.uml2.uml.resources/src/org/eclipse/uml2/uml/resources/util/UMLResourcesUtil.java

On 19.05.2012 15:51, Ed Willink wrote:
>
> For complete coverage use Juno's UMLResourcesUtil.init() and trim all
> the 2.4 declarations.
>
Re: UML2 Versions [message #874028 is a reply to message #873926] Sat, 19 May 2012 19:27 Go to previous messageGo to next message
Eclipse UserFriend
Hi,

i've switched to latest stable builds of both emf (2.8.0M7) and UML2
(4.0.0M7) and passing my resourceSet to UMLResourceUtil.init(). Do i
still need to do following?

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(""));


On 19.05.2012 15:51, Ed Willink wrote:
> Hi
>
> You're getting there but you have no content type declarations so
> inadequate handling of old and future namespaces.
>
> For complete coverage use Juno's UMLResourcesUtil.init() and trim all
> the 2.4 declarations.
>
Re: UML2 Versions [message #874195 is a reply to message #874028] Sun, 20 May 2012 05:41 Go to previous messageGo to next message
Ed Willink is currently offline Ed WillinkFriend
Messages: 7655
Registered: July 2009
Senior Member
<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
Hi<br>
<br>
The appended message from uml2-dev may answer all your questions.
Please criticize as appropriate. (The OCL usage is in M7.)<br>
---------------<br>
The Juno release of MDT/UML2 adds UML 2.4 and 2.4.1 support and
consequently many more namespaces whose content handlers need to be
correctly registered.
<br>
<br>
When running within Eclipse, the magic of extension points should
ensure that this happens automatically.
<br>
<br>
When running standalone, these registrations have been a consumer
responsibility. Most modeling tools have emerged in the last few
years while UML2 has been stable with support for UML 2.2 and so the
complexities of multi-version support is easily overlooked in some
handcrafted UML initialisation code.
<br>
<br>
In the latest MDT/UML2 I-build, there is a UML standalone
initialization routine (<a class="moz-txt-link-freetext"
href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=364419">https://bugs.eclipse.org/bugs/show_bug.cgi?id=364419</a>).
Just invoke UMLResourcesUtil.init(null). This does all the hard
work, and should hide the next generation of changes for UML 2.5.
Only the physical location URI mappings are missing; i.e. from the
resolution of "platform:<i class="moz-txt-slash"><span
class="moz-txt-tag">/</span>resource/org.eclipse.uml2.uml.resources/profiles<span
class="moz-txt-tag">/</span></i>" to
URI.createURI(UMLResource.PROFILES_PATHMAP); similarly for
'metamodels' and 'libraries'. If you have automated plugin location,
using classpath analysis as performed by MWE2's StandaloneSetup
scanPath, or
org.eclipse.ocl.examples.domain.utilities.StandaloneProjectMap, this
missing step may be done automatically as well.
<br>
<br>
A patch to upgrade org.eclipse.ocl.uml.OCL.initialize(resourceSet)
to call UMLResourcesUtil.init(resourceSet) is in the pipeline, so
consumers of OCL.initialize need take no action other than taking
the opportunity to remove their duplicate initializations.
<br>
<br>
Other tools are encouraged to start using
UMLResourcesUtil.init(null) as soon as possible so that any residual
bugs are fixed for Juno, ensuring that UML 2.5 can be introduced
without a further downstream initialization ripple.
<br>
<br>
&nbsp;&nbsp;&nbsp; Regards
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Ed Willink
<br>
<br>
<br>
<br>
On 19/05/2012 20:27, Emil Huseynli wrote:
<blockquote cite="mid:jp8s5m$341$1@xxxxxxxxe.org" type="cite">Hi,
<br>
<br>
i've switched to latest stable builds of both emf (2.8.0M7) and
UML2 (4.0.0M7) and passing my resourceSet to
UMLResourceUtil.init(). Do i still need to do following?
<br>
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uriMap.put(URI.createURI(UMLResource.LIBRARIES_PATHMAP), uri
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .appendSegment("libraries").appendSegment(""));
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uriMap.put(URI.createURI(UMLResource.METAMODELS_PATHMAP),
uri
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .appendSegment("metamodels").appendSegment(""));
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; uriMap.put(URI.createURI(UMLResource.PROFILES_PATHMAP), uri
<br>
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; .appendSegment("profiles").appendSegment(""));
<br>
<br>
<br>
On 19.05.2012 15:51, Ed Willink wrote:
<br>
<blockquote type="cite">Hi
<br>
<br>
You're getting there but you have no content type declarations
so
<br>
inadequate handling of old and future namespaces.
<br>
<br>
For complete coverage use Juno's UMLResourcesUtil.init() and
trim all
<br>
the 2.4 declarations.
<br>
<br>
</blockquote>
</blockquote>
<br>
</body>
</html>
Re: UML2 Versions [message #874283 is a reply to message #874195] Sun, 20 May 2012 11:49 Go to previous message
Eclipse UserFriend
so, it does happen automatically for me, no need to populate uriMap

On 20.05.2012 07:41, Ed Willink wrote:
> Hi
>
> The appended message from uml2-dev may answer all your questions. Please
> criticize as appropriate. (The OCL usage is in M7.)
Previous Topic:Value of EnumerationImpl is not legal
Next Topic:Value of EnumerationImpl is not legal
Goto Forum:
  


Current Time: Sat Apr 20 02:39:37 GMT 2024

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

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

Back to the top