public class SitemapInputData extends AbstractLogEnabled implements InputData, Contextualizable, Serviceable, FileReloader
InputData
for SAXing events about the current sitemap.Modifier and Type | Field and Description |
---|---|
private static int |
__DEFAULT_DESCENDANT_DEPTH |
private static int |
__DEFAULT_INITIAL_DEPTH |
private static String |
__DESCENDANT_DEPTH |
private static String |
__INITIAL_DEPTH |
private Context |
_context |
private FileReloaderUtils |
_fileReloaderUtils |
private SiteManager |
_siteManager |
private Map<String,Map<String,Integer>> |
_sitemapCfgCache |
private SitemapSaxer |
_sitemapSaxer |
Constructor and Description |
---|
SitemapInputData() |
Modifier and Type | Method and Description |
---|---|
private String |
_getSkinId() |
private void |
_loadSitemapConfiguration() |
private int |
_parseInt(Configuration cfg,
String tagName,
int defaultValue) |
void |
contextualize(Context context) |
String |
getId(String sourceUrl)
Get an unique ID for this File Reloader
|
boolean |
isCacheable(Site site,
Page page)
Returns true if this
InputData 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 central
PageElementCache .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 if InputData.isCacheable(Site, Page) returns true. |
void |
toSAX(ContentHandler handler)
Generates SAX events for providing data.
|
void |
updateFile(String sourceUrl,
InputStream is)
Update the file, the sourceUrl is only there if you manage multiple files, the Configuration object is already present to read it
|
getLogger, setLogger
private static final String __INITIAL_DEPTH
private static final String __DESCENDANT_DEPTH
private static final int __DEFAULT_INITIAL_DEPTH
private static final int __DEFAULT_DESCENDANT_DEPTH
private SitemapSaxer _sitemapSaxer
private FileReloaderUtils _fileReloaderUtils
private SiteManager _siteManager
public SitemapInputData()
public void service(ServiceManager manager) throws ServiceException
service
in interface Serviceable
ServiceException
public void contextualize(Context context) throws ContextException
contextualize
in interface Contextualizable
ContextException
public boolean isCacheable(Site site, Page page)
InputData
InputData
is cacheable for the current site and if possible page.isCacheable
in interface InputData
site
- the current Site
.page
- the current Page
. Can be null.InputData
is cacheable for the current site or page.public boolean shouldBeCached(Site site, Page page)
InputData
PageElementCache
.InputData.isCacheable(Site, Page)
returns true.shouldBeCached
in interface InputData
site
- the current Site
.page
- the current Page
. Can be null.PageElementCache
.public void toSAX(ContentHandler handler) throws SAXException, ProcessingException
InputData
toSAX
in interface InputData
handler
- the content handler to SAX into.SAXException
- if an error occurs while SAXing.ProcessingException
- if an error occurs during processing.private void _loadSitemapConfiguration()
public String getId(String sourceUrl)
FileReloader
getId
in interface FileReloader
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 IDprivate String _getSkinId()
public void updateFile(String sourceUrl, InputStream is) throws Exception
FileReloader
updateFile
in interface FileReloader
sourceUrl
- the url of the file.is
- the input stram to read, can be null if no file was readException
- something went wrong while reading the inputstreamprivate int _parseInt(Configuration cfg, String tagName, int defaultValue)