Hi all,

I am trying to write a tag handler for a custom tag (xdoclet-1.3-SNAPSHOT-cvs). The tag's example is:

@ejb.auth
parameter-object=”code”
type="both"

In the tag handler:

/**
* @xdoclet.taghandler namespace="EjbAuth"
*/
public class AuthTagsHandler extends XDocletTagSupport {

/**
* Detects if the method is using before processing
* @doc.tag type="block"
*/
public void ifBeforeAuthRequired(String template) throws XDocletException {
XMethod method = getCurrentMethod();
XDoc doc = method.getDoc();
java.util.List tags = doc.getTags();
for (java.util.Iterator i = tags.iterator(); i.hasNext(); ) {
XTag thisTag = (XTag)i.next();
System.out.println("Tag name is: " + thisTag.getName());
java.util.Collection attrs = thisTag.getAttributeNames();
for (java.util.Iterator h = attrs.iterator(); h.hasNext();) {
Object thisAttName = h.next();
System.out.println("\tAtt Name is: " + thisAttName.toString());
}
}
String value =
getTagValue(
FOR_METHOD,
"ejb.auth",
"parameter-object",
null,
null,
true,
true
);
System.out.println("EJBAuth is: " + value);
value =
getTagValue(
FOR_METHOD,
"ejb.auth",
"action",
null,
null,
true,
true
);
System.out.println("EJBAuth is: " + value);
value =
getTagValue(
FOR_METHOD,
"ejb.auth",
"type",
null,
null,
true,
true
);
System.out.println("EJBAuth is: " + value);
if (value != null) {
if (value.equalsIgnoreCase("both") || value.equalsIgnoreCase("before")) {
generate(template);
}
}
}
}

The session-custom.xdt template is like:

<XDtMethod:forAllMethods>
<XDtEjbIntf:ifIsInterfaceMethod superclasses="false" interface="remote">
<XDtMethod:ifHasMethodTag tagName="ejb:auth">
...
<XDtEjbAuth:ifBeforeAuthRequired>
// doing before
</XDtEjbAuth:ifBeforeAuthRequired>
...

The method in question is tagged:

/**
* Finds a full value of the action set by it's code
* @param code
* @return
*
* @ejb.interface-method
* @ejb.transaction type="Required"
* @blah action=”code” parameter-object=”code” type=”code”
* @ejb.auth
* parameter-object=”code”
* type="both"
*/


The relevant output from running ant is:

[exec] [ejbdoclet] Tag name is: param
[exec] [ejbdoclet] Tag name is: return
[exec] [ejbdoclet] Tag name is: ejb.interface-method
[exec] [ejbdoclet] Tag name is: ejb.transaction
[exec] [ejbdoclet] Att Name is: type
[exec] [ejbdoclet] Tag name is: blah
[exec] [ejbdoclet] Tag name is: ejb.auth
[exec] [ejbdoclet] (XDocletMain.start 53 ) Running XDoclet failed.
[exec] [ejbdoclet] (XDocletMain.start 54 ) <<Mandatory parameter 'parameter-object' missing for ejb.auth tag in findFullByCode method of com.dcs.applications.service.ActionSetServiceBean class.>> [exec] [ejbdoclet] /home/collinl/workspaces/UserAuthorities/ejb-applications/build.xml:233: XDoclet failed.
[exec] [ejbdoclet] at xdoclet.DocletTask.start(DocletTask.java:471)

As you can see, I'm listing out the tags on the current method, but the attributes for the blah and ejb.auth tag are not included. If I remove the parameter-object="code" line under ejb.auth, then I do get the type attribute found.

Right now, I'm lost. Why does the positioning of the attributes matter to the tag. Why doesn't the tag listing print out all the attributes... I've been looking at this all day, with not a clue as to how to fix it. The cvs snapshot that I'm using is dated April 26th 2005, and I'm now looking at retrieving another snapshot and trying it out... but given that other tags used on ejb beans are working correctly with multiple attributes, somehow I think I'm missing something.

Cheers for any help,

--
Lloyd Colling




******************************************************************************************
'This e-mail message is intended solely for the person to whom it is addressed 
and may contain confidential
or privileged information. If you have received it in error, please notify [EMAIL PROTECTED] and destroy this e-mail and any attachments. In addition, you must not disclose, copy, distribute or take any action in reliance on this e-mail or any attachments. Any views or opinions presented in this e-mail are solely those of the author and do not necessarily represent those of the company. When addressed to our
customers, any quotations contained in this e-mail are subject to contract and 
are on the terms of The
Company's standard Conditions, a copy of which is available on request. Any 
errors or omissions in any
quotations or other information issued by The Company shall be subject to 
correction without any liability
on the part of The Company. Due to the nature of Internet communications, DCS 
cannot guarantee that this
communication, or any attachments, do not contain software viruses. We have 
taken every precaution to
minimize this probability but cannot accept any liability for damage which you 
may sustain as a result of
software viruses. We recommend you carry out your own virus checks before 
opening attachments.'

DCS Transport & Logistics Solutions Ltd.
Registered office: Newstead House, Lake View Drive, Sherwood Park, Annesley, 
Nottinghamshire, NG15 0DT
Registered in England no: 3373490
******************************************************************************************



-------------------------------------------------------
SF.Net email is Sponsored by the Better Software Conference & EXPO
September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices
Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA
Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf
_______________________________________________
xdoclet-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/xdoclet-user

Reply via email to