Skip to main content


Advanced topics

Generator: GetContentFileAuto

Class name:org.weborganic.bastille.psml.GetContentFileAuto
Version:0.7.5 - 25 October 2012


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

This generator behaves as if it 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 with the added .psml extension to identify the file to load.



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 app.


This generator does not accept or require any parameter.

Returned XML

Like most PSML generators returning a PSML file, this generator wraps 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.

See the following:

<psml-file name="[file name]" base="[base path]" status="[status]">
  <!-- PSML content -->

Error handling

If the file cannot be found or read, this generator returns the following:

<psml-file name="[file name]" base="[base path]" status="not-found">
Unable to find file: [path]

The status of this generator is set to ‘NOT_FOUND’.


Following is the code to include in the services:

<generator class="org.weborganic.bastille.psml.GetContentFileAuto" ... />
Created on , last edited on