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

Java NamespacePrefixResolver类代码示例

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

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



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

示例1: getXPathName

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
public static String getXPathName(QName qName, NamespacePrefixResolver nspr)
{

    Collection<String> prefixes = nspr.getPrefixes(qName.getNamespaceURI());
    if (prefixes.size() == 0)
    {
        throw new NamespaceException("A namespace prefix is not registered for uri " + qName.getNamespaceURI());
    }
    String prefix = prefixes.iterator().next();
    if (prefix.equals(NamespaceService.DEFAULT_PREFIX))
    {
        return ISO9075.encode(qName.getLocalName());
    }
    else
    {
        return prefix + ":" + ISO9075.encode(qName.getLocalName());
    }

}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:20,代码来源:ISO9075.java


示例2: JCRPatternMatch

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
/**
 * Construct
 * 
 * @param pattern
 *            JCR Pattern
 * @param resolver
 *            Namespace Prefix Resolver
 */
public JCRPatternMatch(String pattern, NamespacePrefixResolver resolver)
{
    // TODO: Check for valid pattern

    // Convert to regular expression
    String regexPattern = pattern.replaceAll("\\*", ".*");

    // Split into independent search strings
    StringTokenizer tokenizer = new StringTokenizer(regexPattern, "|", false);
    while (tokenizer.hasMoreTokens())
    {
        String disjunct = tokenizer.nextToken().trim();
        this.searches.add(disjunct);
    }

    this.resolver = resolver;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:26,代码来源:NodeServiceXPath.java


示例3: convertNameToQName

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
public static QName convertNameToQName(String name, NamespacePrefixResolver prefixResolver)
{
    if (name.indexOf(QName.NAMESPACE_BEGIN)==0)
    {
        return QName.createQName(name);
    }
    String qName = name;
    if (name.indexOf(QName.NAMESPACE_PREFIX)==-1)
    {
        if (name.indexOf('_')==-1)
        {
            return QName.createQName(NamespaceService.DEFAULT_URI, name);
        }
        qName = name.replaceFirst("_", ":");
    }
    try
    {
        return QName.createQName(qName, prefixResolver);
    }
    catch (NamespaceException ne)
    {
        return QName.createQName(NamespaceService.DEFAULT_URI, name);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:WorkflowQNameConverter.java


示例4: applyFTSDecorations

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
private SearchParameters applyFTSDecorations(SearchParameters searchParameters, NamespacePrefixResolver nspResolver)
{
    SearchParameters constrainedParameters = searchParameters.copy();
    String theQuery = constrainedParameters.getQuery();
    theQuery = "(" + theQuery + ")";

    if (ignoreAspectQNames != null)
    {
        for (QName ignoredAspect : ignoreAspectQNames)
        {
            theQuery = theQuery + " and " + "!ASPECT:'" + ignoredAspect.toPrefixString(nspResolver) + "'";
        }
    }

    if (ignoreTypeNames != null)
    {
        for (QName ignoredType : ignoreTypeNames)
        {
            theQuery = theQuery + " and " + "!TYPE:'" + ignoredType.toPrefixString(nspResolver) + "'";
        }
    }

    constrainedParameters.setQuery(theQuery);

    return constrainedParameters;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:27,代码来源:IgnoreConstraint.java


示例5: matchAspectDefinition

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
public static AspectDefinition matchAspectDefinition(String defaultNameSpaceUri, NamespacePrefixResolver namespacePrefixResolver, DictionaryService dictionaryService, String string)
{
    QName search = QName.createQName(expandQName(defaultNameSpaceUri, namespacePrefixResolver, string));
    AspectDefinition aspectDefinition = dictionaryService.getAspect(QName.createQName(expandQName(defaultNameSpaceUri, namespacePrefixResolver, string)));
    QName match = null;
    if (aspectDefinition == null)
    {
        for (QName definition : dictionaryService.getAllAspects())
        {
            if (definition.getNamespaceURI().equalsIgnoreCase(search.getNamespaceURI()))
            {
                if (definition.getLocalName().equalsIgnoreCase(search.getLocalName()))
                {
                    if (match == null)
                    {
                        match = definition;
                    }
                    else
                    {
                        throw new DictionaryException("Ambiguous data datype " + string);
                    }
                }
            }
        }
    }
    else
    {
        return aspectDefinition;
    }
    if (match == null)
    {
        return null;
    }
    else
    {
        return dictionaryService.getAspect(match);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:39,代码来源:QueryParserUtils.java


示例6: initialise

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
public void initialise(Element element, NamespacePrefixResolver nspr, PermissionModel permissionModel)
{
    qname = QName.createQName(element.attributeValue(TYPE), nspr);
    
    Attribute exposeAttribute = element.attribute(EXPOSE);
    if(exposeAttribute != null)
    {
        exposeAll = exposeAttribute.getStringValue().equalsIgnoreCase(EXPOSE_ALL);
    }
    else
    {
        exposeAll = true;
    }
    
    for(Iterator pgit = element.elementIterator(PERMISSION_GROUP); pgit.hasNext(); /**/)
    {
        Element permissionGroupElement = (Element)pgit.next();
        PermissionGroup permissionGroup = new PermissionGroup(qname);
        permissionGroup.initialise(permissionGroupElement, nspr, permissionModel);
        permissionGroups.add(permissionGroup);
    }
    
    for(Iterator pit = element.elementIterator(PERMISSION); pit.hasNext(); /**/)
    {
        Element permissionElement = (Element)pit.next();
        Permission permission = new Permission(qname);
        permission.initialise(permissionElement, nspr, permissionModel);
        permissions.add(permission);
    }
    
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:32,代码来源:PermissionSet.java


示例7: initialise

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
public void initialise(Element element, NamespacePrefixResolver nspr, PermissionModel permissionModel)
{
   Attribute nodeRefAttribute = element.attribute(NODE_REF);
   if(nodeRefAttribute != null)
   {
       nodeRef = new NodeRef(nodeRefAttribute.getStringValue());
   }
   
   Attribute inheritFromParentAttribute = element.attribute(INHERIT_FROM_PARENT);
   if(inheritFromParentAttribute != null)
   {
       inheritPermissionsFromParent = Boolean.parseBoolean(inheritFromParentAttribute.getStringValue());
   }
   else
   {
       inheritPermissionsFromParent = true;
   }
   
   // Node Permissions Entry

   for (Iterator npit = element.elementIterator(NODE_PERMISSION); npit.hasNext(); /**/)
   {
       Element permissionEntryElement = (Element) npit.next();
       ModelPermissionEntry permissionEntry = new ModelPermissionEntry(nodeRef);
       permissionEntry.initialise(permissionEntryElement, nspr, permissionModel);
       permissionEntries.add(permissionEntry);
   }
    
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:30,代码来源:NodePermission.java


示例8: toPrefixString

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
/**
 * @return Returns a string path made up of the component elements of this instance (prefixed where appropriate)
 */
public String toPrefixString(NamespacePrefixResolver resolver)
{
    StringBuilder sb = new StringBuilder(128);
    for (Element element : elements)
    {
        if((sb.length() > 1) || ((sb.length() == 1) && (sb.charAt(0) != '/')))
        {
            sb.append("/");
        }
        sb.append(element.getPrefixedString(resolver));
    }
    return sb.toString();
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:17,代码来源:Path.java


示例9: initialise

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
public void initialise(Element element, NamespacePrefixResolver nspr, PermissionModel permissionModel)
{
    Attribute authorityAttribute = element.attribute(AUTHORITY);
    if(authorityAttribute != null)
    {
        authority = authorityAttribute.getStringValue();
    }
    Attribute permissionAttribute = element.attribute(PERMISSION);
    if(permissionAttribute != null)
    {
        permissionReference = permissionModel.getPermissionReference(null, permissionAttribute.getStringValue());
    }

}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:15,代码来源:GlobalPermissionEntry.java


示例10: setNamespacePrefixResolver

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
public void setNamespacePrefixResolver(NamespacePrefixResolver namespacePrefixResolver)
{
    this.namespacePrefixResolver = namespacePrefixResolver;
    qnameAssocSystem = QName.createQName("sys", "system", namespacePrefixResolver);
    qnameAssocAuthorities = QName.createQName("sys", "authorities", namespacePrefixResolver);
    qnameAssocZones = QName.createQName("sys", "zones", namespacePrefixResolver);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:8,代码来源:AuthorityDAOImpl.java


示例11: selectNodes

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
public List<NodeRef> selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters,
        NamespacePrefixResolver namespacePrefixResolver, boolean followAllParentLinks)
        throws InvalidNodeRefException, XPathException
{
    return selectNodes(contextNodeRef, xpath, parameters, namespacePrefixResolver, followAllParentLinks,
            SearchService.LANGUAGE_XPATH);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:8,代码来源:AbstractSearcherComponent.java


示例12: selectProperties

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
public List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath,
        QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver,
        boolean followAllParentLinks) throws InvalidNodeRefException, XPathException
{
    return selectProperties(contextNodeRef, xpath, parameters, namespacePrefixResolver, followAllParentLinks,
            SearchService.LANGUAGE_XPATH);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:8,代码来源:AbstractSearcherComponent.java


示例13: selectProperties

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
/**
 * @see NodeServiceXPath
 */
public List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath,
        QueryParameterDefinition[] paramDefs, NamespacePrefixResolver namespacePrefixResolver,
        boolean followAllParentLinks, String language)
{
    try
    {
        DocumentNavigator documentNavigator = new DocumentNavigator(dictionaryService, nodeService, searchService,
                namespacePrefixResolver, followAllParentLinks);
        NodeServiceXPath nsXPath = new NodeServiceXPath(xpath, documentNavigator, paramDefs);
        for (String prefix : namespacePrefixResolver.getPrefixes())
        {
            nsXPath.addNamespace(prefix, namespacePrefixResolver.getNamespaceURI(prefix));
        }
        @SuppressWarnings("rawtypes")
        List list = nsXPath.selectNodes(nodeService.getPrimaryParent(contextNodeRef));
        List<Serializable> answer = new ArrayList<Serializable>(list.size());
        for (Object o : list)
        {
            if (!(o instanceof DocumentNavigator.Property))
            {
                throw new XPathException("Xpath expression must only select nodes");
            }
            answer.add(((DocumentNavigator.Property) o).value);
        }
        return answer;
    }
    catch (JaxenException e)
    {
        throw new XPathException("Error executing xpath", e);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:35,代码来源:NodeSearcher.java


示例14: createElementString

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
private String createElementString(NamespacePrefixResolver resolver)
{
    StringBuilder sb = new StringBuilder(32);
    sb.append("@").append(resolver == null ? ISO9075.getXPathName(attribute) : ISO9075.getXPathName(attribute, resolver));
    
    if (position > -1)
    {
        sb.append("[").append(position).append("]");
    }
    return sb.toString();
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:12,代码来源:Path.java


示例15: resolveDependencies

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
void resolveDependencies(
        ModelQuery query,
        NamespacePrefixResolver prefixResolver,
        Map<QName, ConstraintDefinition> modelConstraints)
{
    if (propertyTypeName == null)
    {
        throw new DictionaryException(
                "d_dictionary.property.err.property_type_not_specified",
                name.toPrefixString());
    }
    dataType = query.getDataType(propertyTypeName);
    if (dataType == null)
    {
        throw new DictionaryException(
                "d_dictionary.property.err.property_type_not_found",
                propertyTypeName.toPrefixString(), name.toPrefixString());
    }
    
    // ensure content properties are not multi-valued
    if (propertyTypeName.equals(DataTypeDefinition.CONTENT) && isMultiValued())
    {
        throw new DictionaryException("d_dictionary.property.err.single_valued_content");
    }

    // Construct constraints
    constraintDefs = buildConstraints(
            m2Property.getConstraints(),
            this,
            prefixResolver,
            modelConstraints);
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:33,代码来源:M2PropertyDefinition.java


示例16: selectNodes

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
/**
 * @see org.alfresco.repo.search.impl.NodeSearcher
 */
public List<NodeRef> selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver,
        boolean followAllParentLinks, String language) throws InvalidNodeRefException, XPathException
{
    NodeSearcher nodeSearcher = new NodeSearcher(nodeService, getDictionaryService(), this);
    return nodeSearcher.selectNodes(contextNodeRef, xpath, parameters, namespacePrefixResolver, followAllParentLinks, language);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:10,代码来源:ADMLuceneSearcherImpl.java


示例17: selectProperties

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
/**
 * @see org.alfresco.repo.search.impl.NodeSearcher
 */
public List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver,
        boolean followAllParentLinks, String language) throws InvalidNodeRefException, XPathException
{
    NodeSearcher nodeSearcher = new NodeSearcher(nodeService, getDictionaryService(), this);
    return nodeSearcher.selectProperties(contextNodeRef, xpath, parameters, namespacePrefixResolver, followAllParentLinks, language);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:10,代码来源:ADMLuceneSearcherImpl.java


示例18: selectNodes

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
@Override
public List<NodeRef> selectNodes(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver,
        boolean followAllParentLinks, String language) throws InvalidNodeRefException, XPathException
{
    NodeSearcher nodeSearcher = new NodeSearcher(nodeService, dictionaryService, this);
    return nodeSearcher.selectNodes(contextNodeRef, xpath, parameters, namespacePrefixResolver, followAllParentLinks, language);

}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:9,代码来源:SolrSearchService.java


示例19: selectProperties

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
@Override
public List<Serializable> selectProperties(NodeRef contextNodeRef, String xpath, QueryParameterDefinition[] parameters, NamespacePrefixResolver namespacePrefixResolver,
        boolean followAllParentLinks) throws InvalidNodeRefException, XPathException
{
    return selectProperties(contextNodeRef, xpath, parameters, namespacePrefixResolver, followAllParentLinks, SearchService.LANGUAGE_XPATH);

}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:8,代码来源:SolrSearchService.java


示例20: createQName

import org.alfresco.service.namespace.NamespacePrefixResolver; //导入依赖的package包/类
/**
 * This method converts the supplied qname string into a {@link QName} object.
 * It accepts both short and long form qname strings.
 * 
 * @param s a qname string, such as "cm:name" or "{http://www.alfresco.org/model/content/1.0}name"
 * @param resolver this is needed to convert any qname prefixes into their long form.
 * @return the QName instance.
 * @throws NullPointerException if the provided string is {@code null}.
 * @throws IllegalArgumentException if the provided string could not be recognised as a valid QName.
 */
public static QName createQName(String s, NamespacePrefixResolver resolver)
{
    final QName result;
    
    if (s.length() < 2) { throw new IllegalArgumentException("Cannot convert string '" + s + "'"); }
    
    if (s.charAt(0) == QName.NAMESPACE_BEGIN &&
        s.substring(1).contains(Character.toString(QName.NAMESPACE_END)))
    {
        // Assume it's a long-form qname.
        result = QName.createQName(s);
    }
    else if ( !s.contains(Character.toString(QName.NAMESPACE_BEGIN)) &&
             s.contains(Character.toString(QName.NAMESPACE_PREFIX)))
    {
        // Assume it's a short-form qname.
        result = QName.createQName(s, resolver);
    }
    else if (!s.contains(Character.toString(QName.NAMESPACE_BEGIN)) &&
            !s.contains(Character.toString(QName.NAMESPACE_END)) &&
            !s.contains(Character.toString(QName.NAMESPACE_PREFIX)))
    {
        // No '{', '}' or ':' means it's a prefixless QName (SITE or TAG, in our case).
        result = QName.createQName(null, s);
    }
    else
    {
        // We're not sure what sort of qname this is supposed to be.
        throw new IllegalArgumentException("Cannot convert string '" + s + "'");
    }
    
    return result;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:44,代码来源:FacetQNameUtils.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
Java Deserializer类代码示例发布时间:2022-05-23
下一篇:
Java RelBuilderFactory类代码示例发布时间: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