本文整理汇总了Java中org.apache.chemistry.opencmis.commons.enums.Action类的典型用法代码示例。如果您正苦于以下问题:Java Action类的具体用法?Java Action怎么用?Java Action使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
Action类属于org.apache.chemistry.opencmis.commons.enums包,在下文中一共展示了Action类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: registerEvaluator
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
/**
* Register an Action Evaluator
*
* @param scope BaseTypeId
* @param evaluator CMISActionEvaluator
*/
private void registerEvaluator(BaseTypeId scope, CMISActionEvaluator evaluator)
{
Map<Action, CMISActionEvaluator> evaluators = actionEvaluators.get(scope);
if (evaluators == null)
{
evaluators = new LinkedHashMap<Action, CMISActionEvaluator>();
actionEvaluators.put(scope, evaluators);
}
if (evaluators.get(evaluator.getAction()) != null)
{
throw new AlfrescoRuntimeException("Already registered Action Evaluator " + evaluator.getAction()
+ " for scope " + scope);
}
evaluators.put(evaluator.getAction(), evaluator);
if (logger.isDebugEnabled())
logger.debug("Registered Action Evaluator: scope=" + scope + ", evaluator=" + evaluator);
}
示例2: getAllowableActions
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
public AllowableActions getAllowableActions(CMISNodeInfo info)
{
AllowableActionsImpl result = new AllowableActionsImpl();
Set<Action> allowableActions = new HashSet<Action>();
result.setAllowableActions(allowableActions);
for (CMISActionEvaluator evaluator : info.getType().getActionEvaluators().values())
{
if (evaluator.isAllowed(info))
{
allowableActions.add(evaluator.getAction());
}
}
return result;
}
示例3: compileAllowableActions
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
@Override
protected Set<Action> compileAllowableActions(Set<Action> aas) {
Set<Action> result = super.compileAllowableActions(aas);
try {
boolean status = getNode().getContentStream() != null ? true : false;
setAction(result, Action.CAN_GET_CONTENT_STREAM, status);
} catch (RegistryException e) {
log.error("Failed to get the content stream for the node " + getNode().getId() + " " , e);
setAction(result, Action.CAN_GET_CONTENT_STREAM, false);
}
setAction(result, Action.CAN_SET_CONTENT_STREAM, true);
setAction(result, Action.CAN_DELETE_CONTENT_STREAM, true);
setAction(result, Action.CAN_GET_RENDITIONS, false);
return result;
}
示例4: compileAllowableActions
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
/**
* Compile the allowed actions on the CMIS object represented by this instance
* See CMIS 1.0 section 2.2.4.6 getAllowableActions
*
* @param aas compilation of allowed actions
* @return
*/
protected Set<Action> compileAllowableActions(Set<Action> aas) {
setAction(aas, Action.CAN_GET_OBJECT_PARENTS, true);
setAction(aas, Action.CAN_GET_PROPERTIES, true);
setAction(aas, Action.CAN_UPDATE_PROPERTIES, true);
setAction(aas, Action.CAN_MOVE_OBJECT, true);
if(pathManager.isRoot(getNode())){
setAction(aas, Action.CAN_DELETE_OBJECT, false);
} else {
setAction(aas, Action.CAN_DELETE_OBJECT, true);
}
setAction(aas, Action.CAN_GET_ACL, false);
setAction(aas, Action.CAN_APPLY_ACL, false);
setAction(aas, Action.CAN_GET_OBJECT_RELATIONSHIPS, false);
setAction(aas, Action.CAN_ADD_OBJECT_TO_FOLDER, false);
setAction(aas, Action.CAN_REMOVE_OBJECT_FROM_FOLDER, false);
setAction(aas, Action.CAN_APPLY_POLICY, false);
setAction(aas, Action.CAN_GET_APPLIED_POLICIES, false);
setAction(aas, Action.CAN_REMOVE_POLICY, false);
setAction(aas, Action.CAN_CREATE_RELATIONSHIP, false);
return aas;
}
示例5: compileAllowableActions
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
@Override
protected Set<Action> compileAllowableActions(Set<Action> aas) {
Set<Action> result = super.compileAllowableActions(aas);
setAction(result, Action.CAN_GET_ALL_VERSIONS, true);
try {
if(isCheckedOut()){
setAction(result, Action.CAN_CANCEL_CHECK_OUT, true);
setAction(result, Action.CAN_CHECK_IN, true);
setAction(result, Action.CAN_CHECK_OUT, false);
} else{
//setAction(result, Action.CAN_CANCEL_CHECK_OUT, false);
//setAction(result, Action.CAN_CHECK_IN, false);
setAction(result, Action.CAN_CHECK_OUT, true);
}
} catch (RegistryException e) {
log.error("Failed compiling allowable actions ", e); //To change body of catch statement use File | Settings | File Templates.
}
return result;
}
示例6: compileAllowableActions
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
@Override
protected Set<Action> compileAllowableActions(Set<Action> aas) {
Set<Action> result = super.compileAllowableActions(aas);
setAction(result, Action.CAN_GET_DESCENDANTS, true);
setAction(result, Action.CAN_GET_CHILDREN, true);
setAction(result, Action.CAN_GET_FOLDER_PARENT, !pathManager.isRoot(getNode()));
setAction(result, Action.CAN_GET_OBJECT_PARENTS, !pathManager.isRoot(getNode()));
setAction(result, Action.CAN_GET_FOLDER_TREE, true);
setAction(result, Action.CAN_CREATE_DOCUMENT, true);
setAction(result, Action.CAN_CREATE_FOLDER, true);
if(getNode().getPath().equals("/")) {
setAction(result, Action.CAN_DELETE_TREE, false);
} else {
setAction(result, Action.CAN_DELETE_TREE, true);
}
return result;
}
示例7: getActionEvaluators
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
/**
* Gets the Action Evaluators applicable for the given CMIS Scope
*
* @param scope BaseTypeId
*/
public Map<Action, CMISActionEvaluator> getActionEvaluators(BaseTypeId scope)
{
Map<Action, CMISActionEvaluator> evaluators = actionEvaluators.get(scope);
if (evaluators == null)
{
evaluators = Collections.emptyMap();
}
return evaluators;
}
示例8: CanDeleteDocumentEvaluator
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
/**
* Construct
*
* @param serviceRegistry ServiceRegistry
*/
protected CanDeleteDocumentEvaluator(ServiceRegistry serviceRegistry)
{
super(serviceRegistry, Action.CAN_DELETE_OBJECT);
this.currentVersionEvaluator = new PermissionActionEvaluator(serviceRegistry,
Action.CAN_DELETE_OBJECT, PermissionService.DELETE_NODE);
}
示例9: CanCancelCheckOutActionEvaluator
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
/**
* Construct
*/
protected CanCancelCheckOutActionEvaluator(ServiceRegistry serviceRegistry)
{
super(serviceRegistry, Action.CAN_CANCEL_CHECK_OUT);
permissionEvaluator = new PermissionActionEvaluator(
serviceRegistry,
Action.CAN_CANCEL_CHECK_OUT,
PermissionService.CANCEL_CHECK_OUT);
}
示例10: CanCheckInActionEvaluator
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
/**
* Construct
*/
protected CanCheckInActionEvaluator(ServiceRegistry serviceRegistry)
{
super(serviceRegistry, Action.CAN_CHECK_IN);
permissionEvaluator = new PermissionActionEvaluator(
serviceRegistry,
Action.CAN_CHECK_IN,
PermissionService.CHECK_IN);
}
示例11: CanCheckOutActionEvaluator
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
/**
* Construct
*/
protected CanCheckOutActionEvaluator(ServiceRegistry serviceRegistry)
{
super(serviceRegistry, Action.CAN_CHECK_OUT);
permissionEvaluator = new PermissionActionEvaluator(
serviceRegistry,
Action.CAN_CHECK_OUT,
PermissionService.CHECK_OUT);
lockService = serviceRegistry.getLockService();
}
示例12: addRule
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
private Rule addRule(boolean isAppliedToChildren, String title)
{
// Rule properties
Map<String, Serializable> conditionProps = new HashMap<String, Serializable>();
conditionProps.put(ComparePropertyValueEvaluator.PARAM_VALUE, ".txt");
Map<String, Serializable> actionProps = new HashMap<String, Serializable>();
actionProps.put(AddFeaturesActionExecuter.PARAM_ASPECT_NAME, ContentModel.ASPECT_VERSIONABLE);
List<String> ruleTypes = new ArrayList<String>(1);
ruleTypes.add(RuleType.INBOUND);
// Create the action
org.alfresco.service.cmr.action.Action action = actionService.createAction(title);
action.setParameterValues(conditionProps);
ActionCondition actionCondition = actionService.createActionCondition(ComparePropertyValueEvaluator.NAME);
actionCondition.setParameterValues(conditionProps);
action.addActionCondition(actionCondition);
// Create the rule
Rule rule = new Rule();
rule.setRuleTypes(ruleTypes);
rule.setTitle(title);
rule.setDescription("description");
rule.applyToChildren(isAppliedToChildren);
rule.setAction(action);
return rule;
}
示例13: setAction
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
/**
* Add <code>action</code> to <code>actions</code> iff <code>condition</code> is true.
*
* @param actions
* @param action
* @param condition
*/
protected static void setAction(Set<Action> actions, Action action, boolean condition) {
if (condition) {
actions.add(action);
} else {
actions.remove(action);
}
}
示例14: compileAllowableActions
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
@Override
protected Set<Action> compileAllowableActions(Set<Action> aas) {
Set<Action> result = super.compileAllowableActions(aas);
setAction(result, Action.CAN_GET_ALL_VERSIONS, false);
setAction(result, Action.CAN_CHECK_OUT, false);
setAction(result, Action.CAN_CANCEL_CHECK_OUT, false);
setAction(result, Action.CAN_CHECK_IN, false);
return result;
}
示例15: getAction
import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
public Action getAction()
{
return action;
}