The fallback:// Protocol Family
The fallback:// protocol family is used to address resources which support publication templating. The following protocols are available:
Available Protocols
fallback://
The fallback:// protocol is used to address the first encountered instance of a resource in the template traversal order.
template-fallback://
The template-fallback:// protocol is used to address the second encountered instance of a resource in the template traversal order. This is especially useful to import XSLT stylesheets.
aggregate-fallback://
This protocol aggregates all resources in the template hierarchy, starting with the current publication. This works only for XML resources. The document element of the aggregated document is the document element of the first encountered dcument. The document elements of the other XML documents are stripped.
The following example shows how to aggregate an XML document to construct a breadcrumb path from metadata.xml
files which are present in all publications. The university publication is at the top of the hierarchy, the biology publication at the bottom:
/pubs/university/metadata.xml
<metadata> <name>Springfield University</name> </metadata>
/pubs/science/metadata.xml
<metadata> <name>Departement of Sciences</name> </metadata>
/pubs/biology/metadata.xml
<metadata> <name>Biology Studies</name> </metadata>
aggregate-fallback://metadata.xml
<metadata> <name>Biology Studies</name> <name>Departement of Sciences</name> <name>Springfield University</name> </metadata>
This aggregated XML document can easily be transformed into a breadcrumb path (in this simple example without links) using an XSLT stylesheet.
URI Syntax
Each protocol of the fallback protocol family supports the following URI syntax variants:
- {scheme}:/{path}
- The path is an absolute path (starting with a slash) from the publication root directory (or the servlet context directory for global resources). If this syntax is used, the publication is derived from the current HTTP request.
- {scheme}:{pubId}/{path}
- Including the publication ID in the path is useful to use a different publication than the one from the current HTTP request. It also allows to use the URI as a cache key for publication-specific resources (e.g., in connection with the SourceCache service).