no.sesat.sitemap
Class SitemapGenerator

java.lang.Object
  extended by no.sesat.sitemap.SitemapGenerator

public final class SitemapGenerator
extends Object

A class for generating sitemaps. The entries are provided by implementors of no.sesat.commons.sitemaps.PageProvider. This class will generate a sitemap index file and any number of sitemap files required to meet the size resitriction of a single sitemap file. A list of no.sesat.search.sitemap.PageProvider can be supplied at instantiation. Another options is to have this class load providers available in a skin using the the java6 ServiceLoader mechanism. The main method of this class expect three parameters:

Version:
$Id: SitemapGenerator.java 6596 2008-05-10 10:05:48Z ssmiweve $

Constructor Summary
SitemapGenerator(Collection<PageProvider> providers, File dest, URI url)
          Creates a new generator.
SitemapGenerator(URI site, File dest, URI url)
          Creates a new instance loading any providers found in the provided skin.
 
Method Summary
 void generate()
          Generate the sitemap files.
static void main(String[] args)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SitemapGenerator

public SitemapGenerator(Collection<PageProvider> providers,
                        File dest,
                        URI url)
                 throws IOException
Creates a new generator.

Parameters:
providers - the list of page providers to use.
dest - the destination directory.
url - the public url corresponding to the the destination directory.
Throws:
IOException - if the files could not be written.

SitemapGenerator

public SitemapGenerator(URI site,
                        File dest,
                        URI url)
                 throws IOException
Creates a new instance loading any providers found in the provided skin.

Parameters:
site - The skin to generate a sitemap for
dest - The directory to write files to.
url - The URI at which this directory is accessible using HTTP.
Throws:
IOException - If the files can't be written.
Method Detail

main

public static void main(String[] args)
                 throws URISyntaxException,
                        IOException,
                        TransformerConfigurationException,
                        SAXException
Throws:
URISyntaxException
IOException
TransformerConfigurationException
SAXException

generate

public void generate()
              throws IOException,
                     SAXException
Generate the sitemap files.

Throws:
IOException - if the files could not be created.
SAXException - if a xml error occurs.


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.