Package org.apache.jetspeed.prefs.om

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


        {
            boolean foundKey = false;
            String currentPropertyKeyName = (String) i.next();
            for (Iterator j = propertyKeys.iterator(); j.hasNext();)
            {
                PropertyKey existingPpk = (PropertyKey) j.next();
                if (propertyKeysMap.containsKey(existingPpk.getPropertyKeyName()))
                {
                    if (logger.isDebugEnabled())
                        logger.debug("Existing Property: " + (String) propertyKeysMap.get(currentPropertyKeyName));
                    foundKey = true;
                    newPropertyKeys.add(existingPpk);
                    break;
                }
            }
            if (!foundKey)
            {
                if (logger.isDebugEnabled())
                    logger.debug("New Property: " + currentPropertyKeyName);
                PropertyKey ppk = new PropertyKeyImpl(currentPropertyKeyName, ((Integer) propertyKeysMap
                        .get(currentPropertyKeyName)).intValue());
                newPropertyKeys.add(ppk);
            }
        }
View Full Code Here


        Collection keys = nodeObj.getNodeKeys();
        HashMap propertyKeysMap = new HashMap(keys.size());
        for (Iterator i = keys.iterator(); i.hasNext();)
        {
            PropertyKey curpk = (PropertyKey) i.next();
            propertyKeysMap.put(curpk.getPropertyKeyName(), new Integer(curpk.getPropertyKeyType()));
        }
        return propertyKeysMap;

    }
View Full Code Here

        Collection keys = nodeObj.getNodeKeys();
        ArrayList newKeys = new ArrayList(keys.size());
        for (Iterator i = properties.iterator(); i.hasNext();)
        {
            Property curProp = (Property) i.next();
            PropertyKey curPropKey = (PropertyKey) curProp.getPropertyKey();
            if ((null != curPropKey) && (!propertyKeys.contains(curProp.getPropertyKey().getPropertyKeyName())))
            {
                newProperties.add(curProp);
            }
        }
        for (Iterator j = newKeys.iterator(); j.hasNext();)
        {
            PropertyKey curPropKey = (PropertyKey) j.next();
            if (!propertyKeys.contains(curPropKey.getPropertyKeyName()))
            {
                newKeys.add(curPropKey);
            }
        }
        // Remove the properties keys.
View Full Code Here

        Node nodeObj = getNode(prefNode);

        Collection keys = nodeObj.getNodeKeys();
        for (Iterator i = keys.iterator(); i.hasNext();)
        {
            PropertyKey curPropKey = (PropertyKey) i.next();
            if (curPropKey.getPropertyKeyName().equals(oldPropertyKeyName))
            {
                for (Iterator j = newPropertyKey.keySet().iterator(); j.hasNext();)
                {
                    String newKey = (String) j.next();
                    // Update the property key.

                    curPropKey.setPropertyKeyName(newKey);
                    curPropKey.setPropertyKeyType(((Integer) newPropertyKey.get(newKey)).intValue());
                    curPropKey.setModifiedDate(new Timestamp(System.currentTimeMillis()));
                    if (logger.isDebugEnabled())
                        logger.debug("Updated property key: " + curPropKey.toString());

                    getPersistenceBrokerTemplate().store(curPropKey);

                }
            }
View Full Code Here

        // the property key exits and is associated to this node.
        if (prefsProvider.isPropertyManagerEnabled() && !foundProp)
        {
            for (Iterator i = nodeKeys.iterator(); i.hasNext();)
            {
                PropertyKey curpk = (PropertyKey) i.next();
                if (curpk.getPropertyKeyName().equals(key))
                {
                    foundKey = true;
                    if (log.isDebugEnabled())
                        log.debug("New property value: [" + key + ", " + value + "]");

                    properties.add(new PropertyImpl(node.getNodeId(), curpk.getPropertyKeyId(), curpk, curpk
                            .getPropertyKeyType(), value));
                }
            }
        }
        else if (!prefsProvider.isPropertyManagerEnabled() && !foundProp)
        {
            foundKey = true;
            PropertyKey pKey = new PropertyKeyImpl(key, Property.STRING_TYPE);
            properties.add(new PropertyImpl(node.getNodeId(), pKey.getPropertyKeyId(), pKey, pKey
                    .getPropertyKeyType(), value));

        }

        if (!foundKey)
View Full Code Here

TOP

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

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.