Allow for export of all Repository content including version store. Required:

- supporting content in ANY properties (for Content Service and Exporter)
- moving Content related permission to sys:base as type can support a property of datatype CONTENT

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2505 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
David Caruana
2006-02-28 17:11:17 +00:00
parent 2c88c5f17a
commit 32990f3d62
17 changed files with 408 additions and 146 deletions

View File

@@ -236,22 +236,31 @@ public class RoutingContentService implements ContentService
{
return getReader(nodeRef, propertyQName, true);
}
private ContentReader getReader(NodeRef nodeRef, QName propertyQName, boolean fireContentReadPolicy)
{
// ensure that the node property is of type content
PropertyDefinition contentPropDef = dictionaryService.getProperty(propertyQName);
if (contentPropDef == null || !contentPropDef.getDataType().getName().equals(DataTypeDefinition.CONTENT))
// get the property value
ContentData contentData = null;
Serializable propValue = nodeService.getProperty(nodeRef, propertyQName);
if (propValue instanceof ContentData)
{
throw new InvalidTypeException("The node property must be of type content: \n" +
" node: " + nodeRef + "\n" +
" property name: " + propertyQName + "\n" +
" property type: " + ((contentPropDef == null) ? "unknown" : contentPropDef.getDataType()),
propertyQName);
contentData = (ContentData)propValue;
}
// ensure that the node property is of type content
if (contentData == null)
{
PropertyDefinition contentPropDef = dictionaryService.getProperty(propertyQName);
if (contentPropDef == null || !(contentPropDef.getDataType().getName().equals(DataTypeDefinition.CONTENT)))
{
throw new InvalidTypeException("The node property must be of type content: \n" +
" node: " + nodeRef + "\n" +
" property name: " + propertyQName + "\n" +
" property type: " + ((contentPropDef == null) ? "unknown" : contentPropDef.getDataType()),
propertyQName);
}
}
// get the content property
ContentData contentData = (ContentData) nodeService.getProperty(nodeRef, propertyQName);
// check that the URL is available
if (contentData == null || contentData.getContentUrl() == null)
{