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 Constructor Description SitemapInputData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
contextualize(Context context)
String
getId(String sourceUrl)
Get an unique ID for this File Reloadervoid
initialize()
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 it-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Constructor Detail
-
SitemapInputData
public SitemapInputData()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
service
in interfaceServiceable
- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
contextualize
public void contextualize(Context context) throws ContextException
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
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.
-
shouldBeCached
public boolean shouldBeCached(Site site, Page page)
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
public void toSAX(ContentHandler handler) throws SAXException, ProcessingException
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
public String getId(String sourceUrl)
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
public void updateFile(String sourceUrl, Source source, InputStream is) throws Exception
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
-
-