JET2 Transform not working [message #990345] |
Tue, 11 December 2012 23:54  |
Eclipse User |
|
|
|
Basically I'm trying to run a JET2 Transform programmatically.
I've got a String representing XML input.
I've got a simple JET2 Transform:
main.jet
<%@taglib prefix="ws" id="org.eclipse.jet.workspaceTags" %>
<%-- Main entry point for com.themousewheel.sandbox.jet2 --%>
<%--
Let c:iterate tags set the XPath context object.
For 100% compatibility with JET 0.9.x or earlier, remove this statement
--%>
<c:setVariable var="org.eclipse.jet.taglib.control.iterateSetsContext" select="true()"/>
<%--
TODO: traverse input model, performing calculations and storing
the results as model annotations via c:set tag
--%>
<%--
TODO: traverse annotated model, performing text generation actions
such as ws:file, ws:folder and ws:project
--%>
<%-- For debug purposes, dump the annotated input model in
the root of the project containing the original input model.
Note that model formatting may not be identical, and that in
the case of non-XML input models, the dump may look quite different.
--%>
<c:if test="isVariableDefined('org.eclipse.jet.resource.project.name')">
<ws:file template="templates/dump.jet" path="{$org.eclipse.jet.resource.project.name}/dump.xml"/>
</c:if>
and dump.jet
<%@taglib prefix="ws" id="org.eclipse.jet.workspaceTags" %>
<ws:project name="TEST">
</ws:project>
Also some text in case dump.xml works
<ws:rebuildWorkspace/>
I figured after I couldn't find the dump.xml file that it might be easier to tell if the transform is working by creating a project in the workspace (in case I just had file paths a bit wonky).
I'm running the transform within an OSGi bundle activator using the following line
IStatus status = JET2Platform.runTransformOnString("com.themousewheel.sandbox.jet2", generator.getDomainXML(), new NullProgressMonitor());
System.out.println(status);
which prints "Status OK: org.eclipse.jet code=0 Successful Execution null" to standard out.
However despite the transform apparently running successfully dump.xml and the project TEST aren't created!
Does anyone have any ideas? This problem is currently a blocker for me and I don't know how to proceed because I'm not getting any meaningful output to help me diagnose what's wrong!
Thanks in advance!
|
|
|
|
Re: JET2 Transform not working [message #990533 is a reply to message #990446] |
Wed, 12 December 2012 17:39  |
Eclipse User |
|
|
|
Well it appeared to be doing nothing but moving the <ws:project> tag outside of the <c:if> tag does actually create the project.
The problem is that it creates the new project in a location that is not my workspace so obviously the new project doesn't actually appear in Eclipse.
How do I force it to generate the project in my actual workspace folder?
New main.jet shown below
<%@taglib prefix="ws" id="org.eclipse.jet.workspaceTags" %>
<%-- Main entry point for com.themousewheel.sandbox.jet2 --%>
<%--
Let c:iterate tags set the XPath context object.
For 100% compatibility with JET 0.9.x or earlier, remove this statement
--%>
<c:setVariable var="org.eclipse.jet.taglib.control.iterateSetsContext" select="true()"/>
<%--
TODO: traverse input model, performing calculations and storing
the results as model annotations via c:set tag
--%>
<%--
TODO: traverse annotated model, performing text generation actions
such as ws:file, ws:folder and ws:project
--%>
<%-- For debug purposes, dump the annotated input model in
the root of the project containing the original input model.
Note that model formatting may not be identical, and that in
the case of non-XML input models, the dump may look quite different.
--%>
<ws:project name="TEST">
<ws:file template="templates/dump.jet" path="dump.xml"/>
</ws:project>
<ws:rebuildWorkspace/>
|
|
|
Powered by
FUDForum. Page generated in 0.03164 seconds