Package org.apache.jetspeed.prefs.om

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


        if (removed)
        {
            throw new IllegalStateException("Preferences node removed");
        }
        // get persistent node and properties
        Node node = getNode();
        Collection properties = node.getNodeProperties();
        // extract property names from nod
        ArrayList propertyNames = new ArrayList();
        if ((null != properties) && properties.size() > 0)
        {
            for (Iterator j = properties.iterator(); j.hasNext();)
View Full Code Here


        if (removed)
        {
            throw new IllegalStateException("Preferences node removed");
        }
        // get persistent node and child nodes
        Node node = getNode();
        Collection nodes = ppw.provider().getChildren(node);
        // get child node names
        if (null != nodes)
        {
            ArrayList childrenNames = new ArrayList(nodes.size());
            for (Iterator i = nodes.iterator(); i.hasNext();)
            {
                Node curnode = (Node) i.next();
                childrenNames.add(curnode.getNodeName());
            }
            return (String[]) childrenNames.toArray(new String[0]);
        }
        else
        {
View Full Code Here

        if (path.equals("/"))
        {
            throw new UnsupportedOperationException("Root preferences node cannot be removed");
        }
        // get persistent node and parent
        Node node = getNode(path, type, false);
        if (node != null)
        {
            Node parentNode = getNode(parentPath(path), type, false);
            if (parentNode != null)
            {
                // remove persistent node and children
                removeNodeAndChildren(parentNode, node);
            }
View Full Code Here

     * @return persistent preference node
     */
    private Node getNode(String path, int type, boolean create)
    {
        // access node
        Node node = null;
        try
        {
            node = ppw.provider().getNode(path, type);
        }
        catch (NodeDoesNotExistException e1)
View Full Code Here

        Collection nodes = ppw.provider().getChildren(node);
        if (null != nodes)
        {
            for (Iterator i = nodes.iterator(); i.hasNext();)
            {
                Node childNode = (Node) i.next();
                removeNodeAndChildren(node, childNode);                   
            }
        }
        ppw.provider().removeNode(parentNode, node);
    }
View Full Code Here

        Criteria c = new Criteria();
        c.addEqualTo("fullPath", fullPath);
        c.addEqualTo("nodeType", new Integer(nodeType));
        Query query = QueryFactory.newQuery(NodeImpl.class, c);

        Node nodeObj = (Node) getPersistenceBrokerTemplate().getObjectByQuery(query);
        if (null != nodeObj)
        {
          NodeImplProxy proxy = new NodeImplProxy(nodeObj);
            addToCache(new NodeCache(proxy));
            return proxy;
View Full Code Here

        Criteria c = new Criteria();
        c.addEqualTo("fullPath", fullPath);
        c.addEqualTo("nodeType", new Integer(nodeType));
        Query query = QueryFactory.newQuery(NodeImpl.class, c);

        Node nodeObj = (Node) getPersistenceBrokerTemplate().getObjectByQuery(query);
        if (null != nodeObj)
        {
          proxy.setNode(nodeObj);
          NodeCache cn = new NodeCache(nodeObj.getFullPath(), nodeObj.getNodeType());
          cn.setNode(proxy);
            addToCache(cn);
        }
        else
        {
View Full Code Here

        Criteria c = new Criteria();
        c.addEqualTo("fullPath", fullPath);
        c.addEqualTo("nodeType", new Integer(nodeType));
        Query query = QueryFactory.newQuery(NodeImpl.class, c);

        Node nodeObj = (Node) getPersistenceBrokerTemplate().getObjectByQuery(query);
        if (null != nodeObj)
        {
          NodeImplProxy proxy = new NodeImplProxy(nodeObj);
            addToCache(new NodeCache(proxy));
            return true;
View Full Code Here

        // check to see if node exists in persistent store       
        Criteria c = new Criteria();
        c.addEqualTo("fullPath", fullPath);
        c.addEqualTo("nodeType", new Integer(nodeType));
        Query query = QueryFactory.newQuery(NodeImpl.class, c);
        Node nodeObj = (Node) getPersistenceBrokerTemplate().getObjectByQuery(query);
        if (null != nodeObj)
        {
            throw new NodeAlreadyExistsException("Node of type " + nodeType + " already exists at path " + fullPath);
        }
        else
View Full Code Here

                    int index = s.lastIndexOf("-");
                    if (index > 0)
                    {
                        String fullPath = s.substring(0, index);
                        int type = Integer.parseInt(s.substring(index + 1));
                        Node node = getNode(fullPath, type);
                        if (node != null)
                        {
                            v.add(node);
                        }
                    }
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.