Package org.ametys.web.inputdata
Class SitemapSaxer
- java.lang.Object
-
- org.ametys.runtime.plugin.component.AbstractLogEnabled
-
- org.ametys.web.inputdata.SitemapSaxer
-
- All Implemented Interfaces:
LogEnabled,Initializable,Component,Serviceable
public class SitemapSaxer extends AbstractLogEnabled implements Serviceable, Component, Initializable
Send a sitemap as SAX events. Handles both cacheable and non-cacheable cases.
-
-
Field Summary
Fields Modifier and Type Field Description static StringNAMESPACE_PREFIXPrefix for sitemap namespace.static StringNAMESPACE_URIURI for sitemap namespace.static StringROLEAvalon role.
-
Constructor Summary
Constructors Constructor Description SitemapSaxer()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected org.ametys.web.inputdata.SitemapSaxer.PageStatus_saxCurrentStatus(String currentPagePath, String pagePath, AttributesImpl attrs)SAX current status.voidclearCache(String siteName, String workspace)Clear the page cache.voidinitialize()voidservice(ServiceManager manager)voidtoSAX(ContentHandler contentHandler, String siteName, String sitemapName, Page currentPage, int initialDepth, int descendantDepth)Send SAX events representing pages from a sitemap.-
Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
-
-
-
Field Detail
-
NAMESPACE_PREFIX
public static final String NAMESPACE_PREFIX
Prefix for sitemap namespace.- See Also:
- Constant Field Values
-
NAMESPACE_URI
public static final String NAMESPACE_URI
URI for sitemap namespace.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
SitemapSaxer
public SitemapSaxer()
-
-
Method Detail
-
service
public void service(ServiceManager manager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
public void initialize() throws Exception
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
clearCache
public void clearCache(String siteName, String workspace)
Clear the page cache.- Parameters:
siteName- the site.workspace- the JCR workspace.
-
toSAX
public void toSAX(ContentHandler contentHandler, String siteName, String sitemapName, Page currentPage, int initialDepth, int descendantDepth) throws SAXException, ProcessingException
Send SAX events representing pages from a sitemap.- Parameters:
contentHandler- the SAX handler.siteName- the site name.sitemapName- the sitemap name.currentPage- the currentPage.initialDepth- max depth from the root.descendantDepth- max depth under the current page.- Throws:
SAXException- if an error occurs with the content handler.ProcessingException- if an error occurs while processing data.
-
_saxCurrentStatus
protected org.ametys.web.inputdata.SitemapSaxer.PageStatus _saxCurrentStatus(String currentPagePath, String pagePath, AttributesImpl attrs)
SAX current status.- Parameters:
currentPagePath- the path to the current page.pagePath- the path to the page to process.attrs- the attributes to populate.- Returns:
- the current status.
-
-