Hi, Template tags changed from 1.0.1 to latest cvs. For example instead of <XDoclet:classTagValue/> you should put <XDtClass:classTagValue/>. Basically this change is to better manage tag implementation code, so there's no long SubTask or AbstractEjbSubTask class anymore, but many tinier and more manageable classes. XDt is the new prefix instead of XDoclet, so Class postfix in XDtClass in the above example specifies the where the tag is defined. As you can see it's just a symbolic name, actually a mapping file is used to map Class to xdoclet.tags.ClassTagsHandler where classTagValue() is defined. The mapping file is core/config/xdoclet-mappings.properties. Take a look at other template files, you'll get the idea. I'll add a facility to define new tag impl classes for user defined namespaces dynamically soon.
Ara. -----Original Message----- From: J. Matthew Pryor [mailto:[EMAIL PROTECTED]] Sent: Tuesday, November 06, 2001 5:38 AM To: Ara Abrahamian; [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: RE: [Xdoclet-user] example use of <template/> tag OK so I am trying to test this. I believe I have the latest code from CVS My template gets called just fine, and on the classes I expect, but I get a strange error [templatedoclet] Constructing Javadoc information... [templatedoclet] Running <template/> [templatedoclet] Generating output for 'com.versata.repository.xml.bind.dataobject.Action' using template file 'D:\data\proj\galli um\main\etc\interface.j'. [templatedoclet] (TemplateEngine.getTagSupportClass 175 ) Could not find tag support class for prefix: clet [templatedoclet] Running XDoclet failed: [templatedoclet] Running XDoclet failed. [templatedoclet] javadoc: In doclet class xdoclet.DocletTask$DocletMain, method start has thrown an exception java.lang.reflect.Inv ocationTargetException [templatedoclet] 1 error Now the input classes/interfaces to the xdoclet run are not EJBs, just Java interfaces generated with another tool. The interface decl looks like this: /** * @zeus:interface-decl **/ public interface Action extends Serializable { The templatedoclet Ant task looks like this : <target name="generateInterfaces" depends="generateCode"> <templatedoclet sourcepath="${generated.src.dir}" destdir="${generated.src.dir}" classpathref="compile.classpath"> <fileset dir="${generated.src.dir}"> <include name="**/com/versata/repository/xml/bind/**/*.java" /> </fileset> <template templateFile="${etc.dir}/interface.j" destinationFile="I{0}.java" havingClassTag="zeus:interface-decl"> </template> </templatedoclet> </target> It works in as much as all my interfaces get loaded and is applies the tample to the correct interfaces. If I specify an empty template file, I get a file created with the correct name for each interface that I expect. But I don't understand the error I get when trying to use the template language. I tried doing something really simple like this : /** * Generated remote interface for <XDoclet:fullClassName/>. Do not edit! */ But even that got the same error as above Any help would be appreciated Cheers, Matthew > -----Original Message----- > From: Ara Abrahamian [mailto:[EMAIL PROTECTED]] > Sent: Thursday, October 11, 2001 1:40 PM > To: [EMAIL PROTECTED]; [EMAIL PROTECTED]; > [EMAIL PROTECTED] > Subject: RE: [Xdoclet-user] example use of <template/> tag > > > OK, it's implemented. Checkout from cvs. > Here is an example: > > <taskdef name="templatedoclet" classname="xdoclet.DocletTask" > classpath="${xdoclet.jar.path};${log4j.jar.path};${ant.jar.path}" > /> > > <templatedoclet > sourcepath="${java.dir}" > destdir="${output.dir}" > classpathref="project.class.path"> > > <fileset dir="${java.dir}"> > <include name="test/ejb/*Bean.java" /> > </fileset> > > <template > templateFile="D:\XDocletProject\xdoclet\core\samples\script\report.j" > destinationFile="report-for-{0}.html" > ofType="javax.ejb.SessionBean,javax.ejb.EntityBean" extent="hierarchy" > havingClassTag="ejb:bean"/> > > </templatedoclet> > > templateFile and destinationFile are the minimum required parameters. > The {0} in destination mean a per class output is desired. The output > for test.ejb.AccountBean is test\ejb\report-for-AccountBean.html. ofType > mean only apply on classes of the specified types (comma-separated). > Extent is used for ofType, valid values are: concrete-type (good for > searching for a specific class, superclass for classes directly derived > from the type, and hierarchy for class extending or implementing a type > somewhere in its hierarchy (it's the default). ofType and extent should > be used with each other. havingClassTag means the class should have the > specified class tag in it, otherwise ignore it. > > Note that currently you can't use ejb-specific tags, that's scheduled > for v1.1. > > Ara. > > > -----Original Message----- > > From: [EMAIL PROTECTED] [mailto:xdoclet-user- > > [EMAIL PROTECTED]] On Behalf Of J. Matthew Pryor > > Sent: Wednesday, October 10, 2001 3:32 PM > > To: Ara Abrahamian; [EMAIL PROTECTED] > > Subject: RE: [Xdoclet-user] example use of <template/> tag > > > > Sounds excellent, I'll happily beta test it > > > > jmp > > > > > -----Original Message----- > > > From: Ara Abrahamian [mailto:[EMAIL PROTECTED]] > > > Sent: Wednesday, October 10, 2001 8:45 PM > > > To: [EMAIL PROTECTED]; [EMAIL PROTECTED] > > > Subject: RE: [Xdoclet-user] example use of <template/> tag > > > > > > > > > Currently there's no support for per class templates, but you can > write > > > templates that operates on a set of classes (like ejb-jar_xml.j). > > > Hopefully I'll implement what you're looking for today :-) > > > So you'll be able to do something like this: > > > > > > <template destinationFile="{0}" templateFile="MyTemplate.j"/> > > > > > > And {0} will be substituted by class name. Probably I'll also add a > > > derivedFrom and havingClassTag params so you'll be able to specify > which > > > classes you want output for, not just all classes in the fileset. > OK? > > > > > > Ara. > > > > > > > -----Original Message----- > > > > From: [EMAIL PROTECTED] > [mailto:xdoclet-user- > > > > [EMAIL PROTECTED]] On Behalf Of J. Matthew Pryor > > > > Sent: Wednesday, October 10, 2001 10:07 AM > > > > To: [EMAIL PROTECTED] > > > > Subject: [Xdoclet-user] example use of <template/> tag > > > > > > > > I was wondering if anyone had an example use of the template tag ? > > > > > > > > I can get it to work, but it appears that is gets passed the root > of > > > the > > > > JavaDoc run, where I was expecting to be able to apply a template > to > > > each > > > > individual class/interface > > > > > > > > I realize I can do this by changing the fileset, but I was > wondering > > > if > > > > perhaps I was using the <temaplate/> tag incorrectly > > > > > > > > I have something like this : > > > > <ejbdoclet > > > > sourcepath="${java.dir}" > > > > destdir="${generated.java.dir}" > > > > classpathref="project.class.path" > > > > excludedtags="@version,@author" > > > > ejbspec="2.0"> > > > > > > > > <fileset dir="${java.dir}"> > > > > <include name="**/*Bean.java" /> > > > > </fileset> > > > > > > > > <template destinationFile="MyFile.java" > > > > templateFile="MyTemplate.j"/> > > > > > > > > </ejbdoclet> > > > > > > > > Basically I just want to apply a customer template to a large > number > > > of > > > > Java > > > > files that already have the custom javadoc tags in them > > > > > > > > I realize also I could create a custom Doclet task of SubTasb, but > I > > > can > > > > see > > > > an easy way to hook additional subtasks into an existing doclet, > looks > > > > like > > > > I'd have to write my own top-level Ant Task (styled on something > like > > > > webdoclet) > > > > > > > > I am way off track ? > > > > > > > > Also is there any plan to support Ant Mappers to enable the > > > specification > > > > of > > > > output file names ? > > > > > > > > Thanks, > > > > Matthew > > > > > > > > > > > > _______________________________________________ > > > > Xdoclet-user mailing list > > > > [EMAIL PROTECTED] > > > > https://lists.sourceforge.net/lists/listinfo/xdoclet-user > > > > > > > > > _________________________________________________________ > > > Do You Yahoo!? > > > Get your free @yahoo.com address at http://mail.yahoo.com > > > > > > > _______________________________________________ > > Xdoclet-user mailing list > > [EMAIL PROTECTED] > > https://lists.sourceforge.net/lists/listinfo/xdoclet-user > > > _________________________________________________________ > Do You Yahoo!? > Get your free @yahoo.com address at http://mail.yahoo.com > _________________________________________________________ Do You Yahoo!? Get your free @yahoo.com address at http://mail.yahoo.com _______________________________________________ Xdoclet-devel mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/xdoclet-devel
