org.mycore.frontend.indexbrowser
Class MCRGoogleSitemapCommon

java.lang.Object
  extended by org.mycore.frontend.indexbrowser.MCRGoogleSitemapCommon

public final class MCRGoogleSitemapCommon
extends Object

This class implements all common methods th create the Google sitemap data.

Version:
$Revision: 14589 $ $Date: 2009-01-14 15:17:28 +0100 (Wed, 14 Jan 2009) $
Author:
Frank Luetzenkirchen, Jens Kupferschmidt, Thomas Scheffler (yagee)

Constructor Summary
MCRGoogleSitemapCommon()
          The constructor
MCRGoogleSitemapCommon(String baseURL)
           
 
Method Summary
protected  Document buildSitemap()
          The method build the sitemap_google.xml JDOM document over all items.
protected  Document buildSitemap(int number)
          The method call the database and build the sitemap_google.xml JDOM document.
protected  Document buildSitemapIndex(int number)
          The method build the index sitemap_google.xml JDOM document.
protected  int checkSitemapFile()
          The method compute 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 removeSitemapFiles()
          This method remove all sitemap files from the webapps directory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MCRGoogleSitemapCommon

public MCRGoogleSitemapCommon()
The constructor


MCRGoogleSitemapCommon

public MCRGoogleSitemapCommon(String baseURL)
Method Detail

checkSitemapFile

protected final int checkSitemapFile()
The method compute the number of sitemap files. If we have less than numberOfURLs URLs and only one MyCoRe type the sitemap_google.xml containted all URSs. 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 singel sitemap_google.xml file, more than one for the index and all parts.

getFileName

protected final String getFileName(int number,
                                   boolean withpath)
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.xml
withpath - true for the full path, false for the file name
Returns:
a path to sitemap_google.xml

buildSitemap

protected final Document buildSitemap()
                               throws Exception
The method build the sitemap_google.xml JDOM document over all items.

Returns:
The sitemap_google.xml as JDOM document
Throws:
Exception

buildSitemap

protected final Document buildSitemap(int number)
                               throws Exception
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

protected final Document buildSitemapIndex(int number)
                                    throws Exception
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
Throws:
Exception

removeSitemapFiles

protected final void removeSitemapFiles()
This method remove all sitemap files from the webapps directory.