Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [Acceleo 3.4.x] How to import template / modul?
[Acceleo 3.4.x] How to import template / modul? [message #1229495] Thu, 09 January 2014 15:04 Go to next message
Ralph Bergmann is currently offline Ralph Bergmann
Messages: 10
Registered: July 2009
Location: Berlin / Germany
Junior Member
What is the right way to import a module?

I have a main modul called DatabaseGenerator. It's located under eu.the4thfloor.dme.generator.main.DatabaseGenerator.mtl
I have another modul called DatabaseGeneratorHelper. This is located under eu.the4thfloor.dme.generator.common.DatabaseGeneratorHelper.mtl

Now I want to import the helper module with this command:

[import eu::the4thfloor::dme::generator::common::DatabaseGeneratorHelper /]

I get no error in the modul files but I get a error from Eclipse:

Errors occurred during the build.
Errors running builder 'Acceleo Builder' on project 'eu.the4thfloor.dme.generator'.
org.eclipse.core.internal.resources.ResourceException: Resource '/dme.generator/bin/eu/the4thfloor/dme/generator/common/DatabaseGeneratorHelper.emtl' does not exist.

But the files exists. Whats going wrong? I found out that the Indigo version of Acceleo works but not the Kepler / Luna version.


Ralph
Re: [Acceleo 3.4.x] How to import template / modul? [message #1230326 is a reply to message #1229495] Sat, 11 January 2014 17:28 Go to previous messageGo to next message
Ziyaulhaq Aliyu is currently offline Ziyaulhaq Aliyu
Messages: 2
Registered: January 2014
Junior Member
iam new to epsilon. i want to use Epsilon Generation Language (EGL).So now i want to know a link where to start learning how to write a program using EGL and some examples. thnk you
Re: [Acceleo 3.4.x] How to import template / modul? [message #1231699 is a reply to message #1230326] Wed, 15 January 2014 08:19 Go to previous messageGo to next message
Johan Hardy is currently offline Johan Hardy
Messages: 34
Registered: December 2012
Member
Working with Acceleo 3.4.1 everyday in Kepler is fine for me.

By the way, your import seems to be correctly performed on your side. I don't understand why you have this error. Maybe a clean/re-build of your project may be sufficient I don't know.

Also, make sure that the name of your module corresponds to what you want to import. I mean that the 'DatabaseGeneratorHelper.mtl' file has the following header:

[comment encoding = UTF-8 /]
[module DatabaseGeneratorHelper('http://www.eclipse.org/xxxx/xxxx.0.0.1.xx')]

etc ...


Regards;

[Updated on: Wed, 15 January 2014 08:28]

Report message to a moderator

Re: [Acceleo 3.4.x] How to import template / modul? [message #1233033 is a reply to message #1231699] Sat, 18 January 2014 11:56 Go to previous messageGo to next message
Ralph Bergmann is currently offline Ralph Bergmann
Messages: 10
Registered: July 2009
Location: Berlin / Germany
Junior Member
I think the [import ...] command is okay because it works with older Eclipse versions. I think the problem is the new Eclipse 4.x build system.


Ralph
Re: [Acceleo 3.4.x] How to import template / modul? [message #1233921 is a reply to message #1233033] Mon, 20 January 2014 21:09 Go to previous messageGo to next message
Stephane Begaudeau is currently offline Stephane Begaudeau
Messages: 413
Registered: April 2010
Location: Nantes (France)
Senior Member

Hi,

myModule.mtl
[comment encoding = UTF-8 /]
[module myModule('myMetamodelNsUri')]

[template public aTemplate(anObject: Type)]
World!
[/template]


myOtherModule.mtl
[comment encoding = UTF-8 /]
[module myOtherModule('myMetamodelNsUri')]

[import qualified::name::of::myModule]

[template public anotherTemplate(anObject: Type)]
Hello [anObject.aTemplate()/]
[/template]


See an example here.

Regards,

Stephane Begaudeau, Obeo

--
Twitter: @sbegaudeau
Google+: +stephane.begaudeau
Blog: http://stephanebegaudeau.tumblr.com | Eclipse Java Development Tools Tips and Tricks



Re: [Acceleo 3.4.x] How to import template / modul? [message #1234597 is a reply to message #1233921] Wed, 22 January 2014 10:34 Go to previous messageGo to next message
Ralph Bergmann is currently offline Ralph Bergmann
Messages: 10
Registered: July 2009
Location: Berlin / Germany
Junior Member
I think I found the problem.

I created a Acceleo Project inside the "default location" and everything works fine.
But when I create the project inside a folder in the "dafault location" I get this error

!ENTRY org.eclipse.core.resources 4 2 2014-01-22 11:30:00.586
!MESSAGE Problems occurred when invoking code from plug-in: "org.eclipse.core.resources".
!STACK 0
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.core.internal.resources.ResourceException: Resource '/eu.the4thfloor.dme.generator/bin/eu/the4thfloor/dme/generator/files/generate.emtl' does not exist.
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
	at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:361)
	at org.eclipse.acceleo.internal.parser.compiler.AcceleoParser.doBuild(AcceleoParser.java:627)
	at org.eclipse.acceleo.internal.parser.compiler.AcceleoParser.build(AcceleoParser.java:431)
	at org.eclipse.acceleo.internal.parser.compiler.AcceleoParser.buildImpactedModules(AcceleoParser.java:763)
	at org.eclipse.acceleo.internal.parser.compiler.AcceleoParser.build(AcceleoParser.java:436)
	at org.eclipse.acceleo.internal.parser.compiler.AcceleoParser.buildAll(AcceleoParser.java:262)
	at org.eclipse.acceleo.internal.ide.ui.builders.AcceleoBuilder.buildAll(AcceleoBuilder.java:278)
	at org.eclipse.acceleo.internal.ide.ui.builders.AcceleoBuilder.build(AcceleoBuilder.java:180)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:733)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: org.eclipse.core.internal.resources.ResourceException: Resource '/eu.the4thfloor.dme.generator/bin/eu/the4thfloor/dme/generator/files/generate.emtl' does not exist.
	at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:341)
	at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:215)
	at org.eclipse.core.internal.resources.File.getContents(File.java:287)
	at org.eclipse.core.internal.resources.File.getContents(File.java:278)
	at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl$WorkbenchHelper.createPlatformResourceInputStream(PlatformResourceURIHandlerImpl.java:207)
	at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createInputStream(PlatformResourceURIHandlerImpl.java:525)
	at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:360)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1269)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	... 21 more

