Package org.ametys.web.tags.inputdata
Class FilteredPagesInputData
java.lang.Object
org.apache.avalon.framework.logger.AbstractLogEnabled
org.ametys.web.tags.inputdata.FilteredPagesInputData
- All Implemented Interfaces:
PluginAware
,InputData
,Contextualizable
,LogEnabled
,Serviceable
,ThreadSafe
public class FilteredPagesInputData
extends AbstractLogEnabled
implements InputData, Serviceable, Contextualizable, ThreadSafe, PluginAware
This class generates an output with all existing filters defined on context's current page.
-
Field Summary
Modifier and TypeFieldDescriptionprotected Context
The avalon context.protected CurrentUserProvider
The current user providerprotected String
The plugin nameprotected RenderingContextHandler
The rendering context handler.protected AmetysObjectResolver
The repositoryprotected RightManager
The right managerprotected SiteManager
The ametys sites managerprotected SourceResolver
The source resolver -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected List<PageFilter>
Retrieves the configured filtersvoid
contextualize
(Context context) boolean
isCacheable
(Site site, Page page) Returns true if thisInputData
is cacheable for the current site and if possible page.protected boolean
isPageAccessible
(Page page) Test the page accessible by the current user.protected void
saxFilter
(ContentHandler contentHandler, PageFilter filter, String siteName, String lang, Page currentPage) SAX a filterprotected void
saxPage
(ContentHandler contentHandler, Page page) SAX a pagevoid
service
(ServiceManager smanager) void
setPluginInfo
(String pluginName, String featureName, String id) Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.void
toSAX
(ContentHandler contentHandler) Generates SAX events for providing data.Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface org.ametys.web.inputdata.InputData
shouldBeCached
-
Field Details
-
_pluginName
The plugin name -
_sourceResolver
The source resolver -
_resolver
The repository -
_context
The avalon context. -
_rightManager
The right manager -
_siteManager
The ametys sites manager -
_renderingContextHandler
The rendering context handler. -
_currentUserProvider
The current user provider
-
-
Constructor Details
-
FilteredPagesInputData
public FilteredPagesInputData()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
isCacheable
Description copied from interface:InputData
Returns true if thisInputData
is cacheable for the current site and if possible page.- Specified by:
isCacheable
in interfaceInputData
- Parameters:
site
- the currentSite
.page
- the currentPage
. Can be null.- Returns:
- true if this
InputData
is cacheable for the current site or page.
-
toSAX
Description copied from interface:InputData
Generates SAX events for providing data.- Specified by:
toSAX
in interfaceInputData
- Parameters:
contentHandler
- the content handler to SAX into.- Throws:
SAXException
- if an error occurs while SAXing.ProcessingException
- if an error occurs during processing.
-
saxFilter
protected void saxFilter(ContentHandler contentHandler, PageFilter filter, String siteName, String lang, Page currentPage) throws SAXException, IOException SAX a filter- Parameters:
contentHandler
- The content handlerfilter
- The filter to SAXsiteName
- The current site namelang
- The current languagecurrentPage
- The current page- Throws:
SAXException
- If an errors occurs while SAXingIOException
- If an errors occurs
-
isPageAccessible
Test the page accessible by the current user.- Parameters:
page
- the page- Returns:
- true if the page is accessible, false otherwise.
-
configureFilters
Retrieves the configured filters- Returns:
- The list of filters
- Throws:
ProcessingException
- If an error occurred while parsing the file.
-
saxPage
protected void saxPage(ContentHandler contentHandler, Page page) throws SAXException, AmetysRepositoryException SAX a page- Parameters:
contentHandler
- The content handlerpage
- The page to SAX- Throws:
SAXException
- if an error occurs while saxingAmetysRepositoryException
- if failed to get page's properties
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
setPluginInfo
Description copied from interface:PluginAware
Sets the plugin info relative to the current component.
Note : The feature name may be null if the targeted component in declared at plugin level.- Specified by:
setPluginInfo
in interfacePluginAware
- Parameters:
pluginName
- Unique identifier for the plugin hosting the extensionfeatureName
- Unique feature identifier (unique for a given pluginName)id
- Unique identifier of this component
-