mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
OpenCMIS server refactoring
git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@29544 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -20,19 +20,18 @@ package org.alfresco.opencmis.mapping;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
import org.alfresco.model.ContentModel;
|
||||
import org.alfresco.opencmis.CMISConnector;
|
||||
import org.alfresco.opencmis.dictionary.CMISNodeInfo;
|
||||
import org.alfresco.repo.node.getchildren.GetChildrenCannedQuery;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.ContentData;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.cmr.repository.datatype.DefaultTypeConverter;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.chemistry.opencmis.commons.PropertyIds;
|
||||
|
||||
/**
|
||||
* Accessor for CMIS content stream length property
|
||||
*
|
||||
* @author andyh
|
||||
* @author florian.mueller
|
||||
*/
|
||||
public class ContentStreamLengthProperty extends AbstractProperty
|
||||
{
|
||||
@@ -41,31 +40,22 @@ public class ContentStreamLengthProperty extends AbstractProperty
|
||||
*
|
||||
* @param serviceRegistry
|
||||
*/
|
||||
public ContentStreamLengthProperty(ServiceRegistry serviceRegistry)
|
||||
public ContentStreamLengthProperty(ServiceRegistry serviceRegistry, CMISConnector connector)
|
||||
{
|
||||
super(serviceRegistry, PropertyIds.CONTENT_STREAM_LENGTH);
|
||||
super(serviceRegistry, connector, PropertyIds.CONTENT_STREAM_LENGTH);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* org.alfresco.cmis.property.PropertyAccessor#getValue(org.alfresco.service
|
||||
* .cmr.repository.NodeRef)
|
||||
*/
|
||||
public Serializable getValue(NodeRef nodeRef)
|
||||
public Serializable getValueInternal(CMISNodeInfo nodeInfo)
|
||||
{
|
||||
Serializable value = getServiceRegistry().getNodeService().getProperty(nodeRef, ContentModel.PROP_CONTENT);
|
||||
if (value != null)
|
||||
ContentData contentData = getContentData(nodeInfo);
|
||||
|
||||
if (contentData != null)
|
||||
{
|
||||
ContentData contentData = DefaultTypeConverter.INSTANCE.convert(ContentData.class, value);
|
||||
return contentData.getSize();
|
||||
} else
|
||||
{
|
||||
return 0L;
|
||||
}
|
||||
return 0L;
|
||||
}
|
||||
|
||||
|
||||
public QName getMappedProperty()
|
||||
{
|
||||
// spoof
|
||||
|
Reference in New Issue
Block a user