it.sistematica.isharedoc.opencmis.indatabase.storedobj.api
Interface StoredObject

All Known Subinterfaces:
Document, DocumentVersion, Folder, VersionedDocument
All Known Implementing Classes:
AbstractMultiFilingImpl, AbstractSingleFilingImpl, DocumentVersionImpl, FolderImpl, ItemImpl, PolicyImpl, RelationshipImpl, StoredObjectImpl, VersionedDocumentImpl

public interface StoredObject

Stored Object interface is common part that all objects handled by CMIS (Documents, Folders, Relations, Policies, ACLs) share. Objects that implement this interface are always concrete and can live in the object store. A stored object always has an id, a name and properties.

Author:
Jens

Method Summary
 org.apache.chemistry.opencmis.commons.data.Acl addAcl(org.apache.chemistry.opencmis.commons.data.Acl acl)
          Add the Acl to the stored object
 void addAppliedPolicy(java.lang.String policyId)
          add an id of a policy to an object
 void createSystemBasePropertiesWhenCreated(java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> properties, java.lang.String user)
          Create all system base properties that need to be stored with every object in the repository This method is called when a new object is created to record all of the capturing data like the creation time, creator etc.
 void fillProperties(java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> properties, org.apache.chemistry.opencmis.commons.spi.BindingsObjectFactory objFactory, java.util.List<java.lang.String> requestedIds)
           
 org.apache.chemistry.opencmis.commons.data.Acl getAcl()
          get the Acl of the stored object
 org.apache.chemistry.opencmis.commons.data.AllowableActions getAllowableActions(java.lang.String user)
           
 java.util.List<java.lang.String> getAppliedPolicies()
          get applied policies of this object
 java.lang.String getChangeToken()
          Retrieve a change token uniquely identifying the state of the object when it was persisted (used for optimistic locking)
 java.util.GregorianCalendar getCreatedAt()
           
 java.lang.String getCreatedBy()
          Retrieve the user who created the document
 java.lang.String getDescription()
          CMIS 1.1: get description of an object
 java.lang.String getId()
          Retrieve the id of this object.
 java.util.GregorianCalendar getModifiedAt()
          Retrieve date and time when the object was last modified.
 java.lang.String getModifiedBy()
          Retrieve the user who last modified the document
 java.lang.String getName()
          Retrieve the name of this object
 File getNativeObject()
          Retrieve the native object.
 java.util.List<StoredObject> getObjectRelationships(org.apache.chemistry.opencmis.commons.enums.RelationshipDirection relationshipDirection, java.lang.String user)
          get the relationships of the object
 java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> getProperties()
          Retrieve the list of properties
 org.apache.chemistry.opencmis.commons.data.ContentStream getRenditionContent(java.lang.String streamId, long offset, long length)
          get the rendition of this object
 java.util.List<org.apache.chemistry.opencmis.commons.data.RenditionData> getRenditions(java.lang.String renditionFilter, long maxItems, long skipCount)
          get the rendition this objects supports
 java.lang.String getRepositoryId()
          Get the repository id of this object where the object is stored.
 java.util.List<java.lang.String> getSecondaryTypeIds()
          CMIS 1.1 get ids of all secondary types
 java.lang.String getTypeId()
          Retrieve the type of this document.
 boolean hasRendition(java.lang.String user)
          check if the document can generate a renditions and rendition is visible for user
 void persist()
          Persist the object so that it can be later retrieved by its id.
 void removeAcl(org.apache.chemistry.opencmis.commons.data.Acl acl)
          Remove the Acl from the stored object
 void removePolicy(java.lang.String policyId)
          remove an id of a policy from an object
 void rename(java.lang.String newName)
          Rename an object
 void setCreatedAt(java.util.GregorianCalendar createdAt)
          Assign date and time when the object was created.
 void setCreatedBy(java.lang.String createdBy)
          Set the user who last modified the object.
 void setCustomProperties(java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> properties)
          Set all properties which are not system properties.
 void setDescription(java.lang.String description)
          CMIS 1.1: set description of an object
 void setModifiedAtNow()
          Assign current date and time when the object was last modified.
 void setModifiedBy(java.lang.String modifiedBy)
          Set the user who last modified the object.
 void setName(java.lang.String name)
          Set the name of this document.
 void setNativeObject(File nobj)
          Set the native object.
 void setProperties(java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> props)
          Assign the properties to an object.
 void setRepositoryId(java.lang.String repositoryId)
          Assign a repository where this object will be stored.
 void setTypeId(java.lang.String type)
          Set the type of this document.
 void updateSystemBasePropertiesWhenModified(java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> properties, java.lang.String user)
          Update all system base properties that need to be stored with every object in the repository This method is called when an object is is updated to record all of the capturing data like the modification time, updating user etc.
 

