On Thu, 2004-05-27 at 15:50, [EMAIL PROTECTED]
wrote:
> I started to learn about xdoclet today and decided to integrate
> xdoclet incrementally in my project.
> My first exercise is to replace all my session beans with xdoclet
> generated ones.
> 
> I was able to do it exept for one little thing. I frequently have
> static variables in my remote interfaces.
> I can't find a tag that would generate such variables in the remote
> interface.
> 
> Does anybody if that is possible ?

When there's no tag for something, the next thing to check for is a
suitable merge point.  That's how custom code etc. is usually added.

If you look in the docs for the remoteinterface subtask
(http://xdoclet.sourceforge.net/xdoclet/ant/xdoclet/modules/ejb/intf/RemoteInterfaceSubTask.html),
 you'll see that currently there's only a "remote-custom.xdt" merge file, "A text file 
containing custom template and/or java code to include in the remote interface."

This would get included in all the generated remote interfaces, however,
so assuming that you don't want the same constants in every interface,
it probably isn't quite what you need.  So you've got a couple of
options:  1) raise an enhancement request to add a per-bean merge point
in the template, 2) download the source archive, add a per-bean merge
point to the template yourself and rebuild, or 3) use the custom merge
file to add one.  2 & 3 get you going again sooner, and 3 is easier as
you don't have to rebuild XDoclet, so lets go with that.

Create a file <mergedirectory>/remote-custom.xdt containing the line

<XDtMerge:merge file="remote-custom-{0}.xdt"></XDtMerge:merge>

Then create a file
<mergedirectory>/com/test/remote-custom-RequestService.xdt containing
the constant declarations.  Hopefully that should do the trick.  I think
that's the right name & path, it might need to be RequestServiceBean or
RequestServiceEJB or whatever your bean class is called, and under a
different path if your bean class is in a different package.  The
important thing to note is that it's not just in the merge directory
itself; it follows the same hierarchy as the original bean, to avoid
possible conflicts.


Andrew.



-------------------------------------------------------
This SF.Net email is sponsored by: Oracle 10g
Get certified on the hottest thing ever to hit the market... Oracle 10g. 
Take an Oracle 10g class now, and we'll give you the exam FREE.
http://ads.osdn.com/?ad_id=3149&alloc_id=8166&op=click
_______________________________________________
xdoclet-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to