本文整理汇总了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);
}
}
示例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;
}
示例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();
}
示例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;
}
示例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;
}
}
示例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);
}
}
示例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;
}
示例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);
}
示例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!");
}
}
示例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;
}
示例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;
}
示例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;
}
示例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);
}
}
}
示例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);
}
}
示例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);
}