mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-08-07 17:49:17 +00:00
Plumbing for CMIS Allowable Actions
- add CMIS enum for Allowable Actions - introduce Action Evaluator, with Permission based and fixed boolean implementations - registry of available action evaluators based on CMIS type - CMIS Type Definition has getter for applicable action evaluators - couple of CMIS actions registered TODO: - register all actions as defined in spec - serialize in AtomPub binding git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@13816 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -158,6 +158,7 @@ public abstract class CMISAbstractDictionaryService extends AbstractLifecycleBea
|
||||
logger.debug("Registered type " + typeDef.getTypeId() + " (scope=" + typeDef.getTypeId().getScope() + ", public=" + typeDef.isPublic() + ")");
|
||||
logger.debug(" QName: " + typeDef.getTypeId().getQName());
|
||||
logger.debug(" Table: " + typeDef.getQueryName());
|
||||
logger.debug(" Action Evaluators: " + typeDef.getActionEvaluators().size());
|
||||
}
|
||||
}
|
||||
|
||||
|
@@ -32,6 +32,8 @@ import java.util.HashMap;
|
||||
import java.util.LinkedList;
|
||||
import java.util.Map;
|
||||
|
||||
import org.alfresco.cmis.CMISActionEvaluator;
|
||||
import org.alfresco.cmis.CMISAllowedActionEnum;
|
||||
import org.alfresco.cmis.CMISContentStreamAllowedEnum;
|
||||
import org.alfresco.cmis.CMISPropertyDefinition;
|
||||
import org.alfresco.cmis.CMISPropertyId;
|
||||
@@ -80,7 +82,7 @@ public class CMISAbstractTypeDefinition implements CMISTypeDefinition, Serializa
|
||||
protected Map<CMISPropertyId, CMISPropertyDefinition> properties = new HashMap<CMISPropertyId, CMISPropertyDefinition>();
|
||||
protected Map<CMISPropertyId, CMISPropertyDefinition> inheritedProperties = new HashMap<CMISPropertyId, CMISPropertyDefinition>();
|
||||
protected Map<CMISPropertyId, CMISPropertyDefinition> ownedProperties = new HashMap<CMISPropertyId, CMISPropertyDefinition>();
|
||||
|
||||
protected Map<CMISAllowedActionEnum, CMISActionEvaluator> actionEvaluators;
|
||||
|
||||
|
||||
/**
|
||||
@@ -386,6 +388,15 @@ public class CMISAbstractTypeDefinition implements CMISTypeDefinition, Serializa
|
||||
return ownedProperties;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.alfresco.cmis.CMISTypeDefinition#getActionEvaluators()
|
||||
*/
|
||||
public Map<CMISAllowedActionEnum, CMISActionEvaluator> getActionEvaluators()
|
||||
{
|
||||
return actionEvaluators;
|
||||
}
|
||||
|
||||
//
|
||||
// Document Type specific
|
||||
//
|
||||
|
@@ -92,6 +92,8 @@ public class CMISDocumentTypeDefinition extends CMISAbstractTypeDefinition
|
||||
controllable = false;
|
||||
includeInSuperTypeQuery = true;
|
||||
|
||||
actionEvaluators = cmisMapping.getActionEvaluators(objectTypeId.getScope());
|
||||
|
||||
// Document type properties
|
||||
versionable = false;
|
||||
List<AspectDefinition> defaultAspects = cmisClassDef.getDefaultAspects();
|
||||
|
@@ -75,6 +75,8 @@ public class CMISFolderTypeDefinition extends CMISAbstractTypeDefinition
|
||||
}
|
||||
}
|
||||
|
||||
actionEvaluators = cmisMapping.getActionEvaluators(objectTypeId.getScope());
|
||||
|
||||
creatable = true;
|
||||
queryable = true;
|
||||
controllable = false;
|
||||
|
@@ -71,6 +71,8 @@ public class CMISObjectTypeDefinition extends CMISAbstractTypeDefinition
|
||||
}
|
||||
}
|
||||
|
||||
actionEvaluators = cmisMapping.getActionEvaluators(objectTypeId.getScope());
|
||||
|
||||
creatable = false;
|
||||
queryable = false;
|
||||
controllable = false;
|
||||
|
@@ -75,6 +75,9 @@ public class CMISPolicyTypeDefinition extends CMISAbstractTypeDefinition
|
||||
parentTypeId = CMISDictionaryModel.POLICY_TYPE_ID;
|
||||
}
|
||||
description = cmisClassDef.getDescription();
|
||||
|
||||
actionEvaluators = cmisMapping.getActionEvaluators(objectTypeId.getScope());
|
||||
|
||||
creatable = false;
|
||||
queryable = false;
|
||||
controllable = false;
|
||||
|
@@ -75,6 +75,9 @@ public class CMISRelationshipTypeDefinition extends CMISAbstractTypeDefinition
|
||||
isPublic = true;
|
||||
this.cmisClassDef = cmisClassDef;
|
||||
objectTypeId = typeId;
|
||||
|
||||
actionEvaluators = cmisMapping.getActionEvaluators(objectTypeId.getScope());
|
||||
|
||||
creatable = false;
|
||||
queryable = false;
|
||||
controllable = false;
|
||||
|
Reference in New Issue
Block a user