org.weborganic.berlioz.generator
Class NoContent

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

public final class NoContent
extends Object
implements ContentGenerator, Cacheable

Generates no content.

This content generator is useful for when the XML header already contains enough information for the purpose of application.

This generator can also be useful to be picked up by the XSLT even if no content is required.

Configuration

There is no configuration associated with this generator.

Parameters

This generator does not use and require any parameter.

Returned XML

This generator does not have any content, so the XML content is always empty.

Since Berlioz always wraps generators' content, the final XML is always:

<content generator="org.weborganic.berlioz.generator.NoContent"
               name="[name]" target="[target]" status="ok"/>

Note: since this generator does produce any data, the return status is always ok.

Usage

To use this generator in Berlioz (in /WEB-INF/config/services.xml):

<generator class="org.weborganic.berlioz.generator.NoContent"
                         name="[name]" target="[target]"/>

Etag

This Etag for this generator is always "nocontent".

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

Constructor Summary
NoContent()
           
 
Method Summary
 String getETag(ContentRequest req)
          Always returns the "nocontent".
 void process(ContentRequest req, XMLWriter xml)
          Do nothing.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NoContent

public NoContent()
Method Detail

getETag

public String getETag(ContentRequest req)
Always returns the "nocontent". 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)
Do nothing. 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.