Search template

From VYRE

Jump to: navigation, search

Contents

Overview

Search Templates are JSP files that control the interface that users use to search through collection schemas using the Template search input portlet. A JSP tag library is used to help build the form that which users see. They are similar to Content templates and Bulk edit templates.

Search templates were introduced into Unify in version 4.4. They can be found in Publishing module -> Files -> Code templates -> Search templates.

The Unify "VYRE search" tag library

vyre-search:default-input

This tag will produce an input box for searching on all indexed fields. The following attributes can be used in this tag:

  • labelText - Optional label text for the generated input field (overrides the default value)

vyre-search:metadata

This tag will produce an input box for searching on the default metadata fields. The following attributes can be used in this tag (name HAS to be specified):

  • name - [name/description/keywords] the name of the metatdata attribute to use.
  • labelText - Optional label text for the generated input field (overrides the default value)

vyre-search:date-range

This tag will produce a ranged input for searching on the createion or modification date. The following attributes can be used in this tag (field HAS to be specified):

  • field - [creation/modification] - Creates a search input field for searching create or modify date ranges.
  • startLabel - Optional label text for the generated start input field (overrides the default value).
  • endLabel - Optional label text for the generated end input field (overrides the default value).
  • showTime - [true/false] Defaults to true. When set to false, time will not be displayed in the input boxes.

vyre-search:taxonomy

This will produce either a drop down list or category tree for searching on taxonomy. Please note that this tag will developed further in future versions of Unify. The following attributes can be used in this tag:

  • labelText - Optional label text for the generated input field (overrides the default value)
  • rootCategories - A comma separated list of IDs of categories that should be displayed at the first level in the tree.
  • linkPath - the linkpath from the store the results will be from to the store you wish to search on.

LinkPaths must be defined according to the following syntax:

 linkPath 	:= "link_"[linkId]("/"[linkPath])?

where linkId is an id of a link definition.

vyre-search:attribute

This tag will produce an input box for search on any metadata or content attribute fields. The following attributes can be used in this tag (attributePath HAS to be specified):

  • labelText - Optional label text for the generated input field (overrides the default value)
  • startLabel - Text to append to the label of the start of the range (default: after)
  • endLabel - Text to append to the label of the end of the range (default: before)
  • rangeQuery - [true/false] defaults to false. Whether the input should be a range input. A range input will generate two input boxes.
  • showTime - [true/false]. Defaults to true. Only applicable when the attribute this tag relates to is searching on a 'time and date' field. If this is set to false, the time will not be displayed. Note, you cannot set show time to true when search on a date only field.
  • attributePath - the path from the store the results will be from to the store you wish to be searching on.

This must be defined according to the following syntax:

 attributePath 	:= "attribute_"[attId] | "link_"[linkId]"/"[attributePath]

where

- linkId is an id of a link definition

- attId is an id of an attribute definition or name, description, keywords, creationDate, lastModifiedDate, creator or lastModifier.

For example, if you wanted to an include an attribute with an ID of 999, the tag would be:

 <vyre-search:attribute attributePath="attribute_999" />

vyre-search:item-link

This will produce a select box for searching by which items an item is linked to. The following attributes can be used in this tag (linkDefinition HAS to be specified):

  • labelText - Optional label text for the generated input field (overrides the default value)
  • linkDefinition - the ID of the link definition to search on.
  • useCurrentItem - [true/false]. Defaults to false. If this is set to true, the input is not displayed and the search will look for items linked to the currently displayed item.
  • multiple - [true/false]. Defaults to false. Choose weather or not to use a multi select box. Set to either one or multiple.
  • filterType [all/savedSearch:[id] where [id] is the id of a saved search]. Defaults to all. If a saved search is used, the options will be limited to the results of that saved search.
  • optionDisplay - Defaults to $item.name. Expression used to display the item options in the select box. Use velocity syntax, available variables are item, itemDocument and itemMap.
  • sortLocale - The locale that items should be sorted by. If no locale is specified, the locale which the page is being rendered in will be used.

vyre-search:user-link

This will produce a select box for searching by which users an item is linked to. The following attributes can be used in this tag (linkDefinition HAS to be specified):

  • labelText - Optional label text for the generated input field (overrides the default value)
  • linkDefinition - the ID of the user link definition to search on.
  • useCurrentUser - [true/false]. Defaults to false. If this is set to true, the input is not displayed and the search will look for items linked to the currently logged in user. If no user is logged in, this tag will not filter the search results.
  • multiple - [true/false]. Defaults to false. Choose weather or not to use a multi select box. Set to either one or multiple.
  • filterType - [all/group:[id]/profile:[id] where [id] is a id of a static user group or profile group respectively]. Defaults to all. If a static group or profile group is used, the results will be limited to users from that group.
  • optionDisplay - Defaults to $user.fullName. Expression used to display the user options in the select box. Use velocity syntax, available variables are user, profile and properties (a map).
  • sortLocale - The locale that items should be sorted by. If no locale is specified, the locale which the page is being rendered in will be used.

vyre-search:search-button

This will produce the submit button for the search form. The following attributes can be used in this tag:

  • labelText - Optional label text for the generated input field (overrides the default value).

vyre-search:locale

This tag will generate a select box for search on an items locale. The following attributes can be used in this tag (inputType HAS to be specified):

  • labelText - Optional label text for the generated input field (overrides the default value)
  • inputType - [useSite/userSelected]. When set to useSite no input field is displayed and the render locale is automatically used, otherwise a list of locales is displayed.
  • localesOptions - Only applicable when inputType=userSelected. A comma seperated list of the the user should be able to choose from.

Including another search template

Template:Rellink

Personal tools