Package org.alfresco.cmis.client.impl
Class AlfrescoUtils
java.lang.Object
org.alfresco.cmis.client.impl.AlfrescoUtils
-
Field Summary
Fields -
Method Summary
Modifier and TypeMethodDescriptionstatic <T> List<T>checkProperty(org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<T> propertyDefinition, Object value) Checks a property value.static org.apache.chemistry.opencmis.commons.data.CmisExtensionElementcreateAspectPropertiesExtension(List<org.apache.chemistry.opencmis.commons.data.CmisExtensionElement> propertiesChildren) Creates an aspectsToAdd extension element.static org.apache.chemistry.opencmis.commons.data.CmisExtensionElementcreateAspectPropertyExtension(org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?> propertyDefinition, Object value) Creates a property extension element.static org.apache.chemistry.opencmis.commons.data.CmisExtensionElementcreateAspectsToAddExtension(org.apache.chemistry.opencmis.client.api.ObjectType aspectType) Creates an aspectsToAdd extension element.static org.apache.chemistry.opencmis.commons.data.CmisExtensionElementcreateAspectsToRemoveExtension(org.apache.chemistry.opencmis.client.api.ObjectType aspectType) Creates an aspectsToRemove extension element.static StringcreateObjectTypeIdValue(org.apache.chemistry.opencmis.client.api.ObjectType type, Collection<org.apache.chemistry.opencmis.client.api.ObjectType> aspectTypes) static org.apache.chemistry.opencmis.commons.data.CmisExtensionElementcreateSetAspectsExtension(List<org.apache.chemistry.opencmis.commons.data.CmisExtensionElement> setAspectsChildren) Creates a setAspects extension element.static List<org.apache.chemistry.opencmis.commons.data.CmisExtensionElement>findAlfrescoExtensions(List<org.apache.chemistry.opencmis.commons.data.CmisExtensionElement> extensions) Finds the Alfresco extensions within the given extensions.static org.apache.chemistry.opencmis.client.api.ObjectTypefindAspect(Collection<org.apache.chemistry.opencmis.client.api.ObjectType> aspectTypes, String propertyId) Finds the aspect type that contains the given property id.static Collection<org.apache.chemistry.opencmis.client.api.ObjectType>getAspectTypes(org.apache.chemistry.opencmis.client.api.Session session, List<org.apache.chemistry.opencmis.commons.data.CmisExtensionElement> alfrescoExtensions) Returns the aspect types from the Alfresco extensions.getMandatoryAspects(org.apache.chemistry.opencmis.commons.data.ExtensionsData object) preparePropertiesForUpdate(Map<String, ?> properties, org.apache.chemistry.opencmis.client.api.ObjectType type, Collection<org.apache.chemistry.opencmis.client.api.ObjectType> aspectTypes) Adds object type and aspect types to properties.static StringupdateAspects(org.apache.chemistry.opencmis.client.api.Session session, org.apache.chemistry.opencmis.client.api.CmisObject object, org.apache.chemistry.opencmis.client.api.ObjectType[] addAspectIds, org.apache.chemistry.opencmis.client.api.ObjectType[] removeAspectIds, Map<String, ?> properties) Adds and removes aspects.
-
Field Details
-
ALFRESCO_NAMESPACE
- See Also:
-
CMIS_NAMESPACE
- See Also:
-
APPLIED_ASPECTS
- See Also:
-
SET_ASPECTS
- See Also:
-
ASPECTS_TO_ADD
- See Also:
-
ASPECTS_TO_REMOVE
- See Also:
-
PROPERTIES
- See Also:
-
MANDATORY_ASPECTS
- See Also:
-
MANDATORY_ASPECT
- See Also:
-
-
Method Details
-
findAlfrescoExtensions
public static List<org.apache.chemistry.opencmis.commons.data.CmisExtensionElement> findAlfrescoExtensions(List<org.apache.chemistry.opencmis.commons.data.CmisExtensionElement> extensions) Finds the Alfresco extensions within the given extensions.- Parameters:
extensions- List of extensions (List<CmisExtensionElement>)- Returns:
- The Alfresco extensions
-
getAspectTypes
public static Collection<org.apache.chemistry.opencmis.client.api.ObjectType> getAspectTypes(org.apache.chemistry.opencmis.client.api.Session session, List<org.apache.chemistry.opencmis.commons.data.CmisExtensionElement> alfrescoExtensions) Returns the aspect types from the Alfresco extensions.- Parameters:
session- sessionalfrescoExtensions- List of Alfesco extensions- Returns:
- A collection of
aspectTypes
-
findAspect
public static org.apache.chemistry.opencmis.client.api.ObjectType findAspect(Collection<org.apache.chemistry.opencmis.client.api.ObjectType> aspectTypes, String propertyId) Finds the aspect type that contains the given property id.- Parameters:
aspectTypes- The aspects to searchpropertyId- The desired property ID of the aspect.- Returns:
- The
ObjectTypeof the aspect if found, otherwise returnsnull
-
createSetAspectsExtension
public static org.apache.chemistry.opencmis.commons.data.CmisExtensionElement createSetAspectsExtension(List<org.apache.chemistry.opencmis.commons.data.CmisExtensionElement> setAspectsChildren) Creates a setAspects extension element.- Parameters:
setAspectsChildren- children- Returns:
- setAspects extension element
-
createAspectsToAddExtension
public static org.apache.chemistry.opencmis.commons.data.CmisExtensionElement createAspectsToAddExtension(org.apache.chemistry.opencmis.client.api.ObjectType aspectType) Creates an aspectsToAdd extension element.- Parameters:
aspectType- aspect type- Returns:
- new aspectsToAdd extension element
-
createAspectsToRemoveExtension
public static org.apache.chemistry.opencmis.commons.data.CmisExtensionElement createAspectsToRemoveExtension(org.apache.chemistry.opencmis.client.api.ObjectType aspectType) Creates an aspectsToRemove extension element.- Parameters:
aspectType- aspect type- Returns:
- new aspectsToRemove extension element
-
createAspectPropertiesExtension
public static org.apache.chemistry.opencmis.commons.data.CmisExtensionElement createAspectPropertiesExtension(List<org.apache.chemistry.opencmis.commons.data.CmisExtensionElement> propertiesChildren) Creates an aspectsToAdd extension element.- Parameters:
propertiesChildren- children- Returns:
- new aspectsToAdd extension element
-
createAspectPropertyExtension
public static org.apache.chemistry.opencmis.commons.data.CmisExtensionElement createAspectPropertyExtension(org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?> propertyDefinition, Object value) Creates a property extension element.- Parameters:
propertyDefinition- propertyDefinitionvalue- value- Returns:
- new property extension element
-
checkProperty
public static <T> List<T> checkProperty(org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<T> propertyDefinition, Object value) Checks a property value.- Type Parameters:
T- Todo: provide definition- Parameters:
propertyDefinition- propertyDefinitionvalue- value- Returns:
- List
-
preparePropertiesForUpdate
public static Map<String,?> preparePropertiesForUpdate(Map<String, ?> properties, org.apache.chemistry.opencmis.client.api.ObjectType type, Collection<org.apache.chemistry.opencmis.client.api.ObjectType> aspectTypes) Adds object type and aspect types to properties.- Parameters:
properties- Properites to be added totype- the object tyoeaspectTypes- collection of aspect types- Returns:
- The properties list with the new object and aspect types
-
createObjectTypeIdValue
public static String createObjectTypeIdValue(org.apache.chemistry.opencmis.client.api.ObjectType type, Collection<org.apache.chemistry.opencmis.client.api.ObjectType> aspectTypes) -
updateAspects
public static String updateAspects(org.apache.chemistry.opencmis.client.api.Session session, org.apache.chemistry.opencmis.client.api.CmisObject object, org.apache.chemistry.opencmis.client.api.ObjectType[] addAspectIds, org.apache.chemistry.opencmis.client.api.ObjectType[] removeAspectIds, Map<String, ?> properties) Adds and removes aspects.- Parameters:
session- sessionobject- objectaddAspectIds- The aspect IDs to addremoveAspectIds- The aspect IDs to removeproperties- properties- Returns:
- Object ID
-
getMandatoryAspects
-