public final class CmsCmisUtil
extends java.lang.Object
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
addAction(java.util.Set<org.apache.chemistry.opencmis.commons.enums.Action> aas,
org.apache.chemistry.opencmis.commons.enums.Action action,
boolean condition)
Adds an action to a set of actions if a condition is fulfilled.
|
static void |
addDynamicProperties(CmsObject cms,
CmsCmisTypeManager typeManager,
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props,
java.lang.String typeId,
CmsResource resource,
java.util.Set<java.lang.String> filter)
Helper method to add the dynamic properties for a resource.
|
static void |
addPropertyBigInteger(CmsCmisTypeManager typeManager,
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props,
java.lang.String typeId,
java.util.Set<java.lang.String> filter,
java.lang.String id,
java.math.BigInteger value)
Adds bigint property to a PropertiesImpl.
|
static void |
addPropertyBoolean(CmsCmisTypeManager typeManager,
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props,
java.lang.String typeId,
java.util.Set<java.lang.String> filter,
java.lang.String id,
boolean value)
Adds a boolean property to a PropertiesImpl.
|
static void |
addPropertyDateTime(CmsCmisTypeManager typeManager,
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props,
java.lang.String typeId,
java.util.Set<java.lang.String> filter,
java.lang.String id,
java.util.GregorianCalendar value)
Adds a date/time property to a PropertiesImpl.
|
static boolean |
addPropertyDefault(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props,
org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?> propDef)
Adds the default value of property if defined.
|
static void |
addPropertyId(CmsCmisTypeManager typeManager,
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props,
java.lang.String typeId,
java.util.Set<java.lang.String> filter,
java.lang.String id,
java.lang.String value)
Helper method for adding an id-valued property.
|
static void |
addPropertyIdList(CmsCmisTypeManager typeManager,
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props,
java.lang.String typeId,
java.util.Set<java.lang.String> filter,
java.lang.String id,
java.util.List<java.lang.String> value)
Helper method for adding an id-list-valued property.
|
static void |
addPropertyInteger(CmsCmisTypeManager typeManager,
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props,
java.lang.String typeId,
java.util.Set<java.lang.String> filter,
java.lang.String id,
long value)
Adds an integer property to a PropertiesImpl.
|
static void |
addPropertyString(CmsCmisTypeManager typeManager,
org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props,
java.lang.String typeId,
java.util.Set<java.lang.String> filter,
java.lang.String id,
java.lang.String value)
Adds a string property to a PropertiesImpl.
|
static boolean |
checkAddProperty(CmsCmisTypeManager typeManager,
org.apache.chemistry.opencmis.commons.data.Properties properties,
java.lang.String typeId,
java.util.Set<java.lang.String> filter,
java.lang.String id)
Checks whether a property can be added to a Properties.
|
static void |
checkResourceName(java.lang.String name)
Checks whether a name is a valid OpenCms resource name and throws an exception otherwise.
|
static boolean |
ensureLock(CmsObject cms,
CmsResource resource)
Tries to lock a resource and throws an exception if it can't be locked.
|
static java.lang.String |
getAcePrincipalName(CmsObject cms,
CmsUUID principalId)
Gets a user-readable name for a principal id read from an ACE.
|
static java.util.List<java.lang.String> |
getCmisPermissions(CmsAccessControlEntry ace)
Converts an OpenCms ACE to a list of basic CMIS permissions.
|
static java.util.List<java.lang.String> |
getNativePermissions(CmsAccessControlEntry ace)
Converts an OpenCms access control entry to a list of CMIS permissions which represent native OpenCms permissions.
|
static java.util.List<java.lang.String> |
getNativePermissions(int permissionBits,
boolean denied)
Converts an OpenCms access control bitset to a list of CMIS permissions representing native OpenCms permissions.
|
static void |
handleCmsException(CmsException e)
Wrap OpenCms into OpenCMIS exceptions and rethrow them.
|
static boolean |
hasChildren(CmsObject cms,
CmsResource resource)
Checks whether the given resource has any children.
|
static java.util.GregorianCalendar |
millisToCalendar(long millis)
Converts milliseconds into a calendar object.
|
static java.util.Set<java.lang.String> |
splitFilter(java.lang.String filter)
Splits a filter statement into a collection of properties.
|
public static void addAction(java.util.Set<org.apache.chemistry.opencmis.commons.enums.Action> aas,
org.apache.chemistry.opencmis.commons.enums.Action action,
boolean condition)
aas - the set of actionsaction - the action to addcondition - the value of the condition for adding the actionpublic static void addDynamicProperties(CmsObject cms, CmsCmisTypeManager typeManager, org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props, java.lang.String typeId, CmsResource resource, java.util.Set<java.lang.String> filter)
cms - the current CMS contexttypeManager - the type manager instanceprops - the properties to which the dynamic properties should be addedtypeId - the type idresource - the resourcefilter - the property filterpublic static void addPropertyBigInteger(CmsCmisTypeManager typeManager, org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props, java.lang.String typeId, java.util.Set<java.lang.String> filter, java.lang.String id, java.math.BigInteger value)
typeManager - the type managerprops - the propertiestypeId - the type idfilter - the property filter stringid - the property idvalue - the property valuepublic static void addPropertyBoolean(CmsCmisTypeManager typeManager, org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props, java.lang.String typeId, java.util.Set<java.lang.String> filter, java.lang.String id, boolean value)
typeManager - props - the propertiestypeId - the type idfilter - the property filter stringid - the property idvalue - the property valuepublic static void addPropertyDateTime(CmsCmisTypeManager typeManager, org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props, java.lang.String typeId, java.util.Set<java.lang.String> filter, java.lang.String id, java.util.GregorianCalendar value)
typeManager - the type managerprops - the propertiestypeId - the type idfilter - the property filter stringid - the property idvalue - the property valuepublic static boolean addPropertyDefault(org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props,
org.apache.chemistry.opencmis.commons.definitions.PropertyDefinition<?> propDef)
props - the Properties objectpropDef - the property definitionpublic static void addPropertyId(CmsCmisTypeManager typeManager, org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props, java.lang.String typeId, java.util.Set<java.lang.String> filter, java.lang.String id, java.lang.String value)
typeManager - the type managerprops - the properties to add totypeId - the type idfilter - the property filterid - the property idvalue - the property valuepublic static void addPropertyIdList(CmsCmisTypeManager typeManager, org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props, java.lang.String typeId, java.util.Set<java.lang.String> filter, java.lang.String id, java.util.List<java.lang.String> value)
typeManager - props - the properties to add totypeId - the type idfilter - the property filterid - the property idvalue - the property valuepublic static void addPropertyInteger(CmsCmisTypeManager typeManager, org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props, java.lang.String typeId, java.util.Set<java.lang.String> filter, java.lang.String id, long value)
typeManager - the type managerprops - the propertiestypeId - the type idfilter - the property filter stringid - the property idvalue - the property valuepublic static void addPropertyString(CmsCmisTypeManager typeManager, org.apache.chemistry.opencmis.commons.impl.dataobjects.PropertiesImpl props, java.lang.String typeId, java.util.Set<java.lang.String> filter, java.lang.String id, java.lang.String value)
typeManager - props - the propertiestypeId - the type idfilter - the property filter stringid - the property idvalue - the property valuepublic static boolean checkAddProperty(CmsCmisTypeManager typeManager, org.apache.chemistry.opencmis.commons.data.Properties properties, java.lang.String typeId, java.util.Set<java.lang.String> filter, java.lang.String id)
typeManager - properties - the properties objecttypeId - the type idfilter - the property filterid - the property idpublic static void checkResourceName(java.lang.String name)
name - the name to checkpublic static boolean ensureLock(CmsObject cms, CmsResource resource) throws CmsException
Returns true only if the resource wasn't already locked before.
cms - the CMS contextresource - the resource to lockCmsException - if something goes wrongpublic static java.lang.String getAcePrincipalName(CmsObject cms, CmsUUID principalId)
cms - the current CMS contextprincipalId - the principal id from the ACEpublic static java.util.List<java.lang.String> getCmisPermissions(CmsAccessControlEntry ace)
ace - the access control entrypublic static java.util.List<java.lang.String> getNativePermissions(CmsAccessControlEntry ace)
ace - the access control entrypublic static java.util.List<java.lang.String> getNativePermissions(int permissionBits,
boolean denied)
permissionBits - the permission bitsdenied - if the permission bitset refers to a list of denied rather than allowed permissionspublic static void handleCmsException(CmsException e)
e - the exception to handlepublic static boolean hasChildren(CmsObject cms, CmsResource resource) throws CmsException
cms - the CMS contextresource - the resource to checkCmsException - if something goes wrongpublic static java.util.GregorianCalendar millisToCalendar(long millis)
millis - a time given in milliseconds after epochpublic static java.util.Set<java.lang.String> splitFilter(java.lang.String filter)
filter is null, empty or one of the properties
is '*' , an empty collection will be returned.filter - the filter string