Plug-in Profile URI_Mapping [message #1752602] |
Wed, 25 January 2017 15:00 |
Daniel Clarke Messages: 24 Registered: March 2016 |
Junior Member |
|
|
Hi,
I've created a UML Profile in Papyrus. I then conveted this to an Eclipse Plugin Project. I've created a number of extensions below as specified in another thread: https://www.eclipse.org/forums/index.php/t/604098/
<extension
point="org.eclipse.emf.ecore.generated_package">
<package
class="test.profile.EPackage1"
uri="test.profile.package1">
</package>
</extension>
<extension
point="org.eclipse.uml2.uml.generated_package">
<profile
location="platform:/plugin/test.profile/test_profile.profile.uml"
uri="test.profile">
</profile>
</extension>
<extension
point="org.eclipse.papyrus.uml.extensionpoints.UMLProfile">
<profile
description="A test UML profile"
name="test.profile"
path="platform:/plugin/test.profile/test_profile.profile.uml">
</profile>
</extension>
<extension
point="org.eclipse.emf.ecore.uri_mapping">
<mapping
source="pathmap://test.profile/"
target="platform:/plugin/test.profile/">
</mapping>
</extension>
However, I am unsure what these values should be set to... Anyway, if I export this profile using "Deployable plug-ins and fragments" and install on the host Eclipse, when it restarts I can select the profile to apply to a model and all is good...
However, I have another project in which I am trying to interogate the UML model (which references the profile) in order to generate code. When I attempt to run this, I get the following error:
Exception in thread "main" org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.emf.ecore.xmi.PackageNotFoundException: Package with uri 'http:///schemas/Test_Profile/_I0W14KAUEeaf1fcNl03atw/51' not found. (file:/D:/Test_Model, 261, 104)
So it appears it cannot load the profile for some reason. I presume it is because the URI mapping is not correct? I have tried many different things, but do not really understand how everything is tied together.
Any help is appreciated.
Regards,
Dan
|
|
|
|
|
|
|
|
Re: Plug-in Profile URI_Mapping [message #1781610 is a reply to message #1781566] |
Fri, 09 February 2018 12:11 |
Michael Nestler Messages: 30 Registered: September 2014 |
Member |
|
|
Hi Ed,
ok. To describe my problem I have created a static UML plugin, containing 2 stereotypes MyStereotype1 and MyStereotype2 extending the <<Metaclass>> class.
Name: com.mycompany.myproject.static.profile
This plugin is exported as a deployable plugin and copied to the eclipse plugins Directory.
Name: com.mycompany.myproject.static.profile_1.0.0.201802091212.jar
The UML model MyProject.uml (in com.mycompany.myproject.model) uses this UML plugin via Apply Registered Profile. It contains
two classes Class1 and Class2, which are applying the both stereotype MyStereotype1 and MyStereotype2 from the profile.
With the Acceleo plugin com.mycompany.myproject.acceleo I want to generate to two files Class1 and Class2 with the class name and
the applied stereotypes.
Content of generate.mtl:
[comment encoding = UTF-8 /]
[module generate('http://www.mycompany.com/MyProject/1', 'http://www.eclipse.org/uml2/5.0.0/UML')]
[template public generateElement(aClass : Class)]
[comment @main/]
[file (aClass.name, false, 'UTF-8')]
class: [aClass.name/], applied stereotypes: [aClass.getAppliedStereotypes().name/]
[/file]
[/template]
My problem is, that the used stereotypes names are not reported.
I just get the class names.
Enclosed:
the deployable UML profile plugin
com.mycompany.myproject.static.profile_1.0.0.201802091212.jar
in com.mycompany.myproject.zip
-Papyrus profile project: com.mycompany.myproject.static.profile
-Papyrus model project: com.mycompany.myproject.model
-Acceleo project: com.mycompany.myproject.acceleo
I hope, it is possible the reproduce the problem.
Best regards
Michael
|
|
|
|
|
|
|
Powered by
FUDForum. Page generated in 0.04123 seconds