public class CMISRootResourcesCollection extends AbstractAmetysObject implements JCRAmetysObject, ResourceCollection
AmetysObject
implementing the root of CMISResourcesCollection
sModifier and Type | Field and Description |
---|---|
private static Logger |
__LOGGER |
private CMISTreeFactory |
_factory
The corresponding
SimpleAmetysObjectFactory |
private String |
_name |
private Node |
_node |
private String |
_parentPath |
private Folder |
_root |
private Session |
_session |
static String |
APPLICATION_ID
application id for resources collections.
|
static String |
METADATA_PASSWORD
Metadata for user password
|
static String |
METADATA_REPOSITORY_ID
Metadata for repository id
|
static String |
METADATA_REPOSITORY_URL
Metadata for repository url
|
static String |
METADATA_USER
Metadata for user login
|
Constructor and Description |
---|
CMISRootResourcesCollection(Node node,
String parentPath,
CMISTreeFactory factory)
Creates a
CMISRootResourcesCollection . |
Modifier and Type | Method and Description |
---|---|
(package private) void |
connect(Session session,
Folder root) |
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.
|
String |
getDescription()
Get the description of the application
|
String |
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> |
ModifiableCompositeMetadata |
getMetadataHolder()
Returns the root
CompositeMetadata of this AmetysObject . |
String |
getName()
Retrieves the name of the current object.
|
Node |
getNode()
Gives access to the underlying JCR node.
|
<A extends AmetysObject> |
getParent()
Returns the parent object in the Ametys hierarchy.
|
String |
getParentPath()
Returns the path of the parent object in the Ametys hierarchy.
|
String |
getPassword()
Get the password to connect to CMIS repository
|
String |
getPath()
Retrieves the path of the current object.
|
String |
getRepositoryId()
Get the CMIS repository id
|
String |
getRepositoryUrl()
Get the CMIS repository URL
|
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. |
(package private) Folder |
getRootFolder() |
(package private) Session |
getSession() |
String |
getUser()
Get the user to connect to CMIS repository
|
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.
|
boolean |
needsSave()
Returns true if there is pending changes.
|
void |
remove()
Removes this
AmetysObject from the Ametys tree. |
void |
rename(String newName)
Rename the
AmetysObject |
void |
revertChanges()
Discard pending changes and revert to the currently persisted version.
|
void |
saveChanges()
Persists pending changes.
If the underlying Node is new, the Session is globally saved. |
void |
setPassword(String password)
Set a password for the CMIS Repository
|
void |
setRepositoryId(String id)
Set the id of the CMIS repository
|
void |
setRepositoryUrl(String url)
Set the URL of the CMIS repository
|
void |
setUser(String user)
Set a user name for the CMIS Repository
|
equals, hashCode, toString
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
equals, hashCode
getChildAt, getChildPosition
public static final String APPLICATION_ID
public static final String METADATA_REPOSITORY_ID
public static final String METADATA_REPOSITORY_URL
public static final String METADATA_USER
public static final String METADATA_PASSWORD
private final CMISTreeFactory _factory
SimpleAmetysObjectFactory
private String _parentPath
public CMISRootResourcesCollection(Node node, String parentPath, CMISTreeFactory factory)
CMISRootResourcesCollection
.node
- the node backing this AmetysObject
parentPath
- the parentPath in the Ametys hierarchyfactory
- the CMISRootResourcesCollectionFactory which created this AmetysObjectSession getSession()
Folder getRootFolder()
public AmetysObject getChild(String path) throws AmetysRepositoryException, UnknownAmetysObjectException
TraversableAmetysObject
null
, empty nor begin with a '/'
.getChild
in interface TraversableAmetysObject
path
- the path of the child which can contains a position with.
[n]
if same name sibling is allowed.AmetysRepositoryException
- if an error occurs.UnknownAmetysObjectException
- if the object does not exist.public CollectionIterable<AmetysObject> getChildren() throws AmetysRepositoryException
TraversableAmetysObject
getChildren
in interface TraversableAmetysObject
AmetysObjectIterable
.AmetysRepositoryException
- if an error occurs.public boolean hasChild(String name) throws AmetysRepositoryException
TraversableAmetysObject
hasChild
in interface TraversableAmetysObject
name
- the name to test. Cannot be null
nor empty nor
begin with a '/'
and it cannot contain '/'
.true
if the named child exists,
false
otherwise.AmetysRepositoryException
- if an error occurs.public ModifiableCompositeMetadata getMetadataHolder()
MetadataAwareAmetysObject
CompositeMetadata
of this AmetysObject
.getMetadataHolder
in interface MetadataAwareAmetysObject
getMetadataHolder
in interface ModifiableMetadataAwareAmetysObject
CompositeMetadata
of this AmetysObject
public String getIconCls()
ExplorerNode
getIconCls
in interface ExplorerNode
public String getApplicationId()
ExplorerNode
getApplicationId
in interface ExplorerNode
public String getName() throws AmetysRepositoryException
AmetysObject
getName
in interface AmetysObject
AmetysRepositoryException
- if an error occurs.public String getParentPath() throws AmetysRepositoryException
AmetysObject
getParentPath
in interface AmetysObject
AmetysRepositoryException
- if an error occurs.public String getPath() throws AmetysRepositoryException
AmetysObject
getPath
in interface AmetysObject
AmetysRepositoryException
- if an error occurs.public Node getNode()
JCRAmetysObject
getNode
in interface JCRAmetysObject
public String getId()
AmetysObject
<protocol>://<protocol-specific-part>
getId
in interface AmetysObject
public boolean hasChildResources() throws AmetysRepositoryException
ResourceCollection
hasChildResources
in interface ResourceCollection
AmetysRepositoryException
- if an error occurs.public boolean hasChildExplorerNodes() throws AmetysRepositoryException
ExplorerNode
hasChildExplorerNodes
in interface ExplorerNode
AmetysRepositoryException
- if an error occurs.public void rename(String newName) throws AmetysRepositoryException
ModifiableAmetysObject
AmetysObject
rename
in interface ModifiableAmetysObject
newName
- the new name of the ametys objectAmetysRepositoryException
- if an error occurs.public void remove() throws AmetysRepositoryException, RepositoryIntegrityViolationException
RemovableAmetysObject
AmetysObject
from the Ametys tree.remove
in interface RemovableAmetysObject
AmetysRepositoryException
- if an error occurs.RepositoryIntegrityViolationException
- if this AmetysObject
is referenced by another objects.public <A extends AmetysObject> A getParent() throws AmetysRepositoryException
AmetysObject
getParent
in interface AmetysObject
A
- the type of the parent AmetysObject
.null
if current object
is the root.AmetysRepositoryException
- if an error occurs.public void saveChanges() throws AmetysRepositoryException
ModifiableAmetysObject
saveChanges
in interface ModifiableAmetysObject
AmetysRepositoryException
- if an error occurs.public void revertChanges() throws AmetysRepositoryException
ModifiableAmetysObject
revertChanges
in interface ModifiableAmetysObject
AmetysRepositoryException
- if an error occurs.public boolean needsSave() throws AmetysRepositoryException
ModifiableAmetysObject
needsSave
in interface ModifiableAmetysObject
AmetysRepositoryException
- if an error occurs.public String getResourcePath() throws AmetysRepositoryException
ResourceCollection
getResourcePath
in interface ResourceCollection
AmetysRepositoryException
- if an error occurs.public String getExplorerPath()
ExplorerNode
getExplorerPath
in interface ExplorerNode
public String getUser() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurredpublic String getPassword() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurredpublic String getRepositoryUrl() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurredpublic String getRepositoryId() throws AmetysRepositoryException
AmetysRepositoryException
- if an error occurredpublic void setRepositoryUrl(String url) throws AmetysRepositoryException
url
- the CMIS repository URLAmetysRepositoryException
- if an error occurredpublic void setRepositoryId(String id) throws AmetysRepositoryException
id
- the CMIS repository idAmetysRepositoryException
- if an error occurredpublic void setUser(String user)
user
- the loginpublic void setPassword(String password)
password
- the passwordpublic String getDescription()
ExplorerNode
getDescription
in interface ExplorerNode