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:
David Caruana
2009-04-02 17:20:26 +00:00
parent 8b86152153
commit 79c938f0b4
15 changed files with 443 additions and 5 deletions

View File

@@ -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());
}
}

View File

@@ -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
//

View File

@@ -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();

View File

@@ -75,6 +75,8 @@ public class CMISFolderTypeDefinition extends CMISAbstractTypeDefinition
}
}
actionEvaluators = cmisMapping.getActionEvaluators(objectTypeId.getScope());
creatable = true;
queryable = true;
controllable = false;

View File

@@ -71,6 +71,8 @@ public class CMISObjectTypeDefinition extends CMISAbstractTypeDefinition
}
}
actionEvaluators = cmisMapping.getActionEvaluators(objectTypeId.getScope());
creatable = false;
queryable = false;
controllable = false;

View File

@@ -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;

View File

@@ -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;