Package org.ametys.web.explorer
Class ResourceHelper
- java.lang.Object
-
- org.ametys.web.explorer.ResourceHelper
-
public final class ResourceHelper extends Object
Helper methods related toResources andResourceCollections.
-
-
Field Summary
Fields Modifier and Type Field Description static StringSHARED_RESOURCE_PATHThe shared resource base path in the repository.static StringSHARED_RESOURCE_PREFIXThe shared resource prefix.
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static StringgetRightsContext(String objectPath, String resourcePath)Get the rights context of a resource.static StringgetRightsContext(ExplorerNode explorerNode)Get the rights context of an explorer node.static StringgetSharedRootName(String objectPath)Get the shared root name of a shared resource or collectionstatic StringgetSharedRootName(ExplorerNode explorerNode)Get the shared root name of a shared explorer node.static StringgetSharedRootName(Resource resource)Get the shared root name of a shared resource.static StringgetSharedRootName(ResourceCollection collection)Get the shared root name of a shared resource collection.static booleanisShared(String objectPath)Test if a resource or resource collection belongs to a shared tree.static booleanisShared(ExplorerNode explorerNode)Test if an explorer node belongs to a shared tree.static booleanisShared(Resource resource)Test if a resource belongs to a shared tree.static booleanisShared(ResourceCollection collection)Test if a resource collection belongs to a shared tree.
-
-
-
Field Detail
-
SHARED_RESOURCE_PATH
public static final String SHARED_RESOURCE_PATH
The shared resource base path in the repository.- See Also:
- Constant Field Values
-
SHARED_RESOURCE_PREFIX
public static final String SHARED_RESOURCE_PREFIX
The shared resource prefix.- See Also:
- Constant Field Values
-
-
Method Detail
-
isShared
public static final boolean isShared(Resource resource)
Test if a resource belongs to a shared tree.- Parameters:
resource- the resource to test.- Returns:
- true if the resource belongs to a shared tree, false otherwise.
-
isShared
public static final boolean isShared(ResourceCollection collection)
Test if a resource collection belongs to a shared tree.- Parameters:
collection- the resource collection to test.- Returns:
- true if the resource collection belongs to a shared tree, false otherwise.
-
isShared
public static final boolean isShared(ExplorerNode explorerNode)
Test if an explorer node belongs to a shared tree.- Parameters:
explorerNode- the explorer node to test.- Returns:
- true if the explorer node belongs to a shared tree, false otherwise.
-
isShared
public static final boolean isShared(String objectPath)
Test if a resource or resource collection belongs to a shared tree.- Parameters:
objectPath- the path of the resource or resource collection AmetysObject.- Returns:
- true if the resource belongs to a shared tree, false otherwise.
-
getSharedRootName
public static final String getSharedRootName(Resource resource)
Get the shared root name of a shared resource.- Parameters:
resource- the resource.- Returns:
- the shared root name of the resource, or null if the resource is not shared.
-
getSharedRootName
public static final String getSharedRootName(ResourceCollection collection)
Get the shared root name of a shared resource collection.- Parameters:
collection- the resource collection.- Returns:
- the shared root name of the resource collection, or null if the collection is not shared.
-
getSharedRootName
public static final String getSharedRootName(ExplorerNode explorerNode)
Get the shared root name of a shared explorer node.- Parameters:
explorerNode- the explorer node.- Returns:
- the shared root name of the explorer node, or null if the node is not shared.
-
getSharedRootName
public static final String getSharedRootName(String objectPath)
Get the shared root name of a shared resource or collection- Parameters:
objectPath- the path of the resource or collection AmetysObject.- Returns:
- the shared root name of the resource, or null if the resource is not shared.
-
getRightsContext
public static final String getRightsContext(ExplorerNode explorerNode)
Get the rights context of an explorer node.- Parameters:
explorerNode- the explorer node.- Returns:
- the explorer node rights context.
-
getRightsContext
public static final String getRightsContext(String objectPath, String resourcePath)
Get the rights context of a resource.- Parameters:
objectPath- the path of the resource or collection AmetysObject.resourcePath- the path of the resource in the resource explorer.- Returns:
- the resource rights context.
-
-