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

Java ISO9075类代码示例

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

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



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

示例1: stringToPath

import org.alfresco.util.ISO9075; //导入依赖的package包/类
/**
 * Converts a String representation of a path to a Path
 * 
 * e.g "/{http://www.alfresco.org/model/application/1.0}company_home/{http://www.alfresco.org/model/application/1.0}dictionary/{http://www.alfresco.org/model/application/1.0}transfers/{http://www.alfresco.org/model/content/1.0}default/{http://www.alfresco.org/model/transfer/1.0}snapshotMe";
 * @param value the string representation of the path.
 * @return Path 
 */
public static Path stringToPath(String value)
{
    Path path = new Path();
    
    // pattern for QName e.g. /{stuff}stuff
    
    Pattern pattern = Pattern.compile("/\\{[a-zA-Z:./0-9]*\\}[^/]*");
    Matcher matcher = pattern.matcher(value);
    
    // This is the root node
    path.append(new SimplePathElement("/"));
           
    while ( matcher.find() )
    {
        String group = matcher.group();
        final String val = ISO9075.decode(group.substring(1));
        path.append(new SimplePathElement(val));
    }
    
    return path;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:29,代码来源:PathHelper.java


示例2: getName

import org.alfresco.util.ISO9075; //导入依赖的package包/类
private String getName(QName qName)
{
    String name = null;
    
    try
    {
        name = qName.toPrefixString(namespaceService);
    }
    catch (NamespaceException e)
    {
        name = qName.toPrefixString();
    }
    name = ISO9075.decode(name);
    
    return name;
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:NodeInfoFactory.java


示例3: getElementQName

import org.alfresco.util.ISO9075; //导入依赖的package包/类
public String getElementQName(Object o)
{
    QName qName = ((ChildAssociationRef) o).getQName();
    if(qName == null)
    {
        return "";
    }
    String escapedLocalName = ISO9075.encode(qName.getLocalName());
    if (EqualsHelper.nullSafeEquals(escapedLocalName, qName.getLocalName()))        
    {
        return qName.toString();
    }
    else
    {
        return QName.createQName(qName.getNamespaceURI(), escapedLocalName).toString();
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:18,代码来源:DocumentNavigator.java


示例4: getChildAxisIterator

import org.alfresco.util.ISO9075; //导入依赖的package包/类
public Iterator getChildAxisIterator(Object contextNode, String localName, String namespacePrefix, String namespaceURI) throws UnsupportedAxisException
{
    // decode the localname
    localName = ISO9075.decode(localName);
    
    // MNT-10730
    if (localName != null && (localName.equalsIgnoreCase("true") || localName.equalsIgnoreCase("false")))
    {
        return Collections.singletonList(new Boolean(Boolean.parseBoolean(localName))).iterator();
    }
    
    ChildAssociationRef assocRef = (ChildAssociationRef) contextNode;
    NodeRef childRef = assocRef.getChildRef();
    QName qName = QName.createQName(namespaceURI, localName);
    List<? extends ChildAssociationRef> list = null;
    list = nodeService.getChildAssocs(childRef, RegexQNamePattern.MATCH_ALL, qName);
    // done
    return list.iterator();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:20,代码来源:DocumentNavigator.java


示例5: buildXPath

import org.alfresco.util.ISO9075; //导入依赖的package包/类
private String buildXPath(Path path)
{
    StringBuilder pathBuffer = new StringBuilder(64);
    for (Iterator<Path.Element> elit = path.iterator(); elit.hasNext(); /**/)
    {
        Path.Element element = elit.next();
        if (!(element instanceof Path.ChildAssocElement))
        {
            throw new IndexerException("Confused path: " + path);
        }
        Path.ChildAssocElement cae = (Path.ChildAssocElement) element;
        if (cae.getRef().getParentRef() != null)
        {
            pathBuffer.append("/");
            pathBuffer.append(getPrefix(cae.getRef().getQName().getNamespaceURI()));
            pathBuffer.append(ISO9075.encode(cae.getRef().getQName().getLocalName()));
        }
    }
    return pathBuffer.toString();
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:LuceneCategoryServiceImpl.java


示例6: getClassificationNodes

import org.alfresco.util.ISO9075; //导入依赖的package包/类
private Set<NodeRef> getClassificationNodes(StoreRef storeRef, QName qname)
{
    ResultSet resultSet = null;
    try
    {
        resultSet = indexerAndSearcher.getSearcher(storeRef, false).query(storeRef, "lucene",
                "PATH:\"/" + getPrefix(qname.getNamespaceURI()) + ISO9075.encode(qname.getLocalName()) + "\"", null);
        
        Set<NodeRef> nodeRefs = new HashSet<NodeRef>(resultSet.length());
        for (ResultSetRow row : resultSet)
        {
            nodeRefs.add(row.getNodeRef());
        }
        
        return nodeRefs;
    }
    finally
    {
        if (resultSet != null)
        {
            resultSet.close();
        }
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:LuceneCategoryServiceImpl.java


示例7: getDisplayLabel

import org.alfresco.util.ISO9075; //导入依赖的package包/类
@Override
public FacetLabel getDisplayLabel(String value)
{
    // Solr returns the site short name encoded
    value = ISO9075.decode(value);
    String title = null;

    if (nonSiteLocationsLabels.containsKey(value))
    {
        title = nonSiteLocationsLabels.get(value);
    }
    else
    {
        SiteService siteService = serviceRegistry.getSiteService();
        SiteInfo siteInfo = siteService.getSite(value);
        title = siteInfo != null ? siteInfo.getTitle() : value;
    }

    return new FacetLabel(value, title, -1);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:21,代码来源:SiteTitleDisplayHandler.java


示例8: findTaggedNodes

import org.alfresco.util.ISO9075; //导入依赖的package包/类
/**
 * @see org.alfresco.service.cmr.tagging.TaggingService#findTaggedNodes(StoreRef, java.lang.String)
 */
public List<NodeRef> findTaggedNodes(StoreRef storeRef, String tag)
{
    // Lower the case of the tag
    tag = tag.toLowerCase();
    ResultSet resultSet= null;
    
    try
    {
        // Do the search for nodes
        resultSet = this.searchService.query(
            storeRef, 
            SearchService.LANGUAGE_LUCENE, 
            "+PATH:\"/cm:taggable/cm:" + ISO9075.encode(tag) + "/member\"");
        List<NodeRef> nodeRefs = resultSet.getNodeRefs();
        return nodeRefs;
    }
    finally
    {
        if(resultSet != null) {resultSet.close();}
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:25,代码来源:TaggingServiceImpl.java


示例9: testEncodingOfTypeAndPropertyNames

import org.alfresco.util.ISO9075; //导入依赖的package包/类
public void testEncodingOfTypeAndPropertyNames() throws Exception
{
    addTypeTestDataModel();
    
    assertNotNull("Type not found by query name "+ISO9075.encodeSQL(typeThatRequiresEncoding.toPrefixString(namespaceService)), cmisDictionaryService.findTypeByQueryName(ISO9075.encodeSQL(typeThatRequiresEncoding.toPrefixString(namespaceService))));
    assertNotNull("Aspect not found by query name "+ISO9075.encodeSQL(aspectThatRequiresEncoding.toPrefixString(namespaceService)), cmisDictionaryService.findTypeByQueryName(ISO9075.encodeSQL(aspectThatRequiresEncoding.toPrefixString(namespaceService))));
    assertNotNull("Prop not found by query name "+ISO9075.encodeSQL(propertyThatRequiresEncoding.toPrefixString(namespaceService)), cmisDictionaryService.findPropertyByQueryName(ISO9075.encodeSQL(propertyThatRequiresEncoding.toPrefixString(namespaceService))));
   
    
    testQuery("SELECT * FROM "+  ISO9075.encodeSQL(typeThatRequiresEncoding.toPrefixString(namespaceService)), 0, false, "cmis:allowedChildObjectTypeIds",
            new String(), false);
    testQuery("SELECT * FROM test:type_x002d_that_x002d_requires_x002d_encoding", 0, false, "cmis:allowedChildObjectTypeIds",
            new String(), false);
    testQuery("SELECT * FROM test:type_x002D_that_x002D_requires_x002D_encoding", 0, false, "cmis:allowedChildObjectTypeIds",
            new String(), false);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:17,代码来源:OpenCmisQueryTest.java


示例10: createElementString

import org.alfresco.util.ISO9075; //导入依赖的package包/类
private String createElementString(NamespacePrefixResolver resolver)
{
    StringBuilder sb = new StringBuilder(32);
    if (ref.getParentRef() == null)
    {
        sb.append("/");
    }
    else
    {
        // a parent is present
        sb.append(resolver == null ? ISO9075.getXPathName(ref.getQName()) : ISO9075.getXPathName(ref.getQName(), resolver));
    }
    if (ref.getNthSibling() > -1)
    {
        sb.append("[").append(ref.getNthSibling()).append("]");
    }
    return sb.toString();
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:19,代码来源:Path.java


示例11: AttributeElement

import org.alfresco.util.ISO9075; //导入依赖的package包/类
public AttributeElement(String attribute)
{
    String qNameStr = null;
    int idx = attribute.indexOf("[");
    if(idx != -1)
    {
        String positionStr = attribute.substring(idx + 1, attribute.length() - 1);
        position = Integer.parseInt(positionStr);
        qNameStr = attribute.substring(1, idx);
    }
    else
    {
        qNameStr = attribute.substring(1);
    }
    this.attribute = ISO9075.parseXPathName(qNameStr);
}
 
开发者ID:Alfresco,项目名称:alfresco-data-model,代码行数:17,代码来源:Path.java


示例12: encodePathISO9075

import org.alfresco.util.ISO9075; //导入依赖的package包/类
/**
 * Helper to encode the elements of a path to be used as a Lucene PATH statement
 * using the ISO9075 encoding. Note that leading and trailing '/' elements will NOT
 * be preserved.
 * 
 * @param path  Path to encode, elements separated by '/'
 * 
 * @return the encoded path, a minimum of the empty string will be returned
 */
public static String encodePathISO9075(String path)
{
    if (path == null || path.length() == 0)
    {
        return "";
    }
    StringBuilder result = new StringBuilder(path.length() + 16);
    for (StringTokenizer t = new StringTokenizer(path, "/"); t.hasMoreTokens(); /**/)
    {
        result.append(ISO9075.encode(t.nextToken()));
        if (t.hasMoreTokens())
        {
            result.append('/');
        }
    }
    return result.toString();
}
 
开发者ID:Alfresco,项目名称:alfresco-remote-api,代码行数:27,代码来源:RepoStore.java


示例13: getSearchQuery

import org.alfresco.util.ISO9075; //导入依赖的package包/类
/**
 * Build the search query from the passed in parameters and SEARCH_QUERY constant
 * 
 * @param site SiteInfo
 * @param author String
 * @param daysAgo int
 * @return Pair with the query string in first and query language in second
 */
protected Pair<String, String> getSearchQuery(SiteInfo site, String author, int daysAgo)
{
   String search = String.format(SEARCH_QUERY,
         (site != null ? "cm:" + ISO9075.encode(site.getShortName()) : "*"),
         getDateXDaysAgo(daysAgo)
   );

   // If author equals 'mine' add cm:creator to the search query otherwise leave out
   if(author.equals(DEFAULT_TOPIC_AUTHOR))
   {
      search += " AND @cm:creator:\"" + AuthenticationUtil.getFullyAuthenticatedUser() + "\"";
   }

   // Add the query string and language to the returned results
   Pair<String, String> searchQuery = new Pair<String, String>(search, SearchService.LANGUAGE_FTS_ALFRESCO);

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


示例14: getXPathEscape

import org.alfresco.util.ISO9075; //导入依赖的package包/类
/**
 * The ISO9075 encoding class should be used to encode local names. This
 * method will encode all local names found in a path. For example
 * "/app:company_home/cm:My Space//*" will become
 * "/app:company_home/cm:My_x0020_Space//*"
 */
public static String getXPathEscape(String psToEncode) {
	StringBuilder sbResult = new StringBuilder(psToEncode.length());

	String sDelimiters = ":/_*";
	StringTokenizer T = new StringTokenizer(psToEncode, sDelimiters, true);

	while (T.hasMoreTokens()) {
		String sToken = T.nextToken();

		if (sDelimiters.contains(sToken))
			sbResult.append(sToken);
		else {
			sbResult.append(ISO9075.encode(sToken));
		}
	}

	String path = sbResult.toString();
	path = path.replaceAll("//","/");
	return path;
}
 
开发者ID:xenit-eu,项目名称:move2alf,代码行数:27,代码来源:WebServiceRepositoryAccessSession.java


示例15: createSiteQuery

import org.alfresco.util.ISO9075; //导入依赖的package包/类
protected Query createSiteQuery(String site) throws ParseException
{
    if(site.equals("_EVERYTHING_"))
    {
        return createTermQuery(FIELD_ISNODE, "T");
    }
    else if(site.equals("_ALL_SITES_"))
    {
        return getFieldQuery(FIELD_PATH, "/app:company_home/st:sites/*//*");
    }
    else if(site.equals("_REPOSITORY_"))
    {
        return createTermQuery(FIELD_ISNODE, "T");
    }
    else
    {
        return getFieldQuery(FIELD_PATH, "/app:company_home/st:sites/cm:" + ISO9075.encode(site)+"//*");
    }
    
    
   
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:23,代码来源:AbstractLuceneQueryParser.java


示例16: startProperty

import org.alfresco.util.ISO9075; //导入依赖的package包/类
public void startProperty(NodeRef nodeRef, QName property)
{
    try
    {
        QName encodedProperty = QName.createQName(property.getNamespaceURI(), ISO9075.encode(property.getLocalName()));
        contentHandler.startElement(encodedProperty.getNamespaceURI(), encodedProperty.getLocalName(), toPrefixString(encodedProperty), EMPTY_ATTRIBUTES);
    }
    catch (SAXException e)
    {
        throw new ExporterException("Failed to process start property event - nodeRef " + nodeRef + "; property " + toPrefixString(property), e);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:13,代码来源:ViewXMLExporter.java


示例17: endProperty

import org.alfresco.util.ISO9075; //导入依赖的package包/类
public void endProperty(NodeRef nodeRef, QName property)
{
    try
    {
        QName encodedProperty = QName.createQName(property.getNamespaceURI(), ISO9075.encode(property.getLocalName()));
        contentHandler.endElement(encodedProperty.getNamespaceURI(), encodedProperty.getLocalName(), toPrefixString(encodedProperty));
    }
    catch (SAXException e)
    {
        throw new ExporterException("Failed to process end property event - nodeRef " + nodeRef + "; property " + toPrefixString(property), e);
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:13,代码来源:ViewXMLExporter.java


示例18: evaluate

import org.alfresco.util.ISO9075; //导入依赖的package包/类
public Object evaluate(List nodes, Object obj, Object patternObj, Object includeFtsObj, Navigator nav)
{
    Object attribute = null;
    if (obj instanceof List)
    {
        List list = (List) obj;
        if (list.isEmpty())
        {
            return false;
        }
        // do not recurse: only first list should unwrap
        attribute = list.get(0);
    }
    if ((attribute == null) || !nav.isAttribute(attribute))
    {
        return false;
    }
    if (nodes.size() != 1)
    {
        return false;
    }
    if (!nav.isElement(nodes.get(0)))
    {
        return false;
    }
    ChildAssociationRef car = (ChildAssociationRef) nodes.get(0);
    String pattern = StringFunction.evaluate(patternObj, nav);
    boolean includeFts = BooleanFunction.evaluate(includeFtsObj, nav);
    QName qname = QName.createQName(nav.getAttributeNamespaceUri(attribute), ISO9075.decode(nav
            .getAttributeName(attribute)));

    DocumentNavigator dNav = (DocumentNavigator) nav;
    // JSR 170 includes full text matches
    return dNav.like(car.getChildRef(), qname, pattern, includeFts);

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


示例19: getAttributeQName

import org.alfresco.util.ISO9075; //导入依赖的package包/类
public String getAttributeQName(Object o)
{
    QName qName = ((Property) o).qname;
    String escapedLocalName = ISO9075.encode(qName.getLocalName());
    if (EqualsHelper.nullSafeEquals(escapedLocalName, qName.getLocalName()))        
    {
        return qName.toString();
    }
    else
    {
        return QName.createQName(qName.getNamespaceURI(), escapedLocalName).toString();
    }
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:14,代码来源:DocumentNavigator.java


示例20: getElementName

import org.alfresco.util.ISO9075; //导入依赖的package包/类
public String getElementName(Object o)
{
    QName qName = ((ChildAssociationRef) o).getQName();
    if(qName == null)
    {
        return "";
    }
    return ISO9075.encode(qName.getLocalName());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:10,代码来源:DocumentNavigator.java



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

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

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

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