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

Definition at line 8 of file SDRServiceRequest.php5.


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

Definition at line 44 of file SDRServiceRequest.php5.

References SConfig::getDefault(), and SPath::getFullPath().


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

Definition at line 145 of file SDRServiceRequest.php5.

References SObject::setWarning().

Referenced by usePreset().

SDRServiceRequest::addCSERDFilter (  ) 

Add a project filter for CSERD.

Call addProjectFilter(), passing in the CSERD project name

Definition at line 404 of file SDRServiceRequest.php5.

References addProjectFilter().

SDRServiceRequest::addDataSection ( section  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

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

Definition at line 530 of file SDRServiceRequest.php5.

Referenced by usePreset().

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

Definition at line 363 of file SDRServiceRequest.php5.

Referenced by addCSERDFilter().

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

Definition at line 71 of file SDRServiceRequest.php5.

References getDataSectionsForURL(), and SObject::setError().

SDRServiceRequest::clearCSERDFilter (  ) 

Remove the project filter for CSERD.

Call removeProjectFilter(), passing in the CSERD project name

Definition at line 413 of file SDRServiceRequest.php5.

References removeProjectFilter().

SDRServiceRequest::clearProjectFilters (  ) 

Remove all project filters.

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

Definition at line 395 of file SDRServiceRequest.php5.

SDRServiceRequest::constraintsToString (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

Definition at line 585 of file SDRServiceRequest.php5.

Referenced by toString().

SDRServiceRequest::getConstraint ( key  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

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

Definition at line 171 of file SDRServiceRequest.php5.

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

Definition at line 159 of file SDRServiceRequest.php5.

SDRServiceRequest::getDataSectionsForURL (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

Definition at line 547 of file SDRServiceRequest.php5.

Referenced by buildQueryURL().

SDRServiceRequest::getFilterProjectType (  ) 

Get the filter project type.

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

Definition at line 436 of file SDRServiceRequest.php5.

SDRServiceRequest::getKey (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

Definition at line 495 of file SDRServiceRequest.php5.

SDRServiceRequest::getMethod (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

Definition at line 304 of file SDRServiceRequest.php5.

SDRServiceRequest::getNumResultsPerPage (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

Definition at line 472 of file SDRServiceRequest.php5.

SDRServiceRequest::getState (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

Definition at line 327 of file SDRServiceRequest.php5.

SDRServiceRequest::getType (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

Definition at line 350 of file SDRServiceRequest.php5.

SDRServiceRequest::getXMLData (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

Definition at line 518 of file SDRServiceRequest.php5.

SDRServiceRequest::isAdvanced (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

Definition at line 281 of file SDRServiceRequest.php5.

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

Definition at line 374 of file SDRServiceRequest.php5.

Referenced by clearCSERDFilter().

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)

Definition at line 427 of file SDRServiceRequest.php5.

SDRServiceRequest::setKey ( key  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

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

Definition at line 484 of file SDRServiceRequest.php5.

SDRServiceRequest::setMethod ( method  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

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

Definition at line 293 of file SDRServiceRequest.php5.

Referenced by usePreset().

SDRServiceRequest::setNumResultsPerPage ( numPerPage  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

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

Definition at line 461 of file SDRServiceRequest.php5.

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

Definition at line 386 of file SDRServiceRequest.php5.

SDRServiceRequest::setStartingResult ( sr  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

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

Definition at line 449 of file SDRServiceRequest.php5.

Referenced by usePreset().

SDRServiceRequest::setState ( state  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

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

Definition at line 316 of file SDRServiceRequest.php5.

SDRServiceRequest::setType ( type  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

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

Definition at line 339 of file SDRServiceRequest.php5.

Referenced by usePreset().

SDRServiceRequest::setXMLData ( data  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

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

Definition at line 507 of file SDRServiceRequest.php5.

SDRServiceRequest::toString (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

Definition at line 558 of file SDRServiceRequest.php5.

References constraintsToString().

SDRServiceRequest::typeToString (  ) 

INSERT BRIEF DESCRIPTION HERE.

INSERT FULL DESCRIPTION HERE

Returns:
[TYPE]: RETURN DESCRIPTION

Definition at line 621 of file SDRServiceRequest.php5.

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

Definition at line 186 of file SDRServiceRequest.php5.

References addConstraints(), addDataSection(), SObject::setError(), setMethod(), setStartingResult(), and setType().


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

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