Method Detail

getNativeObject

File getNativeObject()
Retrieve the native object.

Returns:
native object

setNativeObject

void setNativeObject(File nobj)
Set the native object.


getId

java.lang.String getId()
Retrieve the id of this object.

Returns:
id of this object

getName

java.lang.String getName()
Retrieve the name of this object

Returns:
name of this object

setName

void setName(java.lang.String name)
Set the name of this document. This method does not persist the object.

Parameters:
name - name that is assigned to this object

getTypeId

java.lang.String getTypeId()
Retrieve the type of this document.

Returns:
Id of the type identifying the type of this object

setTypeId

void setTypeId(java.lang.String type)
Set the type of this document. This method does not persist the object.

Parameters:
type - id of the type this object gets assigned.

getSecondaryTypeIds

java.util.List<java.lang.String> getSecondaryTypeIds()
CMIS 1.1 get ids of all secondary types

Returns:
list of type ids

setDescription

void setDescription(java.lang.String description)
CMIS 1.1: set description of an object

Parameters:
description - description of this object

getDescription

java.lang.String getDescription()
CMIS 1.1: get description of an object

Returns:
description of this object

getCreatedBy

java.lang.String getCreatedBy()
Retrieve the user who created the document

Returns:
user who created the document.

setCreatedBy

void setCreatedBy(java.lang.String createdBy)
Set the user who last modified the object. This method does not persist the object.

Parameters:
createdBy - user who last modified the document

getModifiedBy

java.lang.String getModifiedBy()
Retrieve the user who last modified the document

Returns:
user who last modified the document.

setModifiedBy

void setModifiedBy(java.lang.String modifiedBy)
Set the user who last modified the object. This method does not persist the object.

Parameters:
modifiedBy - user who last modified the document

getCreatedAt

java.util.GregorianCalendar getCreatedAt()

setCreatedAt

void setCreatedAt(java.util.GregorianCalendar createdAt)
Assign date and time when the object was created. Usually you should not call this method externally. This method does not persist the object.

Parameters:
createdAt - date the object was created

getModifiedAt

java.util.GregorianCalendar getModifiedAt()
Retrieve date and time when the object was last modified.

Returns:
date the object was last modified

setModifiedAtNow

void setModifiedAtNow()
Assign current date and time when the object was last modified. Usually you should not call this method externally. This method does not persist the object.


getRepositoryId

java.lang.String getRepositoryId()
Get the repository id of this object where the object is stored.

Returns:

setRepositoryId

void setRepositoryId(java.lang.String repositoryId)
Assign a repository where this object will be stored. This method does not persist the object.

Parameters:
repositoryId - id of the repository

getProperties

java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> getProperties()
Retrieve the list of properties

Returns:

setProperties

void setProperties(java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> props)
Assign the properties to an object. This method does not persist the object.

Parameters:
props - properties to be assigned

getChangeToken

java.lang.String getChangeToken()
Retrieve a change token uniquely identifying the state of the object when it was persisted (used for optimistic locking)

Returns:
String identifying the change token

persist

