Skip to main content

Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » M2T (model-to-text transformation) » [JET2] Is output to file system location or string possible?
[JET2] Is output to file system location or string possible? [message #667705] Sun, 01 May 2011 14:22
Nigel Daniels is currently offline Nigel DanielsFriend
Messages: 66
Registered: July 2009

I am building an EMF/RCP app and want to add the capability to generate
files from the model being edited. To do this I have added a wizard that
lets me specify a file location then attempt to generate the file using
the following call:

HashMap variableMap = new HashMap();

variableMap.put("my.outputPath", relativePath.toString());

// Call the transform
IStatus status =
JET2Platform.runTransformOnObject("my.jet.allquestions", rootObject,
variableMap, new NullProgressMonitor());

The relative path is the path selected in the wizard. In my main.jet
file I tried to do:

<%@taglib prefix="ws" id="org.eclipse.jet.workspaceTags" %>
<%@taglib prefix="f" id="org.eclipse.jet.formatTags"%>

<%-- Main entry point for my.jet.allquestions --%>

<ws:file template="templates/KeyQuestions.xml.jet"

It seems that the first part of the path is always handles as a
project. Is there any way to generate a file that just sits in the file
system? The RCP application I am using uses file:/path/file.ext rather
than a project and workspace to access the EMF instances being edited.

If the above is just not possible is there anyway to capture the output
of the transformation as a string so I can write out the file myself?

Thanks for any help,

Previous Topic:[Acceleo] Overriding templates (provided by an installed plugin) in a dev project
Next Topic:T2T
Goto Forum:

Current Time: Fri Dec 01 04:47:14 GMT 2023

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

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

Back to the top