OpenXML format to ADMS-AP

Started by zakariaEIRA, February 02, 2016, 10:40:16 AM

Previous topic - Next topic

zakariaEIRA

Dear Archi-ists,

ADMS is a W3C standard for describing re-usable assets [1]. ADMS-AP [2] is an application profile of ADMS used on Joinup, the catalogue of re-usable and interoperable solution hosted by the European Commission [3], to describe re-usable assets.

In this context we are developing an Archi plug-in to export building blocks to an ADMS-AP compliant RDF/XML file based on OpenXML format. This allows Enterprise/Solution Architect to develop models in Archi and export them in a file that is readable by Joinup and other platform that understand ADMS-AP.

In the model we differentiate between an architectural building block and solution building block by using "stereotyping" [4]. In essence a solution building block is a specialization of an architectural building representing a re-usable asset (software, framework, tool...).

We still in development but we'd like to know the procedure for hosting the plug-in on the Archimatetool website. We believe it's a great addition to the plug-in library.


[1] W3C ADMS -  https://www.w3.org/TR/vocab-adms/
[2] ADMS-AP - https://joinup.ec.europa.eu/asset/adms/asset_release/adms-application-profile-joinup
[3] Joinup - https://joinup.ec.europa.eu
[4] Stereotyping in ArchiMate - http://pubs.opengroup.org/architecture/archimate2-doc/chap09.html

Best Regards,

Zakaria (PwC) - contractor European Commission.

Jean-Baptiste Sarrodie

Hi,

Thank you for your interrest and (upcoming) contribution to Archi.

What I would suggest is the following: I can create a repository under the umbrella of archi-contrib GitHub Organization. This means that your code and plugin releases would become visible as part of official contributions. Then, when a useable release of your plugin will exists, Phil could add a link to it in either http://www.archimatetool.com/resources or http://www.archimatetool.com/plugins (@Phil: it's maybe time to revamp this part as having plugins listed on 2 separate pages in not really useful).

If this suits you, then just provide me a suggested name for the repository to be created and the github username of the repo admin.

Regards

JB
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Phil Beauvoir

#2
Hi,

@Zakaria - that sounds like an interesting project. Please keep us updated. As Jean-Baptiste says, you could host the code on GitHub at that location, if you like. Also, it sounds like it would be a nice subject for a small blog post. Would it be possible to write about it?

@JB - the "plugins" page is the official page for plugins that we can support (TOG plugin atm). These plugins are packaged in a certain way so that they can be installed easily. We could divide it into official and third-party plugins. I just want to make sure that it's clear that we cannot support (i.e. fix bugs, etc) the third party plugins.

Phil
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

zakariaEIRA

Hi guys,

Thanks for the update and the answers. I'll discuss this with the Commission and see how to proceed. We're currently finishing up the code and writing documentation. We can provide a blog post.

We'll keep you posted on the project.

Cheerz,

Zakaria

inigoEIRA

Hello guys,

I'm working with Zakaria in the development of the ADMS-AP plugin for Archi, but we are facing some problems when exporting the plug-in that we can't solve, so we kindly ask for your help.

We started following the Developer Guides in Archi for developing import and export plug-ins and everything went perfectly, we were able to run Archi in Eclipse and the exporter worked. After that, we exported the plug-in as a jar file and added it to Archi installation plugins folder, as you explain in "Deploying the plug-in" section.

The problem is that when we open Archi the plug-in doesn't work and when we check the "Plug-ins" tab in Archi installation details, there is no information about it. However, in the "Configuration" tab and under the "*** Plug-in Registry" area, we can see that the plug-in is detected: org.ISA.export (1.0.0.201604131324) "ADMS-AP Export Model" [Installed]

We think we are having some problem when exporting the plug-in as a jar file, but we can't find the solution, so we would like to know if you have any idea on how we could solve it.

Thank you very much

Regards

Inigo

Phil Beauvoir

Hi Inigo,

without seeing the project setup or the jar file it's hard to say. Have you compared your plugin's files (MANIFEST.MF, plugin.xml, build.xml, etc) with some Archi plugins to see if something is not getting declared?

