search_pane.js

Summary
search_pane.js
bbop.widget.search_paneBBOP object to produce a self-constructing/self-destructing term general filtering search tool for an index.
Functions
search_paneContructor for the bbop.widget.search_pane object.
establish_displayCompletely redraw the display.
get_selected_itemsThe idea is to return a list of the items selected (with checkboxes) in the display.
add_buttonAdd a user-defined button to the display.
clear_buttonsRemove all user-defined buttons from the display.
set_query_field_textPush text into the search box.
set_initial_reset_callbackAdd a callback to be run after the initial reset is finished.

bbop.widget.search_pane

BBOP object to produce a self-constructing/self-destructing term general filtering search tool for an index.  This is a completely self-contained UI and manager.

The function “.establish_display()” must be run after an initial personality is set.  Also, in many use cases, you’ll want to have a line like the following before running “.establish_display()”: sp_widget.add_query_filter(‘document_category’, ‘annotation’, [‘*’]);

Also, establish_display() literally just establishes the physical presence of the display.  To actually populate it with data once you start, a seeding call to the .reset() or .search() is necessary.

The search pane will display one less filter row than is set with .set_facet_limit(), it will use this runover to decide whether or not to display the “more” option for the filters.

Summary
Functions
search_paneContructor for the bbop.widget.search_pane object.
establish_displayCompletely redraw the display.
get_selected_itemsThe idea is to return a list of the items selected (with checkboxes) in the display.
add_buttonAdd a user-defined button to the display.
clear_buttonsRemove all user-defined buttons from the display.
set_query_field_textPush text into the search box.
set_initial_reset_callbackAdd a callback to be run after the initial reset is finished.

Functions

search_pane

bbop.widget.search_pane = function(golr_loc,
golr_conf_obj,
interface_id,
in_argument_hash)

Contructor for the bbop.widget.search_pane object.

This is a specialized (and widgetized) subclass of bbop.golr.manager.jquery.

Sticky filters (see manager documentation) are “hidden” from the user in all displays.

The optional hash arguments look like

linkerthe linker to be used; null function otherwise
handlerspecial field handler to be used; null function otherwise
show_filterbox_pshow currents filters and accordion (default true)
show_pager_pshow the results pager (default true)
show_checkboxes_pshow/enable the item select checkboxes (default true)
spinner_search_sourcesource for the spinner used during typical searching
spinner_shield_sourcesource for the spinner used shield waiting
spinner_shield_messagemessage to display on the spinner shield while waiting
icon_clear_label(default: text button based on ‘X’)
icon_clear_source(default: ‘’)
icon_reset_label(default: text button based on ‘X’)
icon_reset_source(default: ‘’)
icon_positive_label(default: text button based on ‘+’)
icon_positive_source(default: ‘’)
icon_negative_label(default: text button based on ‘-’)
icon_negative_source(default: ‘’)
icon_remove_label(default: text button based on ‘X’)
icon_remove_source(default: ‘’)

Arguments

golr_locstring url to GOlr server; not needed if local
golr_conf_obja bbop.golr.conf object
interface_idstring id of the element to build on
in_argument_hash[optional] optional hash of optional arguments

Returns

self

establish_display

this.establish_display = function()

Completely redraw the display.

Required to display after setting up the manager.

Also may be useful after a major change to the manager to reset it.

Parameters

n/a

Returns n/a

get_selected_items

this.get_selected_items = function()

The idea is to return a list of the items selected (with checkboxes) in the display.  This means that there are three possibilities.  1) We are not using checkboxes or the display has not been established, so we return null; 2) no or all items have been selected, so we get back an empty list (all == none in our view); 3) a subset list of strings (ids).

NOTE: Naturally, does not function until the display is established.

Parameters

n/a

Returns string list or null

add_button

this.add_button = function(button_definition_hash)

Add a user-defined button to the display.

NOTE: Does not function until the display is established.

Parameters

button_definition_hash””

Returns n/a

clear_buttons

this.clear_buttons = function()

Remove all user-defined buttons from the display.

NOTE: Does not function until the display is established.

Parameters

n/a

Returns n/a

set_query_field_text

this.set_query_field_text = function(query)

Push text into the search box.  Does not affect the state of the manager in any way.

NOTE: Does not function until the display is established.

Parameters

querythe text to put into the search box

Returns true or false on whether the task was accomplished

set_initial_reset_callback

this.set_initial_reset_callback = function(callback)

Add a callback to be run after the initial reset is finished.

Parameters

responsethe usual
managerthe usual

Returns n/a

bbop.widget.search_pane = function(golr_loc,
golr_conf_obj,
interface_id,
in_argument_hash)
Contructor for the bbop.widget.search_pane object.
this.establish_display = function()
Completely redraw the display.
this.get_selected_items = function()
The idea is to return a list of the items selected (with checkboxes) in the display.
this.add_button = function(button_definition_hash)
Add a user-defined button to the display.
this.clear_buttons = function()
Remove all user-defined buttons from the display.
this.set_query_field_text = function(query)
Push text into the search box.
this.set_initial_reset_callback = function(callback)
Add a callback to be run after the initial reset is finished.
jQuery BBOP manager for dealing with actual ajax calls.
Close