Faceted Browser
Introduction
The Daisy Wiki includes a faceted browser which allows for faceted navigation through the repository. The faceted browser shows the distinct values for selected properties (facets) of the documents in the repository, and allows to search for documents by selecting values for these facets. This technique is quite common in many websites, but Daisy's faceted browser makes it very easy to add it to your site.
A somewhat bland demo (i.e. only using system properties) of the faceted browser can be found on the main cocoondev.org site.
To use the faceted browser, you need to create a small configuration file in which you list the facets (document properties) to use. You can have multiple faceted navigation configurations.
Howto
Faceted navigations are defined on a per-site level. In the directory for the site, create a subdirectory called "facetednavdefs" if it does not already exist. Thus the location for this directory is:
<DAISY_HOME>/daisywiki/webapp/daisy/sites/<sitedir>/facetednavdefs
In this directory, create a file with the extension ".xml", for example "test.xml". The content of the file should be something like this:
<facetedNavigationDefinition xmlns="http://outerx.org/daisy/1.0#facetednavdef">
<options>
<limitToSiteCollection>false</limitToSiteCollection>
<limitToSiteVariant>true</limitToSiteVariant>
</options>
<facets>
<facet expression="documentType"/>
<facet expression="collections"/>
<facet expression="lastModifierLogin"/>
</facets>
</facetedNavigationDefinition>
About the content of this file:
The options limitToSiteCollection and limitToSiteVariant speak pretty much for themselves, they define whether the query should automatically limit to documents belonging to the collection, branch and language of the current site. If you want to include the collection or branch/language as facets to search on, then you put the respective options to false, otherwise to true. In this example, since we included collections in the list of facets, we put the limitToSiteCollection option to false.
The <facet> elements list the different facets on which the user can browse. The expression attribute contains an identifier as used in the Daisy Query Language. Thus to include document fields, use $fieldname.
The faceted navigation definition file is validated against an XML Schema, so don't put any additional elements in it or validation will fail.
Once you have saved this file, you can use the faceted browser immediately to browse on the defined facets (a restart of the Daisy Wiki is not needed). The faceted browser is accessed with an URL of this form:
http://localhost:8888/daisy/yoursite/facetedBrowser/test
In which you need to replace "yoursite" with the name of your site and "test" with the name of the file you just created, without the ".xml" extension.



There are no comments.