Package org.ametys.web.sitemap
Class DefaultSitemapDecoratorsHandler
- java.lang.Object
-
- org.ametys.web.sitemap.DefaultSitemapDecoratorsHandler
-
- All Implemented Interfaces:
SitemapDecoratorsHandler
,Component
,Contextualizable
,Serviceable
public class DefaultSitemapDecoratorsHandler extends Object implements SitemapDecoratorsHandler, Serviceable, Contextualizable, Component
Default implementation ofSitemapDecoratorsHandler
-
-
Field Summary
Fields Modifier and Type Field Description private AmetysObjectResolver
_ametysResolver
private Context
_context
private Map<String,List<SitemapDecorator>>
_decorators
private Map<String,List<SitemapIcon>>
_icons
protected Map<String,Long>
_lastConfUpdate
The last time the file was loadedprivate static org.slf4j.Logger
_logger
private RightManager
_rightManager
private SourceResolver
_sourceResolver
-
Fields inherited from interface org.ametys.web.sitemap.SitemapDecoratorsHandler
ROLE
-
-
Constructor Summary
Constructors Constructor Description DefaultSitemapDecoratorsHandler()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description private boolean
_findAllValuesInMultipleData(String valueToTest, Object valueFromDataHolder, ElementType type)
protected boolean
_matches(SitemapIcon icon, Page page)
Determines if page matches the decoratorprotected boolean
_matches(SitemapIcon icon, Sitemap sitemap)
Determines if page matches the decorator(package private) boolean
_matchesAndData(Map<String,String> data, ModelLessDataHolder dataHolder)
private boolean
_matchesAndProperties(Map<String,String> properties, PagesContainer page)
private boolean
_matchesMetadata(SitemapIcon icon, MetadataAwarePagesContainer page)
private boolean
_matchesOrData(String dataPath, Map<String,String> data, ModelLessDataHolder dataHolder)
(package private) boolean
_matchesOrData(Map<String,String> data, ModelLessDataHolder dataHolder)
private boolean
_matchesOrProperties(Map<String,String> properties, PagesContainer page)
private boolean
_matchesProperties(SitemapIcon icon, PagesContainer page)
private boolean
_matchesTags(SitemapIcon icon, Page page)
void
contextualize(Context context)
List<SitemapDecorator>
getDecorators(Page page)
Get the list of decorators for a given pageList<SitemapDecorator>
getDecorators(Site site)
Get the list of available decoratorsList<SitemapDecorator>
getDecorators(Sitemap sitemap)
Get the list of available decoratorsSitemapIcon
getIcon(Page page)
Get the icon of the pageList<SitemapIcon>
getIcons(Site site)
Get the list of available iconsvoid
refreshValues(String skinId)
Refresh the configuration valuesvoid
service(ServiceManager manager)
-
-
-
Field Detail
-
_logger
private static org.slf4j.Logger _logger
-
_lastConfUpdate
protected Map<String,Long> _lastConfUpdate
The last time the file was loaded
-
_icons
private Map<String,List<SitemapIcon>> _icons
-
_decorators
private Map<String,List<SitemapDecorator>> _decorators
-
_ametysResolver
private AmetysObjectResolver _ametysResolver
-
_sourceResolver
private SourceResolver _sourceResolver
-
_rightManager
private RightManager _rightManager
-
-
Constructor Detail
-
DefaultSitemapDecoratorsHandler
public DefaultSitemapDecoratorsHandler()
-
-
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
-
getIcons
public List<SitemapIcon> getIcons(Site site)
Description copied from interface:SitemapDecoratorsHandler
Get the list of available icons- Specified by:
getIcons
in interfaceSitemapDecoratorsHandler
- Parameters:
site
- the site name- Returns:
- the list of available icons
-
getIcon
public SitemapIcon getIcon(Page page)
Description copied from interface:SitemapDecoratorsHandler
Get the icon of the page- Specified by:
getIcon
in interfaceSitemapDecoratorsHandler
- Parameters:
page
- the page- Returns:
- the file icon path
-
getDecorators
public List<SitemapDecorator> getDecorators(Site site)
Description copied from interface:SitemapDecoratorsHandler
Get the list of available decorators- Specified by:
getDecorators
in interfaceSitemapDecoratorsHandler
- Parameters:
site
- the site name- Returns:
- the list of available decorators
-
getDecorators
public List<SitemapDecorator> getDecorators(Sitemap sitemap)
Description copied from interface:SitemapDecoratorsHandler
Get the list of available decorators- Specified by:
getDecorators
in interfaceSitemapDecoratorsHandler
- Parameters:
sitemap
- the sitemap- Returns:
- the list of available decorators
-
getDecorators
public List<SitemapDecorator> getDecorators(Page page)
Description copied from interface:SitemapDecoratorsHandler
Get the list of decorators for a given page- Specified by:
getDecorators
in interfaceSitemapDecoratorsHandler
- Parameters:
page
- the page- Returns:
- decorators of page
-
_matches
protected boolean _matches(SitemapIcon icon, Sitemap sitemap)
Determines if page matches the decorator- Parameters:
icon
- the iconsitemap
- the sitemap- Returns:
- true if the page matches the decorator
-
_matches
protected boolean _matches(SitemapIcon icon, Page page)
Determines if page matches the decorator- Parameters:
icon
- the iconpage
- the page to test- Returns:
- true if the page matches the decorator
-
_matchesTags
private boolean _matchesTags(SitemapIcon icon, Page page)
-
_matchesMetadata
private boolean _matchesMetadata(SitemapIcon icon, MetadataAwarePagesContainer page)
-
_matchesProperties
private boolean _matchesProperties(SitemapIcon icon, PagesContainer page)
-
_matchesAndProperties
private boolean _matchesAndProperties(Map<String,String> properties, PagesContainer page)
-
_matchesOrProperties
private boolean _matchesOrProperties(Map<String,String> properties, PagesContainer page)
-
_matchesAndData
boolean _matchesAndData(Map<String,String> data, ModelLessDataHolder dataHolder)
-
_matchesOrData
boolean _matchesOrData(Map<String,String> data, ModelLessDataHolder dataHolder)
-
_matchesOrData
private boolean _matchesOrData(String dataPath, Map<String,String> data, ModelLessDataHolder dataHolder)
-
_findAllValuesInMultipleData
private boolean _findAllValuesInMultipleData(String valueToTest, Object valueFromDataHolder, ElementType type)
-
refreshValues
public void refreshValues(String skinId)
Refresh the configuration values- Parameters:
skinId
- the skin name
-
-