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:
FileReloader
,PluginAware
,InputData
,Initializable
,Contextualizable
,LogEnabled
,Serviceable
,ThreadSafe
public class FilteredContentsInputData
extends AbstractLogEnabled
implements InputData, Serviceable, Contextualizable, ThreadSafe, PluginAware, FileReloader, Initializable
This class generates an output with all existing filters defined on context's current page.
-
Field Summary
Modifier and TypeFieldDescriptionprotected ContentTypeExtensionPoint
The extension point for content typesprotected Context
The avalon context.protected String
The plugin nameprotected AmetysObjectResolver
The repositoryprotected SiteManager
The site managerprotected SourceResolver
The source resolverprotected TagProviderExtensionPoint
The tag provider EP -
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionprotected List<WebContentFilter>
configureFilters
(Site site, Page page) Retrieves the configured filtersvoid
contextualize
(Context context) Get an unique ID for this File Reloadervoid
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.void
updateFile
(String sourceUrl, Source source, InputStream is) Update the file, the sourceUrl is only there if you manage multiple files, the Configuration object is already present to read itMethods 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 -
_contentTypeEP
The extension point for content types -
_context
The avalon context. -
_siteManager
The site manager -
_tagProviderEP
The tag provider EP
-
-
Constructor Details
-
FilteredContentsInputData
public FilteredContentsInputData()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
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.
-
configureFilters
Retrieves the configured filters -
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
- 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
-
getId
Description copied from interface:FileReloader
Get an unique ID for this File Reloader- Specified by:
getId
in interfaceFileReloader
- Parameters:
sourceUrl
- this is passed as an argument if your class read multiple files. If it reads only one file, the full class name can be a good enough ID- Returns:
- an unique ID
-
updateFile
Description copied from interface:FileReloader
Update the file, the sourceUrl is only there if you manage multiple files, the Configuration object is already present to read it- Specified by:
updateFile
in interfaceFileReloader
- Parameters:
sourceUrl
- the url of the file.source
- the source to read, can be null if no file was readis
- the input stream to read, can be null if no file was read- Throws:
Exception
- something went wrong while reading the inputstream
-