Package org.ametys.web.skin
Class SkinsManager
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.web.skin.SkinsManager
-
- All Implemented Interfaces:
Disposable,Initializable,Component,Contextualizable,LogEnabled,Serviceable,ThreadSafe
public class SkinsManager extends AbstractLogEnabled implements ThreadSafe, Serviceable, Component, Contextualizable, Initializable, Disposable
Manages the skins
-
-
Field Summary
Fields Modifier and Type Field Description protected Context_cocoonContextCocoon contextprotected Context_contextAvalon contextprotected Map<String,Path>_externalSkinsThe skins declared as external: name of the skin and file locationprotected ServiceManager_managerThe avalon service managerprotected Map<String,Path>_resourcesSkinsThe skins declared in jar filesprotected SiteManager_siteManagerThe site managerprotected Map<Path,Skin>_skinsA cache of skins objects classified by absolute pathprotected SourceResolver_sourceResolverThe excalibur source resolverprotected ViewAndParametersParser_viewAndParametersParserThe view and parameters parserprotected ViewParameterTypeExtensionPoint_viewParametersEPThe extension point for type of view parameterprotected ViewParametersManager_viewParametersManagerThe view parameters managerstatic StringROLEThe avalon role name
-
Constructor Summary
Constructors Constructor Description SkinsManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcontextualize(Context context)voiddispose()List<Skin>getDirectChildren(Skin skin)Compute the skin that are directly derived from the given onePathgetLocalSkinsLocation()Get the skins locationSkingetSkin(String id)Get a skinList<Skin>getSkinAndParents(Skin skin)Get the skin and recursively its parents skins in the right weight orderStringgetSkinNameFromRequest()Get the skin name from request ornullif not foundStringgetSkinNameFromRequest(Request request)Get the skin name from request ornullif not foundSet<String>getSkins()Get the list of existing skinsvoidinitialize()voidservice(ServiceManager manager)-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
-
-
-
Field Detail
-
_externalSkins
protected Map<String,Path> _externalSkins
The skins declared as external: name of the skin and file location
-
_resourcesSkins
protected Map<String,Path> _resourcesSkins
The skins declared in jar files
-
_manager
protected ServiceManager _manager
The avalon service manager
-
_sourceResolver
protected SourceResolver _sourceResolver
The excalibur source resolver
-
_cocoonContext
protected Context _cocoonContext
Cocoon context
-
_siteManager
protected SiteManager _siteManager
The site manager
-
_viewParametersManager
protected ViewParametersManager _viewParametersManager
The view parameters manager
-
_viewAndParametersParser
protected ViewAndParametersParser _viewAndParametersParser
The view and parameters parser
-
_viewParametersEP
protected ViewParameterTypeExtensionPoint _viewParametersEP
The extension point for type of view parameter
-
-
Constructor Detail
-
SkinsManager
public SkinsManager()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
dispose
public void dispose()
- Specified by:
disposein interfaceDisposable
-
getSkins
public Set<String> getSkins()
Get the list of existing skins- Returns:
- A set of skin names. Can be null if there is an error.
-
getSkin
public Skin getSkin(String id)
Get a skin- Parameters:
id- The id of the skin- Returns:
- The skin or null if the skin does not exist
-
getSkinAndParents
public List<Skin> getSkinAndParents(Skin skin)
Get the skin and recursively its parents skins in the right weight order- Parameters:
skin- The non null skin to check- Returns:
- The list of parent skins INCLUDING the given one
-
getDirectChildren
public List<Skin> getDirectChildren(Skin skin)
Compute the skin that are directly derived from the given one- Parameters:
skin- A non null skin- Returns:
- A non null list of skins
-
getLocalSkinsLocation
public Path getLocalSkinsLocation()
Get the skins location- Returns:
- the skin location
-
getSkinNameFromRequest
public String getSkinNameFromRequest()
Get the skin name from request ornullif not found- Returns:
- The skin name or
null
-
getSkinNameFromRequest
public String getSkinNameFromRequest(Request request)
Get the skin name from request ornullif not found- Parameters:
request- The request- Returns:
- The skin name or
null
-
-