Pawtucket Advanced Search Form Configuration

From CollectiveAccess Documentation
Jump to: navigation, search

advanced_search_forms.conf defines the forms used by Pawtucket2's advanced search feature. The advanced search site section is enabled by setting use_advanced_search to true in app.conf. advanced_search_forms.conf is located in /app/conf/ and or /themes/<your theme>/conf/. Just like all configuration files in Pawtucket2, the file in your theme's conf directory overrides the one in /app/conf/ allowing you to have theme specific settings.

Configuration

Pawtucket2's advanced search feature integrates custom search forms into your website. Since every deployment of CA is different, and the metadata schema varies from one installation to another, you must configure what fields are searchable and how the form should be displayed to the user. As with all other CA configuration files, advanced_search_forms.conf is written using the standard CA configuration syntax.

Top level key Description
<search_table_name> For each item type you wish to support searching on you must define an associative array attached to the item table name: ca_objects, ca_entities, ca_places, ca_occurrences, ca_collections, ca_object_lots, and ca_storage_locations). The values set in each item array define the search form for that item type. These values are defined below.

For each item type you want to be search-able, you must define a top-level key with the item's table name (eg. ca_objects for objects) and a associative array value. The array should contain one or more form keys for each advanced search form you would like displayed. When multiple forms are configured, users switch between forms by choosing them from a drop down. The keys of the form array are arbitrary code names for each form – it doesn't matter what they are so long as they are unique within the form list. The values are yet another associative array which actually defines the fields in the search form.

Each form array should contain 2 additional arrays with the keys settings and bundles.

The settings array contains the display name of the form and the number of columns the form fields should be displayed in.

key Description
name Display name of the form. When multiple forms are defined the display name is used in a drop down that allows the user to navigate between forms.
columns The number of columns the form fields should be displayed in.


The bundles array is used to define the fields of the search form. The key of each element of the array should be the attribute (tablename.metadata element code) the form field will search. Each attribute array can contain 2 optional settings for the width and height of the form element.

key Value
<tablename.element_code> Optional array of settings. The supported settings are width, height and label. For example: ca_objects.description = { width = 30, height = 3, label = "Full description" }

Example Configuration

Here is an example advanced_search_forms.conf set up to display 2 search forms that conduct object searches:

#
# Advanced search forms
#
# This configuration file defines search forms available in your Pawtucket system
#

ca_objects = {
	form1 = {
		settings = {
			name = Standard form,
			columns = 4
		},
		bundles = {
			ca_objects.description = { width = 30, height = 3 },
			ca_objects.subtitle = { width = 20, height = 1 },
			ca_objects.creation_date = { },
			ca_objects.preferred_labels = { },
			ca_entities.preferred_labels = { },
			ca_objects.status = { }
		}
	},
	form2 = {
		settings = {
			name = Second form,
			columns = 4
		},
		bundles = {
			ca_objects.subtitle = { width = 20, height = 1 },
			ca_objects.description = { width = 30, height = 3 }
		}
	}
}
Namespaces

Variants
Actions
Navigation
Tools
User
Personal tools