org.weborganic.bastille.xml
Class GetXMLFileFromRelativePathParameter

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

public final class GetXMLFileFromRelativePathParameter
extends Object
implements ContentGenerator, Cacheable

This generator returns the static content by providing relative path parameter.

Only return the content under the website root folder, by default ( WEB-INF/xml ).

Parameter

Use the element parameter to define relative-path in server.xml.

Sample Berlioz config:

 <generator class="org.weborganic.bastille.xml.GetXMLFileFromRelativePathParameter" name="navigation" target="navigation">
     <parameter name="relative-path" value="config/navigation.xml" />
   </generator>
  


Constructor Summary
GetXMLFileFromRelativePathParameter()
           
 
Method Summary
static String addXMLExtension(String loc)
          Add the extension ".xml" to request value.
 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

GetXMLFileFromRelativePathParameter

public GetXMLFileFromRelativePathParameter()
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

addXMLExtension

public static String addXMLExtension(String loc)
Add the extension ".xml" to request value.

Parameters:
loc - defines the request location file.
Returns:
path somewhat normalised