Package org.ametys.web.inputdata
Class SitemapInputData
java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.web.inputdata.SitemapInputData
- All Implemented Interfaces:
FileReloader,LogEnabled,InputData,Initializable,Contextualizable,Serviceable
public class SitemapInputData
extends AbstractLogEnabled
implements InputData, Contextualizable, Serviceable, FileReloader, Initializable
InputData for SAXing events about the current sitemap.-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcontextualize(Context context) Get an unique ID for this File ReloadervoidbooleanisCacheable(Site site, Page page) Returns true if thisInputDatais cacheable for the current site and if possible page.voidservice(ServiceManager manager) booleanshouldBeCached(Site site, Page page) Returns true if the resulting SAX events should be actually stored in the centralPageElementCache.
It may be useful to return false for some InputData managing their own cache and don't wanting to waste space in the central cache.
This method is only called ifInputData.isCacheable(Site, Page)returns true.voidtoSAX(ContentHandler handler) Generates SAX events for providing data.voidupdateFile(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.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Constructor Details
-
SitemapInputData
public SitemapInputData()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
contextualize
- Specified by:
contextualizein interfaceContextualizable- Throws:
ContextException
-
isCacheable
Description copied from interface:InputDataReturns true if thisInputDatais cacheable for the current site and if possible page.- Specified by:
isCacheablein interfaceInputData- Parameters:
site- the currentSite.page- the currentPage. Can be null.- Returns:
- true if this
InputDatais cacheable for the current site or page.
-
shouldBeCached
Description copied from interface:InputDataReturns true if the resulting SAX events should be actually stored in the centralPageElementCache.
It may be useful to return false for some InputData managing their own cache and don't wanting to waste space in the central cache.
This method is only called ifInputData.isCacheable(Site, Page)returns true.- Specified by:
shouldBeCachedin interfaceInputData- Parameters:
site- the currentSite.page- the currentPage. Can be null.- Returns:
- true if the content is cacheable and should be stored in the
PageElementCache.
-
toSAX
Description copied from interface:InputDataGenerates SAX events for providing data.- Specified by:
toSAXin interfaceInputData- Parameters:
handler- the content handler to SAX into.- Throws:
SAXException- if an error occurs while SAXing.ProcessingException- if an error occurs during processing.
-
getId
Description copied from interface:FileReloaderGet an unique ID for this File Reloader- Specified by:
getIdin 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:FileReloaderUpdate the file, the sourceUrl is only there if you manage multiple files, the Configuration object is already present to read it- Specified by:
updateFilein 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
-