Package org.apache.jetspeed.prefs.om

Examples of org.apache.jetspeed.prefs.om.Node


    {
      Iterator it = children.iterator();
      Vector v = new Vector();
      while (it.hasNext())
      {
           Node key = (Node)it.next()
             NodeCache nodeKey = new NodeCache(key.getFullPath(),key.getNodeType());
             NodeCache hit = getNode(nodeKey.getCacheKey());
                if (hit == null)
                {
                NodeImplProxy proxy = new NodeImplProxy(key);
                nodeKey.setNode(proxy);
View Full Code Here


    }

    public void preload() throws Exception
    {
        // ensure base root preference nodes exist
        Node systemRoot = null;
        if (!nodeExists("/", PreferencesImpl.SYSTEM_NODE_TYPE))
        {
            systemRoot = createNode(null, "", PreferencesImpl.SYSTEM_NODE_TYPE, "/");
        }
        else
View Full Code Here

            return count;          
        }
        Iterator ri = result.iterator();
        if (ri.hasNext())
        {
            Node n = (Node)ri.next();
            NodeImplProxy proxy = new NodeImplProxy(n);
            root = new NodeCache(proxy);
            addToCache(root);
            count++;
        }
        else
        {
            return count;       
        }
        Map parents = new HashMap();
        parents.put(new Long(root.getNode().getNodeId()), root);
        while (ri.hasNext())
        {
            // build children and subchildren
            Node subNode = (Node)ri.next();
            //System.out.println("*** Preloading: " + subNode.getFullPath());
            // add to current node
            NodeCache nodeKey = new NodeCache(subNode.getFullPath(), subNode.getNodeType());
            NodeCache lookup = getNode(nodeKey.getCacheKey());
            if (lookup == null)
            {
                NodeImplProxy proxy = new NodeImplProxy(subNode);
                nodeKey.setNode(proxy);
                addToCache(nodeKey);
                lookup = nodeKey;
            }
            NodeCache parent = (NodeCache)parents.get(subNode.getParentNodeId());
            if (parent != null)
            {
                if (parent.getChildren() == null)
                    parent.setChildren(new ArrayList());
                parent.getChildren().add(lookup.getCacheKey());
                count += parent.getChildren().size();
            }
            parents.put(new Long(subNode.getNodeId()), lookup);
            count++;
        }        
        return count;
    }
View Full Code Here

    return super.clone();
  }

  public Timestamp getCreationDate()
  {
        Node node = getNode();
        if (node != null)
        {
            return node.getCreationDate();
        }
        throw new RuntimeException("Node not defined, getCreationDate() invoked on negative cache entry");
  }
View Full Code Here

        throw new RuntimeException("Node not defined, getCreationDate() invoked on negative cache entry");
  }

  public String getFullPath()
  {
        Node node = getNode();
        if (node != null)
        {
            return node.getFullPath();
        }
        return fullPath;
  }
View Full Code Here

        return fullPath;
  }

  public Timestamp getModifiedDate()
  {
        Node node = getNode();
        if (node != null)
        {
            return node.getModifiedDate();
        }
        throw new RuntimeException("Node not defined, getModifiedDate() invoked on negative cache entry");
  }
View Full Code Here

        throw new RuntimeException("Node not defined, getModifiedDate() invoked on negative cache entry");
  }

  public long getNodeId()
  {
        Node node = getNode();
        if (node != null)
        {
            return node.getNodeId();
        }
        throw new RuntimeException("Node not defined, getNodeId() invoked on negative cache entry");
  }
View Full Code Here

        throw new RuntimeException("Node not defined, getNodeId() invoked on negative cache entry");
  }

  public Collection getNodeKeys()
  {
        Node node = getNode();
        if (node != null)
        {
            return node.getNodeKeys();
        }
        throw new RuntimeException("Node not defined, getNodeKeys() invoked on negative cache entry");
  }
View Full Code Here

        throw new RuntimeException("Node not defined, getNodeKeys() invoked on negative cache entry");
  }

  public String getNodeName()
  {
        Node node = getNode();
        if (node != null)
        {
            return node.getNodeName();
        }
        throw new RuntimeException("Node not defined, getNodeName() invoked on negative cache entry");
  }
View Full Code Here

        throw new RuntimeException("Node not defined, getNodeName() invoked on negative cache entry");
  }

  public Collection getNodeProperties()
  {
        Node node = getNode();
        if (node != null)
        {
            return node.getNodeProperties()
        }
        throw new RuntimeException("Node not defined, getNodeProperties() invoked on negative cache entry");
  }
View Full Code Here

TOP

Related Classes of org.apache.jetspeed.prefs.om.Node

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.