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


Java CMISNodeInfo類代碼示例

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


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

示例1: getRenditions

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入依賴的package包/類
@Override
public List<RenditionData> getRenditions(String repositoryId, String objectId, String renditionFilter,
        BigInteger maxItems, BigInteger skipCount, ExtensionsData extension)
{
    checkRepositoryId(repositoryId);

    // what kind of object is it?
    CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object");

    if (info.isVariant(CMISObjectVariant.ASSOC))
    {
        return Collections.emptyList();
    }
    else
    {
        return connector.getRenditions(info.getNodeRef(), renditionFilter, maxItems, skipCount);
    }
}
 
開發者ID:Alfresco,項目名稱:community-edition-old,代碼行數:19,代碼來源:AlfrescoCmisServiceImpl.java

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

示例3: getValueInternal

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入依賴的package包/類
public Serializable getValueInternal(CMISNodeInfo nodeInfo)
{
    if (nodeInfo.isFolder())
    {
        return BaseTypeId.CMIS_FOLDER.value();
    } 
    else if (nodeInfo.isRelationship())
    {
        return BaseTypeId.CMIS_RELATIONSHIP.value();
    }
    else if(nodeInfo.isItem())
    {
    	return BaseTypeId.CMIS_ITEM.value();
    }

    return BaseTypeId.CMIS_DOCUMENT.value();
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:18,代碼來源:BaseTypeIdProperty.java

示例4: getValueInternal

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入依賴的package包/類
@Override
public Serializable getValueInternal(CMISNodeInfo nodeInfo)
{
    if (nodeInfo.getNodeRef() != null)
    {
        if (nodeInfo.isCurrentVersion())
        {
            return nodeInfo.getCurrentNodeNodeRef().toString();
        } else
        {
            return nodeInfo.getNodeRef().toString();
        }
    } else if (nodeInfo.getAssociationRef() != null)
    {
        return nodeInfo.getAssociationRef().toString();
    }

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

示例5: getContentData

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入依賴的package包/類
protected ContentData getContentData(CMISNodeInfo nodeInfo)
{
    if (!nodeInfo.isDocument())
    {
        return null;
    }

    if (nodeInfo.containsPropertyValue(CONTENT_PROPERTY))
    {
        return (ContentData) nodeInfo.getPropertyValue(CONTENT_PROPERTY);
    } else
    {
        ContentData contentData = null;

        Serializable value = nodeInfo.getNodeProps().get(ContentModel.PROP_CONTENT);

        if (value != null)
        {
            contentData = DefaultTypeConverter.INSTANCE.convert(ContentData.class, value);
        }

        nodeInfo.putPropertyValue(CONTENT_PROPERTY, contentData);
        return contentData;
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:26,代碼來源:AbstractProperty.java

示例6: getValueInternal

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入依賴的package包/類
public Serializable getValueInternal(CMISNodeInfo nodeInfo)
{
    if (!nodeInfo.hasPWC())
    {
        return null;
    }

    if (nodeInfo.isPWC())
    {
        return nodeInfo.getNodeProps().get(ContentModel.PROP_WORKING_COPY_OWNER);
    } else
    {
        return getServiceRegistry().getNodeService().getProperty(nodeInfo.getCurrentNodeNodeRef(),
                ContentModel.PROP_LOCK_OWNER);
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:17,代碼來源:VersionSeriesCheckedOutByProperty.java

示例7: getValueInternal

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入依賴的package包/類
@Override
public Serializable getValueInternal(CMISNodeInfo nodeInfo)
{
    if (nodeInfo.getNodeRef() != null)
    {
        return nodeInfo.getNodeProps().get(ContentModel.PROP_DESCRIPTION);
    }
    else if (nodeInfo.getAssociationRef() != null)
    {
        return getServiceRegistry().getNodeService().getProperty(
                nodeInfo.getAssociationRef().getSourceRef(),
                ContentModel.PROP_DESCRIPTION);
    }
    
    return null;
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:17,代碼來源:DescriptionProperty.java

示例8: isAllowed

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入依賴的package包/類
public boolean isAllowed(CMISNodeInfo nodeInfo)
{
    if(nodeInfo.hasPWC())
    {
        if(!nodeInfo.isPWC())
        {
            return nonCurrentVersionValue;
        }
    }
    else
    {
        if (!nodeInfo.isCurrentVersion())
        {
            return nonCurrentVersionValue;
        }
    }
    

    return currentVersionEvaluator == null ? currentVersionValue : currentVersionEvaluator.isAllowed(nodeInfo);
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:21,代碼來源:CurrentVersionEvaluator.java

示例9: checkChildObjectType

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入依賴的package包/類
/**
 * Checks if a child of a given type can be added to a given folder.
 */
@SuppressWarnings("unchecked")
public void checkChildObjectType(CMISNodeInfo folderInfo, String childType)
{
    TypeDefinitionWrapper targetType = folderInfo.getType();
    PropertyDefinitionWrapper allowableChildObjectTypeProperty = targetType
            .getPropertyById(PropertyIds.ALLOWED_CHILD_OBJECT_TYPE_IDS);
    List<String> childTypes = (List<String>) allowableChildObjectTypeProperty.getPropertyAccessor().getValue(
            folderInfo);

    if ((childTypes == null) || childTypes.isEmpty())
    {
        return;
    }

    if (!childTypes.contains(childType))
    {
        throw new CmisConstraintException("Objects of type '" + childType + "' cannot be added to this folder!");
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:23,代碼來源:CMISConnector.java

示例10: getNodeProperties

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入依賴的package包/類
public Properties getNodeProperties(CMISNodeInfo info, String filter)
{
    PropertiesImpl result = new PropertiesImpl();

    Set<String> filterSet = splitFilter(filter);

    for (PropertyDefinitionWrapper propDef : info.getType().getProperties())
    {
        if (!propDef.getPropertyId().equals(PropertyIds.OBJECT_ID))
        {
            // don't filter the object id
            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));
    }

    addAspectProperties(info, filter, result);

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

示例11: getAssocProperties

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入依賴的package包/類
public Properties getAssocProperties(CMISNodeInfo info, String filter)
{
    PropertiesImpl result = new PropertiesImpl();

    Set<String> filterSet = splitFilter(filter);

    for (PropertyDefinitionWrapper propDefWrap : info.getType().getProperties())
    {
        PropertyDefinition<?> propDef = propDefWrap.getPropertyDefinition();
        if ((filterSet != null) && (!filterSet.contains(propDef.getQueryName())))
        {
            // skip properties that are not in the filter
            continue;
        }

        CMISPropertyAccessor cmisPropertyAccessor = propDefWrap.getPropertyAccessor();
        Serializable value = cmisPropertyAccessor.getValue(info);
        PropertyType propType = propDef.getPropertyType();
        PropertyData<?> propertyData = getProperty(propType, propDefWrap, value);
        result.addProperty(propertyData);
    }

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

示例12: getAllowableActions

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入依賴的package包/類
public AllowableActions getAllowableActions(CMISNodeInfo info)
{
    AllowableActionsImpl result = new AllowableActionsImpl();
    Set<Action> allowableActions = new HashSet<Action>();
    result.setAllowableActions(allowableActions);

    for (CMISActionEvaluator evaluator : info.getType().getActionEvaluators().values())
    {
        if (evaluator.isAllowed(info))
        {
            allowableActions.add(evaluator.getAction());
        }
    }

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

示例13: update

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入依賴的package包/類
public void update()
{
    String objectId = objectIdAndChangeToken.getId();
    final CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object");

    if (!info.isVariant(CMISObjectVariant.ASSOC) && !info.isVariant(CMISObjectVariant.VERSION))
    {
        final NodeRef nodeRef = info.getNodeRef();

        connector.setProperties(nodeRef, info.getType(), properties, new String[0]);

        if (isObjectInfoRequired)
        {
            getObjectInfo(repositoryId, objectId, "*", IncludeRelationships.NONE);
        }

        connector.addSecondaryTypes(nodeRef, addSecondaryTypeIds);
        connector.removeSecondaryTypes(nodeRef, removeSecondaryTypeIds);

        if (properties.getProperties().size() > 0 || addSecondaryTypeIds.size() > 0 || removeSecondaryTypeIds.size() > 0)
        {
            bulkUpdateContext.success(info);
        }
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:26,代碼來源:AlfrescoCmisServiceImpl.java

示例14: getProperties

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入依賴的package包/類
@Override
public Properties getProperties(String repositoryId, String objectId, String filter, ExtensionsData extension)
{
    checkRepositoryId(repositoryId);

    // what kind of object is it?
    CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object");

	boolean isObjectInfoRequired = getContext().isObjectInfoRequired();
    if (isObjectInfoRequired)
    {
        getObjectInfo(repositoryId, info.getObjectId(), IncludeRelationships.NONE);
    }

    if (info.isVariant(CMISObjectVariant.ASSOC))
    {
        return connector.getAssocProperties(info, filter);
    }
    else
    {
        return connector.getNodeProperties(info, filter);
    }
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:24,代碼來源:AlfrescoCmisServiceImpl.java

示例15: getContentStream

import org.alfresco.opencmis.dictionary.CMISNodeInfo; //導入依賴的package包/類
@Override
public ContentStream getContentStream(
        String repositoryId, String objectId, String streamId, BigInteger offset,
        BigInteger length, ExtensionsData extension)
{
    checkRepositoryId(repositoryId);

    // what kind of object is it?
    CMISNodeInfo info = getOrCreateNodeInfo(objectId, "Object");

    // relationships cannot have content
    if (info.isVariant(CMISObjectVariant.ASSOC))
    {
        throw new CmisInvalidArgumentException("Object is a relationship and cannot have content!");
    }

    // now get it
    return connector.getContentStream(info, streamId, offset, length);
}
 
開發者ID:Alfresco,項目名稱:alfresco-repository,代碼行數:20,代碼來源:AlfrescoCmisServiceImpl.java


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