!ENTRY org.eclipse.core.resources 4 75 2014-01-22 11:30:00.589
!MESSAGE Errors occurred during the build.
!SUBENTRY 1 org.eclipse.acceleo.ide.ui 4 75 2014-01-22 11:30:00.589
!MESSAGE Errors running builder 'Acceleo Builder' on project 'eu.the4thfloor.dme.generator'.
!STACK 0
org.eclipse.emf.ecore.resource.impl.ResourceSetImpl$1DiagnosticWrappedException: org.eclipse.core.internal.resources.ResourceException: Resource '/eu.the4thfloor.dme.generator/bin/eu/the4thfloor/dme/generator/files/generate.emtl' does not exist.
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.handleDemandLoadException(ResourceSetImpl.java:319)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:278)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.getResource(ResourceSetImpl.java:406)
	at org.eclipse.acceleo.common.utils.ModelUtils.load(ModelUtils.java:361)
	at org.eclipse.acceleo.internal.parser.compiler.AcceleoParser.doBuild(AcceleoParser.java:627)
	at org.eclipse.acceleo.internal.parser.compiler.AcceleoParser.build(AcceleoParser.java:431)
	at org.eclipse.acceleo.internal.parser.compiler.AcceleoParser.buildImpactedModules(AcceleoParser.java:763)
	at org.eclipse.acceleo.internal.parser.compiler.AcceleoParser.build(AcceleoParser.java:436)
	at org.eclipse.acceleo.internal.parser.compiler.AcceleoParser.buildAll(AcceleoParser.java:262)
	at org.eclipse.acceleo.internal.ide.ui.builders.AcceleoBuilder.buildAll(AcceleoBuilder.java:278)
	at org.eclipse.acceleo.internal.ide.ui.builders.AcceleoBuilder.build(AcceleoBuilder.java:180)
	at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:733)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:206)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:246)
	at org.eclipse.core.internal.events.BuildManager$1.run(BuildManager.java:299)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:302)
	at org.eclipse.core.internal.events.BuildManager.basicBuildLoop(BuildManager.java:358)
	at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:381)
	at org.eclipse.core.internal.events.AutoBuildJob.doBuild(AutoBuildJob.java:143)
	at org.eclipse.core.internal.events.AutoBuildJob.run(AutoBuildJob.java:241)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
