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 -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected 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.voidvoidservice(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 Details
-
ROLE
Avalon role. -
NAMESPACE_PREFIX
Prefix for sitemap namespace.- See Also:
-
NAMESPACE_URI
URI for sitemap namespace.- See Also:
-
-
Constructor Details
-
SitemapSaxer
public SitemapSaxer()
-
-
Method Details
-
service
- Specified by:
servicein interfaceServiceable- Throws:
ServiceException
-
initialize
- Specified by:
initializein interfaceInitializable- Throws:
Exception
-
clearCache
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.
-