Package org.mycore.frontend.indexbrowser
Class MCRGoogleSitemapCommon
java.lang.Object
org.mycore.frontend.indexbrowser.MCRGoogleSitemapCommon
This class implements all common methods to create the sitemap data.
used properties:
used properties:
- MCR.baseurl - the application base URL
- MCR.WebApplication.basedir - the directory where the web application is stored
- MCR.GoogleSitemap.Directory - the directory where the sitemap should be stored relative to MCR.WebApplication.basedir (it could be empty)
- MCR.GoogleSitemap.Types - a list of MCRObject types, they should be included
- MCR.GoogleSitemap.Freq - the frequency of harvesting, 'monthly' is default
- MCR.GoogleSitemap.Style - a style extension for the URL in form of ?XSL.Style={style}, default is empty
- MCR.GoogleSitemap.ObjectPath - the path to get the MCRObject in the sitemap URL, 'receive/' is default
- MCR.GoogleSitemap.NumberOfURLs - the number of URLs in one sitemap file, 10000 is default
- Version:
- $Revision$ $Date$
- Author:
- Frank Lützenkirchen, Jens Kupferschmidt, Thomas Scheffler (yagee)
-
Constructor Summary
ConstructorDescriptionMCRGoogleSitemapCommon
(File baseDir) The constructorMCRGoogleSitemapCommon
(String baseURL, File baseDir) -
Method Summary
Modifier and TypeMethodDescriptionprotected Document
buildPartSitemap
(int number) The method call the database and build the sitemap_google.xml JDOM document.protected Document
The method build the sitemap_google.xml JDOM document over all items.protected Document
buildSitemapIndex
(int number) The method build the index sitemap_google.xml JDOM document.protected int
The method computes the number of sitemap files.protected String
getFileName
(int number, boolean withpath) The method return the path to the sitemap_google.xml file.protected void
This method remove all sitemap files from the webapps directory.
-
Constructor Details
-
MCRGoogleSitemapCommon
The constructor- Throws:
NotDirectoryException
-
MCRGoogleSitemapCommon
- Throws:
NotDirectoryException
-
-
Method Details
-
checkSitemapFile
The method computes the number of sitemap files. If we have less than numberOfURLs URLs and only one MyCoRe type the sitemap_google.xml contained all URLs. Otherwise it split the sitemap in an sitemap_google.xml index file and a lot of sitemap_google_xxxx.xml URL files.- Returns:
- the number of files, one for a single sitemap_google.xml file, more than one for the index and all parts.
- Throws:
IOException
-
getFileName
The method return the path to the sitemap_google.xml file.- Parameters:
number
- number of this file - '1' = sitemap_google.xml - '> 1' sitemap_google_xxx.xmlwithpath
- true for the full path, false for the file name- Returns:
- a path to sitemap_google.xml
-
buildSingleSitemap
The method build the sitemap_google.xml JDOM document over all items.- Returns:
- The sitemap_google.xml as JDOM document
- Throws:
Exception
-
buildPartSitemap
The method call the database and build the sitemap_google.xml JDOM document.- Parameters:
number
- number of this file - '1' = sitemap_google.xml - '> 1' sitemap_google_xxx.xml- Returns:
- The sitemap.xml as JDOM document
- Throws:
Exception
-
buildSitemapIndex
The method build the index sitemap_google.xml JDOM document.- Parameters:
number
- number of indexed files (must greater than 1- Returns:
- The index sitemap_google.xml as JDOM document
-
removeSitemapFiles
protected void removeSitemapFiles()This method remove all sitemap files from the webapps directory.
-