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
-
Method Summary
Modifier and TypeMethodDescriptionvoid
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.void
service
(ServiceManager manager) boolean
shouldBeCached
(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.void
toSAX
(ContentHandler handler) 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.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Constructor Details
-
SitemapInputData
public SitemapInputData()
-
-
Method Details
-
service
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
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.
-
shouldBeCached
Description copied from interface:InputData
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.- Specified by:
shouldBeCached
in 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:InputData
Generates SAX events for providing data.- Specified by:
toSAX
in 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: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
-