Skip to content

Commit c2a7d08

Browse files
epsilon-0311Christoph Lehr
andauthored
Feature/14 release beta v2 preperation (#39)
* updated features descriptions * updated wrongly named plugin * cleaned up and revisitied build dependencies * updated installation instructions * fixed typos * removed unused imports * added resources to build * add a console for debug output * changed remaining transformations to commands * changed required java version from 1.8 to 11 Co-authored-by: Christoph Lehr <christoph@localhost.localdomain>
1 parent 867cd14 commit c2a7d08

File tree

107 files changed

+22048
-445
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

107 files changed

+22048
-445
lines changed

README.md

Lines changed: 173 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,42 +1,197 @@
11
# papyrus-opcua-plugin
2-
This project develops a Eclipse Papyrus Plugin which handles transforming UML Diagrams into OPC-UA information models.
2+
This project develops several features extending Eclipse Papyrus which handles modelling of OPC-UA information models.
33

44
## Prerequisites
55

6-
### Papyrus UML Designer
7-
The Plugin relies on an existing installation of Papyurs Eclipse Project https://www.eclipse.org/papyrus/. You can install it in Eclipse or download a optimized version from the project page https://www.eclipse.org/papyrus/download.html. The Plugin is developed using version 4.7.0.
6+
### Java Version
87

9-
### Install Designer Plugins
8+
The Plugin requires at least Java version 11.
9+
10+
### Papyrus
11+
The Features reliy on an existing installation of Papyurs Eclipse Project https://www.eclipse.org/papyrus/. You can install it in Eclipse or download a optimized version from the project page https://www.eclipse.org/papyrus/download.html. The Plugin is developed using Papyrus version 2020-06.
12+
13+
## Installation
14+
15+
### Preperation
16+
17+
Open Papyrus and go to Help-->Check for Updates and bring the installation up to date and restart if required.
18+
19+
If not already installed the plugin Requires a version of "Papyrus for UML Developer Resources" greater or equal to 5.0.0
20+
21+
### Adding Update-Site
22+
The Plugin is provided via the model-ua update site : https://model-ua.auto.tuwien.ac.at/updates/releases
23+
24+
Open Papyrus and go to Help-->Install New Software, click on Add and enter the link.
25+
26+
![](doc/img/add_update_site.png)
27+
28+
29+
### Adding Archive as Update-Site
30+
31+
Alternatively the releases can be downloaded here as archives : https://github.com/model-UA/papyrus-opcua-plugin/releases
32+
33+
Open Papyrus and go to Help-->Install New Software, click on Add and then on Local or Archive depending if you extracted the archive or not.
34+
35+
### OPC UA Modelling Features
36+
37+
If the last step was successful you should be able to find the following packages:
38+
39+
![](doc/img/update_site_packages.png)
40+
41+
OPC UA NodeSet SDK provides the underlying functions required for reading and writing to NodeSet files.
42+
43+
OPC UA Profile provides a UML Profile which eases creation of OPC UA Information Models.
44+
45+
OPC UA Companion Specifications provides UML models of the NodeSets provided by the companion specifications.
46+
47+
OPC UA Modelling provides a new Diagram Type for Papyrus according to the graphical notation of the OPC UA Foundation.
48+
49+
### Diagram Installation
50+
51+
To get the OPC UA Modelling option inside Papyrus install the following packages:
52+
- OPC UA NodeSet SDK
53+
- OPC UA Profile
54+
- OPC UA Companion Specifications
55+
- OPC UA Modelling
56+
57+
When the installation is done restart Papyrus.
58+
59+
## Usage
60+
61+
### Creating new Models
62+
63+
When creating a new Model select the Architecture Context OPC UA/Informationmodel:
64+
65+
![](doc/img/create_opc_ua_model_architecture_context.png)
66+
67+
As the tool does not automatically generate any namespaces it's better to create the Diagrams itself later. When clicking on finish, it may take a minute until the new model is initialized and the namespace 0 elements are loaded.
68+
69+
### Start Modelling
70+
The first step which should be done is creating a namespace, this can be done by right clicking on the root element of your model in the Model Explorer. In the now opened context menu there is a entry NodeSet and in there is an entry Namespace.
71+
72+
![](doc/img/create_namespace.png)
73+
74+
After creating the namespace, the URI can be set inside the propoerties tab:
75+
76+
![](doc/img/set_namespace_URI.png)
77+
78+
The next step is to create a NodeSet Diagram by right clicking on the created namespace element inside the Model Explorer. In the context menu click on New Diagram and then on NodeSetDiagram.
79+
80+
![](doc/img/new_nodeset_diagram.png)
81+
82+
On the right side of the diagram the following palette is shown. It can be used to directly drag and drop new elements into the Diagram.
83+
84+
![](doc/img/palette.png)
85+
86+
Each Element can be configured in the Profile page inside the properties page. That a configuration of an UANode (UAObjectType, UAMethod,...) is valid at least the browseName and the NodeID need to be set.
87+
88+
![](doc/img/element_configuration.png)
89+
90+
For creatign Rerferences between Elements click on the Reference entry in the palette and connect the desired diagram elements. In the Profile page inside the Properties Tab, the the direction of the Reference and the desired ReferenceType can selected. By clicking on the Button with the 3 dots all available ReferenceTypes can be browsed through, including namespace 0 and all imported Namespaces.
91+
92+
As the Namespace 0 is automatically loaded all elements from it can be used and draged from the Model Explorer into the diagram and used with References.
93+
94+
### Non-Graphical Elements#
95+
96+
Not all elements required for modelling are part of the Graphical notation, e.g. RolePermissions. These elements can be added via the Model Explorer, right click on an element of your model and select the desired item. Again the configuration options are in the Profile page inside the Properties tab. Afterwards the model member can be referenced in the element.
97+
98+
### Displaying Configuration Entries
99+
100+
Per default no entry of the element is displayed in the diagram, to do this select the desired object in the diagram an open the Appearance page inside the Properties tab. Scroll to Stereotype display and check the top most entry in the In Comment collumn, afterwards deselect every entry which shall not be displayed.
101+
102+
### Exporting the NodeSet
103+
104+
On every save of the model a NodeSet file will be generated in the backgraound and is stored in the project directoy. It has the same name as your model file, but with a xml file extension.
105+
106+
If you want to directly export your diagram to a dedicated location this can be done via Export menu of Papyrus. Right click on an Element of your model inside the Model Explorer, under Export select Export NodeSet Informationmodel.
107+
108+
![](doc/img/export_nodeset.png)
109+
110+
An export to this location can also be done automatically via the preferences. Go to Window --> Preferences and select the OPC UA page. First configure the Default Export directory and then check "Automatically generate a NodeSet file on save inside the default export directory". If the project folder shall be taken over also check "Create folder hierarchy of NodeSet file inside default export folder".
111+
112+
### Importing NodeSet
113+
114+
On every save a NodeSet file corresponding to the model is generated, this NodeSet file can also be used by other applications and will be loaded if it was changed.
115+
116+
For importing a NodeSet to use inside your model right click on an Element of your model inside the Model Explorer, under Import select Import NodeSet Model and select the corresponding UML file of the Informationmodel. If a NodeSet shall be imported and the loaded model shall be updated accordingliny use Update NodeSet instead.
117+
118+
### Configuration Options
119+
120+
The preferences for the diagram can be found under Window --> Preferences and then select the OPC UA page.
121+
The default import and export directories are used as a starting point for the file browsers when e.g. exporting a NodeSet.
122+
123+
The default NodeId scheme can be selected to be either automatic type selection depending on the content of the NodeId field or always use the string scheme.
124+
125+
If other tools use the automatic generated NodeSet file but the changes shall not be synched back, uncheck "Automatically relaod NodeSet if underlaying NodeSet file is changed"
126+
127+
Console log output level can be changed depending on the desired verbosity, this is only relevant for tracing bugs or issues with the model.
128+
129+
## Development and Build
130+
131+
### Depencies
132+
133+
Some additional dependencies are required for building the plugin.
134+
135+
#### Eclipse SDK
136+
137+
If you want to build or debug the plugin yourself you have to install the Eclispe SDK. This can be found in the Eclipse Project repository in the list of update sites.
138+
Select the following items:
139+
- Eclipse SDK
140+
141+
#### Additonal Papyrus depencies
142+
143+
If the underlaying UML model used for the diagram shall be adapted install the following from the papyrus update site:
144+
- Papyrus Toolsmith Tools
145+
- Papyrus Diagram Assistants Generator
146+
147+
### Updating the UML Profile
148+
149+
The plugin at.ac.tuwien.auto.modelua.papyrus.opcua.profile provides the underlying UML Profile for the diagram. The file itself can be found under resources/profile/UANodeSet.profile.umml. If the profile is changed ElementType files and the CreationMenu file need to be regnerated.
150+
151+
For the ElementTypes open the Profile and right click inside the Model Exlporer on the root Element of the Profile. Select Generate Tooling Model --> ElementTypes. Use at.ac.tuwien.auto.modelua.papyrus.opcua.nodeset as id and select UMLElementTypeSet as Base element type set. Set the parten folder to at.ac.tuwien.auto.modelua.papyrus.opcua.diagram/resources/elementtypes and the filename to UANodeSet.elementtypesconfigurations .
152+
153+
For the DI ElementTypes open again Generate Tooling Model --> ElementTypes. Use at.ac.tuwien.auto.modelua.papyrus.opcua.nodeset as id and select UMLDIElementTypeSet as Base element type set. Check both "Suppress semantic parent in diagram-specific element types" and "Add .di postfix to identifier in diagram-specific element types". Set the parten folder to at.ac.tuwien.auto.modelua.papyrus.opcua.diagram/resources/elementtypes and the filename to UANodeSet.di.elementtypesconfigurations .
154+
155+
As the ElementTypes changed the corresponding CreationMenuModel needs to be regnerated, also known as New Child Menu. Therefore right click on UANodeSet.elementtypesconfigurations and select "Create New Child Menu".
156+
157+
### Adding/Updating Companion Specifications
158+
159+
Currenlty only Companion Specification Information Models are supported.
160+
161+
The UML Models for the companion specifications are located at.ac.tuwien.auto.modelua.papyrus.opcua.librareis plugin under resources/libraries.
162+
163+
To update an Information Model open the corresponding UML model and use the "Update NodeSet" Import option to update the content.
164+
165+
To add a new Compion Specification create a OPC UA Diagram with the name of the NodeSet file as Name of the Model and the root element. Then use the "Update NodeSet" Import option to load the content. Create a new folder resources/libraries with the name of the companion spec. To make the specification visible in Papyrus open the plugin.xml file inside at.ac.tuwien.auto.modelua.papyrus.opcua.libraries and open the extensions tab. Add a new org.eclipse.papyrus.uml.extensionpoints.UMLLibrary extension and configure the paths accordingly. Next open OpcUaLibraryResources.java inside the package at.ac.tuwien.auto.modelua.papyrus.opcua.libraries. Add a new entry NAMESPACE_PACKAGE_MAPPING, the first element is the namespace, the second is the file location.
166+
167+
## Papyrus code generator based Transformation
168+
169+
This is deprecated as the programmatic aproach was not further developed, please check out https://github.com/model-UA/uml-to-opcua for more transformation aproaches.
170+
171+
### Prerequisites
172+
173+
#### Install Designer Plugins
10174
The Plugin depends on the availabillity of Papyrus Code Generators, therefore some Papyrus Designer Plugins need the be installed.
11175
Add the following update Site to Papyrus: http://download.eclipse.org/modeling/mdt/papyrus/components/designer/
12176
Then install the following items
13177
- Papyrus base elements for code generation
14178

15-
### Installing the Plugin
179+
#### Installing the Plugin
16180
Download the .jar files from the latest release and drop them into the plugins folder of your Papyrus installation.
17181
Current Release https://github.com/model-UA/papyrus-opcua-plugin/releases/tag/v0.0.1-beta1
18182

19-
## Using the Plugin
183+
### Using the Plugin
20184

21185
Currently the Plugin only supports transformation of Class Diagrams and no output of errors. Errornous entries will be ignored.
22186
A Information Model can be generated by right clicking into a Diagram and selcting the Menu entry Designer->Generate OPC-UA Information Model
23187

24-
### Error Logging
188+
#### Error Logging
25189
Not everything which is modelled in UML can be transformed into OPC-UA information models. Transformation Errors will be shown insided the Error Log of Papyrus which can be shown via Window->Show View->Error Log. Each log entry shows the qualified name of the UML and what the error is.
26190

27-
## Debugging the Plugin
191+
### Debugging the Plugin
28192
With the source code the plugin can debugged inside the Papyrus installation.
29193

30-
### Install Eclipse SDK
31-
If you want to build or debug the plugin yourself you have to install the Eclispe SDK. This can be found in the Eclipse Project repository in the list of update sites.
32-
Select the following items:
33-
- Eclipse SDK
34-
35-
If the underlaying UML model used for the diagram shall be adapted install the following from the papyrus update site:
36-
- Papyrus Toolsmith Tools
37-
- Papyrus Diagram Assistants Generator
38-
39-
### Loading the the Plugin
194+
#### Loading the the Plugin
40195
First the following folders have to imported as Eclipse Project into the Workspace.
41196
- org.eclipse.papyrus.designer.languages.opcua.codegen
42197
- org.eclipse.papyrus.designer.languages.opcua.codegen.ui

at.ac.at.tuwien.modelua.papyrus.opcua.diagram.transformation/src/at/ac/at/tuwien/modelua/papyrus/opcua/diagram/transformation/OpcUaDiagramTransformationResources.java

Lines changed: 0 additions & 7 deletions
This file was deleted.

at.ac.tuwien.auto.modelua.papyrus.designer.languages.opcua.codegen.ui/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
44
<attributes>
55
<attribute name="module" value="true"/>
66
</attributes>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
eclipse.preferences.version=1
22
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
3-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4-
org.eclipse.jdt.core.compiler.compliance=1.8
3+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
4+
org.eclipse.jdt.core.compiler.compliance=11
55
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
66
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
77
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
88
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
9-
org.eclipse.jdt.core.compiler.release=disabled
10-
org.eclipse.jdt.core.compiler.source=1.8
9+
org.eclipse.jdt.core.compiler.release=enabled
10+
org.eclipse.jdt.core.compiler.source=11

at.ac.tuwien.auto.modelua.papyrus.designer.languages.opcua.codegen.ui/META-INF/MANIFEST.MF

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,11 @@ Require-Bundle: org.eclipse.ui,
1010
org.eclipse.core.runtime,
1111
at.ac.tuwien.auto.modelua.papyrus.designer.languages.opcua.codegen;bundle-version="0.0.1",
1212
org.eclipse.papyrus.uml.diagram.common,
13-
org.eclipse.papyrus.designer.languages.common.base;bundle-version="1.1.0"
14-
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
13+
org.eclipse.papyrus.designer.languages.common.base;bundle-version="1.1.0",
14+
org.eclipse.core.resources;bundle-version="3.13.700",
15+
org.eclipse.emf.common;bundle-version="2.19.0",
16+
org.eclipse.uml2.uml;bundle-version="5.5.0"
17+
Bundle-RequiredExecutionEnvironment: JavaSE-11
1518
Bundle-ActivationPolicy: lazy
19+
Automatic-Module-Name: at.ac.tuwien.auto.modelua.papyrus.designer.languages.opcua.codegen.ui
20+
Import-Package: org.eclipse.papyrus.infra.tools.file

at.ac.tuwien.auto.modelua.papyrus.designer.languages.opcua.codegen/.classpath

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<?xml version="1.0" encoding="UTF-8"?>
22
<classpath>
3-
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">
3+
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-11">
44
<attributes>
55
<attribute name="module" value="true"/>
66
</attributes>
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
11
eclipse.preferences.version=1
22
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
33
org.eclipse.jdt.core.compiler.codegen.methodParameters=do not generate
4-
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
4+
org.eclipse.jdt.core.compiler.codegen.targetPlatform=11
55
org.eclipse.jdt.core.compiler.codegen.unusedLocal=preserve
6-
org.eclipse.jdt.core.compiler.compliance=1.8
6+
org.eclipse.jdt.core.compiler.compliance=11
77
org.eclipse.jdt.core.compiler.debug.lineNumber=generate
88
org.eclipse.jdt.core.compiler.debug.localVariable=generate
99
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
1010
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
1111
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
1212
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
1313
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=warning
14-
org.eclipse.jdt.core.compiler.release=disabled
15-
org.eclipse.jdt.core.compiler.source=1.8
14+
org.eclipse.jdt.core.compiler.release=enabled
15+
org.eclipse.jdt.core.compiler.source=11

at.ac.tuwien.auto.modelua.papyrus.designer.languages.opcua.codegen/META-INF/MANIFEST.MF

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,9 @@ Require-Bundle: org.eclipse.ui,
1515
org.eclipse.papyrus.designer.languages.common.base;bundle-version="1.1.0",
1616
org.eclipse.papyrus.infra.tools,
1717
javax.xml.bind;bundle-version="2.2.0",
18-
at.ac.tuwien.auto.modelua.papyrus.opcua.nodeset
19-
Bundle-RequiredExecutionEnvironment: JavaSE-1.8
18+
at.ac.tuwien.auto.modelua.papyrus.opcua.nodeset,
19+
org.eclipse.papyrus.infra.core.log;bundle-version="2.0.0"
20+
Bundle-RequiredExecutionEnvironment: JavaSE-11
2021
Bundle-ActivationPolicy: lazy
2122
Export-Package: at.ac.tuwien.auto.modelua.designer.languages.opcua.codegen.transformations
23+
Automatic-Module-Name: at.ac.tuwien.auto.modelua.papyrus.designer.languages.opcua.codegen

at.ac.tuwien.auto.modelua.papyrus.designer.languages.opcua.codegen/build.properties

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@ output.. = bin/
33
bin.includes = META-INF/,\
44
.,\
55
plugin.xml,\
6-
plugin.properties,\
7-
jars/jaxb-impl.jar
6+
plugin.properties
87
jars.compile.order = .

at.ac.tuwien.auto.modelua.papyrus.designer.languages.opcua.codegen/src/at/ac/tuwien/auto/modelua/designer/languages/opcua/codegen/transformations/OpcUaModelElementCreator.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
package at.ac.tuwien.auto.modelua.designer.languages.opcua.codegen.transformations;
22

3-
import java.io.File;
43
import java.io.StringWriter;
54

65
import javax.xml.parsers.DocumentBuilder;
@@ -19,7 +18,6 @@
1918
import org.eclipse.papyrus.designer.languages.common.base.ModelElementsCreator;
2019
import org.eclipse.papyrus.infra.tools.file.IPFileSystemAccess;
2120
import org.eclipse.uml2.uml.Model;
22-
import org.eclipse.uml2.uml.NamedElement;
2321
import org.eclipse.uml2.uml.PackageableElement;
2422
import org.opcfoundation.ua._2011._03.ua.UANodeSet.UANodeSetType;
2523
import org.w3c.dom.Document;

0 commit comments

Comments
 (0)