public class CMISRootResourcesCollection extends AbstractAmetysObject implements JCRAmetysObject, ResourceCollection
AmetysObject implementing the root of CMISResourcesCollections| Modifier 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, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitequals, hashCodegetChildAt, getChildPositionpublic 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
SimpleAmetysObjectFactoryprivate String _parentPath
public CMISRootResourcesCollection(Node node, String parentPath, CMISTreeFactory factory)
CMISRootResourcesCollection.node - the node backing this AmetysObjectparentPath - the parentPath in the Ametys hierarchyfactory - the CMISRootResourcesCollectionFactory which created this AmetysObjectSession getSession()
Folder getRootFolder()
public AmetysObject getChild(String path) throws AmetysRepositoryException, UnknownAmetysObjectException
TraversableAmetysObjectnull, empty nor begin with a '/'.getChild in interface TraversableAmetysObjectpath - 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
TraversableAmetysObjectgetChildren in interface TraversableAmetysObjectAmetysObjectIterable.AmetysRepositoryException - if an error occurs.public boolean hasChild(String name) throws AmetysRepositoryException
TraversableAmetysObjecthasChild in interface TraversableAmetysObjectname - 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()
MetadataAwareAmetysObjectCompositeMetadata of this AmetysObject.getMetadataHolder in interface MetadataAwareAmetysObjectgetMetadataHolder in interface ModifiableMetadataAwareAmetysObjectCompositeMetadata of this AmetysObjectpublic String getIconCls()
ExplorerNodegetIconCls in interface ExplorerNodepublic String getApplicationId()
ExplorerNodegetApplicationId in interface ExplorerNodepublic String getName() throws AmetysRepositoryException
AmetysObjectgetName in interface AmetysObjectAmetysRepositoryException - if an error occurs.public String getParentPath() throws AmetysRepositoryException
AmetysObjectgetParentPath in interface AmetysObjectAmetysRepositoryException - if an error occurs.public String getPath() throws AmetysRepositoryException
AmetysObjectgetPath in interface AmetysObjectAmetysRepositoryException - if an error occurs.public Node getNode()
JCRAmetysObjectgetNode in interface JCRAmetysObjectpublic String getId()
AmetysObject<protocol>://<protocol-specific-part>getId in interface AmetysObjectpublic boolean hasChildResources() throws AmetysRepositoryException
ResourceCollectionhasChildResources in interface ResourceCollectionAmetysRepositoryException - if an error occurs.public boolean hasChildExplorerNodes() throws AmetysRepositoryException
ExplorerNodehasChildExplorerNodes in interface ExplorerNodeAmetysRepositoryException - if an error occurs.public void rename(String newName) throws AmetysRepositoryException
ModifiableAmetysObjectAmetysObjectrename in interface ModifiableAmetysObjectnewName - the new name of the ametys objectAmetysRepositoryException - if an error occurs.public void remove() throws AmetysRepositoryException, RepositoryIntegrityViolationException
RemovableAmetysObjectAmetysObject from the Ametys tree.remove in interface RemovableAmetysObjectAmetysRepositoryException - if an error occurs.RepositoryIntegrityViolationException - if this AmetysObject is referenced by another objects.public <A extends AmetysObject> A getParent() throws AmetysRepositoryException
AmetysObjectgetParent in interface AmetysObjectA - the type of the parent AmetysObject.null if current object
is the root.AmetysRepositoryException - if an error occurs.public void saveChanges() throws AmetysRepositoryException
ModifiableAmetysObjectsaveChanges in interface ModifiableAmetysObjectAmetysRepositoryException - if an error occurs.public void revertChanges() throws AmetysRepositoryException
ModifiableAmetysObjectrevertChanges in interface ModifiableAmetysObjectAmetysRepositoryException - if an error occurs.public boolean needsSave() throws AmetysRepositoryException
ModifiableAmetysObjectneedsSave in interface ModifiableAmetysObjectAmetysRepositoryException - if an error occurs.public String getResourcePath() throws AmetysRepositoryException
ResourceCollectiongetResourcePath in interface ResourceCollectionAmetysRepositoryException - if an error occurs.public String getExplorerPath()
ExplorerNodegetExplorerPath in interface ExplorerNodepublic 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()
ExplorerNodegetDescription in interface ExplorerNode