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 String |
_configurationError |
private Context |
_context
The Avalon context
|
protected CurrentUserProvider |
_currentUserProvider
The current user provider
|
private DirectoryHelper |
_directoryHelper |
private long |
_lastConfUpdate
The last time the file was loaded
|
private SourceResolver |
_sourceResolver
Excalibur source resolver
|
private List<LinkDirectoryInputData.ThemeInputData> |
_themesCache
Cache for themes: <template, List<themeName, lang>>
|
| Constructor and Description |
|---|
LinkDirectoryInputData() |
| Modifier and Type | Method and Description |
|---|---|
private void |
_cacheConfigurationValues(Source source)
Read the configuration values and store them
|
private List<String> |
_getConfiguredThemes(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 |
_getTemplate(Request request)
Get the current template
|
private Map<String,Boolean> |
_getTemplateProperties(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()
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, setupLoggerprivate static final String __CONF_FILE_PATH
private static final String __WILDCARD
protected CurrentUserProvider _currentUserProvider
private SourceResolver _sourceResolver
private DirectoryHelper _directoryHelper
private List<LinkDirectoryInputData.ThemeInputData> _themesCache
private String _configurationError
private long _lastConfUpdate
public LinkDirectoryInputData()
public void contextualize(Context context) throws ContextException
contextualize in interface ContextualizableContextExceptionpublic void initialize() throws Exception
initialize in interface InitializableExceptionpublic void service(ServiceManager manager) throws ServiceException
service in interface ServiceableServiceExceptionpublic boolean isCacheable(Site site, Page currentPage)
InputDataInputData is cacheable for the current site and if possible page.isCacheable in interface InputDatasite - 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
InputDatatoSAX in interface InputDatacontentHandler - 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
SAXExceptionprivate void _saxLinks(ContentHandler contentHandler, UserIdentity user, Request request, List<String> themeIds, boolean displayUserLinks) throws ProcessingException
ProcessingExceptionprivate List<String> _getConfiguredThemes(String template, String lang)
template - the current page's templatelang - the current languageprivate Map<String,Boolean> _getTemplateProperties(String template)
template - the template's nameprivate void _updateConfigurationValues() throws Exception
Exception - if an exception occursprivate void _cacheConfigurationValues(Source source)
source - the file's sourceprivate String _getTemplate(Request request)
request - the request