Package org.opencms.site.xmlsitemap
Class CmsXmlSitemapUrlBean
java.lang.Object
org.opencms.site.xmlsitemap.CmsXmlSitemapUrlBean
A bean which represents an entry in an XML sitemap for SEO purposes.
-
Constructor Summary
ConstructorsConstructorDescriptionCmsXmlSitemapUrlBean(String url, long lastModified, String changeFrequency, double priority) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionGets the change frequency string.Gets the last modification date.Gets the detail page resource in case the link is the link to a detail page, else returns null.Gets the last modification date formatted as W3C datetime.Returns the locale.Gets the original resource belonging to the link.doubleGets the priority for the page.Returns the subsite.getUrl()Gets the page URL.voidsetDetailPageResource(CmsResource detailPageResource) Sets the detail page resource.voidSets the locale.voidsetOriginalResource(CmsResource resource) Sets the original resource.voidsetSubsite(String subsite) Sets the subsite.toString()voidwriteChangefreq(StringBuffer buffer) Writes the changefreq node to the buffer.voidwriteElement(StringBuffer buffer, String tag, String content) Writes a single XML element with text content to a string buffer.voidwriteLastmod(StringBuffer buffer) Writes the lastmod node to the buffer.voidwritePriority(StringBuffer buffer) Writes the priority node to the buffer.
-
Constructor Details
-
CmsXmlSitemapUrlBean
Creates a new instance.- Parameters:
url- the URLlastModified- the last modification datechangeFrequency- the change frequency stringpriority- the priority
-
-
Method Details
-
getChangeFrequency
Gets the change frequency string.- Returns:
- the change frequency string
-
getDateLastModified
Gets the last modification date.- Returns:
- the last modification date
-
getDetailPageResource
Gets the detail page resource in case the link is the link to a detail page, else returns null.- Returns:
- the container page used as the detail page
-
getFormattedDate
Gets the last modification date formatted as W3C datetime.- Returns:
- the formatted last modification date
-
getLocale
Returns the locale.- Returns:
- the locale
-
getOriginalResource
Gets the original resource belonging to the link.In case this is a link to a detail page, the resource will be the resource displayed on the detail page
- Returns:
- the original resource
-
getPriority
Gets the priority for the page.- Returns:
- the priority
-
getSubsite
Returns the subsite.- Returns:
- the subsite
-
getUrl
Gets the page URL.- Returns:
- the page URL
-
setDetailPageResource
Sets the detail page resource.- Parameters:
detailPageResource- the detail page resource
-
setLocale
Sets the locale.- Parameters:
locale- the locale to set
-
setOriginalResource
Sets the original resource.- Parameters:
resource- the original resource
-
setSubsite
Sets the subsite.- Parameters:
subsite- the subsite to set
-
toString
-
writeChangefreq
Writes the changefreq node to the buffer.- Parameters:
buffer- the buffer to write to
-
writeElement
Writes a single XML element with text content to a string buffer.- Parameters:
buffer- the string buffer to write totag- the XML tag namecontent- the content of the XML element
-
writeLastmod
Writes the lastmod node to the buffer.- Parameters:
buffer- the buffer to write to
-
writePriority
Writes the priority node to the buffer.- Parameters:
buffer- the buffer to write to
-