|Re: JET2 - declaring custom tags [message #4486]
||Wed, 14 March 2007 17:59
Originally posted by: merks.ca.ibm.com|
Questions about JET2 should be directed to the m2t newsgroup, which I've
added to the "to" list.
> Hi everyone, I just discovered new JET2 capabilities and I would like
> to use it in my project.
> I followed the IBM's tutorial
> ( http://www-128.ibm.com/developerworks/opensource/library/os- ecl-jet/)
> and doing simple transformations works right now.
> My question is : how to extend JET2 by declaring my own custom tags ?
> I tried to add a extension point (org.eclipse.jet.tagLibrairies) and
> implement a HelloWorldTag.java as my custom tag, but when I call this
> newly tag in the dump.jet, it just prints out my tag (ie. the tag is
> not recognized by the parser)
> Have anyone ever tried to declare custom tags ? How can I do that ?
> Thanks in advance !
|Re: JET2 - declaring custom tags [message #6656 is a reply to message #6601]
||Mon, 26 March 2007 12:40
| Paul Elder
Registered: July 2009
When you run a JET Transformation from a workspace project, the JET engine
attempts dynamically loads the plug-in into the workbench. But, JET will not
attempt to dynamically load dependencies (such as your tag library). Here's
the sequence of events:
1) you run you JET transform.
2) JET engine realizes its the workspace, and attempts to load it via OSGi.
3) OSGi realizes the transform plug-in has an unresolved dependency on
org.test.customtags and fails the load of transform plug-in.
4) The message you are getting is a side effect of this failure - the engine
is reporting that it could not load a class out of the plug-in that failed
to load. I've submitted a bugzilla to make the error message better
But, the fact remains that the transformation plug-in won't load. You have
1) launch a run-time workbench that includes both you JET transformation and
your custom tags plug-in, and run your transformation there.
2) install you custom tags plug-in into your development workbench.
I would consider an enhancement to the JET engine to attempt to load
dependencies dynamically, but my sense is this could get very complex, very
quickly. It certainly won't happen for this release.
"Vinay" <email@example.com> wrote in message
> I am fairly new to JET. I tried my hands with custom JET tags using steps
> described in this thread. Everything runs smooth when custom tags are
> defined in same project where my JET Templates are but what I want is -
> custom tags should be in separate project and templates in another
> project. Following are the steps I performed -
> 1. Create plugin project (org.test.customtag) and written custom tag
> there. Dependencies include org.eclipse.jet.Also created
> org.eclipse.jet.tagLibraries extension (library id - "customlibrary", tag
> id - "HelloWorld" (function tag), prefix - "cl").
> 2. I created another project (EMFT JET Transformation Project) having JET
> transformations which has org.test.customtag in its dependencies list
> along with org.eclipse.jet. I also added my custom library under
> (transform)/(taglibraries) using new importLibrary option, specifying id
> as "org.test.customtag.customlibrary" and prefix as "cl" along with
> Then I am using my tag (<cl:HelloWorld>James</cl:HelloWorld>) in one of
> the template. But when I run my template, I am getting following error -
> "Could not load JET template loader". Can any one please point out the
> cause of this error.
> Please note that as soon as I remove "org.test.customtag" project from
> dependencies list, this error goes away (though in this case I cann't get
> output of my custom tag but this gives me a feeling that I am doing
> something wrong while including this custom tag project in my JET template
> Thanks in advance.
Powered by FUDForum
. Page generated in 0.02650 seconds