Phil
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Hervé

Hi Inigo,

you may run "Archi.exe -consolelog" to check if there is a runtime exception.

Hope this helps
Herve

inigoEIRA

Hi guys,

Thank you very much for your replies. We compared the plugin's files with other Archi plugins and couldn't find the error. We also check the console log and we couldn't find any runtime exception.

We leave attached the jar file, in case you can find which is the problem

Regards

Phil Beauvoir

#8
Hi Inigo,

I looked inside the jar file, and it does not contain binary code, only source code. This is your problem. Please take another look at the export dialog, and make sure your build settings are correct.

Edit - I seem to recall this happened to me once. I'd forgotten to tick something in the build file, or maybe it was something set in the MANIFEST.MF file, I can't remember. It's worth doing a double-check comparing your settings with those in the example.

Phil
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

inigoEIRA

#9
Hello Phil

We double checked the build settings and compared them with the example but we still can find the origin of the problem. We have uploaded the code to Github [1] in case you can check it and help us with this problem.

Thank you very much for all your help

Regards

[1] Github ADMS Exporter: https://github.com/EFIR/archi-adms-exporter

Phil Beauvoir

#10
Hi,

I succeeded in exporting the jar from your code in GitHub. However, I needed to make some changes first:


  • I had to change the project name. The project name is in the .project file and you have it set to "com.archimatetool.importexportexample". Change this in a text editor so that it does not conflict with the example project on which this is based.
  • You can get rid of the dependency on JUnit. Remove the dependency in the MANIFEST.MF file and also the import statement in ADMSExporter.java
  • Your code has a dependency on the org.opengroup.archimate.xmlexchange project. However, the packages in this plugin are not declared public. In order to get your project to compile I had to declare the org.opengroup.archimate.xmlexchange package as public in the MANIFEST.MF file (you will probably have done this). However, the general released version of Archi does not have this set as public, so your plugin will not work if you try to export it and put the jar file in the target "plugins" folder. I can make this package public for a future version of Archi but this won't solve your immediate problem. A workaround would be to copy the code you need and duplicate it in your project

When I exported the project in the wizard the only settings chosen was "Destination" as "Directory" and ticked "Allow for binary cycles in target platform" under Settings. The plugin jar exported correctly and once I had copied it to the target Archi "plugins" folder I could see the "Export...." menu item but it does not actually work because of the dependency on org.opengroup.archimate.xmlexchange.
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

inigoEIRA

Hi Phil

Thank you for your reply. We made the changes you said about the .project file, the dependency of JUnit and the org.opengroup.archimate.xmlexchange package. But after duplicating the package, we find now the following problem when we click Export->ADMS-AP in Archi.


!ENTRY org.eclipse.ui 4 0 2016-04-20 17:35:08.991
!MESSAGE Unhandled event loop exception
!STACK 0
java.lang.NullPointerException
at org.ISA.ADMS_Export.wizard.ExportToADMSPage.createControl(ExportToADMSPage.java:90)
at org.eclipse.jface.wizard.Wizard.createPageControls(Wizard.java:178)
at org.eclipse.jface.wizard.WizardDialog.createPageControls(WizardDialog.java:759)
at org.eclipse.jface.wizard.WizardDialog.createContents(WizardDialog.java:622)
at org.eclipse.jface.window.Window.create(Window.java:435)
at org.eclipse.jface.dialogs.Dialog.create(Dialog.java:1101)
at org.eclipse.jface.window.Window.open(Window.java:797)
at org.ISA.ADMS_Export.ADMSExportProvider.export(ADMSExportProvider.java:46)
at com.archimatetool.editor.actions.ExportModelAction.run(ExportModelAction.java:37)
at org.eclipse.jface.action.Action.runWithEvent(Action.java:519)
at org.eclipse.jface.action.ActionContributionItem.handleWidgetSelection(ActionContributionItem.java:595)
at org.eclipse.jface.action.ActionContributionItem.access$2(ActionContributionItem.java:511)
at org.eclipse.jface.action.ActionContributionItem$5.handleEvent(ActionContributionItem.java:420)
at org.eclipse.swt.widgets.EventTable.sendEvent(EventTable.java:84)
at org.eclipse.swt.widgets.Display.sendEvent(Display.java:4353)
at org.eclipse.swt.widgets.Widget.sendEvent(Widget.java:1061)
at org.eclipse.swt.widgets.Display.runDeferredEvents(Display.java:4172)
at org.eclipse.swt.widgets.Display.readAndDispatch(Display.java:3761)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine$9.run(PartRenderingEngine.java:1151)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.e4.ui.internal.workbench.swt.PartRenderingEngine.run(PartRenderingEngine.java:1032)
at org.eclipse.e4.ui.internal.workbench.E4Workbench.createAndRunUI(E4Workbench.java:148)
at org.eclipse.ui.internal.Workbench$5.run(Workbench.java:636)
at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:332)
at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:579)
at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:150)
at com.archimatetool.editor.Application.start(Application.java:87)
at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:380)
at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:235)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:648)
at org.eclipse.equinox.launcher.Main.basicRun(Main.java:603)
at org.eclipse.equinox.launcher.Main.run(Main.java:1465)
at org.eclipse.equinox.launcher.Main.main(Main.java:1438)


