Package org.ametys.web.sitemap
Class SkinSitemapDecorators
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.sitemap.SkinSitemapDecorators
-
- All Implemented Interfaces:
FileReloader,LogEnabled,SitemapDecorators,Initializable,Serviceable
public class SkinSitemapDecorators extends AbstractLogEnabled implements SitemapDecorators, Initializable, Serviceable, FileReloader
Implementation ofSitemapDecoratorsfor icons provided by skins
-
-
Field Summary
Fields Modifier and Type Field Description private static String__DECORATORS_CACHEprivate static Pattern__SKIN_SOURCE_PATTERNprivate AbstractCacheManager_cacheManagerprivate FileReloaderUtils_fileReloaderprotected SkinsManager_skinsManagerThe skins managerprotected SourceResolver_srcResolverThe source resolver
-
Constructor Summary
Constructors Constructor Description SkinSitemapDecorators()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void_createCaches()Creates the cachesprivate Cache<String,Set<SitemapDecorator>>_getDecoratorsCache()Set<SitemapDecorator>getDecorators(String skinName)Get the list of available decoratorsStringgetId(String sourceUrl)Get an unique ID for this File Reloadervoidinitialize()voidservice(ServiceManager smanager)voidupdateFile(String sourceUrl, Source source, InputStream is)Update the file, the sourceUrl is only there if you manage multiple files, the Configuration object is already present to read it-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
__SKIN_SOURCE_PATTERN
private static final Pattern __SKIN_SOURCE_PATTERN
-
__DECORATORS_CACHE
private static final String __DECORATORS_CACHE
-
_skinsManager
protected SkinsManager _skinsManager
The skins manager
-
_srcResolver
protected SourceResolver _srcResolver
The source resolver
-
_cacheManager
private AbstractCacheManager _cacheManager
-
_fileReloader
private FileReloaderUtils _fileReloader
-
-
Constructor Detail
-
SkinSitemapDecorators
public SkinSitemapDecorators()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
_createCaches
protected void _createCaches()
Creates the caches
-
getDecorators
public Set<SitemapDecorator> getDecorators(String skinName)
Description copied from interface:SitemapDecoratorsGet the list of available decorators- Specified by:
getDecoratorsin interfaceSitemapDecorators- Parameters:
skinName- name of the skin- Returns:
- the list of available decorators
-
updateFile
public void updateFile(String sourceUrl, Source source, InputStream is) throws Exception
Description copied from interface:FileReloaderUpdate the file, the sourceUrl is only there if you manage multiple files, the Configuration object is already present to read it- Specified by:
updateFilein interfaceFileReloader- Parameters:
sourceUrl- the url of the file.source- the source to read, can be null if no file was readis- the input stream to read, can be null if no file was read- Throws:
Exception- something went wrong while reading the inputstream
-
getId
public String getId(String sourceUrl)
Description copied from interface:FileReloaderGet an unique ID for this File Reloader- Specified by:
getIdin interfaceFileReloader- Parameters:
sourceUrl- this is passed as an argument if your class read multiple files. If it reads only one file, the full class name can be a good enough ID- Returns:
- an unique ID
-
_getDecoratorsCache
private Cache<String,Set<SitemapDecorator>> _getDecoratorsCache()
-
-