You are viewing a plain text version of this content. The canonical link for it is here.
Posted to slide-dev@jakarta.apache.org by cm...@apache.org on 2002/08/01 13:50:27 UTC

cvs commit: jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean NodeBean.java

cmlenz      2002/08/01 04:50:27

  Modified:    src/taglib/common/org/apache/slide/taglib/bean NodeBean.java
  Log:
  - Organized imports
  - NodeBean.getLocks() now only returns the locks directly on the node
  - Removed NodeBean.getLocks(depth) and NodeBean.getMembers(depth)
     in favor of the new iterators
  
  Revision  Changes    Path
  1.7       +19 -80    jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean/NodeBean.java
  
  Index: NodeBean.java
  ===================================================================
  RCS file: /home/cvs/jakarta-slide/src/taglib/common/org/apache/slide/taglib/bean/NodeBean.java,v
  retrieving revision 1.6
  retrieving revision 1.7
  diff -u -r1.6 -r1.7
  --- NodeBean.java	28 Mar 2002 06:12:04 -0000	1.6
  +++ NodeBean.java	1 Aug 2002 11:50:27 -0000	1.7
  @@ -70,10 +70,20 @@
   import org.apache.slide.common.NamespaceConfig;
   import org.apache.slide.common.SlideException;
   import org.apache.slide.common.SlideToken;
  -import org.apache.slide.content.*;
  -import org.apache.slide.lock.*;
  -import org.apache.slide.security.*;
  -import org.apache.slide.structure.*;
  +import org.apache.slide.content.Content;
  +import org.apache.slide.content.NodeRevisionDescriptor;
  +import org.apache.slide.content.NodeRevisionDescriptors;
  +import org.apache.slide.content.NodeRevisionNumber;
  +import org.apache.slide.lock.Lock;
  +import org.apache.slide.lock.NodeLock;
  +import org.apache.slide.security.NodePermission;
  +import org.apache.slide.security.Security;
  +import org.apache.slide.structure.ActionNode;
  +import org.apache.slide.structure.GroupNode;
  +import org.apache.slide.structure.LinkNode;
  +import org.apache.slide.structure.ObjectNode;
  +import org.apache.slide.structure.Structure;
  +import org.apache.slide.structure.SubjectNode;
   
   /**
    * Provides a Java Bean style interface wrapped around an ObjectNode and the 
  @@ -230,7 +240,7 @@
           Vector v = new Vector();
           try {
               Lock lock = nat.getLockHelper();
  -            Enumeration enum = lock.enumerateLocks(st, node.getUri());
  +            Enumeration enum = lock.enumerateLocks(st, node.getUri(), false);
               while (enum.hasMoreElements()) {
                   NodeLock nl = (NodeLock)enum.nextElement();
                   if (nl != null) {
  @@ -530,77 +540,6 @@
       
       
       // --------------------------------------------------------- Public Methods
  -    
  -    
  -    /**
  -     * Returns the active locks on the object and any children down to the 
  -     * specified depth.
  -     * 
  -     * @param depth the depth of lock discovery
  -     * 
  -     * @return a Vector of LockBean objects, or an empty Vector if no locks 
  -     *         exist
  -     * 
  -     * @see #getIsLocked
  -     * @see #getLocks
  -     */
  -    public Vector getLocks(int depth) {
  -        
  -        // add locks on this object
  -        Vector v = new Vector();
  -        try {
  -            Lock lock = nat.getLockHelper();
  -            Enumeration enum = lock.enumerateLocks(st, node.getUri(), false);
  -            while (enum.hasMoreElements()) {
  -                NodeLock nl = (NodeLock)enum.nextElement();
  -                if (nl != null) {
  -                    v.addElement(new LockBean(nat, st, nl));
  -                }
  -            }
  -        } catch (SlideException e) {
  -            // ignore for now
  -        }
  -        
  -        // recursively add locks on child members
  -        if (depth > 1) {
  -            Vector children = getChildren();
  -            for (int i = 0; i < children.size(); i++) {
  -                NodeBean child = (NodeBean)children.elementAt(i);
  -                v.addAll(child.getLocks(depth - 1));
  -            }
  -        }
  -        
  -        return v;
  -    }
  -    
  -    
  -    /**
  -     * Returns a list of all (direct or indirect) members of the node, dowm to 
  -     * the specified depth.
  -     * 
  -     * @param depth the depth of member traversal
  -     * 
  -     * @return Vector of NodeBean objects
  -     * 
  -     * @see #getChildren
  -     * @see #getHasChildren
  -     */
  -    public Vector getMembers(int depth) {
  -        
  -        Vector v = new Vector();
  -        Vector children = getChildren();
  -        for (int i = 0; i < children.size(); i++) {
  -            NodeBean child = (NodeBean)children.elementAt(i);
  -            v.add(child);
  -                
  -            // recursively add child members
  -            if (depth > 1) {
  -                v.addAll(child.getMembers(depth - 1));
  -            }
  -        }
  -        
  -        return v;
  -    }
       
       
       /**
  
  
  

--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>