void persist()
Persist the object so that it can be later retrieved by its id. Assign an id to the object


rename

void rename(java.lang.String newName)
Rename an object

Parameters:
newName - the new name of the object

createSystemBasePropertiesWhenCreated

void createSystemBasePropertiesWhenCreated(java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> properties,
                                           java.lang.String user)
Create all system base properties that need to be stored with every object in the repository This method is called when a new object is created to record all of the capturing data like the creation time, creator etc.

Parameters:
properties - The properties passed by the client, containing, name, type, etc
user - The user creating the document

updateSystemBasePropertiesWhenModified

void updateSystemBasePropertiesWhenModified(java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> properties,
                                            java.lang.String user)
Update all system base properties that need to be stored with every object in the repository This method is called when an object is is updated to record all of the capturing data like the modification time, updating user etc.

Parameters:
properties - The properties passed by the client, containing, name, type, etc
user - The user creating the document

fillProperties

void fillProperties(java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> properties,
                    org.apache.chemistry.opencmis.commons.spi.BindingsObjectFactory objFactory,
                    java.util.List<java.lang.String> requestedIds)

setCustomProperties

void setCustomProperties(java.util.Map<java.lang.String,org.apache.chemistry.opencmis.commons.data.PropertyData<?>> properties)
Set all properties which are not system properties. These are the properties as defined in Type system definition. This method is called when an object is created or updated. The implementation must ignore the system properties.

Parameters:
properties - Set of properties as set by the client, including system parameters

getAcl

org.apache.chemistry.opencmis.commons.data.Acl getAcl()
get the Acl of the stored object


addAcl

org.apache.chemistry.opencmis.commons.data.Acl addAcl(org.apache.chemistry.opencmis.commons.data.Acl acl)
Add the Acl to the stored object


removeAcl

void removeAcl(org.apache.chemistry.opencmis.commons.data.Acl acl)
Remove the Acl from the stored object


getObjectRelationships

java.util.List<StoredObject> getObjectRelationships(org.apache.chemistry.opencmis.commons.enums.RelationshipDirection relationshipDirection,
                                                    java.lang.String user)
get the relationships of the object

Parameters:
includeSubRelationshipTypes - if true, relationships of a sub type will be returned as well
relationshipDirection - whether relationships where the object is the source, or the target or all are returned
typeId - the type of the relationship, may be null
filter - a property filter, "*" means all properties
includeAllowableActions - whether allowable actions should be returned
maxItems -
skipCount -
extension -
user - the id of the user calling the method

getAllowableActions

org.apache.chemistry.opencmis.commons.data.AllowableActions getAllowableActions(java.lang.String user)

hasRendition

boolean hasRendition(java.lang.String user)
check if the document can generate a renditions and rendition is visible for user

Returns:
true if rendition exists, false if not.

getRenditions

java.util.List<org.apache.chemistry.opencmis.commons.data.RenditionData> getRenditions(java.lang.String renditionFilter,
                                                                                       long maxItems,
                                                                                       long skipCount)
get the rendition this objects supports

Parameters:
renditionFilter -
maxItems -
skipCount -
extension -
Returns:
List of renditions or null if no renditions are available for this object

getRenditionContent

org.apache.chemistry.opencmis.commons.data.ContentStream getRenditionContent(java.lang.String streamId,
                                                                             long offset,
                                                                             long length)
get the rendition of this object

Parameters:
streamId - stream if of rendition
offset - offset in rendition content
length - length of rendition content
Returns:
ContentStream containing the rendition

getAppliedPolicies

java.util.List<java.lang.String> getAppliedPolicies()
get applied policies of this object

Returns:
list of ids of policies applied to this object

addAppliedPolicy

void addAppliedPolicy(java.lang.String policyId)
add an id of a policy to an object

Parameters:
policyId - id of policy to add

removePolicy

void removePolicy(java.lang.String policyId)
remove an id of a policy from an object

Parameters:
policyId - id of policy to remove