org.weborganic.berlioz.generator
Class GetGlobalConfig

java.lang.Object
  extended by org.weborganic.berlioz.generator.GetGlobalConfig
All Implemented Interfaces:
Cacheable, ContentGenerator

public final class GetGlobalConfig
extends Object
implements ContentGenerator, Cacheable

Returns the global properties as XML.

Configuration

There is no configuration associated with this generator.

Parameters

This generator does not use and require any parameter.

Returned XML

This generator returns a flat list of the global properties as XML as below:

<properties source="[source]">
   <property name="[nameA]" value="[valueA]"/>
   <property name="[nameB]" value="[valueB]"/>
   <property name="[nameC]" value="[valueC]"/>
   ...
 </properties>
 

Etag

This generator uses a weak etag based on the name, length and last modified date of the properties file being loaded.

Since:
Berlioz 0.8
Version:
Berlioz 0.9.0 - 13 October 2011
Author:
Christophe Lauret

Constructor Summary
GetGlobalConfig()
           
 
Method Summary
 String getETag(ContentRequest req)
          Returns a ETag based on the last modified date and length of the global propertied file.
 void process(ContentRequest req, XMLWriter xml)
          Produces the actual content.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetGlobalConfig

public GetGlobalConfig()
Method Detail

getETag

public String getETag(ContentRequest req)
Returns a ETag based on the last modified date and length of the global propertied file. Returns the ETag for the specified content request.

Specified by:
getETag in interface Cacheable
Parameters:
req - the content request.
Returns:
The corresponding ETag.

process

public void process(ContentRequest req,
                    XMLWriter xml)
             throws IOException
Description copied from interface: ContentGenerator
Produces the actual content.

This is the main method of this interface, it should:

Implementation should specify which attribute or parameters are used or required.

Specified by:
process in interface ContentGenerator
Parameters:
req - The content request.
xml - The XML output.
Throws:
IOException - If an I/O error occurs while writing to the XML writer.