org.dspace.app.xmlui.cocoon
Class SitemapReader

java.lang.Object
  extended by org.apache.cocoon.util.AbstractLogEnabled
      extended by org.apache.cocoon.reading.AbstractReader
          extended by org.dspace.app.xmlui.cocoon.SitemapReader
All Implemented Interfaces:
org.apache.avalon.excalibur.pool.Poolable, org.apache.avalon.excalibur.pool.Recyclable, org.apache.cocoon.reading.Reader, org.apache.cocoon.sitemap.SitemapModelComponent, org.apache.cocoon.sitemap.SitemapOutputComponent

public class SitemapReader
extends org.apache.cocoon.reading.AbstractReader
implements org.apache.avalon.excalibur.pool.Recyclable

Class will read a generated Sitemap (www.sitemaps.org or HTML sitemap) from [dspace]/sitemaps/ and serve it up to the requesting Search Engine. Sitemaps are generated by running the [dspace]/bin/generate-sitemaps script. There are essentially two types of Sitemaps: (1) Basic HTML Sitemaps path = "/htmlmap" <map:read type="SitemapReader"> <map:parameter name="type" value="html"/> </map:read> (2) Sitemaps.org XML Sitemaps path = "/sitemap" <map:read type="SitemapReader"> <map:parameter name="type" value="sitemaps.org"/> </map:read>

Author:
Tim Donohue

Field Summary
protected  org.apache.cocoon.environment.Request request
          The Cocoon request
protected  org.apache.cocoon.environment.Response response
          The Cocoon response
protected  String sitemapMimeType
          The sitemap's mime-type
 
Fields inherited from class org.apache.cocoon.reading.AbstractReader
objectModel, out, parameters, resolver, source
 
Fields inherited from interface org.apache.cocoon.reading.Reader
ROLE
 
Constructor Summary
SitemapReader()
           
 
Method Summary
 void generate()
          Generate the output.
 String getMimeType()
          Returns the mime-type of the sitemap
 void recycle()
          Recycle
 void setup(org.apache.cocoon.environment.SourceResolver resolver, Map objectModel, String src, org.apache.avalon.framework.parameters.Parameters par)
          Set up the bitstream reader.
 
Methods inherited from class org.apache.cocoon.reading.AbstractReader
getLastModified, setOutputStream, shouldSetContentLength
 
Methods inherited from class org.apache.cocoon.util.AbstractLogEnabled
getLogger, setLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

response

protected org.apache.cocoon.environment.Response response
The Cocoon response


request

protected org.apache.cocoon.environment.Request request
The Cocoon request


sitemapMimeType

protected String sitemapMimeType
The sitemap's mime-type

Constructor Detail

SitemapReader

public SitemapReader()
Method Detail

setup

public void setup(org.apache.cocoon.environment.SourceResolver resolver,
                  Map objectModel,
                  String src,
                  org.apache.avalon.framework.parameters.Parameters par)
           throws org.apache.cocoon.ProcessingException,
                  SAXException,
                  IOException
Set up the bitstream reader. See the class description for information on configuration options.

Specified by:
setup in interface org.apache.cocoon.sitemap.SitemapModelComponent
Overrides:
setup in class org.apache.cocoon.reading.AbstractReader
Throws:
org.apache.cocoon.ProcessingException
SAXException
IOException

generate

public void generate()
              throws IOException,
                     org.apache.cocoon.ProcessingException
Generate the output. Determine which type of sitemap is being requested and setup the main request parameters

Specified by:
generate in interface org.apache.cocoon.reading.Reader
Throws:
IOException
org.apache.cocoon.ProcessingException

getMimeType

public String getMimeType()
Returns the mime-type of the sitemap

Specified by:
getMimeType in interface org.apache.cocoon.sitemap.SitemapOutputComponent
Overrides:
getMimeType in class org.apache.cocoon.reading.AbstractReader

recycle

public void recycle()
Recycle

Specified by:
recycle in interface org.apache.avalon.excalibur.pool.Recyclable
Overrides:
recycle in class org.apache.cocoon.reading.AbstractReader


Copyright © 2012 DuraSpace. All Rights Reserved.