org.weborganic.bastille.psml
Class GetContentFileAuto

java.lang.Object
  extended by org.weborganic.bastille.psml.GetContentFileAuto
All Implemented Interfaces:
Cacheable, ContentGenerator

public final class GetContentFileAuto
extends Object
implements ContentGenerator, Cacheable

This generator returns the content of a PSML file using the Berlioz path from content folder.

This generator behaves as if its were using the Berlioz path as path parameter of the GetContentFile generator

The Berlioz path depends on the mapping of the Berlioz servlet in the Web descriptor (web.xml) and usually corresponds to the value of the '*' in the path component of a matching URL. The Berlioz path is then appended to the /content folder and added the '.psml' extension. to identify the file to load.

Configuration

No configuration is required.

The root of the PSML folder can be configured using the global property bastille.psml.root which can be either an absolute path or a relative path from the global repository.

By default, the PSML root is set to "psml" which usually corresponds to the /WEB-INF/psml folder of your Web application.

Parameters

This generator does not accept or require any parameter.

Returned XML

Like most PSML generators returning a PSML file, this generator will wrap the content of the file with the <psml-file> element. The base attribute is the relative path from the PSML root to the folder, since references (xrefs and image sources) in PSML are relative, this attribute can be used to construct the path to images or cross-referenced documents.

Since:
0.7.5

Constructor Summary
GetContentFileAuto()
           
 
Method Summary
 String getETag(ContentRequest req)
           
 void process(ContentRequest req, XMLWriter xml)
           
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GetContentFileAuto

public GetContentFileAuto()
Method Detail

getETag

public String getETag(ContentRequest req)
Specified by:
getETag in interface Cacheable

process

public void process(ContentRequest req,
                    XMLWriter xml)
             throws BerliozException,
                    IOException
Specified by:
process in interface ContentGenerator
Throws:
BerliozException
IOException