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
_cocoonContext
Cocoon contextprotected Context
_context
Avalon contextprotected Map<String,Path>
_externalSkins
The skins declared as external: name of the skin and file locationprotected ServiceManager
_manager
The avalon service managerprotected Map<String,Path>
_resourcesSkins
The skins declared in jar filesprotected SiteManager
_siteManager
The site managerprotected Map<Path,Skin>
_skins
A cache of skins objects classified by absolute pathprotected SourceResolver
_sourceResolver
The excalibur source resolverprotected ViewAndParametersParser
_viewAndParametersParser
The view and parameters parserprotected ViewParameterTypeExtensionPoint
_viewParametersEP
The extension point for type of view parameterprotected ViewParametersManager
_viewParametersManager
The view parameters managerstatic String
ROLE
The avalon role name
-
Constructor Summary
Constructors Constructor Description SkinsManager()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
contextualize(Context context)
void
dispose()
List<Skin>
getDirectChildren(Skin skin)
Compute the skin that are directly derived from the given onePath
getLocalSkinsLocation()
Get the skins locationSkin
getSkin(String id)
Get a skinList<Skin>
getSkinAndParents(Skin skin)
Get the skin and recursively its parents skins in the right weight orderString
getSkinNameFromRequest()
Get the skin name from request ornull
if not foundString
getSkinNameFromRequest(Request request)
Get the skin name from request ornull
if not foundSet<String>
getSkins()
Get the list of existing skinsvoid
initialize()
void
service(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:
service
in interfaceServiceable
- Throws:
ServiceException
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
dispose
public void dispose()
- Specified by:
dispose
in 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 ornull
if not found- Returns:
- The skin name or
null
-
getSkinNameFromRequest
public String getSkinNameFromRequest(Request request)
Get the skin name from request ornull
if not found- Parameters:
request
- The request- Returns:
- The skin name or
null
-
-