Caused by: org.eclipse.core.internal.resources.ResourceException: Resource '/eu.the4thfloor.dme.generator/bin/eu/the4thfloor/dme/generator/files/generate.emtl' does not exist.
	at org.eclipse.core.internal.resources.Resource.checkExists(Resource.java:341)
	at org.eclipse.core.internal.resources.Resource.checkAccessible(Resource.java:215)
	at org.eclipse.core.internal.resources.File.getContents(File.java:287)
	at org.eclipse.core.internal.resources.File.getContents(File.java:278)
	at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl$WorkbenchHelper.createPlatformResourceInputStream(PlatformResourceURIHandlerImpl.java:207)
	at org.eclipse.emf.ecore.resource.impl.PlatformResourceURIHandlerImpl.createInputStream(PlatformResourceURIHandlerImpl.java:525)
	at org.eclipse.emf.ecore.resource.impl.ExtensibleURIConverterImpl.createInputStream(ExtensibleURIConverterImpl.java:360)
	at org.eclipse.emf.ecore.resource.impl.ResourceImpl.load(ResourceImpl.java:1269)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoad(ResourceSetImpl.java:259)
	at org.eclipse.emf.ecore.resource.impl.ResourceSetImpl.demandLoadHelper(ResourceSetImpl.java:274)
	... 21 more

!ENTRY org.eclipse.egit.core 4 0 2014-01-22 11:30:01.277
!MESSAGE Failed finding RepositoryMapping
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Resource '/eu.the4thfloor.dme.generator/tasks' is not local.
	at org.eclipse.core.internal.resources.Resource.checkLocal(Resource.java:353)
	at org.eclipse.core.internal.resources.Resource.checkAccessibleAndLocal(Resource.java:222)
	at org.eclipse.core.internal.resources.Resource.getSessionProperty(Resource.java:1274)
	at org.eclipse.egit.core.project.GitProjectData.getRepositoryMapping(GitProjectData.java:366)
	at org.eclipse.egit.core.project.RepositoryMapping.getMapping(RepositoryMapping.java:271)
	at org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator.getIndexDiffDataOrNull(GitLightweightDecorator.java:206)
	at org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator.decorateResource(GitLightweightDecorator.java:180)
	at org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator.decorate(GitLightweightDecorator.java:166)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:263)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:81)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:365)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:347)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:371)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:331)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
!SUBENTRY 1 org.eclipse.core.resources 4 369 2014-01-22 11:30:01.278
!MESSAGE Resource '/eu.the4thfloor.dme.generator/tasks' is not local.

!ENTRY org.eclipse.egit.core 4 0 2014-01-22 11:30:01.593
!MESSAGE Failed finding RepositoryMapping
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Resource '/eu.the4thfloor.dme.generator/tasks' is not local.
	at org.eclipse.core.internal.resources.Resource.checkLocal(Resource.java:353)
	at org.eclipse.core.internal.resources.Resource.checkAccessibleAndLocal(Resource.java:222)
	at org.eclipse.core.internal.resources.Resource.getSessionProperty(Resource.java:1274)
	at org.eclipse.egit.core.project.GitProjectData.getRepositoryMapping(GitProjectData.java:366)
	at org.eclipse.egit.core.project.RepositoryMapping.getMapping(RepositoryMapping.java:271)
	at org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator.getIndexDiffDataOrNull(GitLightweightDecorator.java:206)
	at org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator.decorateResource(GitLightweightDecorator.java:180)
	at org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator.decorate(GitLightweightDecorator.java:166)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:263)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:81)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:365)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:347)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:371)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:331)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
