[JET] How to Dynamically call JET transform api through a plugin? [message #535825] |
Tue, 25 May 2010 16:18  |
Eclipse User |
|
|
|
Hi,
I am trying to dynamically call JET transform api through a plugin. But I am getting some error. Please help me with it
Detailed explanation:
1) I have created a new wizard plugin Which selects a particular file.
2) This is an XML file which i need to futher process using JET and create some new files.
3) I am already done with the JET templates for that XML. Now the question it to merge the 2 systems.
4) Hence on when we click the finish button of the wizard i give the xml file as input to the JET template.
5) I am using the following code to invoke JET template
IResource fileRes = (IResource) file // the path to xml file;
IStatus status = JET2Platform.runTransformOnResource("com.tibco.mdm.trwJetTemplate ",fileRes,monitor);
But it gives me a weird error when i click on finish button an alert message pops up sayin error in org/eclipse/jet/JET2Platform
and it gives no other error.
Please help me with this
Thanks in advance
Herat
[Updated on: Tue, 25 May 2010 16:43] by Moderator
|
|
|
|
|
|
Re: [JET] How to Dynamically call JET transform api through a plugin? [message #536495 is a reply to message #536352] |
Fri, 28 May 2010 09:37  |
Eclipse User |
|
|
|
The method JET2Platform.runTransformOnResource() has a variant that
accepts a Map. This map defines JET variables that will be available to
the templates. A quick example:
Map<String,Object> predefinedVariables = new HashMap<String,Object>();
predefinedVariables.put("myVar", myValue);
JET2Platform.runTransformOnResource(...., predefinedVariables, ... );
In a template you would refer to the variable in XPath epxressions:
<c:get select="$myVar"/>
Paul
On 2010-05-27 2:10 PM, Herat Acharya wrote:
> Thanks Paul,
> Just one last question.
> I am selecting a value from the wizard plugin lets say Person. This
> value i want to send it to the Jet template . is there any way to do it
> so that i can process the template according to this value.
>
> Thanks in advance
> Herat
|
|
|
Powered by
FUDForum. Page generated in 0.04344 seconds