|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Objectorg.opencms.cmis.CmsCmisUtil
public final class CmsCmisUtil
Utility class for operations which are frequently used by CMIS service methods.
| Method Summary | |
|---|---|
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. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Method Detail |
|---|
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 action
public 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 filter
public 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 value
public 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 value
public 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 value
public 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 definition
public 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 value
public 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 value
public 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 value
public 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 value
public 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 id
public static void checkResourceName(java.lang.String name)
name - the name to check
public 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 lock
CmsException - if something goes wrong
public static java.lang.String getAcePrincipalName(CmsObject cms,
CmsUUID principalId)
cms - the current CMS contextprincipalId - the principal id from the ACE
public static java.util.List<java.lang.String> getCmisPermissions(CmsAccessControlEntry ace)
ace - the access control entry
public static java.util.List<java.lang.String> getNativePermissions(CmsAccessControlEntry ace)
ace - the access control entry
public 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 permissions
public static void handleCmsException(CmsException e)
e - the exception to handle
public static boolean hasChildren(CmsObject cms,
CmsResource resource)
throws CmsException
cms - the CMS contextresource - the resource to check
CmsException - if something goes wrongpublic static java.util.GregorianCalendar millisToCalendar(long millis)
millis - a time given in milliseconds after epoch
public 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
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||