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

@@ -24,8 +24,12 @@ import java.io.RandomAccessFile;
import java.util.ArrayList;
import java.util.Date;
import java.util.List;
import java.util.Map;
import java.util.SortedMap;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.service.namespace.QName;
/**
* This or AVMStore are
* the implementors of the operations specified by AVMService.
@@ -861,6 +865,49 @@ class AVMRepository
store.setOpacity(pathParts[1], opacity);
}
/**
* Set a property on a node.
* @param path The path to the node.
* @param name The name of the property.
* @param value The value of the property.
*/
public void setProperty(String path, QName name, PropertyValue value)
{
fLookupCount.set(1);
String [] pathParts = SplitPath(path);
AVMStore store = getAVMStoreByName(pathParts[0], true);
store.setProperty(pathParts[1], name, value);
}
/**
* Get a property by name for a node.
* @param version The version to look under.
* @param path The path to the node.
* @param name The name of the property.
* @return The PropertyValue or null if it does not exist.
*/
public PropertyValue getProperty(int version, String path, QName name)
{
fLookupCount.set(1);
String [] pathParts = SplitPath(path);
AVMStore store = getAVMStoreByName(pathParts[0], false);
return store.getProperty(version, pathParts[1], name);
}
/**
* Get a Map of all the properties of a node.
* @param version The version to look under.
* @param path The path to the node.
* @return A Map of QNames to PropertyValues.
*/
public Map<QName, PropertyValue> getProperties(int version, String path)
{
fLookupCount.set(1);
String [] pathParts = SplitPath(path);
AVMStore store = getAVMStoreByName(pathParts[0], false);
return store.getProperties(version, pathParts[1]);
}
/**
* Get the AVMStoreDescriptor for an AVMStore.
* @param name The name of the AVMStore.