mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-24 17:32:48 +00:00
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:
@@ -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)
|
||||
{
|
||||
|
Reference in New Issue
Block a user