public class CmsCmisRelationHelper extends java.lang.Object implements I_CmsCmisObjectHelper
Since CMIS requires any object to have an ID by which it is accessed, but OpenCms relations are not addressable by ids, we invent an artificial relation id string of the form REL_(SOURCE_ID)_(TARGET_ID)_(TYPE).
Modifier and Type | Class and Description |
---|---|
static class |
CmsCmisRelationHelper.RelationKey
A class which contains the necessary information to identify a relation object.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
RELATION_ID_PREFIX
The prefix used to identify relation ids.
|
static java.util.regex.Pattern |
RELATION_PATTERN
The pattern which relation ids should match.
|
Constructor and Description |
---|
CmsCmisRelationHelper(CmsCmisRepository repository)
Creates a new relation helper for the given repository.
|
Modifier and Type | Method and Description |
---|---|
protected org.apache.chemistry.opencmis.commons.data.Acl |
collectAcl(CmsObject cms,
CmsResource resource,
boolean onlyBasic)
Compiles the ACL for a relation.
|
protected org.apache.chemistry.opencmis.commons.data.AllowableActions |
collectAllowableActions(CmsObject cms,
CmsResource file,
CmsRelation relation)
Collects the allowable actions for a relation.
|
protected org.apache.chemistry.opencmis.commons.data.ObjectData |
collectObjectData(CmsCmisCallContext context,
CmsObject cms,
CmsResource resource,
CmsRelation relation,
java.util.Set<java.lang.String> filter,
boolean includeAllowableActions,
boolean includeAcl)
Fills in an ObjectData record.
|
protected org.apache.chemistry.opencmis.commons.data.Properties |
collectProperties(CmsObject cms,
CmsResource resource,
CmsRelation relation,
java.util.Set<java.lang.String> orgfilter,
org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl objectInfo)
Gathers all base properties of a file or folder.
|
protected static java.lang.String |
createKey(CmsUUID source,
CmsUUID target,
java.lang.String relType)
Creates a relation id string from the source and target ids and a relation type.
|
protected java.lang.String |
createReadableName(CmsRelation relation)
Creates a user-readable name from the given relation object.
|
void |
deleteObject(CmsCmisCallContext context,
java.lang.String objectId,
boolean allVersions)
Deletes a CMIS object.
|
org.apache.chemistry.opencmis.commons.data.Acl |
getAcl(CmsCmisCallContext context,
java.lang.String objectId,
boolean onlyBasicPermissions)
Gets the ACL for an object.
|
org.apache.chemistry.opencmis.commons.data.AllowableActions |
getAllowableActions(CmsCmisCallContext context,
java.lang.String objectId)
Gets the allowable actions for an object.
|
org.apache.chemistry.opencmis.commons.data.ObjectData |
getObject(CmsCmisCallContext context,
java.lang.String objectId,
java.lang.String filter,
boolean includeAllowableActions,
org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships,
java.lang.String renditionFilter,
boolean includePolicyIds,
boolean includeAcl)
Gets the data for a CMIS object.
|
protected static CmsRelationType |
getRelationType(java.lang.String typeName)
Gets a relation type by name.
|
protected CmsCmisRelationHelper.RelationKey |
parseRelationKey(java.lang.String id)
Extracts the source/target ids and the type from a relation id.
|
public static final java.lang.String RELATION_ID_PREFIX
public static final java.util.regex.Pattern RELATION_PATTERN
public CmsCmisRelationHelper(CmsCmisRepository repository)
repository
- the repositoryprotected org.apache.chemistry.opencmis.commons.data.Acl collectAcl(CmsObject cms, CmsResource resource, boolean onlyBasic)
cms
- the CMS contextresource
- the resource for which to collect the ACLsonlyBasic
- flag to only include basic ACEsprotected org.apache.chemistry.opencmis.commons.data.AllowableActions collectAllowableActions(CmsObject cms, CmsResource file, CmsRelation relation)
cms
- the current CMS contextfile
- the source of the relationrelation
- the relation objectprotected org.apache.chemistry.opencmis.commons.data.ObjectData collectObjectData(CmsCmisCallContext context, CmsObject cms, CmsResource resource, CmsRelation relation, java.util.Set<java.lang.String> filter, boolean includeAllowableActions, boolean includeAcl)
context
- the call contextcms
- the CMS contextresource
- the resource for which we want the ObjectDatarelation
- the relation objectfilter
- the property filter stringincludeAllowableActions
- true if the allowable actions should be includedincludeAcl
- true if the ACL entries should be includedprotected org.apache.chemistry.opencmis.commons.data.Properties collectProperties(CmsObject cms, CmsResource resource, CmsRelation relation, java.util.Set<java.lang.String> orgfilter, org.apache.chemistry.opencmis.commons.impl.server.ObjectInfoImpl objectInfo)
cms
- the current CMS contextresource
- the file for which we want the propertiesrelation
- the relation objectorgfilter
- the property filterobjectInfo
- the object info handlerprotected static java.lang.String createKey(CmsUUID source, CmsUUID target, java.lang.String relType)
source
- the source idtarget
- the target idrelType
- the relation typeprotected java.lang.String createReadableName(CmsRelation relation)
relation
- the relation objectpublic void deleteObject(CmsCmisCallContext context, java.lang.String objectId, boolean allVersions)
I_CmsCmisObjectHelper
deleteObject
in interface I_CmsCmisObjectHelper
context
- the call contextobjectId
- the id of the object to deleteallVersions
- flag to delete all versionI_CmsCmisObjectHelper.deleteObject(org.opencms.cmis.CmsCmisCallContext, java.lang.String, boolean)
public org.apache.chemistry.opencmis.commons.data.Acl getAcl(CmsCmisCallContext context, java.lang.String objectId, boolean onlyBasicPermissions)
I_CmsCmisObjectHelper
getAcl
in interface I_CmsCmisObjectHelper
context
- the call contextobjectId
- the object idonlyBasicPermissions
- flag to only get basic permissionsI_CmsCmisObjectHelper.getAcl(org.opencms.cmis.CmsCmisCallContext, java.lang.String, boolean)
public org.apache.chemistry.opencmis.commons.data.AllowableActions getAllowableActions(CmsCmisCallContext context, java.lang.String objectId)
I_CmsCmisObjectHelper
getAllowableActions
in interface I_CmsCmisObjectHelper
context
- the call contextobjectId
- the object idI_CmsCmisObjectHelper.getAllowableActions(org.opencms.cmis.CmsCmisCallContext, java.lang.String)
public org.apache.chemistry.opencmis.commons.data.ObjectData getObject(CmsCmisCallContext context, java.lang.String objectId, java.lang.String filter, boolean includeAllowableActions, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships includeRelationships, java.lang.String renditionFilter, boolean includePolicyIds, boolean includeAcl)
I_CmsCmisObjectHelper
getObject
in interface I_CmsCmisObjectHelper
context
- the CMIS call contextobjectId
- the id of the objectfilter
- the property filterincludeAllowableActions
- flag to include allowable actionsincludeRelationships
- flag to include relationshipsrenditionFilter
- the rendition filter stringincludePolicyIds
- flag to include policy idsincludeAcl
- flag to include ACLsI_CmsCmisObjectHelper.getObject(org.opencms.cmis.CmsCmisCallContext, java.lang.String, java.lang.String, boolean, org.apache.chemistry.opencmis.commons.enums.IncludeRelationships, java.lang.String, boolean, boolean)
protected static CmsRelationType getRelationType(java.lang.String typeName)
typeName
- the relation type nameprotected CmsCmisRelationHelper.RelationKey parseRelationKey(java.lang.String id)
id
- the relation id