public class LinkDirectoryInputData extends AbstractLogEnabled implements Contextualizable, InputData, Initializable, Serviceable
Modifier and Type | Class and Description |
---|---|
private class |
LinkDirectoryInputData.ThemeInputData |
Modifier and Type | Field and Description |
---|---|
private static String |
__CONF_FILE_PATH
The path to the configuration file
|
private static String |
__WILDCARD
The wildcard
|
private Map<String,String> |
_configurationError |
private Context |
_context
The Avalon context
|
protected CurrentUserProvider |
_currentUserProvider
The current user provider
|
private DirectoryHelper |
_directoryHelper |
private Map<String,Long> |
_lastConfUpdate
The last time the file was loaded
|
private SourceResolver |
_sourceResolver
Excalibur source resolver
|
private Map<String,List<LinkDirectoryInputData.ThemeInputData>> |
_themesCache
Cache for themes: <skinId, List<theme info>>
|
Constructor and Description |
---|
LinkDirectoryInputData() |
Modifier and Type | Method and Description |
---|---|
private void |
_cacheConfigurationValues(Source source,
String skinId)
Read the configuration values and store them
|
private List<String> |
_getConfiguredThemes(String skinId,
String template,
String lang)
Retrieve the configured themes names defined in the skin file link-themes.xml for the current template and current language
|
private String |
_getSkin(Request request)
Get the current skin
|
private String |
_getTemplate(Request request)
Get the current template
|
private Map<String,Boolean> |
_getTemplateProperties(String skinId,
String template)
Retrieve the "configurable" and "applicable" attributes of a template of the configuration file
|
private void |
_saxLinks(ContentHandler contentHandler,
UserIdentity user,
Request request,
List<String> themeIds,
boolean displayUserLinks) |
private void |
_saxThemes(ContentHandler contentHandler,
List<String> themeIds,
List<String> unknownThemesNames) |
private void |
_updateConfigurationValues(String skinId)
Update the configuration values : read them if the map is empty, update them if the file was changed or simply return them
|
void |
contextualize(Context context) |
void |
initialize() |
boolean |
isCacheable(Site site,
Page currentPage)
Returns true if this
InputData is cacheable for the current site and if possible page. |
void |
service(ServiceManager manager) |
void |
toSAX(ContentHandler contentHandler)
Generates SAX events for providing data.
|
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
private static final String __CONF_FILE_PATH
private static final String __WILDCARD
protected CurrentUserProvider _currentUserProvider
private SourceResolver _sourceResolver
private DirectoryHelper _directoryHelper
private Map<String,List<LinkDirectoryInputData.ThemeInputData>> _themesCache
private Map<String,String> _configurationError
private Map<String,Long> _lastConfUpdate
public LinkDirectoryInputData()
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public void initialize() throws Exception
initialize
in interface Initializable
Exception
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public boolean isCacheable(Site site, Page currentPage)
InputData
InputData
is cacheable for the current site and if possible page.isCacheable
in interface InputData
site
- the current Site
.currentPage
- the current Page
. Can be null.InputData
is cacheable for the current site or page.public void toSAX(ContentHandler contentHandler) throws ProcessingException
InputData
toSAX
in interface InputData
contentHandler
- the content handler to SAX into.ProcessingException
- if an error occurs during processing.private void _saxThemes(ContentHandler contentHandler, List<String> themeIds, List<String> unknownThemesNames) throws SAXException
SAXException
private void _saxLinks(ContentHandler contentHandler, UserIdentity user, Request request, List<String> themeIds, boolean displayUserLinks) throws ProcessingException
ProcessingException
private List<String> _getConfiguredThemes(String skinId, String template, String lang)
skinId
- The skintemplate
- the current page's templatelang
- the current languageprivate Map<String,Boolean> _getTemplateProperties(String skinId, String template)
skinId
- The skintemplate
- the template's nameprivate void _updateConfigurationValues(String skinId) throws Exception
skinId
- The skinException
- if an exception occursprivate void _cacheConfigurationValues(Source source, String skinId)
source
- the file's sourceskinId
- The skinprivate String _getTemplate(Request request)
request
- the request