Class ResourceService
- java.lang.Object
-
- fr.paris.lutece.plugins.resource.service.ResourceService
-
public class ResourceService extends java.lang.ObjectResource service
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ResourceServicegetInstance()Get the instance of the servicejava.util.List<IResource>getListResources(java.lang.String strResourceTypeName)Get the list of resources of a given typeIResourcegetResource(java.lang.String strIdResource, java.lang.String strResourceTypeName)Get a resource from its id and typeIResourceProvidergetResourceProvider(java.lang.String strResourceTypeName)Get the resource provider of a resource typejava.util.List<IResourceType>getResourceTypesList()Get the list of available resource typesbooleanisResourceTypeManaged(java.lang.String strResourceTypeName)Check if a resource type is managed by any providervoidresourceTypeCreated(java.lang.String strResourceTypeName)Declare a resource type as created.voidresourceTypeRemoved(java.lang.String strResourceTypeName)Declare a resource type as removed.
-
-
-
Method Detail
-
getInstance
public static ResourceService getInstance()
Get the instance of the service- Returns:
- The instance of the service
-
getResourceTypesList
public java.util.List<IResourceType> getResourceTypesList()
Get the list of available resource types- Returns:
- The list of available resource types
-
isResourceTypeManaged
public boolean isResourceTypeManaged(java.lang.String strResourceTypeName)
Check if a resource type is managed by any provider- Parameters:
strResourceTypeName- The resource type- Returns:
- True if the resource type is managed by any provider, false otherwise
-
resourceTypeCreated
public void resourceTypeCreated(java.lang.String strResourceTypeName)
Declare a resource type as created. This method is used to keep cache up to date.- Parameters:
strResourceTypeName- The created resource type
-
resourceTypeRemoved
public void resourceTypeRemoved(java.lang.String strResourceTypeName)
Declare a resource type as removed. This method is used to keep cache up to date.- Parameters:
strResourceTypeName- The removed resource type
-
getResource
public IResource getResource(java.lang.String strIdResource, java.lang.String strResourceTypeName)
Get a resource from its id and type- Parameters:
strIdResource- the id of the resource to getstrResourceTypeName- the type of the resource to get- Returns:
- The resource, or null if the resource could not be found
-
getListResources
public java.util.List<IResource> getListResources(java.lang.String strResourceTypeName)
Get the list of resources of a given type- Parameters:
strResourceTypeName- the resource type- Returns:
- the list of resource of the given type, or an empty list if not resource was found
-
getResourceProvider
public IResourceProvider getResourceProvider(java.lang.String strResourceTypeName)
Get the resource provider of a resource type- Parameters:
strResourceTypeName- The resource provider of a resource type- Returns:
- The resource provider, or null if no provider was found for the given resource type
-
-