Package org.ametys.web.tags.inputdata
Class FilteredContentsInputData
- java.lang.Object
-
- org.apache.avalon.framework.logger.AbstractLogEnabled
-
- org.ametys.web.tags.inputdata.FilteredContentsInputData
-
- All Implemented Interfaces:
PluginAware
,InputData
,Contextualizable
,LogEnabled
,Serviceable
,ThreadSafe
public class FilteredContentsInputData 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 ContentTypeExtensionPoint
_contentTypeEP
The extension point for content typesprotected Context
_context
The avalon context.private ContentFilterHelper
_filterHelper
protected String
_pluginName
The plugin nameprotected AmetysObjectResolver
_resolver
The repositoryprotected SiteManager
_siteManager
The site managerprotected SourceResolver
_sourceResolver
The source resolverprotected TagProviderExtensionPoint
_tagProviderEP
The tag provider EP
-
Constructor Summary
Constructors Constructor Description FilteredContentsInputData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected List<WebContentFilter>
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 void
saxFilter(ContentHandler contentHandler, WebContentFilter filter, String siteName, String lang, Page page)
SAX a filtervoid
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
-
_contentTypeEP
protected ContentTypeExtensionPoint _contentTypeEP
The extension point for content types
-
_siteManager
protected SiteManager _siteManager
The site manager
-
_tagProviderEP
protected TagProviderExtensionPoint _tagProviderEP
The tag provider EP
-
_filterHelper
private ContentFilterHelper _filterHelper
-
-
Constructor Detail
-
FilteredContentsInputData
public FilteredContentsInputData()
-
-
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.
-
configureFilters
protected List<WebContentFilter> configureFilters() throws ProcessingException
Retrieves the configured filters- Returns:
- The list of filters
- Throws:
ProcessingException
- If an error occurred while parsing the file.
-
saxFilter
protected void saxFilter(ContentHandler contentHandler, WebContentFilter filter, String siteName, String lang, Page page) throws SAXException, IOException
SAX a filter- Parameters:
contentHandler
- The content handlerfilter
- The filter to SAXsiteName
- The current site namelang
- The current languagepage
- The current page- Throws:
SAXException
- If an errors occurs while SAXingIOException
- If an errors occurs
-
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
-
-