libRETS  1.6.0
Public Types | Public Member Functions | Static Public Attributes | List of all members
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

Public Types

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

Public Member Functions

 SearchRequest (std::string searchType, std::string searchClass, std::string query)
 Create a new search request. More...
 
void SetLimit (int limit)
 Sets the limit on the number records returned. More...
 
void SetOffset (int offset)
 Sets the offset to be used for record retrieval. More...
 
void SetSelect (std::string select)
 Sets the select string to choose which fields are returned. More...
 
void SetCountType (CountType countType)
 Sets the count type. More...
 
void SetStandardNames (bool standardNames)
 Sets the vocabular to system names or standard names. More...
 
void SetQueryType (QueryType queryType)
 Sets the query type for this search. More...
 
void SetFormatType (FormatType formatType)
 Sets the format of the data returned from the server. More...
 
void SetRestrictedIndicator (std::string restrictedIndicator)
 Sets the restricted indicator. More...
 
void SetPayload (std::string payload)
 RETS 1.8 Set the PAYLOAD parameter. More...
 
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. More...
 
static const int LIMIT_NONE = 0
 This requests the server to set the limit to NONE. More...
 
static const int OFFSET_NONE = 0
 This indicatates that no offset should be sent to the server. More...
 

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
searchTypeRETS resource name
searchClassRETS class name
queryDMQL(2) query

Member Function Documentation

virtual void ClearHeader ( std::string  name)
virtualinherited
virtual bool Equals ( const RetsObject object) const
virtualinherited
StringMap GetHeaderMap ( ) const
inherited
bool GetLogging ( )
inherited
virtual Method GetMethod ( ) const
virtualinherited
virtual std::string GetQueryString ( ) const
virtualinherited
virtual std::string GetUrl ( ) const
virtualinherited
virtual std::ostream& Print ( std::ostream &  outputStream) const
virtualinherited
void SetCountType ( CountType  countType)

Sets the count type.

By default, it is set to RECORD_COUNT_AND_RESULTS.

Parameters
countTypeThe count type
void SetFormatType ( FormatType  formatType)

Sets the format of the data returned from the server.

The default is COMPACT_DECODED.

Parameters
formatTypeThe formate type
virtual void SetHeader ( std::string  name,
std::string  value 
)
virtualinherited
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
limitThe maximum number of records to return
void SetLogging ( )
inherited
virtual void SetMethod ( Method  method)
virtualinherited
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.

void SetPayload ( std::string  payload)

RETS 1.8 Set the PAYLOAD parameter.

Parameters
payloadA string containing the RESO schema name that was found in the GetPayloadList Transaction.
virtual void SetQueryParameter ( std::string  ,
std::string  value 
)
virtualinherited
virtual void SetQueryParameter ( std::string  ,
int  value 
)
virtualinherited
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
queryTypeThe query type
void SetRestrictedIndicator ( std::string  restrictedIndicator)

Sets the restricted indicator.

Parameters
restrictedIndicatorA 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
selectThe 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
standardNamestrue for standard names.
virtual void SetUrl ( std::string  url)
virtualinherited
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