Package org.ametys.plugins.explorer.cmis
Class CMISResourcesCollection
- java.lang.Object
-
- org.ametys.plugins.explorer.cmis.CMISResourcesCollection
-
- All Implemented Interfaces:
ExplorerNode
,ResourceCollection
,AmetysObject
,TraversableAmetysObject
public class CMISResourcesCollection extends Object implements ResourceCollection
Implementation of anExplorerNode
, backed by a CMIS server.
-
-
Field Summary
Fields Modifier and Type Field Description private static org.slf4j.Logger
__LOGGER
private Folder
_cmisFolder
private AmetysObject
_parent
private CMISRootResourcesCollection
_root
static String
APPLICATION_ID
Application id for resources collections.
-
Constructor Summary
Constructors Constructor Description CMISResourcesCollection(Folder folder, CMISRootResourcesCollection root, AmetysObject parent)
Creates aCMISResourcesCollection
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getApplicationId()
Returns the application id corresponding to this Node.AmetysObject
getChild(String path)
Retrieves a given child from its relative path.CollectionIterable<AmetysObject>
getChildren()
Retrieves children of the current object.Folder
getCmisFolder()
Retrieves theFolder
CMISRootResourcesCollection
getCmisRoot()
Retrieves theCMISRootResourcesCollection
String
getDescription()
Get the description of the applicationString
getExplorerPath()
Returns the path of this explorer node in the explorer hierarchy (which is a subset of the whole repository).
If this collection is the root explorer node, "" is returned.String
getIconCls()
Returns the icon css class for this Node.String
getId()
Retrieves the unique identifier of this AmetysObject.
It must be unique in the whole repository and must never be null.
It must conform to the URI syntax:
<protocol>://<protocol-specific-part>
String
getName()
Retrieves the name of the current object.AmetysObject
getParent()
Returns the parent object in the Ametys hierarchy.String
getParentPath()
Returns the path of the parent object in the Ametys hierarchy.String
getPath()
Retrieves the path of the current object.String
getResourcePath()
Returns the path of this resource collection in its hierarchy (which is a subset of the whole repository).
If this collection is the root collection, "" is returned.boolean
hasChild(String name)
Tests if this Object has at least one child with the given name.boolean
hasChildExplorerNodes()
Returns true if this explorer node contains child explorer nodes.boolean
hasChildResources()
Returns true if this explorer node contains resources.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.ametys.plugins.repository.AmetysObject
equals, hashCode
-
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChildAt, getChildPosition
-
-
-
-
Field Detail
-
APPLICATION_ID
public static final String APPLICATION_ID
Application id for resources collections.- See Also:
- Constant Field Values
-
__LOGGER
private static final org.slf4j.Logger __LOGGER
-
_cmisFolder
private final Folder _cmisFolder
-
_root
private final CMISRootResourcesCollection _root
-
_parent
private AmetysObject _parent
-
-
Constructor Detail
-
CMISResourcesCollection
public CMISResourcesCollection(Folder folder, CMISRootResourcesCollection root, AmetysObject parent)
Creates aCMISResourcesCollection
- Parameters:
folder
- The CMIS folderroot
- The root of the virtual treeparent
- the parentAmetysObject
if known
-
-
Method Detail
-
getApplicationId
public String getApplicationId()
Description copied from interface:ExplorerNode
Returns the application id corresponding to this Node.- Specified by:
getApplicationId
in interfaceExplorerNode
- Returns:
- the application id corresponding to this Node.
-
getIconCls
public String getIconCls()
Description copied from interface:ExplorerNode
Returns the icon css class for this Node.- Specified by:
getIconCls
in interfaceExplorerNode
- Returns:
- the icon css class for this Node for rendering in the tree.
-
getId
public String getId() throws AmetysRepositoryException
Description copied from interface:AmetysObject
Retrieves the unique identifier of this AmetysObject.
It must be unique in the whole repository and must never be null.
It must conform to the URI syntax:
<protocol>://<protocol-specific-part>
- Specified by:
getId
in interfaceAmetysObject
- Returns:
- the unique identifier of this AmetysObject
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getName
public String getName() throws AmetysRepositoryException
Description copied from interface:AmetysObject
Retrieves the name of the current object.- Specified by:
getName
in interfaceAmetysObject
- Returns:
- the name.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getCmisRoot
public CMISRootResourcesCollection getCmisRoot()
Retrieves theCMISRootResourcesCollection
- Returns:
- the
CMISRootResourcesCollection
-
getCmisFolder
public Folder getCmisFolder()
Retrieves theFolder
- Returns:
- the
Folder
-
getParent
public AmetysObject getParent() throws AmetysRepositoryException
Description copied from interface:AmetysObject
Returns the parent object in the Ametys hierarchy.- Specified by:
getParent
in interfaceAmetysObject
- Returns:
- the parent object or
null
if current object is the root. - Throws:
AmetysRepositoryException
- if an error occurs.
-
getParentPath
public String getParentPath() throws AmetysRepositoryException
Description copied from interface:AmetysObject
Returns the path of the parent object in the Ametys hierarchy.- Specified by:
getParentPath
in interfaceAmetysObject
- Returns:
- the path of the parent object.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getPath
public String getPath() throws AmetysRepositoryException
Description copied from interface:AmetysObject
Retrieves the path of the current object.- Specified by:
getPath
in interfaceAmetysObject
- Returns:
- the path.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getChild
public AmetysObject getChild(String path) throws AmetysRepositoryException, UnknownAmetysObjectException
Description copied from interface:TraversableAmetysObject
Retrieves a given child from its relative path. The path cannot benull
, empty nor begin with a'/'
.- Specified by:
getChild
in interfaceTraversableAmetysObject
- Parameters:
path
- the path of the child which can contains a position with.[n]
if same name sibling is allowed.- Returns:
- the child found.
- Throws:
AmetysRepositoryException
- if an error occurs.UnknownAmetysObjectException
- if the object does not exist.
-
getChildren
public CollectionIterable<AmetysObject> getChildren() throws AmetysRepositoryException
Description copied from interface:TraversableAmetysObject
Retrieves children of the current object.- Specified by:
getChildren
in interfaceTraversableAmetysObject
- Returns:
- the children or an empty
AmetysObjectIterable
. - Throws:
AmetysRepositoryException
- if an error occurs.
-
hasChild
public boolean hasChild(String name) throws AmetysRepositoryException
Description copied from interface:TraversableAmetysObject
Tests if this Object has at least one child with the given name.- Specified by:
hasChild
in interfaceTraversableAmetysObject
- Parameters:
name
- the name to test. Cannot benull
nor empty nor begin with a'/'
and it cannot contain'/'
.- Returns:
true
if the named child exists,false
otherwise.- Throws:
AmetysRepositoryException
- if an error occurs.
-
hasChildResources
public boolean hasChildResources() throws AmetysRepositoryException
Description copied from interface:ResourceCollection
Returns true if this explorer node contains resources.- Specified by:
hasChildResources
in interfaceResourceCollection
- Returns:
- true if this explorer node contains resources.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
hasChildExplorerNodes
public boolean hasChildExplorerNodes() throws AmetysRepositoryException
Description copied from interface:ExplorerNode
Returns true if this explorer node contains child explorer nodes.- Specified by:
hasChildExplorerNodes
in interfaceExplorerNode
- Returns:
- true if this explorer node contains child explorer nodes.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getExplorerPath
public String getExplorerPath()
Description copied from interface:ExplorerNode
Returns the path of this explorer node in the explorer hierarchy (which is a subset of the whole repository).
If this collection is the root explorer node, "" is returned.- Specified by:
getExplorerPath
in interfaceExplorerNode
- Returns:
- the path of this node in its hierarchy.
-
getResourcePath
public String getResourcePath() throws AmetysRepositoryException
Description copied from interface:ResourceCollection
Returns the path of this resource collection in its hierarchy (which is a subset of the whole repository).
If this collection is the root collection, "" is returned.- Specified by:
getResourcePath
in interfaceResourceCollection
- Returns:
- the path of this collection in its hierarchy.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getDescription
public String getDescription()
Description copied from interface:ExplorerNode
Get the description of the application- Specified by:
getDescription
in interfaceExplorerNode
- Returns:
- the description
-
-