Package org.silverpeas.cmis.walkers
Class AbstractCmisObjectsTreeWalker
- java.lang.Object
-
- org.silverpeas.cmis.walkers.AbstractCmisObjectsTreeWalker
-
- All Implemented Interfaces:
CmisObjectsTreeWalker
,CmisFilePath
- Direct Known Subclasses:
TreeWalkerForComponentInst
,TreeWalkerForNodeDetail
,TreeWalkerForPublicationDetail
,TreeWalkerForSimpleDocument
,TreeWalkerForSpaceInst
public abstract class AbstractCmisObjectsTreeWalker extends Object implements CmisObjectsTreeWalker, CmisFilePath
Abstract class providing default behaviour of the different methods defined in theCmisObjectsTreeWalker
interface. Both the existence of accessed objects and the user permission to perform the invoked task are checked by this class. The more concrete walkers, each of them working on a specific type of Silverpeas object (and hence of the mapped CMIS object), have to extend this class and implement the methods required by the default behaviour in this class.
-
-
Field Summary
-
Fields inherited from interface org.silverpeas.core.cmis.model.CmisFilePath
PATH_SEPARATOR
-
-
Constructor Summary
Constructors Constructor Description AbstractCmisObjectsTreeWalker()
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract org.apache.chemistry.opencmis.commons.data.ObjectInFolderList
browseObjectsInFolder(LocalizedResource object, Filtering filtering, Paging paging)
Browses for the direct children in the CMIS folder represented by the specified Silverpeas object. the browsing of children depends on the type of the specified object in Silverpeas and it is then delegated to the walker that knows how to browse for children such an object.protected List<org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer>
browseObjectsInFolderSubTrees(List<LocalizedResource> objects, Filtering filtering, long depth)
Browses the different subtrees rooted at the specified objects for all the children accessible by the user in the given filter up to the specified level depth of the trees.protected abstract List<org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer>
browseObjectsInFolderTree(LocalizedResource object, Filtering filtering, long depth)
Browses for the objects in the CMIS tree rooted at the specified object in Silverpeas.protected abstract List<org.apache.chemistry.opencmis.commons.data.ObjectParentData>
browseParentsOfObject(LocalizedResource object, Filtering filtering)
Browses for the parents in the CMIS objects tree of the specified Silverpeas object.protected org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectInFolderContainerImpl
buildObjectInFolderContainer(CmisFile file, Filtering filtering)
Builds the CMIS data both for the specified CMIS folder and recursively for all of its children by taking into account the filtering that indicates the properties to return.protected org.apache.chemistry.opencmis.commons.data.ObjectInFolderData
buildObjectInFolderData(CmisFile file, Filtering filtering)
Builds the CMIS data corresponding to the specified CMIS folder and by taking into account the filtering that indicates the properties to return.protected org.apache.chemistry.opencmis.commons.data.ObjectInFolderList
buildObjectInFolderList(List<LocalizedResource> objects, Filtering filtering, Paging paging)
Builds the CMIS data corresponding to all of the specified Silverpeas object by taking into account the filtering that indicates the properties to return and the paging that indicates both from which object the build is started and the number of objects to build (and return).protected org.apache.chemistry.opencmis.commons.data.ObjectParentData
buildObjectParentData(CmisFolder parent, CmisObject folder, Filtering filtering)
Builds the CMIS data corresponding to the given parent of the specified folder and by taking into account the filtering that indicates the properties to return.CmisObject
createChildData(String folderId, CmisProperties properties, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, String language)
Creates into the specified CMIS folder a newCmisObject
child from the specified CMIS data properties and in the given language.protected CmisObject
createObjectData(CmisProperties properties, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, String language)
Creates a newCmisObject
instance from the specified CMIS data properties and in the given language.protected abstract <T extends CmisObject>
TencodeToCmisObject(LocalizedResource resource, String language)
Encodes the specified Silverpeas object into its CMIS counterpart.protected abstract Stream<LocalizedResource>
getAllowedChildrenOfSilverpeasObject(ResourceIdentifier parentId, User user)
Gets in Silverpeas all the children objects of the specified parent and that are accessible to the given user.org.apache.chemistry.opencmis.commons.data.ObjectInFolderList
getChildrenData(String folderId, Filtering filtering, Paging paging)
Gets a list of CMIS data of the Silverpeas objects that are children of the CMIS folder uniquely identified by the specified identifier.protected <T extends CmisObject>
TgetCmisObject(LocalizedResource resource, String language)
Gets the CMIS representation of the specified localized resource in Silverpeas.org.apache.chemistry.opencmis.commons.data.ContentStream
getContentStream(String objectId, String language, long offset, long length)
Gets a stream on the content of the specified object, starting at the given offset position and upto the given length.protected org.apache.chemistry.opencmis.commons.data.ContentStream
getContentStream(LocalizedResource resource, String language, long offset, long length)
protected OrganizationController
getController()
Gets anOrganizationController
object to access, create and modify an object in Silverpeas.CmisObject
getObjectData(String objectId, Filtering filtering)
Gets the CMIS data of the Silverpeas object uniquely identified by the specified identifier.CmisFile
getObjectDataByPath(String path, Filtering filtering)
Gets the CMIS data of the Silverpeas object that is located at the specified path in the CMIS objects tree.protected CmisObjectFactory
getObjectFactory()
Gets aCmisObjectFactory
object to create a CMIS object representation of some Silverpeas objects.List<org.apache.chemistry.opencmis.commons.data.ObjectParentData>
getParentsData(String objectId, Filtering filtering)
Gets a list of the CMIS data of the Silverpeas objects that are the direct parents of the CMIS object uniquely identified by the specified identifier.protected abstract <T extends LocalizedResource & Securable>
TgetSilverpeasObjectById(String objectId)
Gets in Silverpeas the object identified by the specified unique identifier.List<org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer>
getSubTreeData(String folderId, Filtering filtering, long depth)
Gets the CMIS objects subtree rooted to the CMIS folder uniquely identified by the specified identifier.protected TreeWalkerSelector
getTreeWalkerSelector()
Gets aTreeWalkerSelector
object to select the correctCmisObjectsTreeWalker
object able to work on given CMIS objects.protected abstract boolean
isObjectSupported(String objectId)
Is the object with the specified identifier supported by this walker?protected abstract boolean
isTypeSupported(TypeId typeId)
Is the specified CMIS type supported by this walker?protected void
prepareChildDataCreation(LocalizedResource parent, CmisProperties properties, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, String language)
Prepares the creation of the object in Silverpeas from the specified CMIS properties and content stream, and in the given language.protected void
setObjectDataFields(CmisObject object, Filtering filtering)
The specified CMIS objects in Silverpeas implement theObjectData
interface that defines the specific CMIS attributes and properties a CMIS object should have.CmisObject
updateObjectData(String objectId, CmisProperties properties, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, String language)
Updates the specified CMIS object from the specified CMIS data properties and in the given language.protected CmisObject
updateObjectData(LocalizedResource object, CmisProperties properties, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, String language)
Updates the specified Silverpeas object with the given CMIS properties and content stream, and for the given language.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.silverpeas.core.cmis.model.CmisFilePath
toString
-
-
-
-
Method Detail
-
prepareChildDataCreation
protected void prepareChildDataCreation(LocalizedResource parent, CmisProperties properties, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, String language)
Prepares the creation of the object in Silverpeas from the specified CMIS properties and content stream, and in the given language. The preparation can update some CMIS properties and some content stream attributes required to create the object as a child of the given parent. This method is invoked by thecreateChildData(String, CmisProperties, ContentStream, String)
method before the creation of the child itself. By default, this method throws theCmisNotSupportedException
exception.- Parameters:
parent
- the resource in Silverpeas for which a new object has to be created.properties
- the CMIS properties of the object to create.contentStream
- a stream on a content from which a document has to be created. If not a document, can be null.language
- the ISO 639-1 code of the language in which the textual properties of the object as well as the content (if any) are expressed.
-
createObjectData
protected CmisObject createObjectData(CmisProperties properties, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, String language)
Creates a newCmisObject
instance from the specified CMIS data properties and in the given language. This method is called by thecreateChildData(String, CmisProperties, ContentStream, String)
method after the CMIS properties and content stream has been prepared by the walker in charge of the object parent of the child to create. By default, this method throws theCmisNotSupportedException
exception.- Parameters:
properties
- the CMIS properties of the object to create.contentStream
- a stream on a content from which a document has to be created. If not a document, can be null.language
- the ISO 639-1 code of the language in which the textual properties of the object as well as the content (if any) are expressed.- Returns:
- the created
CmisObject
object corresponding to the given CMIS properties. - See Also:
createChildData(String, CmisProperties, ContentStream, String)
-
updateObjectData
protected CmisObject updateObjectData(LocalizedResource object, CmisProperties properties, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, String language)
Updates the specified Silverpeas object with the given CMIS properties and content stream, and for the given language. This method is invoked by theupdateObjectData(String, CmisProperties, ContentStream, String)
method to effectively perform the update. By default, this method throws theCmisNotSupportedException
exception.- Parameters:
object
- the Silverpeas object to update.properties
- the CMIS properties that contain the data with which the object has to be updated.contentStream
- a stream on a content with which the content of the object has to be updated. It can be null if the object has no content or if the content hasn't to be updated.language
- the ISO 639-1 code of the language in which the textual properties of the object as well as the content (if any) are expressed.- Returns:
- the created
CmisObject
object corresponding to the given CMIS properties.
-
encodeToCmisObject
protected abstract <T extends CmisObject> T encodeToCmisObject(LocalizedResource resource, String language)
Encodes the specified Silverpeas object into its CMIS counterpart. The CMIS representation depends on the concrete type of the Silverpeas object. The way how create such a CMIS object depends on the type of the Silverpeas object and it is then delegated to the walker that handles such a type of Silverpeas objects.- Type Parameters:
T
- the concrete type of the CMIS object.- Parameters:
resource
- a localized resource in Silverpeas.language
- the language to use in the localization of the CMIS object.- Returns:
- a
CmisObject
instance.
-
isObjectSupported
protected abstract boolean isObjectSupported(String objectId)
Is the object with the specified identifier supported by this walker?- Parameters:
objectId
- the unique identifier of an object.- Returns:
- true if the walker knows how to work with objects with such an identifier pattern. False otherwise.
-
isTypeSupported
protected abstract boolean isTypeSupported(TypeId typeId)
Is the specified CMIS type supported by this walker?- Parameters:
typeId
- the unique identifier of a CMIS type.- Returns:
- true if the walker knows how to work with objects of the specified CMIS type. False otherwise.
-
createChildData
public CmisObject createChildData(String folderId, CmisProperties properties, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, String language)
Description copied from interface:CmisObjectsTreeWalker
Creates into the specified CMIS folder a newCmisObject
child from the specified CMIS data properties and in the given language. If the child is a document then the content stream must be not null, otherwise, for any other object types, it is ignored even if it is set. The type of the child to create is provided by thePropertyIds.OBJECT_TYPE_ID
property.If the content stream isn't set whereas the object to create is a document, then a
CmisConstraintException
is thrown.If the content stream is set whereas the object to create isn't a document, it is simply ignored.
If an error occurs while registering the content from the specified content stream, then a
CmisStorageException
is thrown.- Specified by:
createChildData
in interfaceCmisObjectsTreeWalker
- Parameters:
folderId
- the unique identifier of a folder in the CMIS objects tree.properties
- the CMIS properties of the child to create.contentStream
- a stream on a content from which a document has to be created.language
- the ISO 639-1 code of the language in which the textual properties of the object as well as the content (if any) are expressed.- Returns:
- the created
CmisObject
object corresponding to the given CMIS properties.
-
updateObjectData
public CmisObject updateObjectData(String objectId, CmisProperties properties, org.apache.chemistry.opencmis.commons.data.ContentStream contentStream, String language)
Description copied from interface:CmisObjectsTreeWalker
Updates the specified CMIS object from the specified CMIS data properties and in the given language. If the object is a document then the content stream must be not null, otherwise, for any other object types, it is ignored even if it is set.If the content stream isn't set whereas the object to create is a document, then a
CmisConstraintException
is thrown.If the content stream is set whereas the object to create isn't a document, it is simply ignored.
If an error occurs while registering the content from the specified content stream, then a
CmisStorageException
is thrown.- Specified by:
updateObjectData
in interfaceCmisObjectsTreeWalker
- Parameters:
objectId
- the unique identifier of an object in the CMIS objects tree.properties
- the CMIS properties of the object to update.contentStream
- a stream on a content from which a document has to be updated.language
- the ISO 639-1 code of the language in which the textual properties of the object as well as the content (if any) are expressed.- Returns:
- the updated
CmisObject
object corresponding to the given CMIS properties.
-
getContentStream
public org.apache.chemistry.opencmis.commons.data.ContentStream getContentStream(String objectId, String language, long offset, long length)
Description copied from interface:CmisObjectsTreeWalker
Gets a stream on the content of the specified object, starting at the given offset position and upto the given length.- Specified by:
getContentStream
in interfaceCmisObjectsTreeWalker
- Parameters:
objectId
- the unique identifier of the object in the CMIS objects tree.language
- the ISO 639-1 code of the language of the content to fetch. If no content exists in the specified language, then it is the content for the first language found that will be returned (seeI18n.getSupportedLanguages()
).offset
- the position in bytes in the content to start the stream.length
- the length in bytes of the stream, id est the length of the content to read by the stream.- Returns:
- a
ContentStream
instance.
-
getObjectData
public CmisObject getObjectData(String objectId, Filtering filtering)
Description copied from interface:CmisObjectsTreeWalker
Gets the CMIS data of the Silverpeas object uniquely identified by the specified identifier. Only the data satisfying the given filtering rules are returned.- Specified by:
getObjectData
in interfaceCmisObjectsTreeWalker
- Parameters:
objectId
- the unique identifier of a Silverpeas object.filtering
- the filtering rules to apply on the data.- Returns:
- a
CmisObject
instance that provides the CMIS data of the specified Silverpeas object.
-
getObjectDataByPath
public CmisFile getObjectDataByPath(String path, Filtering filtering)
Description copied from interface:CmisObjectsTreeWalker
Gets the CMIS data of the Silverpeas object that is located at the specified path in the CMIS objects tree. Only the data satisfying the given filtering rules are returned. The root of the CMIS objects tree is theCmisFilePath.PATH_SEPARATOR
.- Specified by:
getObjectDataByPath
in interfaceCmisObjectsTreeWalker
- Parameters:
path
- the path of the object in Silverpeas to get.filtering
- the filtering rules to apply on the data.- Returns:
- an
ObjectData
instance that provides the CMIS data of the specified Silverpeas object.
-
getParentsData
public List<org.apache.chemistry.opencmis.commons.data.ObjectParentData> getParentsData(String objectId, Filtering filtering)
Description copied from interface:CmisObjectsTreeWalker
Gets a list of the CMIS data of the Silverpeas objects that are the direct parents of the CMIS object uniquely identified by the specified identifier. Only the data satisfying the given filtering rules are returned. A file-able CMIS object can have one or more parents but in Silverpeas, only publications in an EDM can have more than one parent (through the aliasing mechanism), so unless the object referred by the specified identifier is an aliased publication, this method returns usually a list with one element.- Specified by:
getParentsData
in interfaceCmisObjectsTreeWalker
- Parameters:
objectId
- the unique identifier of a Silverpeas resource or contribution.filtering
- the filtering rules to apply on the CMIS data to return.- Returns:
- a list of
ObjectParentData
elements, each of them being a wrapper of anObjectData
instance with the path of the specified object relative to this parent. The CMIS data are carried by theObjectData
object. If the specified object isn't file-able or it is the root folder (the virtual root space in Silverpeas), then an empty list is returned.
-
getCmisObject
protected final <T extends CmisObject> T getCmisObject(LocalizedResource resource, String language)
Gets the CMIS representation of the specified localized resource in Silverpeas. This is a shortcut of the following code:selectInstance(object.getIdentifier().asString()).createCmisObject(object, language);
- Type Parameters:
T
- the concrete type of the CMIS object- Parameters:
resource
- a localized resource in Silverpeas exposed in the CMIS objects treelanguage
- the language in which the resource has to be exposed.- Returns:
-
getContentStream
protected org.apache.chemistry.opencmis.commons.data.ContentStream getContentStream(LocalizedResource resource, String language, long offset, long length)
-
browseParentsOfObject
protected abstract List<org.apache.chemistry.opencmis.commons.data.ObjectParentData> browseParentsOfObject(LocalizedResource object, Filtering filtering)
Browses for the parents in the CMIS objects tree of the specified Silverpeas object. In a CMIS objects tree, a child can have direct one or several parents. This method returns all of them. However, as the browsing of the CMIS objects tree depends on the type of its node and hence on the type of the objects in Silverpeas, the browsing is delegated to the walker that knows how to handle such a Silverpeas object.- Parameters:
object
- an identifiable object in Silverpeas.filtering
- the filtering rules to apply on the CMIS data to return.- Returns:
- a list of
ObjectParentData
elements, each of them being a wrapper of anObjectData
instance with the path of the specified object relative to this parent. The CMIS data are carried by theObjectData
object. If the specified object isn't file-able or it is the root folder (the virtual root space in Silverpeas), then an empty list is returned.
-
getSilverpeasObjectById
protected abstract <T extends LocalizedResource & Securable> T getSilverpeasObjectById(String objectId)
Gets in Silverpeas the object identified by the specified unique identifier. The way how to get such an object depends on its type and it is then delegated to the walker that handles such a type of Silverpeas objects.- Type Parameters:
T
- the concrete type of the object to return.- Parameters:
objectId
- the unique identifier of an object in Silverpeas.- Returns:
- a Silverpeas object or null if no such object exists.
-
buildObjectInFolderList
protected final org.apache.chemistry.opencmis.commons.data.ObjectInFolderList buildObjectInFolderList(List<LocalizedResource> objects, Filtering filtering, Paging paging)
Builds the CMIS data corresponding to all of the specified Silverpeas object by taking into account the filtering that indicates the properties to return and the paging that indicates both from which object the build is started and the number of objects to build (and return).- Parameters:
objects
- the objects in Silverpeas to expose and therefore for which a CMIS object representation has to be built.filtering
- the filtering rules to apply on the data to build.paging
- the paging to apply on the elements of the list.- Returns:
- an
ObjectInFolderList
instance that is a list ofObjectInFolderData
elements, each of them being a decorator of anObjectData
instance with its path in the CMIS repository tree (if asked by the filtering). The CMIS data are carried by theObjectData
object. The size and the content of the list is conditioned by the paging rules.
-
getAllowedChildrenOfSilverpeasObject
protected abstract Stream<LocalizedResource> getAllowedChildrenOfSilverpeasObject(ResourceIdentifier parentId, User user)
Gets in Silverpeas all the children objects of the specified parent and that are accessible to the given user. The way how to get such an object depends on its type and it is then delegated to the walker that handles such a type of Silverpeas objects.- Parameters:
parentId
- the unique identifier of the parent in Silverpeas.user
- the user for which the children are get.- Returns:
- a stream over all the allowed children of the specified parent in Silverpeas.
-
buildObjectInFolderContainer
protected final org.apache.chemistry.opencmis.commons.impl.dataobjects.ObjectInFolderContainerImpl buildObjectInFolderContainer(CmisFile file, Filtering filtering)
Builds the CMIS data both for the specified CMIS folder and recursively for all of its children by taking into account the filtering that indicates the properties to return.- Parameters:
file
- a CMIS file representing a Silverpeas object.filtering
- the filtering rules to apply on the data to build.- Returns:
- an
ObjectInFolderContainerImpl
instance representing the CMIS data of the folder plus the CMIS data of its direct children, and so on for each of its children.
-
getChildrenData
public org.apache.chemistry.opencmis.commons.data.ObjectInFolderList getChildrenData(String folderId, Filtering filtering, Paging paging)
Description copied from interface:CmisObjectsTreeWalker
Gets a list of CMIS data of the Silverpeas objects that are children of the CMIS folder uniquely identified by the specified identifier. The CMIS folder represents a Silverpeas resource that is a container of others Silverpeas resources (space, component instance, ...). If this method is invoked for a document instead of a folder, then an emptyObjectInFolderList
list should be returned.- Specified by:
getChildrenData
in interfaceCmisObjectsTreeWalker
- Parameters:
folderId
- the unique identifier of a Silverpeas resource.filtering
- the filtering rules to apply on the CMIS data to return.paging
- the paging to apply on the elements of the list.- Returns:
- an
ObjectInFolderList
instance that is a list ofObjectInFolderData
elements, each of them being a decorator of anObjectData
instance with its path in the CMIS repository tree (if asked by the filtering). The CMIS data are carried by theObjectData
object. If the folder has no children, then an emptyObjectInFolderList
instance is returned.
-
setObjectDataFields
protected final void setObjectDataFields(CmisObject object, Filtering filtering)
The specified CMIS objects in Silverpeas implement theObjectData
interface that defines the specific CMIS attributes and properties a CMIS object should have. Sets these data by taking into account the specified filtering rules.- Parameters:
object
- a CMIS object.filtering
- the filtering rules to apply on the data to set.
-
getSubTreeData
public List<org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer> getSubTreeData(String folderId, Filtering filtering, long depth)
Description copied from interface:CmisObjectsTreeWalker
Gets the CMIS objects subtree rooted to the CMIS folder uniquely identified by the specified identifier. The CMIS folder represents a Silverpeas resource that is a container of others Silverpeas resources (space, component instance, ...). A list of the direct children of the folder (ObjectInFolderContainer
instances) is returned with, for each of them, if any, their own direct children and so on. Each child is described by their CMIS data (a decoratorObjectInFolderData
of anObjectData
instance) filtered with the given filtering rules. If this method is invoked for a document instead of a folder, then an empty list should be returned.- Specified by:
getSubTreeData
in interfaceCmisObjectsTreeWalker
- Parameters:
folderId
- the unique identifier of a Silverpeas resource.filtering
- the filtering rules to apply on the CMIS data to return.depth
- the maximum depth of the subtree to return from the specified folder. If -1, the subtree will contain all the descendents at all depth levels. If 0, nothing. If 1, only the direct children. If greater than 1 only children of the folder and descendants up to the given levels deep. Any other values throws anIllegalArgumentException
error.- Returns:
- a list of
ObjectInFolderContainer
elements (the direct children), each of them being a container of othersObjectInFolderContainer
objects (recursive walk of children) and described by anObjectInFolderData
instance that is a decorator of anObjectData
instance (the CMIS data) with its path in the CMIS repository tree (if asked by the filtering). The CMIS data are carried by theObjectData
object. If the folder has no children, then an empty list is returned.
-
browseObjectsInFolderTree
protected abstract List<org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer> browseObjectsInFolderTree(LocalizedResource object, Filtering filtering, long depth)
Browses for the objects in the CMIS tree rooted at the specified object in Silverpeas. The browsing depends on the type of the specified object in Silverpeas and it is then delegated to the walker that knows how to browse a tree rooted at such a tree.- Parameters:
object
- an identifiable object in Silverpeas.filtering
- the filtering rules to apply on the CMIS data to return.depth
- the depth of the browsing of the tree.- Returns:
- a list of
ObjectInFolderContainer
elements (the direct children), each of them being a container of othersObjectInFolderContainer
objects (recursive walk of the different tree's nodes) and described by anObjectInFolderData
instance that is a decorator of anObjectData
instance (the CMIS data) with its path in the CMIS repository tree (if asked by the filtering). The CMIS data are carried by theObjectData
object.
-
browseObjectsInFolder
protected abstract org.apache.chemistry.opencmis.commons.data.ObjectInFolderList browseObjectsInFolder(LocalizedResource object, Filtering filtering, Paging paging)
Browses for the direct children in the CMIS folder represented by the specified Silverpeas object. the browsing of children depends on the type of the specified object in Silverpeas and it is then delegated to the walker that knows how to browse for children such an object.- Parameters:
object
- an identifiable object in Silverpeas.filtering
- the filtering rules to apply on the CMIS data to return.paging
- the paging to apply on the elements of the list.- Returns:
- an
ObjectInFolderList
instance that is a list ofObjectInFolderData
elements, each of them being a decorator of anObjectData
instance with its path in the CMIS repository tree (if asked by the filtering). The CMIS data are carried by theObjectData
object.
-
browseObjectsInFolderSubTrees
protected final List<org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer> browseObjectsInFolderSubTrees(List<LocalizedResource> objects, Filtering filtering, long depth)
Browses the different subtrees rooted at the specified objects for all the children accessible by the user in the given filter up to the specified level depth of the trees. The subtrees are all part of a same CMIS objects tree and therefore share a common parent.- Parameters:
objects
- the objects in Silverpeas as root of the subtrees to browse.filtering
- the filtering rules to apply on the CMIS data to return.depth
- the depth of the browsing of the tree.- Returns:
- a list of
ObjectInFolderContainer
elements (the direct children), each of them being a container of othersObjectInFolderContainer
objects (recursive walk of the different tree's nodes) and described by anObjectInFolderData
instance that is a decorator of anObjectData
instance (the CMIS data) with its path in the CMIS repository tree (if asked by the filtering). The CMIS data are carried by theObjectData
object.
-
buildObjectInFolderData
protected final org.apache.chemistry.opencmis.commons.data.ObjectInFolderData buildObjectInFolderData(CmisFile file, Filtering filtering)
Builds the CMIS data corresponding to the specified CMIS folder and by taking into account the filtering that indicates the properties to return.- Parameters:
file
- a CMIS file representing a Silverpeas object.filtering
- the filtering rules to apply on the data to build.- Returns:
- an
ObjectInFolderData
object representing the CMIS data of the folder plus its path segment in the CMIS objects tree (if not excluded by the filtering rules).
-
buildObjectParentData
protected final org.apache.chemistry.opencmis.commons.data.ObjectParentData buildObjectParentData(CmisFolder parent, CmisObject folder, Filtering filtering)
Builds the CMIS data corresponding to the given parent of the specified folder and by taking into account the filtering that indicates the properties to return.- Parameters:
parent
- a CMIS folder parent of the below other CMIS folder. It represents a Silverpeas object, itself parent of the Silverpeas object represented by the below CMIS folder.folder
- a CMIS folder representing a Silverpeas object.filtering
- the filtering rules to apply on the data to build.- Returns:
- an
ObjectParentData
object representing the CMIS data of the parent plus the path segment of the child folder relative to the parent in the CMIS objects tree (if not excluded by the filtering rules).
-
getController
protected final OrganizationController getController()
Gets anOrganizationController
object to access, create and modify an object in Silverpeas.- Returns:
- an
OrganizationController
instance.
-
getObjectFactory
protected final CmisObjectFactory getObjectFactory()
Gets aCmisObjectFactory
object to create a CMIS object representation of some Silverpeas objects.- Returns:
- a
CmisObjectFactory
instance.
-
getTreeWalkerSelector
protected final TreeWalkerSelector getTreeWalkerSelector()
Gets aTreeWalkerSelector
object to select the correctCmisObjectsTreeWalker
object able to work on given CMIS objects.- Returns:
- a
TreeWalkerSelector
instance.
-
-