Added QName indexed Properties to AVMNodes.

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/BRANCHES/WCM-DEV2/root@3357 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Britt Park
2006-07-19 22:15:09 +00:00
parent e5eb45da0f
commit e2eec832f1
20 changed files with 700 additions and 0 deletions

View File

@@ -29,6 +29,9 @@ import java.util.Map;
import java.util.SortedMap;
import java.util.TreeMap;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.namespace.QName;
/**
* A Repository contains a current root directory and a list of
* root versions. Each root version corresponds to a separate snapshot
@@ -823,4 +826,44 @@ public class AVMStoreImpl implements AVMStore, Serializable
((LayeredDirectoryNode)node).setOpacity(opacity);
node.updateModTime();
}
/**
* Set a property on a node.
* @param path The path to the node.
* @param name The name of the property.
* @param value The value to set.
*/
public void setProperty(String path, QName name, PropertyValue value)
{
Lookup lPath = lookup(-1, path, true);
AVMNode node = lPath.getCurrentNode();
node.setProperty(name, value);
}
/**
* Get a property by name.
* @param version The version to lookup.
* @param path The path to the node.
* @param name The name of the property.
* @return A PropertyValue or null if not found.
*/
public PropertyValue getProperty(int version, String path, QName name)
{
Lookup lPath = lookup(version, path, false);
AVMNode node = lPath.getCurrentNode();
return node.getProperty(name);
}
/**
* Get all the properties associated with a node.
* @param version The version to lookup.
* @param path The path to the node.
* @return A Map of QNames to PropertyValues.
*/
public Map<QName, PropertyValue> getProperties(int version, String path)
{
Lookup lPath = lookup(version, path, false);
AVMNode node = lPath.getCurrentNode();
return node.getProperties();
}
}