Class JCRResourcesCollection
- java.lang.Object
-
- org.ametys.plugins.repository.AbstractAmetysObject
-
- org.ametys.plugins.repository.jcr.SimpleAmetysObject<F>
-
- org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject<JCRResourcesCollectionFactory>
-
- org.ametys.plugins.explorer.resources.jcr.JCRResourcesCollection
-
- All Implemented Interfaces:
ExplorerNode,ModifiableExplorerNode,ModifiableResourceCollection,ResourceCollection,ACLAmetysObject,AmetysObject,CopiableAmetysObject,JCRAmetysObject,JCRTraversableAmetysObject,MetadataAwareAmetysObject,ModifiableMetadataAwareAmetysObject,ModifiableACLAmetysObject,ModifiableAmetysObject,ModifiableTraversableAmetysObject,RemovableAmetysObject,TraversableAmetysObject
public class JCRResourcesCollection extends DefaultTraversableAmetysObject<JCRResourcesCollectionFactory> implements ModifiableResourceCollection, CopiableAmetysObject
ExplorerNoderepresenting a collection of resources.
-
-
Field Summary
Fields Modifier and Type Field Description static StringAPPLICATION_IDapplication id for resources collections.protected static StringMETADATA_DESCRIPTIONConstants for description metadata
-
Constructor Summary
Constructors Constructor Description JCRResourcesCollection(Node node, String parentPath, JCRResourcesCollectionFactory factory)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description AmetysObjectcopyTo(ModifiableTraversableAmetysObject parent, String name)Copy the currentAmetysObjectto the given object.AmetysObjectcopyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo)Copy the currentAmetysObjectto the given object if it is not in the restriction list.StringgetApplicationId()Returns the application id corresponding to this Node.StringgetCollectionType()Get the type of child collectionStringgetDescription()Get the description of the applicationStringgetExplorerPath()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.StringgetIconCls()Returns the icon css class for this Node.StringgetResourcePath()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.StringgetResourceType()Get the type of child resourcesbooleanhasChildExplorerNodes()Returns true if this explorer node contains child explorer nodes.booleanhasChildResources()Returns true if this explorer node contains resources.voidsetDescription(String description)Set the description of the application-
Methods inherited from class org.ametys.plugins.repository.jcr.DefaultTraversableAmetysObject
addAllowedGroups, addAllowedProfilesForAnonymous, addAllowedProfilesForAnyConnectedUser, addAllowedUsers, addDeniedGroups, addDeniedProfilesForAnonymous, addDeniedProfilesForAnyConnectedUser, addDeniedUsers, createChild, disallowInheritance, getChild, getChildren, getProfilesForAnonymousAndAnyConnectedUser, getProfilesForGroups, getProfilesForUsers, hasChild, isInheritanceDisallowed, removeAllowedGroups, removeAllowedGroups, removeAllowedProfilesForAnonymous, removeAllowedProfilesForAnyConnectedUser, removeAllowedUsers, removeAllowedUsers, removeDeniedGroups, removeDeniedGroups, removeDeniedProfilesForAnonymous, removeDeniedProfilesForAnyConnectedUser, removeDeniedUsers, removeDeniedUsers
-
Methods inherited from class org.ametys.plugins.repository.jcr.SimpleAmetysObject
_getFactory, _invalidateName, _invalidateParentPath, getId, getMetadataHolder, getName, getNode, getParent, getParentPath, getPath, needsSave, remove, rename, revertChanges, saveChanges
-
Methods 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, getId, getName, getParent, getParentPath, getPath, hashCode
-
Methods inherited from interface org.ametys.plugins.repository.jcr.JCRAmetysObject
getNode
-
Methods inherited from interface org.ametys.plugins.repository.ModifiableAmetysObject
needsSave, rename, revertChanges, saveChanges
-
Methods inherited from interface org.ametys.plugins.repository.metadata.ModifiableMetadataAwareAmetysObject
getMetadataHolder
-
Methods inherited from interface org.ametys.plugins.repository.ModifiableTraversableAmetysObject
createChild
-
Methods inherited from interface org.ametys.plugins.repository.RemovableAmetysObject
remove
-
Methods inherited from interface org.ametys.plugins.repository.TraversableAmetysObject
getChild, getChildAt, getChildPosition, getChildren, hasChild
-
-
-
-
Field Detail
-
APPLICATION_ID
public static final String APPLICATION_ID
application id for resources collections.- See Also:
- Constant Field Values
-
METADATA_DESCRIPTION
protected static final String METADATA_DESCRIPTION
Constants for description metadata- See Also:
- Constant Field Values
-
-
Constructor Detail
-
JCRResourcesCollection
public JCRResourcesCollection(Node node, String parentPath, JCRResourcesCollectionFactory factory)
Constructor- Parameters:
node- The jcr nodeparentPath- The parent pathfactory- The factory
-
-
Method Detail
-
getIconCls
public String getIconCls()
Description copied from interface:ExplorerNodeReturns the icon css class for this Node.- Specified by:
getIconClsin interfaceExplorerNode- Returns:
- the icon css class for this Node for rendering in the tree.
-
getApplicationId
public String getApplicationId()
Description copied from interface:ExplorerNodeReturns the application id corresponding to this Node.- Specified by:
getApplicationIdin interfaceExplorerNode- Returns:
- the application id corresponding to this Node.
-
getCollectionType
public String getCollectionType()
Description copied from interface:ModifiableResourceCollectionGet the type of child collection- Specified by:
getCollectionTypein interfaceModifiableResourceCollection- Returns:
- the type of child collection
-
getResourceType
public String getResourceType()
Description copied from interface:ModifiableResourceCollectionGet the type of child resources- Specified by:
getResourceTypein interfaceModifiableResourceCollection- Returns:
- the type of child resources
-
getResourcePath
public String getResourcePath() throws AmetysRepositoryException
Description copied from interface:ResourceCollectionReturns 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:
getResourcePathin interfaceResourceCollection- Returns:
- the path of this collection in its hierarchy.
- Throws:
AmetysRepositoryException- if an error occurs.
-
getExplorerPath
public String getExplorerPath()
Description copied from interface:ExplorerNodeReturns 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:
getExplorerPathin interfaceExplorerNode- Returns:
- the path of this node in its hierarchy.
-
hasChildResources
public boolean hasChildResources() throws AmetysRepositoryException
Description copied from interface:ResourceCollectionReturns true if this explorer node contains resources.- Specified by:
hasChildResourcesin 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:ExplorerNodeReturns true if this explorer node contains child explorer nodes.- Specified by:
hasChildExplorerNodesin interfaceExplorerNode- Returns:
- true if this explorer node contains child explorer nodes.
- Throws:
AmetysRepositoryException- if an error occurs.
-
copyTo
public AmetysObject copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException
Description copied from interface:CopiableAmetysObjectCopy the currentAmetysObjectto the given object. Be careful, this method save changes.- Specified by:
copyToin interfaceCopiableAmetysObject- Parameters:
parent- The parent of the new object. Can not be null.name- Name of the new object. Can be null. If null, the new name will be get from the copied object- Returns:
- the created object
- Throws:
AmetysRepositoryException- if an error occurs.
-
copyTo
public AmetysObject copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo) throws AmetysRepositoryException
Description copied from interface:CopiableAmetysObjectCopy the currentAmetysObjectto the given object if it is not in the restriction list. Be careful, this method save changes.- Specified by:
copyToin interfaceCopiableAmetysObject- Parameters:
parent- The parent of the new object. Can not be null.name- Name of the new object. Can be null. If null, the new name will be get from the copied objectrestrictTo- A restrict list ofCopiableAmetysObjectauthorized to be copied- Returns:
- the created object
- Throws:
AmetysRepositoryException- if an error occurs.
-
getDescription
public String getDescription()
Description copied from interface:ExplorerNodeGet the description of the application- Specified by:
getDescriptionin interfaceExplorerNode- Returns:
- the description
-
setDescription
public void setDescription(String description)
Description copied from interface:ModifiableExplorerNodeSet the description of the application- Specified by:
setDescriptionin interfaceModifiableExplorerNode- Parameters:
description- the description
-
-