當前位置: 首頁>>代碼示例>>Java>>正文


Java QName.toPrefixString方法代碼示例

本文整理匯總了Java中org.alfresco.service.namespace.QName.toPrefixString方法的典型用法代碼示例。如果您正苦於以下問題:Java QName.toPrefixString方法的具體用法?Java QName.toPrefixString怎麽用?Java QName.toPrefixString使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在org.alfresco.service.namespace.QName的用法示例。


在下文中一共展示了QName.toPrefixString方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: addTypeTemplate

import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
private synchronized ChildAssociationRef addTypeTemplate(QName theType, String cp)
{
    NodeRefExpression templatesLocationExpr = virtualizationConfigTestBootstrap.getTypeTemplatesPath();
    NodeRef templatesLocation = templatesLocationExpr.resolve();

    assertNotNull(templatesLocation);

    final String prefixedType = theType.toPrefixString(environment.getNamespacePrefixResolver());
    String contentName = prefixedType;
    contentName = contentName.replaceAll(":", "_") + ".json";

    InputStream testTemplsteJsonIS = getClass().getResourceAsStream(cp);
    ChildAssociationRef templateContentChildRef = createContent(templatesLocation, contentName, testTemplsteJsonIS, "application/json", "UTF-8",
            ContentModel.TYPE_CONTENT);

    typeVirtualizationMethod.setQnameFilters(prefixedType);

    return templateContentChildRef;
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:20,代碼來源:TypeVirtualizationMethodIntegrationTest.java

示例2: getName

import org.alfresco.service.namespace.QName; //導入方法依賴的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: applyFTSDecorations

import org.alfresco.service.namespace.QName; //導入方法依賴的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

示例4: getCmisTypeId

import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
/**
 * Gets the CMIS Type Id given the Alfresco QName for the type in any
 * Alfresco model
 * 
 * @param scope BaseTypeId
 * @param typeQName QName
 * @return String
 */
public String getCmisTypeId(BaseTypeId scope, QName typeQName)
{
    String typeId = mapAlfrescoQNameToTypeId.get(typeQName);
    if (typeId == null)
    {
        String p = null;
        switch (scope)
        {
        case CMIS_DOCUMENT:
            p = "D";
            break;
        case CMIS_FOLDER:
            p = "F";
            break;
        case CMIS_RELATIONSHIP:
            p = "R";
            break;
        case CMIS_SECONDARY:
            p = "P";
            break;
        case CMIS_POLICY:
            p = "P";
            break;
        case CMIS_ITEM:
            p = "I";
            break;
        default:
            throw new CmisRuntimeException("Invalid base type!");
        }

        return p + ":" + typeQName.toPrefixString(namespaceService);
    } 
    else
    {
        return typeId;
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-data-model,代碼行數:46,代碼來源:CMISMapping.java

示例5: addVersionPropertiesToAuditMap

import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
private void addVersionPropertiesToAuditMap(Map<String, Serializable> auditMap,
        HashMap<String, Serializable> properties, boolean subAction)
{
    for (Map.Entry<String, Serializable> entry: properties.entrySet())
    {
        // The key may be the string version ({URI}localName) of a QName.
        // If so get the prefixed version.
        String key = entry.getKey();
        if (key.indexOf(QName.NAMESPACE_PREFIX) == 0)
        {
            try
            {
                QName qNameKey = QName.createQName(key);
                qNameKey = getPrefixedQName(qNameKey);
                key = qNameKey.toPrefixString();
            }
            catch (InvalidQNameException e)
            {
                // Its just a String.
            }
        }
        
        String name = replaceInvalidPathChars(key);
        auditMap.put(buildPath(VERSION_PROPERTIES, name), entry.getValue());
    }
    if (!subAction)
    {
        auditMap.put(VERSION_PROPERTIES, properties);
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:31,代碼來源:NodeChange.java

示例6: listNodeChildAssocs

import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
protected CollectionWithPagingInfo<Node> listNodeChildAssocs(List<ChildAssociationRef> childAssocRefs, Parameters parameters, Boolean isPrimary, boolean returnChild)
{
    Map<QName, String> qnameMap = new HashMap<>(3);

    Map<String, UserInfo> mapUserInfo = new HashMap<>(10);

    List<String> includeParam = parameters.getInclude();

    List<Node> collection = new ArrayList<Node>(childAssocRefs.size());
    for (ChildAssociationRef childAssocRef : childAssocRefs)
    {
        if (isPrimary == null || (isPrimary == childAssocRef.isPrimary()))
        {
            // minimal info by default (unless "include"d otherwise)
            NodeRef nodeRef = (returnChild ? childAssocRef.getChildRef() : childAssocRef.getParentRef());

            Node node = nodes.getFolderOrDocument(nodeRef, null, null, includeParam, mapUserInfo);

            QName assocTypeQName = childAssocRef.getTypeQName();

            if (!EXCLUDED_NS.contains(assocTypeQName.getNamespaceURI()))
            {
                String assocType = qnameMap.get(assocTypeQName);
                if (assocType == null)
                {
                    assocType = assocTypeQName.toPrefixString(namespaceService);
                    qnameMap.put(assocTypeQName, assocType);
                }

                node.setAssociation(new AssocChild(assocType, childAssocRef.isPrimary()));
                
                collection.add(node);
            }
        }
    }
    
    return listPage(collection, parameters.getPaging());
}
 
開發者ID:Alfresco,項目名稱:alfresco-remote-api,代碼行數:39,代碼來源:AbstractNodeRelation.java

示例7: convertQNameToName

import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
public static String convertQNameToName(QName name, NamespacePrefixResolver prefixResolver)
{
    // NOTE: Map names using old conversion scheme (i.e. : -> _) as well as new scheme (i.e. } -> _)
    String nameStr = name.toPrefixString(prefixResolver);
    if (nameStr.indexOf('_') != -1 && nameStr.indexOf('_') < nameStr.indexOf(':'))
    {
        // Return full QName string.
        return name.toString();
    }
    // Return prefixed QName string.
    return nameStr.replace(':', '_');
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:13,代碼來源:WorkflowQNameConverter.java

示例8: getParentNameAsString

import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
String getParentNameAsString(QName parentQName)
{
    if (parentQName != null)
    {
        return parentQName.toPrefixString();
    }
    return null;
}
 
開發者ID:Alfresco,項目名稱:alfresco-remote-api,代碼行數:9,代碼來源:AbstractClassModel.java

示例9: getMessageHandler

import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
/**
 * @param nodeRef           Target node
 * @return                  Handler that can process message addressed to specific node (target node).
 * @throws                  EmailMessageException is thrown if a suitable message handler isn't found.
 */
private EmailMessageHandler getMessageHandler(NodeRef nodeRef)
{
    ParameterCheck.mandatory("nodeRef", nodeRef);
    
    QName nodeTypeQName = nodeService.getType(nodeRef);
    String prefixedNodeTypeStr = nodeTypeQName.toPrefixString(namespaceService);
    EmailMessageHandler handler = emailMessageHandlerMap.get(prefixedNodeTypeStr);
    
    if( handler == null)
    {
        if(logger.isDebugEnabled())
        {
            logger.debug("did not find a handler for type:" + prefixedNodeTypeStr);
        }
        
        // not a direct match on type
        // need to check the super-types (if any) of the target node
        TypeDefinition typeDef = dictionaryService.getType(nodeTypeQName);
        while(typeDef != null)
        {
            QName parentName = typeDef.getParentName();
            if(parentName != null)
            {
                String prefixedSubTypeStr = parentName.toPrefixString(namespaceService);
                handler = emailMessageHandlerMap.get(prefixedSubTypeStr);
                if(handler != null)
                {
                    if(logger.isDebugEnabled())
                    {
                        logger.debug("found a handler for a subtype:" + prefixedSubTypeStr);
                    }
                    return handler;
                }
           } 
           typeDef = dictionaryService.getType(parentName); 
        }
         
    }
    
    if (handler == null)
    {
        throw new EmailMessageException(ERR_HANDLER_NOT_FOUND, prefixedNodeTypeStr);
    }
    return handler;
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:51,代碼來源:EmailServiceImpl.java

示例10: buildPrefixEncodedString

import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
public String buildPrefixEncodedString(QName qname)
{
    return qname.toPrefixString(namespaceService);
}
 
開發者ID:Alfresco,項目名稱:alfresco-data-model,代碼行數:5,代碼來源:CMISMapping.java

示例11: validateValue

import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
@Override
public void validateValue(String dataType, String value)
{
    ParameterCheck.mandatoryString("dataType", dataType);
    if (StringUtils.isEmpty(value))
    {
        return;
    }

    QName typeQName = QName.createQName(dataType, this.namespaceService);
    DataTypeDefinition typeDef = this.dictionaryService.getDataType(typeQName);
    if (typeDef == null)
    {
        throw new AlfrescoRuntimeException(MSG_DATA_TYPE_UNKNOWN, new Object[] { typeQName.toPrefixString() });
    }

    if (DataTypeDefinition.BOOLEAN.equals(typeQName))
    {
        checkBooleanValue(value);
    }
    else
    {
        try
        {
            DefaultTypeConverter.INSTANCE.convert(typeDef, value);
        }
        catch (Exception ex)
        {
            if (DataTypeDefinition.DATE.equals(typeQName))
            {
                throw new AlfrescoRuntimeException(MSG_INVALID_DATE, new Object[] { value });
            }
            if (DataTypeDefinition.DATETIME.equals(typeQName))
            {
                throw new AlfrescoRuntimeException(MSG_INVALID_DATETIME, new Object[] { value });
            }

            throw new AlfrescoRuntimeException(MSG_INVALID_VALUE, new Object[] { value, typeQName.toPrefixString() });
        }
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:42,代碼來源:ValueDataTypeValidatorImpl.java

示例12: getJsonQName

import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
private String getJsonQName(QName name)
{
    String nameString = name.toPrefixString(namespaceService);
    return nameString.replaceFirst(":", "_");
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:6,代碼來源:AlfrescoJsonSerializer.java

示例13: makePropDataKey

import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
private String makePropDataKey(QName propName)
{
    String propPrefixName = propName.toPrefixString(namespaceService);
    String dataKey = FormFieldConstants.PROP_DATA_PREFIX + propPrefixName.replace(':', '_');
    return dataKey;
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:7,代碼來源:ContentModelFormProcessor.java

示例14: extractTypeStringFromValue

import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
public String extractTypeStringFromValue(Object value)
{
   QName type = extractTypeFromValue(value);
   return type.toPrefixString(namespaceService);
}
 
開發者ID:Alfresco,項目名稱:alfresco-remote-api,代碼行數:6,代碼來源:RestVariableHelper.java

示例15: create

import org.alfresco.service.namespace.QName; //導入方法依賴的package包/類
public static ArchivedNodeState create(NodeRef archivedNode, ServiceRegistry serviceRegistry)
{
    ArchivedNodeState result = new ArchivedNodeState();
    
    NodeService nodeService = serviceRegistry.getNodeService();
    Map<QName, Serializable> properties = nodeService.getProperties(archivedNode);

    result.archivedNodeRef = archivedNode;
    result.archivedBy = (String) properties.get(ContentModel.PROP_ARCHIVED_BY);
    result.archivedDate = (Date) properties.get(ContentModel.PROP_ARCHIVED_DATE);
    result.name = (String) properties.get(ContentModel.PROP_NAME);
    result.title = (String) properties.get(ContentModel.PROP_TITLE);
    result.description = (String) properties.get(ContentModel.PROP_DESCRIPTION);
    QName type = nodeService.getType(archivedNode);
    result.isContentType = (type.equals(ContentModel.TYPE_CONTENT) || serviceRegistry.getDictionaryService().isSubClass(type, ContentModel.TYPE_CONTENT));
    result.nodeType = type.toPrefixString(serviceRegistry.getNamespaceService());

    PersonService personService = serviceRegistry.getPersonService();
    if (result.archivedBy != null && personService.personExists(result.archivedBy))
    {
        NodeRef personNodeRef = personService.getPerson(result.archivedBy, false);
        Map<QName, Serializable> personProps = nodeService.getProperties(personNodeRef);
        
        result.firstName = (String) personProps.get(ContentModel.PROP_FIRSTNAME);
        result.lastName = (String) personProps.get(ContentModel.PROP_LASTNAME);
    }
    
    ChildAssociationRef originalParentAssoc = (ChildAssociationRef) properties.get(ContentModel.PROP_ARCHIVED_ORIGINAL_PARENT_ASSOC);
    
    if (serviceRegistry.getPermissionService().hasPermission(originalParentAssoc.getParentRef(), PermissionService.READ).equals(AccessStatus.ALLOWED)
            && nodeService.exists(originalParentAssoc.getParentRef()))
    {
       result.displayPath = PathUtil.getDisplayPath(nodeService.getPath(originalParentAssoc.getParentRef()), true);
    }
    else
    {
       result.displayPath = "";
    }
    
    return result;
}
 
開發者ID:Alfresco,項目名稱:alfresco-remote-api,代碼行數:42,代碼來源:ArchivedNodeState.java


注:本文中的org.alfresco.service.namespace.QName.toPrefixString方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。