!SUBENTRY 1 org.eclipse.core.resources 4 369 2014-01-22 11:30:01.594
!MESSAGE Resource '/eu.the4thfloor.dme.generator/tasks' is not local.

!ENTRY org.eclipse.egit.core 4 0 2014-01-22 11:30:01.595
!MESSAGE Failed finding RepositoryMapping
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Resource '/eu.the4thfloor.dme.generator/tasks' is not local.
	at org.eclipse.core.internal.resources.Resource.checkLocal(Resource.java:353)
	at org.eclipse.core.internal.resources.Resource.checkAccessibleAndLocal(Resource.java:222)
	at org.eclipse.core.internal.resources.Resource.getSessionProperty(Resource.java:1274)
	at org.eclipse.egit.core.project.GitProjectData.getRepositoryMapping(GitProjectData.java:366)
	at org.eclipse.egit.core.project.RepositoryMapping.getMapping(RepositoryMapping.java:271)
	at org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator.getIndexDiffDataOrNull(GitLightweightDecorator.java:206)
	at org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator.decorateResource(GitLightweightDecorator.java:180)
	at org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator.decorate(GitLightweightDecorator.java:166)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:263)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:81)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:365)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:347)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:371)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:331)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
!SUBENTRY 1 org.eclipse.core.resources 4 369 2014-01-22 11:30:01.595
!MESSAGE Resource '/eu.the4thfloor.dme.generator/tasks' is not local.

!ENTRY org.eclipse.egit.core 4 0 2014-01-22 11:30:01.597
!MESSAGE Failed finding RepositoryMapping
!STACK 1
org.eclipse.core.internal.resources.ResourceException: Resource '/eu.the4thfloor.dme.generator/tasks' is not local.
	at org.eclipse.core.internal.resources.Resource.checkLocal(Resource.java:353)
	at org.eclipse.core.internal.resources.Resource.checkAccessibleAndLocal(Resource.java:222)
	at org.eclipse.core.internal.resources.Resource.getSessionProperty(Resource.java:1274)
	at org.eclipse.egit.core.project.GitProjectData.getRepositoryMapping(GitProjectData.java:366)
	at org.eclipse.egit.core.project.RepositoryMapping.getMapping(RepositoryMapping.java:271)
	at org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator.getIndexDiffDataOrNull(GitLightweightDecorator.java:206)
	at org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator.decorateResource(GitLightweightDecorator.java:180)
	at org.eclipse.egit.ui.internal.decorators.GitLightweightDecorator.decorate(GitLightweightDecorator.java:166)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorDefinition.decorate(LightweightDecoratorDefinition.java:263)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager$LightweightRunnable.run(LightweightDecoratorManager.java:81)
	at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.decorate(LightweightDecoratorManager.java:365)
	at org.eclipse.ui.internal.decorators.LightweightDecoratorManager.getDecorations(LightweightDecoratorManager.java:347)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.ensureResultCached(DecorationScheduler.java:371)
	at org.eclipse.ui.internal.decorators.DecorationScheduler$1.run(DecorationScheduler.java:331)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:53)
!SUBENTRY 1 org.eclipse.core.resources 4 369 2014-01-22 11:30:01.597
!MESSAGE Resource '/eu.the4thfloor.dme.generator/tasks' is not local.

[Updated on: Wed, 22 January 2014 10:38]

Report message to a moderator

Re: [Acceleo 3.4.x] How to import template / modul? [message #1235831 is a reply to message #1234597] Sat, 25 January 2014 12:07 Go to previous message
Ralph Bergmann is currently offline Ralph Bergmann
Messages: 10
Registered: July 2009
Location: Berlin / Germany
Junior Member
Finally I found my problem.

The name of the project was different than the folder of the project. The name was fully qualified but for the folder I used was only the last part of the name.

Example:
name -> eu.the4thfloor.dme.generator
path -> dme.generator

Now I changed the path and all works fine Smile


Ralph
Previous Topic:[Acceleo] Standalone
Next Topic:[XPand] Generate from Graphitis .diagram file
Goto Forum:
  


Current Time: Thu Oct 30 18:18:40 GMT 2014

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

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