Class WebResourceManagerImpl
- java.lang.Object
-
- org.nuxeo.runtime.model.DefaultComponent
-
- org.nuxeo.ecm.web.resources.core.service.WebResourceManagerImpl
-
- All Implemented Interfaces:
WebResourceManager
,Adaptable
,Component
,Extensible
,TimestampedService
public class WebResourceManagerImpl extends DefaultComponent implements WebResourceManager
- Since:
- 7.3
-
-
Field Summary
Fields Modifier and Type Field Description protected ProcessorRegistry
processors
protected static String
PROCESSORS_ENDPOINT
protected static String
RESOURCE_BUNDLES_ENDPOINT
protected ResourceBundleRegistry
resourceBundles
protected ResourceRegistry
resources
protected static String
RESOURCES_ENDPOINT
-
Fields inherited from class org.nuxeo.runtime.model.DefaultComponent
lastModified, name
-
-
Constructor Summary
Constructors Constructor Description WebResourceManagerImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
activate(ComponentContext context)
Activates the component.protected void
computeResourceUri(ResourceDescriptor resource, ComponentInstance contributor)
Processor
getProcessor(String name)
Returns the corresponding processor with given name, or null if not found.List<Processor>
getProcessors()
Returns all processors registered on the service, ordered.List<Processor>
getProcessors(String type)
Returns all processors registered on the service, ordered, for given type.Resource
getResource(String name)
Returns a registered resource with given name, or null if not found.ResourceBundle
getResourceBundle(String name)
Returns a registered resource bundle with given name, or null if not found.List<ResourceBundle>
getResourceBundles()
Returns all resource bundles registered on the service.List<Resource>
getResources(ResourceContext context, String bundleName, String type)
Returns the ordered list of resources for given bundle name, filtered using given type.protected Map<String,Resource>
getSubResources(org.codehaus.plexus.util.dag.DAG graph, Resource r, String type)
void
registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
void
registerResource(Resource resource)
Allows to dynamically register a resource.void
registerResourceBundle(ResourceBundle bundle)
Allows to dynamically register a bundle.void
unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
void
unregisterResource(Resource resource)
Allows to dynamically unregister a resource.void
unregisterResourceBundle(ResourceBundle bundle)
Allows to dynamically unregister a bundle.-
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
addRuntimeMessage, addRuntimeMessage, deactivate, getAdapter, getDescriptor, getDescriptors, getLastModified, getRegistry, register, registerExtension, setLastModified, setModifiedNow, setName, start, stop, unregister, unregisterExtension
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.nuxeo.runtime.model.Component
applicationStarted, getApplicationStartedOrder
-
Methods inherited from interface org.nuxeo.runtime.service.TimestampedService
getLastModified, setLastModified
-
-
-
-
Field Detail
-
RESOURCES_ENDPOINT
protected static final String RESOURCES_ENDPOINT
- See Also:
- Constant Field Values
-
resources
protected ResourceRegistry resources
-
RESOURCE_BUNDLES_ENDPOINT
protected static final String RESOURCE_BUNDLES_ENDPOINT
- See Also:
- Constant Field Values
-
resourceBundles
protected ResourceBundleRegistry resourceBundles
-
PROCESSORS_ENDPOINT
protected static final String PROCESSORS_ENDPOINT
- See Also:
- Constant Field Values
-
processors
protected ProcessorRegistry processors
-
-
Method Detail
-
activate
public void activate(ComponentContext context)
Description copied from interface:Component
Activates the component.This method is called by the runtime when a component is activated.
- Specified by:
activate
in interfaceComponent
- Overrides:
activate
in classDefaultComponent
- Parameters:
context
- the runtime context
-
registerContribution
public void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
registerContribution
in classDefaultComponent
-
unregisterContribution
public void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
- Overrides:
unregisterContribution
in classDefaultComponent
-
computeResourceUri
protected void computeResourceUri(ResourceDescriptor resource, ComponentInstance contributor)
-
getResource
public Resource getResource(String name)
Description copied from interface:WebResourceManager
Returns a registered resource with given name, or null if not found.Referenced resource can either be a static resource or a style.
- Specified by:
getResource
in interfaceWebResourceManager
-
getResourceBundle
public ResourceBundle getResourceBundle(String name)
Description copied from interface:WebResourceManager
Returns a registered resource bundle with given name, or null if not found.- Specified by:
getResourceBundle
in interfaceWebResourceManager
-
getResourceBundles
public List<ResourceBundle> getResourceBundles()
Description copied from interface:WebResourceManager
Returns all resource bundles registered on the service.- Specified by:
getResourceBundles
in interfaceWebResourceManager
-
getProcessor
public Processor getProcessor(String name)
Description copied from interface:WebResourceManager
Returns the corresponding processor with given name, or null if not found.- Specified by:
getProcessor
in interfaceWebResourceManager
-
getProcessors
public List<Processor> getProcessors()
Description copied from interface:WebResourceManager
Returns all processors registered on the service, ordered.- Specified by:
getProcessors
in interfaceWebResourceManager
-
getProcessors
public List<Processor> getProcessors(String type)
Description copied from interface:WebResourceManager
Returns all processors registered on the service, ordered, for given type.- Specified by:
getProcessors
in interfaceWebResourceManager
-
getResources
public List<Resource> getResources(ResourceContext context, String bundleName, String type)
Description copied from interface:WebResourceManager
Returns the ordered list of resources for given bundle name, filtered using given type.- Specified by:
getResources
in interfaceWebResourceManager
-
getSubResources
protected Map<String,Resource> getSubResources(org.codehaus.plexus.util.dag.DAG graph, Resource r, String type)
-
registerResourceBundle
public void registerResourceBundle(ResourceBundle bundle)
Description copied from interface:WebResourceManager
Allows to dynamically register a bundle.- Specified by:
registerResourceBundle
in interfaceWebResourceManager
-
unregisterResourceBundle
public void unregisterResourceBundle(ResourceBundle bundle)
Description copied from interface:WebResourceManager
Allows to dynamically unregister a bundle.- Specified by:
unregisterResourceBundle
in interfaceWebResourceManager
-
registerResource
public void registerResource(Resource resource)
Description copied from interface:WebResourceManager
Allows to dynamically register a resource.- Specified by:
registerResource
in interfaceWebResourceManager
-
unregisterResource
public void unregisterResource(Resource resource)
Description copied from interface:WebResourceManager
Allows to dynamically unregister a resource.- Specified by:
unregisterResource
in interfaceWebResourceManager
-
-