SDRServiceRequest Class Reference

Defines a set of search constraints to be queried by the XML Service Interface (XSI). More...

Inheritance diagram for SDRServiceRequest:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 __construct ($method=SDRContract::METHOD_FIND, $type=SDRContract::REQUEST_TYPE_DEFAULT)
 Construct a SearchRequest object with an (optional) method and type.
 addConstraints ($constraints)
 Add a set of constraints to your search.
 addCSERDFilter ()
 Add a project filter for CSERD.
 addDataSection ($section)
 INSERT BRIEF DESCRIPTION HERE.
 addProjectFilter ($proj)
 Add a project on which to filter items.
 buildQueryURL ()
 Generate the URL to be queried using XSI.
 clearCSERDFilter ()
 Remove the project filter for CSERD.
 clearProjectFilters ()
 Remove all project filters.
 constraintsToString ()
 INSERT BRIEF DESCRIPTION HERE.
 getConstraint ($key)
 INSERT BRIEF DESCRIPTION HERE.
 getConstraints ()
 Get the list of constraints for this request.
 getDataSectionsForURL ()
 INSERT BRIEF DESCRIPTION HERE.
 getFilterProjectType ()
 Get the filter project type.
 getKey ()
 INSERT BRIEF DESCRIPTION HERE.
 getMethod ()
 INSERT BRIEF DESCRIPTION HERE.
 getNumResultsPerPage ()
 INSERT BRIEF DESCRIPTION HERE.
 getState ()
 INSERT BRIEF DESCRIPTION HERE.
 getType ()
 INSERT BRIEF DESCRIPTION HERE.
 getXMLData ()
 INSERT BRIEF DESCRIPTION HERE.
 isAdvanced ()
 INSERT BRIEF DESCRIPTION HERE.
 removeProjectFilter ($proj)
 Remove a project on which you have been filtering items.
 setFilterProjectType ($fpt)
 Set the filter project type.
 setKey ($key)
 INSERT BRIEF DESCRIPTION HERE.
 setMethod ($method)
 INSERT BRIEF DESCRIPTION HERE.
 setNumResultsPerPage ($numPerPage)
 INSERT BRIEF DESCRIPTION HERE.
 setProjectFilter ($proj)
 Set the project filter, overwriting other filters.
 setStartingResult ($sr)
 INSERT BRIEF DESCRIPTION HERE.
 setState ($state)
 INSERT BRIEF DESCRIPTION HERE.
 setType ($type)
 INSERT BRIEF DESCRIPTION HERE.
 setXMLData ($data)
 INSERT BRIEF DESCRIPTION HERE.
 toString ()
 INSERT BRIEF DESCRIPTION HERE.
 typeToString ()
 INSERT BRIEF DESCRIPTION HERE.
 usePreset ($preset, $params=array())
 Use a named query preset (typically fills in a method, a type, and other needed params).


Detailed Description

Defines a set of search constraints to be queried by the XML Service Interface (XSI).

Author:
valerie@shodor.org (this class inherits much code from SDRFedSearchClient)

jwsm@shodor.org


Constructor & Destructor Documentation

SDRServiceRequest::__construct ( method = SDRContract::METHOD_FIND,
type = SDRContract::REQUEST_TYPE_DEFAULT 
)

Construct a SearchRequest object with an (optional) method and type.

Initialize the search request object using the optional method and type passed in (if nothing) is passed, we revert to the defaults of a FIND method with type DEFAULT (quick). Here, we also ask SConfig for the SDR search service URL

Parameters:
$method [string]: The SDRContract constant for the method name
$type [string]: The SDRContract constant for the method type name


Member Function Documentation

SDRServiceRequest::addConstraints ( constraints  ) 

Add a set of constraints to your search.

A search constraint is a parameter in addition to the normal filter, pagination, and data section params. For instance, "ss" (search string) is a constraint used for quick searches, and different metadata field/value pairs can be specified as constraints for advanced searches

Parameters:
$constraints [array]: An associative array, where the keys are the names of parameters, and the values are the values to which those parameters should be constrained

SDRServiceRequest::addCSERDFilter (  ) 

Add a project filter for CSERD.

Call addProjectFilter(), passing in the CSERD project name

SDRServiceRequest::addDataSection ( section  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$section [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::addProjectFilter ( proj  ) 

Add a project on which to filter items.

If projectFilterType is 'or' (default), this will add all items from this project to the possible search pool. If the type is 'and', items must be from this project. Items may be from multiple projects (projects are the same thing as collections).

Parameters:
$proj [string]: The name of the project/collection

SDRServiceRequest::buildQueryURL (  ) 

Generate the URL to be queried using XSI.

This function should produce a URL that will contact an XML service and provide all GET vars necessary to complete a query. The only additional information that may need to be sent by the XSI is the POST vars. XSI will ask this object for that data separately.

Returns:
[string]: A URL query to a service that should generate an XML response

SDRServiceRequest::clearCSERDFilter (  ) 

Remove the project filter for CSERD.

Call removeProjectFilter(), passing in the CSERD project name

SDRServiceRequest::clearProjectFilters (  ) 

Remove all project filters.

Don't limit the search pool to any particular project(s)/collection(s)

SDRServiceRequest::constraintsToString (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::getConstraint ( key  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$key [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::getConstraints (  ) 

Get the list of constraints for this request.

Returns:
[array]: The list of constraints as an associative array, where the keys are the parameters and the values are the values to which those parameters will be limited

SDRServiceRequest::getDataSectionsForURL (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::getFilterProjectType (  ) 

Get the filter project type.

Returns:
[string]: The filter project type, 'and' or 'or'

SDRServiceRequest::getKey (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::getMethod (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::getNumResultsPerPage (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::getState (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::getType (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::getXMLData (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::isAdvanced (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::removeProjectFilter ( proj  ) 

Remove a project on which you have been filtering items.

Remove one of the projects that is limiting the search pool

Parameters:
$proj [string]: The name of the project/collection

SDRServiceRequest::setFilterProjectType ( fpt  ) 

Set the filter project type.

Set the filter project type either to 'and' or 'or'. The default is 'or'. If this filter is 'and', the search pool will be items in the intersection of all projects for which filters are set (i.e., the items must be in all filtered projects). If the type is 'or', they can be in any of the projects.

Parameters:
$fpt [string]: The filter project type, 'and' or 'or' (or is set by default)

SDRServiceRequest::setKey ( key  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$key [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::setMethod ( method  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$method [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::setNumResultsPerPage ( numPerPage  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$numPerPage [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::setProjectFilter ( proj  ) 

Set the project filter, overwriting other filters.

The search pool will be only the items within this project.

Parameters:
$proj [string]: The name of the project/collection

SDRServiceRequest::setStartingResult ( sr  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$sr [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::setState ( state  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$type [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::setType ( type  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$type [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::setXMLData ( data  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Parameters:
$data [TYPE]: DESCRIPTION
Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::toString (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::typeToString (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

SDRServiceRequest::usePreset ( preset,
params = array() 
)

Use a named query preset (typically fills in a method, a type, and other needed params).

Parameters:
$preset [string]: The class constant representing the preset
$params [array]: An optional associative array of param names/values required for this preset to work. PRESET_FIND_QUICK requires 'ss' => 'user search string' PRESET_ALL_DATA_BY_CSERD_ID requires 'cserdId' => desired object's CSERD id
Returns:
[bool]: True if setting the preset works, false if not


The documentation for this class was generated from the following file:

Generated on Wed Nov 24 02:02:54 2010 for Common by  doxygen 1.5.6