Package org.ametys.plugins.explorer.cmis
Class CMISRootResourcesCollection
java.lang.Object
org.ametys.plugins.repository.AbstractAmetysObject
org.ametys.plugins.explorer.cmis.CMISRootResourcesCollection
- All Implemented Interfaces:
ExplorerNode
,ResourceCollection
,AmetysObject
,JCRAmetysObject
,MetadataAwareAmetysObject
,ModifiableMetadataAwareAmetysObject
,ModifiableAmetysObject
,RemovableAmetysObject
,TraversableAmetysObject
public class CMISRootResourcesCollection
extends AbstractAmetysObject
implements JCRAmetysObject, ResourceCollection
AmetysObject
implementing the root of CMISResourcesCollection
s-
Field Summary
-
Constructor Summary
ConstructorDescriptionCMISRootResourcesCollection
(javax.jcr.Node node, String parentPath, CMISTreeFactory factory) Creates aCMISRootResourcesCollection
. -
Method Summary
Modifier and TypeMethodDescriptionReturns the application id corresponding to this Node.Retrieves a given child from its relative path.Retrieves children of the current object.Get the description of the applicationReturns 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.Returns the icon css class for this Node.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>
Returns the rootCompositeMetadata
of thisAmetysObject
.getName()
Retrieves the name of the current object.javax.jcr.Node
getNode()
Gives access to the underlying JCR node.<A extends AmetysObject>
AReturns the parent object in the Ametys hierarchy.Returns the path of the parent object in the Ametys hierarchy.Get the password to connect to CMIS repositorygetPath()
Retrieves the path of the current object.Get the CMIS repository idGet the CMIS repository URLReturns 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.getUser()
Get the user to connect to CMIS repositoryboolean
Tests if this Object has at least one child with the given name.boolean
Returns true if this explorer node contains child explorer nodes.boolean
Returns true if this explorer node contains resources.boolean
Returns true if there is pending changes.void
remove()
Removes thisAmetysObject
from the Ametys tree.void
Rename theAmetysObject
void
Discard pending changes and revert to the currently persisted version.void
Persists pending changes.
If the underlying Node is new, the Session is globally saved.void
setPassword
(String password) Set a password for the CMIS Repositoryvoid
Set the id of the CMIS repositoryvoid
setRepositoryUrl
(String url) Set the URL of the CMIS repositoryvoid
Set a user name for the CMIS RepositoryMethods inherited from class org.ametys.plugins.repository.AbstractAmetysObject
equals, hashCode, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, 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 Details
-
APPLICATION_ID
application id for resources collections.- See Also:
-
METADATA_REPOSITORY_ID
Metadata for repository id- See Also:
-
METADATA_REPOSITORY_URL
Metadata for repository url- See Also:
-
METADATA_USER
Metadata for user login- See Also:
-
METADATA_PASSWORD
Metadata for user password- See Also:
-
-
Constructor Details
-
CMISRootResourcesCollection
Creates aCMISRootResourcesCollection
.- Parameters:
node
- the node backing thisAmetysObject
parentPath
- the parentPath in the Ametys hierarchyfactory
- the CMISRootResourcesCollectionFactory which created this AmetysObject
-
-
Method Details
-
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
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
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.
-
getMetadataHolder
Description copied from interface:MetadataAwareAmetysObject
Returns the rootCompositeMetadata
of thisAmetysObject
.- Specified by:
getMetadataHolder
in interfaceMetadataAwareAmetysObject
- Specified by:
getMetadataHolder
in interfaceModifiableMetadataAwareAmetysObject
- Returns:
- the root
CompositeMetadata
of thisAmetysObject
-
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.
-
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.
-
getName
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.
-
getParentPath
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
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.
-
getNode
Description copied from interface:JCRAmetysObject
Gives access to the underlying JCR node.- Specified by:
getNode
in interfaceJCRAmetysObject
- Returns:
- the JCR node backing this AmetysObject.
-
getId
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
-
hasChildResources
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
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.
-
rename
Description copied from interface:ModifiableAmetysObject
Rename theAmetysObject
- Specified by:
rename
in interfaceModifiableAmetysObject
- Parameters:
newName
- the new name of the ametys object- Throws:
AmetysRepositoryException
- if an error occurs.
-
remove
Description copied from interface:RemovableAmetysObject
Removes thisAmetysObject
from the Ametys tree.- Specified by:
remove
in interfaceRemovableAmetysObject
- Throws:
AmetysRepositoryException
- if an error occurs.RepositoryIntegrityViolationException
- if thisAmetysObject
is referenced by another objects.
-
getParent
Description copied from interface:AmetysObject
Returns the parent object in the Ametys hierarchy.- Specified by:
getParent
in interfaceAmetysObject
- Type Parameters:
A
- the type of the parentAmetysObject
.- Returns:
- the parent object or
null
if current object is the root. - Throws:
AmetysRepositoryException
- if an error occurs.
-
saveChanges
Description copied from interface:ModifiableAmetysObject
Persists pending changes.
If the underlying Node is new, the Session is globally saved.- Specified by:
saveChanges
in interfaceModifiableAmetysObject
- Throws:
AmetysRepositoryException
- if an error occurs.
-
revertChanges
Description copied from interface:ModifiableAmetysObject
Discard pending changes and revert to the currently persisted version.- Specified by:
revertChanges
in interfaceModifiableAmetysObject
- Throws:
AmetysRepositoryException
- if an error occurs.
-
needsSave
Description copied from interface:ModifiableAmetysObject
Returns true if there is pending changes.- Specified by:
needsSave
in interfaceModifiableAmetysObject
- Returns:
- true if there is pending changes.
- Throws:
AmetysRepositoryException
- if an error occurs.
-
getResourcePath
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.
-
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.
-
getUser
Get the user to connect to CMIS repository- Returns:
- the user login
- Throws:
AmetysRepositoryException
- if an error occurred
-
getPassword
Get the password to connect to CMIS repository- Returns:
- the user password
- Throws:
AmetysRepositoryException
- if an error occurred
-
getRepositoryUrl
Get the CMIS repository URL- Returns:
- the CMIS repository URL
- Throws:
AmetysRepositoryException
- if an error occurred
-
getRepositoryId
Get the CMIS repository id- Returns:
- the CMIS repository id
- Throws:
AmetysRepositoryException
- if an error occurred
-
setRepositoryUrl
Set the URL of the CMIS repository- Parameters:
url
- the CMIS repository URL- Throws:
AmetysRepositoryException
- if an error occurred
-
setRepositoryId
Set the id of the CMIS repository- Parameters:
id
- the CMIS repository id- Throws:
AmetysRepositoryException
- if an error occurred
-
setUser
Set a user name for the CMIS Repository- Parameters:
user
- the login
-
setPassword
Set a password for the CMIS Repository- Parameters:
password
- the password
-
getDescription
Description copied from interface:ExplorerNode
Get the description of the application- Specified by:
getDescription
in interfaceExplorerNode
- Returns:
- the description
-