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_SCHEMEScheme for skinprotected static Pattern__SOURCE_PATTERNThe regexp for a protocolprotected Context_cocoonContextCocoon contextprotected SiteManager_siteManagerThe site managerprotected SkinsManager_skinsManagerThe skins manager-
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 voidconfigure(Configuration configuration)protected SkingetSkin(String name, String defaultValue)Return the current skinSourcegetSource(String location, Map parameters)protected voidinitializeComponents()LookupSiteManagerandSkinsManagerfor lazy initialization.voidrelease(Source source)voidservice(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
-
-
Constructor Detail
-
SkinSourceFactory
public SkinSourceFactory()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
configure
public void configure(Configuration configuration) throws ConfigurationException
- Specified by:
configurein interfaceConfigurable- Throws:
ConfigurationException
-
initializeComponents
protected void initializeComponents()
LookupSiteManagerandSkinsManagerfor 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:
getSourcein interfaceSourceFactory- Throws:
IOException
-
release
public void release(Source source)
- Specified by:
releasein interfaceSourceFactory
-
-