However, when we use the package org.opengroup.archimate.xmlexchange and we run it in Eclipse we have not that problem. The code can be found in Github [1]

[1] Github ADMS Exporter https://github.com/EFIR/archi-adms-exporter

Phil Beauvoir

Hi,

it seems that duplicating the code in this way will not work because of various dependencies. You'd have to do a lot more refactoring than simply copying the code for this to work.

Your plugin is relying on the XML exporter plugin which has its own internal code and therefore it can't guarantee any external behaviour and this is why its code is not public. It was not really designed to be called from another plugin. Possibly using your own wizard on the export plugin is causing a problem. Really Eclipse works on the basis of extensions to existing plugins, and there are also issues with classpaths.

It seems to me that you want the user to export an ArchiMate model to an exchange format file and then you will apply an XSLT to it in one operation. Perhaps there is another way to do this? Perhaps in the end it would work if the exporter package was made public?

Phil
If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.

Phil Beauvoir

I made some tests. It seems that the best way should be to make the exporter plugin package public. I have done this and committed this to Github. So, go back to your original plan, do not copy and paste the exporter code. I tested the exported jar and it worked up to a point. The temporary file is created, but this part does not work:

        CodeSource code=ADMSExporter.class.getProtectionDomain().getCodeSource();   
         String location=code.getLocation().toString();
         location = location.replace("file:/", "");
        location = location + "src/org/ISA/ADMS_Export/EIRA_Archi_xml-to-ADMS_rdf_v0.02.xslt";

You need to get that location another way.

This is the MANIFEST.MF file I used:

Manifest-Version: 1.0
Bundle-ManifestVersion: 2
Bundle-Name: ADMSExport
Bundle-SymbolicName: org.ISA.exportAI;singleton:=true
Bundle-Version: 1.0.0.qualifier
Bundle-Vendor: PwC
Bundle-Localization: plugin
Bundle-RequiredExecutionEnvironment: JavaSE-1.7
Require-Bundle: org.eclipse.ui,
org.eclipse.core.runtime,
com.archimatetool.editor,
com.archimatetool.jdom;bundle-version="2.0.5",
org.opengroup.archimate.xmlexchange;bundle-version="1.0.2"
Export-Package: org.ISA.ADMS_Export
Bundle-ClassPath: saxon9-xqj.jar,
saxon9he.jar,
org.isa.adms.jar

And this is the build.properties file:

jars.compile.order = org.isa.adms.jar
source.org.isa.adms.jar = src/
output.org.isa.adms.jar = bin/
bin.includes = META-INF/,\
               plugin.xml,\
               LICENSE.txt,\
               plugin.properties,\
               saxon9-xqj.jar,\
               saxon9he.jar,\
               org.isa.adms.jar

If you value and use Archi, please consider making a donation!
Ask your ArchiMate related questions to the ArchiMate Community's Discussion Board.