Package org.apache.jetspeed.prefs.om

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


        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


    /**
     * @see java.util.prefs.Preferences#removeNodeSpi()
     */
    public void removeNodeSpi() throws BackingStoreException
    {
        Node parentNode = null;
        Preferences parent = parent();
        if (parent != null && parent instanceof PreferencesImpl)
        {
            parentNode = ((PreferencesImpl) parent).getNode();
        }
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

            if (null != parent)
            {
                parentNodeId = new Long(parent.getNodeId());
            }

            Node nodeObj = new NodeImpl(parentNodeId, nodeName, nodeType, fullPath);

            try
            {
                getPersistenceBrokerTemplate().store(nodeObj);
              NodeImplProxy proxy = new NodeImplProxy(nodeObj);
View Full Code Here

    {
      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

        if (removed)
        {
            throw new IllegalStateException("Preferences node removed");
        }
        // get persistent node and properties
        Node node = getNode();
        Collection properties = node.getNodeProperties();
        // if the property exists, update its value.
        boolean propFound = false;
        for (Iterator i = properties.iterator(); i.hasNext();)
        {
            Property curProp = (Property) i.next();
            if ((null != curProp) && (null != curProp.getPropertyName()) && curProp.getPropertyName().equals(key))
            {
                propFound = true;
                curProp.setPropertyValue(value);
                curProp.setModifiedDate(new Timestamp(System.currentTimeMillis()));
                break;
            }
        }
        // add new property value
        if (!propFound)
        {
            properties.add(new PropertyImpl(node.getNodeId(), key, value));
        }
        // update node
        ppw.provider().storeNode(node);
    }
View Full Code Here

        if (removed)
        {
            throw new IllegalStateException("Preferences node removed");
        }
        // get persistent node and properties
        Node node = getNode();
        Collection properties = node.getNodeProperties();
        // return value
        for (Iterator i = properties.iterator(); i.hasNext();)
        {
            Property curProp = (Property) i.next();
            if ((null != curProp) && (null != curProp.getPropertyName()) && (curProp.getPropertyName().equals(key)))
View Full Code Here

        if (removed)
        {
            throw new IllegalStateException("Preferences node removed");
        }
        // get persistent node and properties
        Node node = getNode();
        Collection properties = node.getNodeProperties();
        // remove property if found
        boolean removed = false;
        for (Iterator i = properties.iterator(); i.hasNext();)
        {
            Property curProp = (Property) i.next();
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.