SearchRequest Class Reference

SearchRequest contains the API that is used to set up and customer a RETS SEARCH transaciton. More...

#include <librets/SearchRequest.h>

Inheritance diagram for SearchRequest:

RetsHttpRequest RetsObject

List of all members.

Public Types

enum  CountType { NO_RECORD_COUNT, RECORD_COUNT_AND_RESULTS, RECORD_COUNT_ONLY }
enum  QueryType { DMQL, DMQL2 }
enum  FormatType { COMPACT, COMPACT_DECODED }

Public Member Functions

 SearchRequest (std::string searchType, std::string searchClass, std::string query)
 Create a new search request.
void SetLimit (int limit)
 Sets the limit on the number records returned.
void SetOffset (int offset)
 Sets the offset to be used for record retrieval.
void SetSelect (std::string select)
 Sets the select string to choose which fields are returned.
void SetCountType (CountType countType)
 Sets the count type.
void SetStandardNames (bool standardNames)
 Sets the vocabular to system names or standard names.
void SetQueryType (QueryType queryType)
 Sets the query type for this search.
void SetFormatType (FormatType formatType)
 Sets the format of the data returned from the server.
void SetRestrictedIndicator (std::string restrictedIndicator)
 Sets the restricted indicator.
virtual Method GetMethod () const
virtual void SetMethod (Method method)
virtual std::string GetUrl () const
virtual void SetUrl (std::string url)
virtual void SetHeader (std::string name, std::string value)
virtual void ClearHeader (std::string name)
StringMap GetHeaderMap () const
virtual void SetQueryParameter (std::string, std::string value)
virtual void SetQueryParameter (std::string, int value)
virtual std::string GetQueryString () const
bool GetLogging ()
void SetNoLogging ()
void SetLogging ()
virtual std::ostream & Print (std::ostream &outputStream) const
std::string ToString () const
virtual bool Equals (const RetsObject *object) const

Static Public Attributes

static const int LIMIT_DEFAULT = -1
 This requests the server default limit.
static const int LIMIT_NONE = 0
 This requests the server to set the limit to NONE.
static const int OFFSET_NONE = 0
 This indicatates that no offset should be sent to the server.


Detailed Description

SearchRequest contains the API that is used to set up and customer a RETS SEARCH transaciton.

Member Enumeration Documentation

enum CountType

Enumerator:
NO_RECORD_COUNT  The search result set will only contain records.

The record count will always be 0.

RECORD_COUNT_AND_RESULTS  The search result set will contain a valid cound and records.
RECORD_COUNT_ONLY  The search result set will contain only a record count.

No records will be in the result set.

enum FormatType

Enumerator:
COMPACT  COMPACT format returns values directly as they are contained in the server.
COMPACT_DECODED  COMPACT_DECODED decodes some values into more human readable values.

This is done on the server side, and the results are server dependent. However, this often implies that lookup fields are decoded to their lookup values.

enum Method [inherited]

Enumerator:
GET 
POST 

enum QueryType

Enumerator:
DMQL  DMQL is required for RETS version 1.0.

DMQL2  DMQL2 is required for all RETS 1.x versions, except 1.0.


Constructor & Destructor Documentation

SearchRequest ( std::string  searchType,
std::string  searchClass,
std::string  query 
)

Create a new search request.

Since the query type is depedent on the RETS version, the RetsSession::CreateRetsRequest() is the preferred way to create a RetsRequest.

Parameters:
searchType RETS resource name
searchClass RETS class name
query DMQL(2) query


Member Function Documentation

virtual void ClearHeader ( std::string  name  )  [virtual, inherited]

virtual bool Equals ( const RetsObject object  )  const [virtual, inherited]

StringMap GetHeaderMap (  )  const [inherited]

bool GetLogging (  )  [inherited]

virtual Method GetMethod (  )  const [virtual, inherited]

virtual std::string GetQueryString (  )  const [virtual, inherited]

virtual std::string GetUrl (  )  const [virtual, inherited]

virtual std::ostream& Print ( std::ostream &  outputStream  )  const [virtual, inherited]

void SetCountType ( CountType  countType  ) 

Sets the count type.

By default, it is set to RECORD_COUNT_AND_RESULTS.

Parameters:
countType The count type

void SetFormatType ( FormatType  formatType  ) 

Sets the format of the data returned from the server.

The default is COMPACT_DECODED.

Parameters:
formatType The formate type

virtual void SetHeader ( std::string  name,
std::string  value 
) [virtual, inherited]

void SetLimit ( int  limit  ) 

Sets the limit on the number records returned.

By default, all matching records are returned. Setting the limit to 0 means all matching records should be returned.

Parameters:
limit The maximum number of records to return

void SetLogging (  )  [inherited]

virtual void SetMethod ( Method  method  )  [virtual, inherited]

void SetNoLogging (  )  [inherited]

void SetOffset ( int  offset  ) 

Sets the offset to be used for record retrieval.

Offsets are 1-based, thus an offset of 1 means to start with the first record.

virtual void SetQueryParameter ( std::string  ,
int  value 
) [virtual, inherited]

virtual void SetQueryParameter ( std::string  ,
std::string  value 
) [virtual, inherited]

void SetQueryType ( QueryType  queryType  ) 

Sets the query type for this search.

This is highly dependent on the RETS version of the server. DMQL must be used for a 1.0 server. DMQL2 must be used for all other 1.x versions. You may use RetsSession::CreateSearchRequest() to create a request with the correct query type already set, based on the version of the currently connected server.

Parameters:
queryType The query type

void SetRestrictedIndicator ( std::string  restrictedIndicator  ) 

Sets the restricted indicator.

Parameters:
restrictedIndicator A string containing the restricted indicator.

void SetSelect ( std::string  select  ) 

Sets the select string to choose which fields are returned.

Setting the select to an empty string returns all fields. The default select string is the empty string. The string should be a comma delimited list of names from the metadata and are either standard names or system names, depending on the value of the standard names flag.

Parameters:
select The select string

void SetStandardNames ( bool  standardNames  ) 

Sets the vocabular to system names or standard names.

If set to true all fields will be standard names. If set to false all fields will be system names. By default, this is set to false.

Parameters:
standardNames true for standard names.

virtual void SetUrl ( std::string  url  )  [virtual, inherited]

std::string ToString (  )  const [inherited]


Member Data Documentation

const int LIMIT_DEFAULT = -1 [static]

This requests the server default limit.

This should be the same as NONE, but some servers do not adhere.

const int LIMIT_NONE = 0 [static]

This requests the server to set the limit to NONE.

const int OFFSET_NONE = 0 [static]

This indicatates that no offset should be sent to the server.


Generated by  doxygen