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
ExplorerNode
representing a collection of resources.
-
-
Field Summary
Fields Modifier and Type Field Description static String
APPLICATION_ID
application id for resources collections.protected static String
METADATA_DESCRIPTION
Constants 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 AmetysObject
copyTo(ModifiableTraversableAmetysObject parent, String name)
Copy the currentAmetysObject
to the given object.AmetysObject
copyTo(ModifiableTraversableAmetysObject parent, String name, List<String> restrictTo)
Copy the currentAmetysObject
to the given object if it is not in the restriction list.String
getApplicationId()
Returns the application id corresponding to this Node.String
getCollectionType()
Get the type of child collectionString
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
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.String
getResourceType()
Get the type of child resourcesboolean
hasChildExplorerNodes()
Returns true if this explorer node contains child explorer nodes.boolean
hasChildResources()
Returns true if this explorer node contains resources.void
setDescription(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, getAllowedGroups, getAllowedProfilesForAnonymous, getAllowedProfilesForAnyConnectedUser, getAllowedProfilesForGroups, getAllowedProfilesForUser, getAllowedProfilesForUsers, getAllowedUsers, getChild, getChildren, getDeniedGroups, getDeniedProfilesForAnonymous, getDeniedProfilesForAnyConnectedUser, getDeniedProfilesForGroups, getDeniedProfilesForUser, getDeniedProfilesForUsers, getDeniedUsers, 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: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
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.
-
getCollectionType
public String getCollectionType()
Description copied from interface:ModifiableResourceCollection
Get the type of child collection- Specified by:
getCollectionType
in interfaceModifiableResourceCollection
- Returns:
- the type of child collection
-
getResourceType
public String getResourceType()
Description copied from interface:ModifiableResourceCollection
Get the type of child resources- Specified by:
getResourceType
in interfaceModifiableResourceCollection
- Returns:
- the type of child resources
-
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.
-
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.
-
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.
-
copyTo
public AmetysObject copyTo(ModifiableTraversableAmetysObject parent, String name) throws AmetysRepositoryException
Description copied from interface:CopiableAmetysObject
Copy the currentAmetysObject
to the given object. Be careful, this method save changes.- Specified by:
copyTo
in 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:CopiableAmetysObject
Copy the currentAmetysObject
to the given object if it is not in the restriction list. Be careful, this method save changes.- Specified by:
copyTo
in 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 ofCopiableAmetysObject
authorized to be copied- Returns:
- the created object
- 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
-
setDescription
public void setDescription(String description)
Description copied from interface:ModifiableExplorerNode
Set the description of the application- Specified by:
setDescription
in interfaceModifiableExplorerNode
- Parameters:
description
- the description
-
-