I found a way to get around it ( not using property tag). 

The problem I mentioned before is:

                <slide:node uri='<%= uri %>' id='nodebean' >    // seems I
can struts tag for uri!!!
                  <slide:property id='bbb' namespace='DAV:'
name='resourcetype' />
                    <bean:write name='bbb' property='value'/>

it return a null exception. 

I check the source code:
in StutsUtilsTagUtils.java the method :findRevision(Tag from, PageContext
context) 
if the tag type is PropertyTagSupport ( since it extends the TagSupport).
    
        public static RevisionBean findRevision(Tag from, PageContext
context)
        throws JspException {
        
        RevisionBean bean = null;
        
        // look for the closest RevisionTagSupport or IterateTag up the tag 
        // hierarchy
        Tag tag = from.getParent();
        while (tag != null) {
            if (tag instanceof RevisionTagSupport) {
                bean = ((RevisionTagSupport)tag).getRevision();
            } else if (tag instanceof NodeTagSupport) {
                bean = ((NodeTagSupport)tag).getNode().getLatestRevision();
            } else if (tag instanceof IterateTag) {
                // check whether we're actually iterating over NamespaceBean
                // objects
                String id = ((IterateTag)tag).getId();
                if ((id != null) && (id.length() > 0)) {
                    Object object = context.getAttribute(id);
                    if (object instanceof RevisionBean) {
                        bean = (RevisionBean)object;
                    }
                }
            }
            if (bean != null) {
                return bean;
            }
            tag = tag.getParent();
        }
        
        return bean;
    }

Maybe the propertyBean can still be retrieved without hte RevisonBean, in
that case, this is a not problem.

Here is one suggestion. In the iterate tag, the type for includetypes and
excludetypes attribute is hard coded. I think it will be good to specify it
in the configuration file just as role's definition. It will be very
flexible since we may define our own ObjectNode. 

Thanks for your reply!

Haiying
    

-----Original Message-----
From: Christopher Lenz [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 18, 2002 7:17 AM
To: Slide Users Mailing List
Subject: Re: tag for nodebean.


12.03.2002 19:49:27, Haiying Qiao <[EMAIL PROTECTED]> wrote:
>I am trying to slide tags, It is very handy! Thanks!
>But it seems no tag to check whether a node is collection or not. 

Well, collections are a concept from the WebDAV world, Slide itself 
doesn't make a difference between collection and non-collection 
resources. That's why I decided to not support it directly in the 
taglib either. Still you can check for collection resources by 
checking whether the "DAV:resourcetype" property's value equals 
"<collection/>".

>Also, the property tag seems not work, I checked source code, 
>findRevision() method always return null for PropertyTag. Anybody 
>ever used the tag with a success?

Yeah, I've used all of the tags with success :o).
However, there may be some quirks, especially in the realm of implicit 
communication between nested tags. I'd be happy to review and 
eventually apply a patch if you find the exact cause of the problem 
;o)

-chris
________________________________________________________________
cmlenz at gmx.de




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to