Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Vorto » Parsing Vorto models outside of Eclipse(Reading Vorto models from the Vorto repository and parsing them in a Java program that is _not_ Eclipse)
Parsing Vorto models outside of Eclipse [message #1711293] Wed, 14 October 2015 15:48 Go to next message
Marcus Munzert is currently offline Marcus MunzertFriend
Messages: 10
Registered: August 2012
Location: Freiburg, Germany
Junior Member
Hi Vortonians Smile,

I have successfully cloned the developer branch of the Vorto repository that is on github and executed the "Generate Xtext Artifacts" for the xtext grammar files. My workspace compiles fine.

My question now is: How I can make use of a subset of Vorto's Eclipse projects to be able to parse existing models that I directly get from the Vorto repository? I'd like to do the parsing in a standalone Java program or in an OSGi container that runs on a server. Getting instances of InformationModel, FunctionBlock, etc. is what we aim for.

As far as I know and understand Xtext/Xtend, this should be easily feasible, right?

Thanks in advance for helping us moving forward making use of the awsome Vorto project,
Marcus


CEO and President
Generative Software GmbH
Cornelia-Schlosser-Allee 15
79111 Freiburg
Germany

www.generative-software.de
Phone: +49 761 1562051
Fax: +49 761 7043098

www.virtual-developer.com
The efficient use of software development
Re: Parsing Vorto models outside of Eclipse [message #1711324 is a reply to message #1711293] Thu, 15 October 2015 02:58 Go to previous messageGo to next message
Alexander Edelmann is currently offline Alexander EdelmannFriend
Messages: 37
Registered: January 2015
Member
Hi Marcus,

just reference the vorto and xtext dependencies for DSL parsing in your standalone application in the pom.xml, like so:
https://github.com/aedelmann/vorto/blob/development/repo/pom.xml

Then, use standard xtext way to parse the vorto models:
Example:
https://github.com/aedelmann/vorto/blob/development/repo/src/main/java/org/eclipse/vorto/repository/internal/service/emf/InformationModelParser.java

Hope that helps Smile

Cheers,
Alex

[Updated on: Thu, 15 October 2015 03:02]

Report message to a moderator

Re: Parsing Vorto models outside of Eclipse [message #1711664 is a reply to message #1711324] Mon, 19 October 2015 07:23 Go to previous messageGo to next message
Marcus Munzert is currently offline Marcus MunzertFriend
Messages: 10
Registered: August 2012
Location: Freiburg, Germany
Junior Member
Thank you, Alex.

Looks promising. I am going to try this out and tell you about the results. With this we'll come up with an open source component to process Vorto models on our Virtual Developer Platform.

Cheers,
Marcus


CEO and President
Generative Software GmbH
Cornelia-Schlosser-Allee 15
79111 Freiburg
Germany

www.generative-software.de
Phone: +49 761 1562051
Fax: +49 761 7043098

www.virtual-developer.com
The efficient use of software development
Re: Parsing Vorto models outside of Eclipse [message #1712776 is a reply to message #1711664] Wed, 28 October 2015 08:25 Go to previous messageGo to next message
Heinz Rohmer is currently offline Heinz RohmerFriend
Messages: 4
Registered: October 2015
Junior Member
Hello Alex,

I took over the work from Marcus, to start reading Vorto models within our code generation unit. I tried to build (JDK 1.8.40 Maven 3.0.4) the development branch of Vorto and got the following error:

[ERROR] Failed to execute goal org.eclipse.xtend:xtend-maven-plugin:2.7.2:compile (default) on project org.eclipse.vorto.core: Execution default of goal org.eclipse.xtend:xtend-maven-plugin:2.7.2:compile failed: Unable to load the mojo 'compile' in the plugin 'org.eclipse.xtend:xtend-maven-plugin:2.7.2'. A required class is missing: org/apache/log4j/Logger
[ERROR] -----------------------------------------------------
[ERROR] realm =    plugin>org.eclipse.xtend:xtend-maven-plugin:2.7.2
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/Users/hrr/.m2/repository/org/eclipse/xtend/xtend-maven-plugin/2.7.2/xtend-maven-plugin-2.7.2.jar
[ERROR] urls[1] = file:/Users/hrr/.m2/repository/org/eclipse/xtend/org.eclipse.xtend.lib/2.7.2/org.eclipse.xtend.lib-2.7.2.pom
[ERROR] urls[2] = file:/Users/hrr/.m2/repository/org/eclipse/xtend/org.eclipse.xtend.lib.macro/2.7.2/org.eclipse.xtend.lib.macro-2.7.2.jar
[ERROR] urls[3] = file:/Users/hrr/.m2/repository/com/google/guava/guava/14.0.1/guava-14.0.1.jar
[ERROR] urls[4] = file:/Users/hrr/.m2/repository/org/eclipse/xtend/org.eclipse.xtend.core/2.7.2/org.eclipse.xtend.core-2.7.2.jar
[ERROR] urls[5] = file:/Users/hrr/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.xbase/2.7.2/org.eclipse.xtext.xbase-2.7.2.jar
[ERROR] urls[6] = file:/Users/hrr/.m2/repository/org/eclipse/xtext/org.eclipse.xtext/2.7.2/org.eclipse.xtext-2.7.2.jar
[ERROR] urls[7] = file:/Users/hrr/.m2/repository/com/ibm/icu/icu4j/52.1/icu4j-52.1.jar
[ERROR] urls[8] = file:/Users/hrr/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.common.types/2.7.2/org.eclipse.xtext.common.types-2.7.2.jar
[ERROR] urls[9] = file:/Users/hrr/.m2/repository/org/eclipse/equinox/common/3.6.200-v20130402-1505/common-3.6.200-v20130402-1505.jar
[ERROR] urls[10] = file:/Users/hrr/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.xbase.lib/2.7.2/org.eclipse.xtext.xbase.lib-2.7.2.jar
[ERROR] urls[11] = file:/Users/hrr/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.util/2.7.2/org.eclipse.xtext.util-2.7.2.jar
[ERROR] urls[12] = file:/Users/hrr/.m2/repository/org/eclipse/xtext/org.eclipse.xtext.dependencies/2.7.2/org.eclipse.xtext.dependencies-2.7.2.jar
[ERROR] urls[13] = file:/Users/hrr/.m2/repository/org/eclipse/xtend/org.eclipse.xtend.lib/2.7.2/org.eclipse.xtend.lib-2.7.2.jar
[ERROR] urls[14] = file:/Users/hrr/.m2/repository/org/eclipse/emf/org.eclipse.emf.common/2.11.0-v20150123-0347/org.eclipse.emf.common-2.11.0-v20150123-0347.jar
[ERROR] urls[15] = file:/Users/hrr/.m2/repository/org/eclipse/emf/org.eclipse.emf.ecore/2.11.0-v20150123-0347/org.eclipse.emf.ecore-2.11.0-v20150123-0347.jar
[ERROR] urls[16] = file:/Users/hrr/.m2/repository/com/google/inject/guice/3.0/guice-3.0.jar
[ERROR] urls[17] = file:/Users/hrr/.m2/repository/javax/inject/javax.inject/1/javax.inject-1.jar
[ERROR] urls[18] = file:/Users/hrr/.m2/repository/aopalliance/aopalliance/1.0/aopalliance-1.0.jar
[ERROR] urls[19] = file:/Users/hrr/.m2/repository/log4j/log4j/1.2.16/log4j-1.2.16.jar
[ERROR] urls[20] = file:/Users/hrr/.m2/repository/org/ow2/asm/asm-commons/5.0.1/asm-commons-5.0.1.jar
[ERROR] urls[21] = file:/Users/hrr/.m2/repository/org/ow2/asm/asm-tree/5.0.1/asm-tree-5.0.1.jar
[ERROR] urls[22] = file:/Users/hrr/.m2/repository/org/ow2/asm/asm/5.0.1/asm-5.0.1.jar
[ERROR] urls[23] = file:/Users/hrr/.m2/repository/org/eclipse/aether/aether-spi/0.9.0.M2/aether-spi-0.9.0.M2.jar
[ERROR] urls[24] = file:/Users/hrr/.m2/repository/org/eclipse/aether/aether-impl/0.9.0.M2/aether-impl-0.9.0.M2.jar
[ERROR] urls[25] = file:/Users/hrr/.m2/repository/org/eclipse/aether/aether-api/0.9.0.M2/aether-api-0.9.0.M2.jar
[ERROR] urls[26] = file:/Users/hrr/.m2/repository/org/eclipse/aether/aether-util/0.9.0.M2/aether-util-0.9.0.M2.jar
[ERROR] urls[27] = file:/Users/hrr/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.plexus/0.0.0.M5/org.eclipse.sisu.plexus-0.0.0.M5.jar
[ERROR] urls[28] = file:/Users/hrr/.m2/repository/javax/enterprise/cdi-api/1.0/cdi-api-1.0.jar
[ERROR] urls[29] = file:/Users/hrr/.m2/repository/javax/annotation/jsr250-api/1.0/jsr250-api-1.0.jar
[ERROR] urls[30] = file:/Users/hrr/.m2/repository/org/sonatype/sisu/sisu-guice/3.1.0/sisu-guice-3.1.0-no_aop.jar
[ERROR] urls[31] = file:/Users/hrr/.m2/repository/org/eclipse/sisu/org.eclipse.sisu.inject/0.0.0.M5/org.eclipse.sisu.inject-0.0.0.M5.jar
[ERROR] urls[32] = file:/Users/hrr/.m2/repository/org/codehaus/plexus/plexus-interpolation/1.19/plexus-interpolation-1.19.jar
[ERROR] urls[33] = file:/Users/hrr/.m2/repository/org/codehaus/plexus/plexus-utils/3.0.17/plexus-utils-3.0.17.jar
[ERROR] urls[34] = file:/Users/hrr/.m2/repository/org/codehaus/plexus/plexus-component-annotations/1.5.5/plexus-component-annotations-1.5.5.jar
[ERROR] urls[35] = file:/Users/hrr/.m2/repository/org/sonatype/plexus/plexus-sec-dispatcher/1.3/plexus-sec-dispatcher-1.3.jar
[ERROR] urls[36] = file:/Users/hrr/.m2/repository/org/sonatype/plexus/plexus-cipher/1.4/plexus-cipher-1.4.jar
[ERROR] urls[37] = file:/Users/hrr/.m2/repository/org/eclipse/emf/org.eclipse.emf.ecore.xmi/2.11.0-v20150123-0347/org.eclipse.emf.ecore.xmi-2.11.0-v20150123-0347.jar
[ERROR] urls[38] = file:/Users/hrr/.m2/repository/org/antlr/antlr-runtime/3.2/antlr-runtime-3.2.jar
[ERROR] urls[39] = file:/Users/hrr/.m2/repository/org/eclipse/emf/org.eclipse.emf.codegen/2.10.0-v20150123-0452/org.eclipse.emf.codegen-2.10.0-v20150123-0452.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import  from realm ClassRealm[project>org.eclipse.vorto:org.eclipse.vorto.parent:0.4.0-SNAPSHOT, parent: ClassRealm[maven.api, parent: null]]]
[ERROR] 
[ERROR] -----------------------------------------------------: org.apache.log4j.Logger
[ERROR] -> [Help 1]
[ERROR] 


Is there any requirement I missed so far?

Best Regards,
Heinz Rohmer

Re: Parsing Vorto models outside of Eclipse [message #1712920 is a reply to message #1712776] Thu, 29 October 2015 11:32 Go to previous messageGo to next message
Olaf Weinmann is currently offline Olaf WeinmannFriend
Messages: 29
Registered: May 2015
Junior Member
Hi Heinz,

Is it possible that there is an issue with your proxy configuration? Can you please check that and let me know?

Cheers,

Olaf
Re: Parsing Vorto models outside of Eclipse [message #1712928 is a reply to message #1712920] Thu, 29 October 2015 12:26 Go to previous messageGo to next message
Heinz Rohmer is currently offline Heinz RohmerFriend
Messages: 4
Registered: October 2015
Junior Member
Hi Olaf,

thanks for your reply!
In the meantime it works Smile
I deleted all log4j, xtext and xtend artifacts within my local Maven repository (<home>/.m2/repository/). After doing that the build just worked find. It looks like for some reasons the download of one or more artifacts failed Sad

Now work can go on ...

Best regards
Heinz
Re: Parsing Vorto models outside of Eclipse [message #1712941 is a reply to message #1712928] Thu, 29 October 2015 13:31 Go to previous messageGo to next message
Olaf Weinmann is currently offline Olaf WeinmannFriend
Messages: 29
Registered: May 2015
Junior Member
Perfect! Smile Please let me know if there are any further issues.

Cheers,

Olaf

Re: Parsing Vorto models outside of Eclipse [message #1713170 is a reply to message #1711324] Sun, 01 November 2015 21:10 Go to previous message
Heinz Rohmer is currently offline Heinz RohmerFriend
Messages: 4
Registered: October 2015
Junior Member
Hello Alex,

thanks for the example java code. It works well for using an InformationModel file. Parsing a simple *.datatype (enumeration) with this parser fails in my implementation class. Using the DatatypeStandaloneSetup class works well for my simple *.datatype file.
We'd like to build a virtual developer generator based on Vorto models. Therefore we need a single parser for each kind of a Vorto model (need to send them all to a server, where the generator is running on).
Do you have an example for a parser understand all current Vorto model types (datatype, functionblock, informationmodel and mapping)?

Best Regards
Heinz
Previous Topic:"the thing is not enough"
Next Topic:info model errors in eclipse Luna
Goto Forum:
  


Current Time: Tue Nov 20 07:52:07 GMT 2018

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

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

Back to the top