Class AjaxSolr.AbstractManager
AbstractManager
Defined in: AbstractManager.js.
Constructor Attributes | Constructor Name and Description |
---|---|
AjaxSolr.AbstractManager(properties)
The Manager acts as the controller in a Model-View-Controller framework.
|
Method Attributes | Method Name and Description |
---|---|
addWidget(widget)
Adds a widget to the manager.
|
|
constructor(attributes)
|
|
doRequest(start, servlet)
Stores the Solr parameters to be sent to Solr and sends a request to Solr.
|
|
executeRequest(servlet, string)
An abstract hook for child implementations.
|
|
handleError(message)
This method is executed if Solr encounters an error.
|
|
handleResponse(data)
This method is executed after the Solr response data arrives.
|
|
init()
An abstract hook for child implementations.
|
|
setStore(store)
Set the manager's parameter store.
|
Class Detail
AjaxSolr.AbstractManager(properties)
The Manager acts as the controller in a Model-View-Controller framework. All
public calls should be performed on the manager object.
- Parameters:
- properties
- A map of fields to set. Refer to the list of public fields.
Method Detail
addWidget(widget)
Adds a widget to the manager.
- Parameters:
- {AjaxSolr.AbstractWidget} widget
constructor(attributes)
- Parameters:
- {Object} attributes Optional
- {String} attributes.solrUrl Optional
- The fully-qualified URL of the Solr application. You must include the trailing slash. Do not include the path to any Solr servlet. Defaults to "http://localhost:8983/solr/"
- {String} attributes.proxyUrl Optional
- If we want to proxy queries through a script, rather than send queries to Solr directly, set this field to the fully-qualified URL of the script.
- {String} attributes.servlet Optional
- The default Solr servlet. You may prepend the servlet with a core if using multiple cores. Defaults to "servlet".
doRequest(start, servlet)
Stores the Solr parameters to be sent to Solr and sends a request to Solr.
- Parameters:
- {Boolean} start Optional
- The Solr start offset parameter.
- {String} servlet Optional
- The Solr servlet to send the request to.
executeRequest(servlet, string)
An abstract hook for child implementations.
Sends the request to Solr, i.e. to this.solrUrl
or
this.proxyUrl
, and receives Solr's response. It should pass Solr's
response to handleResponse()
for handling.
See managers/Manager.jquery.js for a jQuery implementation.
- Parameters:
- {String} servlet
- The Solr servlet to send the request to.
- {String} string
- The query string of the request. If not set, it
should default to
this.store.string()
- Throws:
- If not defined in child implementation.
handleError(message)
This method is executed if Solr encounters an error.
- Parameters:
- {String} message
- An error message.
handleResponse(data)
This method is executed after the Solr response data arrives. Allows each
widget to handle Solr's response separately.
- Parameters:
- {Object} data
- The Solr response.
init()
An abstract hook for child implementations.
This method should be called after the store and the widgets have been added. It should initialize the widgets and the store, and do any other one-time initializations, e.g., perform the first request to Solr.
If no store has been set, it sets the store to the basic AjaxSolr.ParameterStore.
setStore(store)
Set the manager's parameter store.
- Parameters:
- {AjaxSolr.ParameterStore} store