当前位置: 首页>>代码示例>>Java>>正文


Java RegexQNamePattern.MATCH_ALL属性代码示例

本文整理汇总了Java中org.alfresco.service.namespace.RegexQNamePattern.MATCH_ALL属性的典型用法代码示例。如果您正苦于以下问题:Java RegexQNamePattern.MATCH_ALL属性的具体用法?Java RegexQNamePattern.MATCH_ALL怎么用?Java RegexQNamePattern.MATCH_ALL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.alfresco.service.namespace.RegexQNamePattern的用法示例。


在下文中一共展示了RegexQNamePattern.MATCH_ALL属性的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: evaluateImpl

/**
 * @see org.alfresco.repo.action.evaluator.ActionConditionEvaluatorAbstractBase#evaluateImpl(org.alfresco.service.cmr.action.ActionCondition, org.alfresco.service.cmr.repository.NodeRef)
 */
public boolean evaluateImpl(ActionCondition ruleCondition, NodeRef actionedUponNodeRef)
{
    boolean result = false;
    
    if (this.nodeService.exists(actionedUponNodeRef) == true)
    {
        // Default match pattern is to match all.
        QNamePattern matchAll = RegexQNamePattern.MATCH_ALL;

        // Retrieve any specified parameter values.
        QName assocTypeParam = (QName)ruleCondition.getParameterValue(PARAM_ASSOC_TYPE);
        QName assocNameParam = (QName)ruleCondition.getParameterValue(PARAM_ASSOC_NAME);

        // Use the specified QNames if there are any, else default to match_all.
        QNamePattern assocType = assocTypeParam == null ? matchAll : assocTypeParam;
        QNamePattern assocName = assocNameParam == null ? matchAll : assocNameParam;

        // Are there any children which match these association name/type patterns?
        List<ChildAssociationRef> children = nodeService.getChildAssocs(actionedUponNodeRef, assocType, assocName);
        result = !children.isEmpty();
    }
    
    return result;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:HasChildEvaluator.java

示例2: getAssocTypeFromWhereElseAll

protected QNamePattern getAssocTypeFromWhereElseAll(Parameters parameters)
{
    QNamePattern assocTypeQNamePattern = RegexQNamePattern.MATCH_ALL;

    Query q = parameters.getQuery();
    if (q != null)
    {
        MapBasedQueryWalker propertyWalker = new MapBasedQueryWalker(WHERE_PARAMS_ASSOC_TYPE, null);
        QueryHelper.walk(q, propertyWalker);

        String assocTypeQNameStr = propertyWalker.getProperty(Nodes.PARAM_ASSOC_TYPE, WhereClauseParser.EQUALS, String.class);
        if (assocTypeQNameStr != null)
        {
            assocTypeQNamePattern = nodes.getAssocType(assocTypeQNameStr);
        }
    }

    return assocTypeQNamePattern;
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:19,代码来源:AbstractNodeRelation.java

示例3: readAll

/**
 * List child node's parent(s) based on (parent ->) child associations.
 * Returns primary parent & also secondary parents, if any.
 *
 * @param childNodeId String id of child node
 */
@Override
@WebApiDescription(title = "Return a list of parent nodes based on child assocs")
public CollectionWithPagingInfo<Node> readAll(String childNodeId, Parameters parameters)
{
    NodeRef childNodeRef = nodes.validateOrLookupNode(childNodeId, null);

    QNamePattern assocTypeQNameParam = RegexQNamePattern.MATCH_ALL;

    Boolean isPrimary = null;

    Query q = parameters.getQuery();
    if (q != null)
    {
        MapBasedQueryWalker propertyWalker = new MapBasedQueryWalker(WHERE_PARAMS_PARENTS, null);
        QueryHelper.walk(q, propertyWalker);

        isPrimary = propertyWalker.getProperty(Nodes.PARAM_ISPRIMARY, WhereClauseParser.EQUALS, Boolean.class);

        String assocTypeQNameStr = propertyWalker.getProperty(Nodes.PARAM_ASSOC_TYPE, WhereClauseParser.EQUALS, String.class);
        if (assocTypeQNameStr != null)
        {
            assocTypeQNameParam = nodes.getAssocType(assocTypeQNameStr);
        }
    }

    List<ChildAssociationRef> childAssocRefs = null;
    if (assocTypeQNameParam.equals(RegexQNamePattern.MATCH_ALL))
    {
        childAssocRefs = nodeService.getParentAssocs(childNodeRef);
    }
    else
    {
        childAssocRefs = nodeService.getParentAssocs(childNodeRef, assocTypeQNameParam, RegexQNamePattern.MATCH_ALL);
    }

    return listNodeChildAssocs(childAssocRefs, parameters, isPrimary, false);
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:43,代码来源:NodeParentsRelation.java

示例4: assoc

@Override
@WebApiDescription(title = "Remove node assoc(s)")
public void delete(String sourceNodeId, String targetNodeId, Parameters parameters)
{
    NodeRef srcNodeRef = nodes.validateNode(sourceNodeId);
    NodeRef tgtNodeRef = nodes.validateNode(targetNodeId);

    String assocTypeStr = parameters.getParameter(Nodes.PARAM_ASSOC_TYPE);
    QNamePattern assocTypeQName = nodes.getAssocType(assocTypeStr, false);

    if (assocTypeQName == null)
    {
        assocTypeQName = RegexQNamePattern.MATCH_ALL;
    }

    // note: even if assocType is provided, we currently don't use nodeService.removeAssociation(srcNodeRef, tgtNodeRef, assocTypeQName);
    // since silent it returns void even if nothing deleted, where as we return 404

    boolean found = false;

    List<AssociationRef> assocRefs = nodeAssocService.getTargetAssocs(new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, sourceNodeId), assocTypeQName);
    for (AssociationRef assocRef : assocRefs)
    {
        if (assocRef.getTargetRef().equals(tgtNodeRef))
        {
            nodeAssocService.removeAssociation(srcNodeRef, tgtNodeRef, assocRef.getTypeQName());
            found = true;
        }
    }

    if (! found)
    {
        throw new EntityNotFoundException(sourceNodeId+","+assocTypeStr+","+targetNodeId);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:35,代码来源:NodeTargetsRelation.java


注:本文中的org.alfresco.service.namespace.RegexQNamePattern.MATCH_ALL属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。