Package org.silverpeas.cmis.walkers
Class TreeWalkerForSpaceInst
- java.lang.Object
-
- org.silverpeas.cmis.walkers.AbstractCmisObjectsTreeWalker
-
- org.silverpeas.cmis.walkers.TreeWalkerForSpaceInst
-
- All Implemented Interfaces:
CmisObjectsTreeWalker,CmisFilePath
@Service @Singleton public class TreeWalkerForSpaceInst extends AbstractCmisObjectsTreeWalker
ACmisObjectsTreeWalkerobject that knows how to walk the subtree rooted to a collaborative space in Silverpeas. It takes care of the virtual root node in the CMIS objects tree that represents the virtual container of all of the root spaces in Silverpeas.- Author:
- mmoquillon
-
-
Field Summary
-
Fields inherited from interface org.silverpeas.core.cmis.model.CmisFilePath
PATH_SEPARATOR
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedTreeWalkerForSpaceInst()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.apache.chemistry.opencmis.commons.data.ObjectInFolderListbrowseObjectsInFolder(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>browseObjectsInFolderTree(LocalizedResource object, Filtering filtering, long depth)Browses for the objects in the CMIS tree rooted at the specified object in Silverpeas.protected 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 SpaceencodeToCmisObject(LocalizedResource space, String language)Encodes the specified Silverpeas object into its CMIS counterpart.protected 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.ObjectInFolderListgetChildrenData(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.CmisObjectgetObjectData(String objectId, Filtering filtering)Gets the CMIS data of the Silverpeas object uniquely identified by the specified identifier.CmisFilegetObjectDataByPath(String path, Filtering filtering)Gets the CMIS data of the Silverpeas object that is located at the specified path in the CMIS objects tree.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 SpaceInstLightgetSilverpeasObjectById(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 booleanisObjectSupported(String objectId)Is the object with the specified identifier supported by this walker?protected booleanisTypeSupported(TypeId typeId)Is the specified CMIS type supported by this walker?-
Methods inherited from class org.silverpeas.cmis.walkers.AbstractCmisObjectsTreeWalker
browseObjectsInFolderSubTrees, buildObjectInFolderContainer, buildObjectInFolderData, buildObjectInFolderList, buildObjectParentData, createChildData, createObjectData, getCmisObject, getContentStream, getContentStream, getController, getObjectFactory, getTreeWalkerSelector, prepareChildDataCreation, setObjectDataFields, updateObjectData, updateObjectData
-
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
-
getSilverpeasObjectById
protected SpaceInstLight getSilverpeasObjectById(String objectId)
Description copied from class:AbstractCmisObjectsTreeWalkerGets 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.- Specified by:
getSilverpeasObjectByIdin classAbstractCmisObjectsTreeWalker- Parameters:
objectId- the unique identifier of an object in Silverpeas.- Returns:
- a Silverpeas object or null if no such object exists.
-
encodeToCmisObject
protected Space encodeToCmisObject(LocalizedResource space, String language)
Description copied from class:AbstractCmisObjectsTreeWalkerEncodes 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.- Specified by:
encodeToCmisObjectin classAbstractCmisObjectsTreeWalker- Parameters:
space- a localized resource in Silverpeas.language- the language to use in the localization of the CMIS object.- Returns:
- a
CmisObjectinstance.
-
isObjectSupported
protected boolean isObjectSupported(String objectId)
Description copied from class:AbstractCmisObjectsTreeWalkerIs the object with the specified identifier supported by this walker?- Specified by:
isObjectSupportedin classAbstractCmisObjectsTreeWalker- 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 boolean isTypeSupported(TypeId typeId)
Description copied from class:AbstractCmisObjectsTreeWalkerIs the specified CMIS type supported by this walker?- Specified by:
isTypeSupportedin classAbstractCmisObjectsTreeWalker- 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.
-
getAllowedChildrenOfSilverpeasObject
protected Stream<LocalizedResource> getAllowedChildrenOfSilverpeasObject(ResourceIdentifier parentId, User user)
Description copied from class:AbstractCmisObjectsTreeWalkerGets 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.- Specified by:
getAllowedChildrenOfSilverpeasObjectin classAbstractCmisObjectsTreeWalker- 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.
-
getObjectData
public CmisObject getObjectData(String objectId, Filtering filtering)
Description copied from interface:CmisObjectsTreeWalkerGets 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:
getObjectDatain interfaceCmisObjectsTreeWalker- Overrides:
getObjectDatain classAbstractCmisObjectsTreeWalker- Parameters:
objectId- the unique identifier of a Silverpeas object.filtering- the filtering rules to apply on the data.- Returns:
- a
CmisObjectinstance that provides the CMIS data of the specified Silverpeas object.
-
getObjectDataByPath
public CmisFile getObjectDataByPath(String path, Filtering filtering)
Description copied from interface:CmisObjectsTreeWalkerGets 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:
getObjectDataByPathin interfaceCmisObjectsTreeWalker- Overrides:
getObjectDataByPathin classAbstractCmisObjectsTreeWalker- Parameters:
path- the path of the object in Silverpeas to get.filtering- the filtering rules to apply on the data.- Returns:
- an
ObjectDatainstance 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:CmisObjectsTreeWalkerGets 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:
getParentsDatain interfaceCmisObjectsTreeWalker- Overrides:
getParentsDatain classAbstractCmisObjectsTreeWalker- 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
ObjectParentDataelements, each of them being a wrapper of anObjectDatainstance with the path of the specified object relative to this parent. The CMIS data are carried by theObjectDataobject. 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.
-
getChildrenData
public org.apache.chemistry.opencmis.commons.data.ObjectInFolderList getChildrenData(String folderId, Filtering filtering, Paging paging)
Description copied from interface:CmisObjectsTreeWalkerGets 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 emptyObjectInFolderListlist should be returned.- Specified by:
getChildrenDatain interfaceCmisObjectsTreeWalker- Overrides:
getChildrenDatain classAbstractCmisObjectsTreeWalker- 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
ObjectInFolderListinstance that is a list ofObjectInFolderDataelements, each of them being a decorator of anObjectDatainstance with its path in the CMIS repository tree (if asked by the filtering). The CMIS data are carried by theObjectDataobject. If the folder has no children, then an emptyObjectInFolderListinstance is returned.
-
getSubTreeData
public List<org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer> getSubTreeData(String folderId, Filtering filtering, long depth)
Description copied from interface:CmisObjectsTreeWalkerGets 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 (ObjectInFolderContainerinstances) 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 decoratorObjectInFolderDataof anObjectDatainstance) 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:
getSubTreeDatain interfaceCmisObjectsTreeWalker- Overrides:
getSubTreeDatain classAbstractCmisObjectsTreeWalker- 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 anIllegalArgumentExceptionerror.- Returns:
- a list of
ObjectInFolderContainerelements (the direct children), each of them being a container of othersObjectInFolderContainerobjects (recursive walk of children) and described by anObjectInFolderDatainstance that is a decorator of anObjectDatainstance (the CMIS data) with its path in the CMIS repository tree (if asked by the filtering). The CMIS data are carried by theObjectDataobject. If the folder has no children, then an empty list is returned.
-
browseObjectsInFolderTree
protected List<org.apache.chemistry.opencmis.commons.data.ObjectInFolderContainer> browseObjectsInFolderTree(LocalizedResource object, Filtering filtering, long depth)
Description copied from class:AbstractCmisObjectsTreeWalkerBrowses 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.- Specified by:
browseObjectsInFolderTreein classAbstractCmisObjectsTreeWalker- 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
ObjectInFolderContainerelements (the direct children), each of them being a container of othersObjectInFolderContainerobjects (recursive walk of the different tree's nodes) and described by anObjectInFolderDatainstance that is a decorator of anObjectDatainstance (the CMIS data) with its path in the CMIS repository tree (if asked by the filtering). The CMIS data are carried by theObjectDataobject.
-
browseObjectsInFolder
protected org.apache.chemistry.opencmis.commons.data.ObjectInFolderList browseObjectsInFolder(LocalizedResource object, Filtering filtering, Paging paging)
Description copied from class:AbstractCmisObjectsTreeWalkerBrowses 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.- Specified by:
browseObjectsInFolderin classAbstractCmisObjectsTreeWalker- 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
ObjectInFolderListinstance that is a list ofObjectInFolderDataelements, each of them being a decorator of anObjectDatainstance with its path in the CMIS repository tree (if asked by the filtering). The CMIS data are carried by theObjectDataobject.
-
browseParentsOfObject
protected List<org.apache.chemistry.opencmis.commons.data.ObjectParentData> browseParentsOfObject(LocalizedResource object, Filtering filtering)
Description copied from class:AbstractCmisObjectsTreeWalkerBrowses 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.- Specified by:
browseParentsOfObjectin classAbstractCmisObjectsTreeWalker- Parameters:
object- an identifiable object in Silverpeas.filtering- the filtering rules to apply on the CMIS data to return.- Returns:
- a list of
ObjectParentDataelements, each of them being a wrapper of anObjectDatainstance with the path of the specified object relative to this parent. The CMIS data are carried by theObjectDataobject. 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.
-
-