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
Fields Modifier and Type Field Description protected Context
_context
The avalon context.protected CurrentUserProvider
_currentUserProvider
The current user providerprotected String
_pluginName
The plugin nameprotected RenderingContextHandler
_renderingContextHandler
The rendering context handler.protected AmetysObjectResolver
_resolver
The repositoryprotected RightManager
_rightManager
The right managerprotected SiteManager
_siteManager
The ametys sites managerprotected SourceResolver
_sourceResolver
The source resolver
-
Constructor Summary
Constructors Constructor Description FilteredPagesInputData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<PageFilter>
configureFilters()
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 Detail
-
_pluginName
protected String _pluginName
The plugin name
-
_sourceResolver
protected SourceResolver _sourceResolver
The source resolver
-
_resolver
protected AmetysObjectResolver _resolver
The repository
-
_rightManager
protected RightManager _rightManager
The right manager
-
_siteManager
protected SiteManager _siteManager
The ametys sites manager
-
_renderingContextHandler
protected RenderingContextHandler _renderingContextHandler
The rendering context handler.
-
_currentUserProvider
protected CurrentUserProvider _currentUserProvider
The current user provider
-
-
Constructor Detail
-
FilteredPagesInputData
public FilteredPagesInputData()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
isCacheable
public boolean isCacheable(Site site, Page page)
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
public void toSAX(ContentHandler contentHandler) throws SAXException, ProcessingException
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
protected boolean isPageAccessible(Page page)
Test the page accessible by the current user.- Parameters:
page
- the page- Returns:
- true if the page is accessible, false otherwise.
-
configureFilters
protected List<PageFilter> configureFilters() throws ProcessingException
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
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
setPluginInfo
public void setPluginInfo(String pluginName, String featureName, String id)
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
-
-