• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java Action类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.apache.chemistry.opencmis.commons.enums.Action的典型用法代码示例。如果您正苦于以下问题:Java Action类的具体用法?Java Action怎么用?Java Action使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



Action类属于org.apache.chemistry.opencmis.commons.enums包,在下文中一共展示了Action类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:RuntimePropertyAccessorMapping.java


示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:CMISConnector.java


示例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;

}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:18,代码来源:RegistryDocument.java


示例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;
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:29,代码来源:RegistryObject.java


示例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;
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:20,代码来源:RegistryVersionBase.java


示例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;
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:19,代码来源:RegistryFolder.java


示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:15,代码来源:RuntimePropertyAccessorMapping.java


示例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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:12,代码来源:CanDeleteDocumentEvaluator.java


示例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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:12,代码来源:CanCancelCheckOutActionEvaluator.java


示例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);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:12,代码来源:CanCheckInActionEvaluator.java


示例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();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:13,代码来源:CanCheckOutActionEvaluator.java


示例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;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:32,代码来源:CMISTest.java


示例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);
    }
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:15,代码来源:RegistryObject.java


示例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;
}
 
开发者ID:wso2,项目名称:carbon-registry,代码行数:10,代码来源:RegistryUnversionedDocument.java


示例15: getAction

import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
public Action getAction()
{
    return action;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:5,代码来源:AbstractActionEvaluator.java


示例16: extractMetadata

import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
/**
 * Extracts metadata for the node.
 *
 * @param nodeRef NodeRef
 */
public void extractMetadata(NodeRef nodeRef)
{
	org.alfresco.service.cmr.action.Action action = actionService.createAction(ContentMetadataExtracter.EXECUTOR_NAME);
	actionService.executeAction(action, nodeRef, true, false);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:11,代码来源:CMISConnector.java


示例17: getActionEvaluators

import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
@Override
public Map<Action, CMISActionEvaluator> getActionEvaluators()
{
    return actionEvaluators;
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:6,代码来源:AbstractTypeDefinitionWrapper.java


示例18: extractMetadata

import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
/**
 * Extracts metadata for the node.
 *  
 * @param nodeRef NodeRef
 */
public void extractMetadata(NodeRef nodeRef)
{
	org.alfresco.service.cmr.action.Action action = actionService.createAction(ContentMetadataExtracter.EXECUTOR_NAME);
	actionService.executeAction(action, nodeRef, true, false);
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:11,代码来源:CMISConnector.java


示例19: compileAllowableActions

import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
/**
 * Compiles the allowable actions for a file or folder.
 */
private AllowableActions compileAllowableActions(File file, boolean userReadOnly) {
    if (file == null) {
        throw new IllegalArgumentException("File must not be null!");
    }

    // we can't gather allowable actions if the file or folder doesn't exist
    if (!file.exists()) {
        throw new CmisObjectNotFoundException("Object not found!");
    }

    boolean isReadOnly = !file.canWrite();
    boolean isFolder = file.isDirectory();
    boolean isRoot = root.equals(file);

    Set<Action> aas = EnumSet.noneOf(Action.class);

    addAction(aas, Action.CAN_GET_OBJECT_PARENTS, !isRoot);
    addAction(aas, Action.CAN_GET_PROPERTIES, true);
    addAction(aas, Action.CAN_UPDATE_PROPERTIES, !userReadOnly && !isReadOnly);
    addAction(aas, Action.CAN_MOVE_OBJECT, !userReadOnly && !isRoot);
    addAction(aas, Action.CAN_DELETE_OBJECT, !userReadOnly && !isReadOnly && !isRoot);
    addAction(aas, Action.CAN_GET_ACL, true);

    if (isFolder) {
        addAction(aas, Action.CAN_GET_DESCENDANTS, true);
        addAction(aas, Action.CAN_GET_CHILDREN, true);
        addAction(aas, Action.CAN_GET_FOLDER_PARENT, !isRoot);
        addAction(aas, Action.CAN_GET_FOLDER_TREE, true);
        addAction(aas, Action.CAN_CREATE_DOCUMENT, !userReadOnly);
        addAction(aas, Action.CAN_CREATE_FOLDER, !userReadOnly);
        addAction(aas, Action.CAN_DELETE_TREE, !userReadOnly && !isReadOnly);
    } else {
        addAction(aas, Action.CAN_GET_CONTENT_STREAM, file.length() > 0);
        addAction(aas, Action.CAN_SET_CONTENT_STREAM, !userReadOnly && !isReadOnly);
        addAction(aas, Action.CAN_DELETE_CONTENT_STREAM, !userReadOnly && !isReadOnly);
        addAction(aas, Action.CAN_GET_ALL_VERSIONS, true);
    }

    AllowableActionsImpl result = new AllowableActionsImpl();
    result.setAllowableActions(aas);

    return result;
}
 
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuideV2,代码行数:47,代码来源:FileBridgeRepository.java


示例20: addAction

import org.apache.chemistry.opencmis.commons.enums.Action; //导入依赖的package包/类
private void addAction(Set<Action> aas, Action action, boolean condition) {
    if (condition) {
        aas.add(action);
    }
}
 
开发者ID:cmisdocs,项目名称:ServerDevelopmentGuideV2,代码行数:6,代码来源:FileBridgeRepository.java



注:本文中的org.apache.chemistry.opencmis.commons.enums.Action类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Suggestion类代码示例发布时间:2022-05-23
下一篇:
Java DialValueIndicator类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap