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


Java ISO9075.encode方法代码示例

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


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

示例1: 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

示例2: 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

示例3: 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

示例4: getPathFromSpaceRef

import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
/**
 * Generate a search XPATH pointing to the specified node, optionally return an XPATH
 * that includes the child nodes.
 *  
 * @param ref         Of the node to generate path too
 * @param children   Whether to include children of the node
 * 
 * @return the path
 */
public static String getPathFromSpaceRef(NodeRef ref, boolean children)
{
   FacesContext context = FacesContext.getCurrentInstance();
   Path path = Repository.getServiceRegistry(context).getNodeService().getPath(ref);
   NamespaceService ns = Repository.getServiceRegistry(context).getNamespaceService();
   StringBuilder buf = new StringBuilder(64);
   for (int i=0; i<path.size(); i++)
   {
      String elementString = "";
      Path.Element element = path.get(i);
      if (element instanceof Path.ChildAssocElement)
      {
         ChildAssociationRef elementRef = ((Path.ChildAssocElement)element).getRef();
         if (elementRef.getParentRef() != null)
         {
            Collection<String> prefixes = ns.getPrefixes(elementRef.getQName().getNamespaceURI());
            if (prefixes.size() >0)
            {
               elementString = '/' + (String)prefixes.iterator().next() + ':' + ISO9075.encode(elementRef.getQName().getLocalName());
            }
         }
      }
      
      buf.append(elementString);
   }
   if (children == true)
   {
      // append syntax to get all children of the path
      buf.append("//*");
   }
   else
   {
      // append syntax to just represent the path, not the children
      buf.append("/*");
   }
   
   return buf.toString();
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:48,代码来源:SearchContext.java

示例5: getAttributeName

import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
public String getAttributeName(Object o)
{
    // Get the local name
    return ISO9075.encode(((Property) o).qname.getLocalName());
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:6,代码来源:DocumentNavigator.java

示例6: getUserSearchesRef

import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
/**
 * @return the cached reference to the shared Saved Searches folder
 */
protected NodeRef getUserSearchesRef()
{
   if (properties.getUserSearchesRef() == null)
   {
      NodeRef globalRef = getGlobalSearchesRef();
      if (globalRef != null)
      {
         FacesContext fc = FacesContext.getCurrentInstance();
         User user = Application.getCurrentUser(fc);
         String userName = ISO9075.encode(user.getUserName());
         String xpath = NamespaceService.APP_MODEL_PREFIX + ":" + QName.createValidLocalName(userName);
         
         List<NodeRef> results = null;
         try
         {
            results = getSearchService().selectNodes(
                  globalRef,
                  xpath,
                  null,
                  getNamespaceService(),
                  false);
         }
         catch (AccessDeniedException err)
         {
            // ignore and return null
         }
         
         if (results != null)
         {
            if (results.size() == 1)
            {
               properties.setUserSearchesRef(results.get(0));
            }
            else if (results.size() == 0 && new Node(globalRef).hasPermission(PermissionService.ADD_CHILDREN))
            {
               // attempt to create folder for this user for first time
               // create the preferences Node for this user
               ChildAssociationRef childRef = getNodeService().createNode(
                     globalRef,
                     ContentModel.ASSOC_CONTAINS,
                     QName.createQName(NamespaceService.APP_MODEL_1_0_URI, QName.createValidLocalName(user.getUserName())),
                     ContentModel.TYPE_FOLDER,
                     null);
               
               properties.setUserSearchesRef(childRef.getChildRef());
            }
         }
      }
   }
   
   return properties.getUserSearchesRef();
}
 
开发者ID:Alfresco,项目名称:community-edition-old,代码行数:56,代码来源:AdvancedSearchDialog.java

示例7: ISO9075Encode

import org.alfresco.util.ISO9075; //导入方法依赖的package包/类
/**
 * Encode a string to ISO9075 - used to build valid paths for Lucene queries etc.
 * 
 * @param s     Value to encode
 * 
 * @return encoded value
 */
public String ISO9075Encode(String s)
{
    return ISO9075.encode(s);
}
 
开发者ID:Alfresco,项目名称:alfresco-repository,代码行数:12,代码来源:Search.java


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