mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Merged HEAD-QA to HEAD (4.2) (including moving test classes into separate folders)
51903 to 54309 git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@54310 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -42,7 +42,7 @@ public abstract class AbstractProperty implements CMISPropertyAccessor
|
||||
private static final String CONTENT_PROPERTY = "::content";
|
||||
|
||||
private ServiceRegistry serviceRegistry;
|
||||
private CMISConnector connector;
|
||||
protected CMISConnector connector;
|
||||
private String propertyName;
|
||||
|
||||
/**
|
||||
|
@@ -36,6 +36,7 @@ import org.alfresco.service.namespace.QName;
|
||||
import org.apache.chemistry.opencmis.commons.PropertyIds;
|
||||
import org.apache.chemistry.opencmis.commons.enums.Action;
|
||||
import org.apache.chemistry.opencmis.commons.enums.BaseTypeId;
|
||||
import org.apache.chemistry.opencmis.commons.enums.CmisVersion;
|
||||
import org.apache.commons.logging.Log;
|
||||
import org.apache.commons.logging.LogFactory;
|
||||
import org.springframework.beans.factory.InitializingBean;
|
||||
@@ -140,6 +141,10 @@ public class RuntimePropertyAccessorMapping implements PropertyAccessorMapping,
|
||||
registerPropertyAccessor(new AllowedChildObjectTypeIdsProperty(serviceRegistry, cmisConnector, cmisMapping));
|
||||
registerPropertyAccessor(new SourceIdProperty(serviceRegistry, cmisConnector));
|
||||
registerPropertyAccessor(new TargetIdProperty(serviceRegistry, cmisConnector));
|
||||
if(cmisMapping.getCmisVersion().equals(CmisVersion.CMIS_1_1))
|
||||
{
|
||||
registerPropertyAccessor(new SecondaryTypesProperty(serviceRegistry, cmisConnector, cmisMapping));
|
||||
}
|
||||
|
||||
//
|
||||
// Action Evaluator Mappings
|
||||
@@ -275,6 +280,10 @@ public class RuntimePropertyAccessorMapping implements PropertyAccessorMapping,
|
||||
registerEvaluator(BaseTypeId.CMIS_POLICY, new FixedValueActionEvaluator(serviceRegistry, Action.CAN_APPLY_ACL,
|
||||
false));
|
||||
}
|
||||
|
||||
public void init()
|
||||
{
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a property accessor
|
||||
|
@@ -0,0 +1,56 @@
|
||||
package org.alfresco.opencmis.mapping;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
import java.util.Collections;
|
||||
import java.util.Set;
|
||||
|
||||
import org.alfresco.opencmis.CMISConnector;
|
||||
import org.alfresco.opencmis.dictionary.CMISNodeInfo;
|
||||
import org.alfresco.service.ServiceRegistry;
|
||||
import org.alfresco.service.cmr.repository.NodeRef;
|
||||
import org.alfresco.service.namespace.QName;
|
||||
import org.apache.chemistry.opencmis.commons.PropertyIds;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author steveglover
|
||||
*
|
||||
*/
|
||||
public class SecondaryTypesProperty extends AbstractProperty
|
||||
{
|
||||
private CMISMapping cmisMapping;
|
||||
|
||||
/**
|
||||
* Construct
|
||||
*/
|
||||
public SecondaryTypesProperty(ServiceRegistry serviceRegistry, CMISConnector connector, CMISMapping cmisMapping)
|
||||
{
|
||||
super(serviceRegistry, connector, PropertyIds.SECONDARY_OBJECT_TYPE_IDS);
|
||||
this.cmisMapping = cmisMapping;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Serializable getValueInternal(CMISNodeInfo nodeInfo)
|
||||
{
|
||||
NodeRef nodeRef = nodeInfo.getNodeRef();
|
||||
|
||||
if(nodeRef == null || nodeInfo.getType() == null)
|
||||
{
|
||||
// If the nodeRef or type is null, we can't handle it so return an empty list
|
||||
return (Serializable) Collections.emptyList();
|
||||
}
|
||||
|
||||
Set<QName> aspects = connector.getNodeService().getAspects(nodeRef);
|
||||
ArrayList<String> results = new ArrayList<String>(aspects.size());
|
||||
for (QName aspect : aspects)
|
||||
{
|
||||
String typeId = cmisMapping.getCmisTypeId(aspect);
|
||||
if (typeId != null)
|
||||
{
|
||||
results.add(typeId);
|
||||
}
|
||||
}
|
||||
return results;
|
||||
}
|
||||
}
|
@@ -41,7 +41,6 @@ public class VersionSeriesIdProperty extends AbstractProperty
|
||||
@Override
|
||||
public Serializable getValueInternal(CMISNodeInfo nodeInfo)
|
||||
{
|
||||
return getGuid(nodeInfo.getCurrentNodeId());
|
||||
//return nodeInfo.getCurrentObjectId();
|
||||
return connector.constructObjectId(nodeInfo.getCurrentNodeId(), null);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user