Introduction
The document browser is used to let the user search for a document to link to. The document browser is used in various locations: in the HTML editor, in the navigation editor, for link fields, in the workflow interaction screens, ...
The document browser can be customized by means of a simple configuration file to enable or disable various search features and to influence the columns shown in the search result table.
Configuration
On opening of the document browser, you can add a parameter called config which specifies which configuration to use. If not found, there is a fallback on the default configuration. The configuration files are located in the conf directory of the wikidata and are named docbrowser-{config}.xml or docbrowser-default.xml for the default.
For document browsers opened from link-type fields, the config parameter will be set to the name of the field type. This makes it convenient to create document browser configurations specific to a certain link type field.
Documentbrowser configuration
In the configuration you can specify:
- whether the search should be launched immediately on opening the browser (default true)
- which filters to show in the documentbrowser: filter on metadata, textsearch, predefined queries and faceted search
- which columns to show in the results table
- the chunk size
- predefined filters
<?xml version="1.0"?>
<browserconf loadImmediately="true">
<chunk size="10"/>
<filters>
<meta show="true">
<limitToSite show="false"/>
<exclude show="false"/>
<language show="true"/>
<branch show="true"/>
<version show="true"/>
</meta>
<fulltext show="true"/>
<predefined show="true"/>
<faceted show="true">
<config>documentbrowser</config>
</faceted>
</filters>
<columns>
<column name="id"/>
<column name="name"/>
<column name="lastModifierLogin"/>
<column name="lastModified"/>
</columns>
<baseCondition>
documentType = 'SimpleDocument' and InCollection('mycollection')
</baseCondition>
<predefined>
<whereclause id="1">
<name>vdab</name>
<description>documents in collection 'VDAB'</description>
<value>InCollection('vdab')</value>
</whereclause>
<whereclause id="2">
<name>simpledoc</name>
<description>all Simple Documents</description>
<value>documentType = 'SimpleDocument'</value>
</whereclause>
</predefined>
</browserconf>
Faceted browser configuration
To show the faceted browser filter in the document browser, you need to
- set show="true"
- define which faceted browser configuration you would like to use. In the example above we have defined "documentbrowser" which results in the usage of the documentbrowser.xml configuration found in the facetednavdefs directory of the current site. See Faceted Browser for more information on configuring the faceted browser.
Basecondition
You can add a basecondition to the configuration of your documentbrowser. This basecondition will allways be executed on loading of the document list. This can be useful to limit your list to a certain type of document or limit to a collection. The user cannot modify this condition in the documentbrowser GUI.
<baseCondition>
documentType = 'SimpleDocument' and InCollection('mycollection')
</baseCondition>