Package org.ametys.web.source
Class SkinSourceFactory
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.source.SkinSourceFactory
-
- All Implemented Interfaces:
LogEnabled
,Component
,Configurable
,Serviceable
,SourceFactory
- Direct Known Subclasses:
TemplateSourceFactory
public class SkinSourceFactory extends AbstractLogEnabled implements SourceFactory, Serviceable, Configurable
Resolve the protocol skin:// seeking file in skins/{siteConfiguration:skin}/
-
-
Field Summary
Fields Modifier and Type Field Description protected static String
__SKIN_SCHEME
Scheme for skinprotected static Pattern
__SOURCE_PATTERN
The regexp for a protocolprotected Context
_cocoonContext
Cocoon contextprivate ServiceManager
_manager
protected SiteManager
_siteManager
The site managerprotected SkinsManager
_skinsManager
The skins managerprivate boolean
_supportInheritance
-
Fields inherited from interface org.apache.excalibur.source.SourceFactory
ROLE
-
-
Constructor Summary
Constructors Constructor Description SkinSourceFactory()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
configure(Configuration configuration)
protected Skin
getSkin(String name, String defaultValue)
Return the current skinSource
getSource(String location, Map parameters)
protected void
initializeComponents()
LookupSiteManager
andSkinsManager
for lazy initialization.void
release(Source source)
void
service(ServiceManager manager)
-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
__SOURCE_PATTERN
protected static final Pattern __SOURCE_PATTERN
The regexp for a protocol
-
__SKIN_SCHEME
protected static final String __SKIN_SCHEME
Scheme for skin- See Also:
- Constant Field Values
-
_skinsManager
protected SkinsManager _skinsManager
The skins manager
-
_siteManager
protected SiteManager _siteManager
The site manager
-
_cocoonContext
protected Context _cocoonContext
Cocoon context
-
_manager
private ServiceManager _manager
-
_supportInheritance
private boolean _supportInheritance
-
-
Constructor Detail
-
SkinSourceFactory
public SkinSourceFactory()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configure
in interfaceConfigurable
- Throws:
ConfigurationException
-
initializeComponents
protected void initializeComponents()
LookupSiteManager
andSkinsManager
for lazy initialization.
-
getSkin
protected Skin getSkin(String name, String defaultValue) throws SourceNotFoundException
Return the current skin- Parameters:
name
- the skin name. Can be null or emptydefaultValue
- switch to this value if skin cannot be determined, or if the determined skin does not exist. Can be null- Returns:
- the skin. Cannot be null.
- Throws:
SourceNotFoundException
- If the skin do not exist
-
getSource
public Source getSource(String location, Map parameters) throws IOException
- Specified by:
getSource
in interfaceSourceFactory
- Throws:
IOException
-
release
public void release(Source source)
- Specified by:
release
in interfaceSourceFactory
-
-