org.weborganic.bastille.xml
Class GetXMLFileFromRelativePathParameter
java.lang.Object
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
relative-path
defines the request relative path from the berlioz website root.
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>
GetXMLFileFromRelativePathParameter
public GetXMLFileFromRelativePathParameter()
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