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


Java CMISNodeInfo.getNodeAspects方法代碼示例

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


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

示例1: getValueInternal

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入方法依賴的package包/類
@Override
public Serializable getValueInternal(CMISNodeInfo nodeInfo)
{
    NodeRef nodeRef = nodeInfo.getNodeRef();

    if(nodeRef == null || nodeInfo.getType() == null)
    {
    	// If the nodeRef or type is null, we can't handle it so return an empty list	
    	return (Serializable) Collections.emptyList();
    }

    Set<QName> aspects = nodeInfo.getNodeAspects();
    ArrayList<String> results = new ArrayList<String>(aspects.size());
    for (QName aspect : aspects)
    {
    	String typeId = cmisMapping.getCmisTypeId(aspect);
    	if (typeId != null)
    	{
    		results.add(typeId);
    	}
    }
    return results;
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:24,代碼來源:SecondaryTypesProperty.java

示例2: addAspectProperties

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入方法依賴的package包/類
private void addAspectProperties(CMISNodeInfo info, String filter, PropertiesImpl result)
{
    if (getRequestCmisVersion().equals(CmisVersion.CMIS_1_1))
    {
        Set<String> propertyIds = new HashSet<>();
        Set<String> filterSet = splitFilter(filter);

        Set<QName> aspects = info.getNodeAspects();
        for (QName aspect : aspects)
        {
            TypeDefinitionWrapper aspectType = getOpenCMISDictionaryService().findNodeType(aspect);
            if (aspectType == null)
            {
                continue;
            }

            for (PropertyDefinitionWrapper propDef : aspectType.getProperties())
            {
                if (propertyIds.contains(propDef.getPropertyId()))
                {
                    // skip properties that have already been added
                    continue;
                }

                if ((filterSet != null) && (!filterSet.contains(propDef.getPropertyDefinition().getQueryName())))
                {
                    // skip properties that are not in the filter
                    continue;
                }

                Serializable value = propDef.getPropertyAccessor().getValue(info);
                result.addProperty(getProperty(propDef.getPropertyDefinition().getPropertyType(), propDef, value));

                // mark property as 'added'
                propertyIds.add(propDef.getPropertyId());
            }
        }
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:40,代碼來源:CMISConnector.java

示例3: getAspectExtensions

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入方法依賴的package包/類
/**
 * Builds aspect extension.
 */
public List<CmisExtensionElement> getAspectExtensions(CMISNodeInfo info, String filter, Set<String> alreadySetProperties)
{
    List<CmisExtensionElement> extensions = new ArrayList<CmisExtensionElement>();
    Set<String> propertyIds = new HashSet<String>(alreadySetProperties);
    List<CmisExtensionElement> propertyExtensionList = new ArrayList<CmisExtensionElement>();
    Set<String> filterSet = splitFilter(filter);

    Set<QName> aspects = info.getNodeAspects();
    for (QName aspect : aspects)
    {
        TypeDefinitionWrapper aspectType = getOpenCMISDictionaryService().findNodeType(aspect);
        if (aspectType == null)
        {
            continue;
        }

        AspectDefinition aspectDefinition = dictionaryService.getAspect(aspect);
        Map<QName, org.alfresco.service.cmr.dictionary.PropertyDefinition> aspectProperties = aspectDefinition.getProperties();

        extensions.add(new CmisExtensionElementImpl(ALFRESCO_EXTENSION_NAMESPACE, APPLIED_ASPECTS, null, aspectType
                .getTypeId()));

        for (PropertyDefinitionWrapper propDef : aspectType.getProperties())
        {
            boolean addPropertyToExtensionList = getRequestCmisVersion().equals(CmisVersion.CMIS_1_1) && aspectProperties.keySet().contains(propDef.getAlfrescoName());
            // MNT-11876 : add property to extension even if it has been returned (CMIS 1.1)
            if (propertyIds.contains(propDef.getPropertyId()) && !addPropertyToExtensionList)
            {
                // skip properties that have already been added
                continue;
            }

            if ((filterSet != null) && (!filterSet.contains(propDef.getPropertyDefinition().getQueryName())))
            {
                // skip properties that are not in the filter
                continue;
            }

            Serializable value = propDef.getPropertyAccessor().getValue(info);
            propertyExtensionList.add(createAspectPropertyExtension(propDef.getPropertyDefinition(), value));

            // mark property as 'added'
            propertyIds.add(propDef.getPropertyId());
        }
    }

    if (!propertyExtensionList.isEmpty())
    {
        CmisExtensionElementImpl propertiesExtension = new CmisExtensionElementImpl(
                ALFRESCO_EXTENSION_NAMESPACE, "properties", null, propertyExtensionList);
        extensions.addAll(Collections.singletonList(propertiesExtension));
    }

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


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