#include <librets/SearchRequest.h>
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. |
enum CountType |
enum FormatType |
enum Method [inherited] |
enum QueryType |
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.
searchType | RETS resource name | |
searchClass | RETS class name | |
query | DMQL(2) query |
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] |
Reimplemented in CapabilityUrls, DefaultMetadataCollector, DmqlQuery, FieldCriterion, GetObjectQuery, JunctionCriterion, LiteralCriterion, LookupCriterion, MetadataElement, NotCriterion, RetsXmlAttribute, RetsXmlEndDocumentEvent, RetsXmlEndElementEvent, RetsXmlStartElementEvent, RetsXmlTextEvent, and Uri.
void SetCountType | ( | CountType | countType | ) |
Sets the count type.
By default, it is set to RECORD_COUNT_AND_RESULTS.
countType | The count type |
void SetFormatType | ( | FormatType | formatType | ) |
Sets the format of the data returned from the server.
The default is COMPACT_DECODED.
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.
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.
queryType | The query type |
void SetRestrictedIndicator | ( | std::string | restrictedIndicator | ) |
Sets the restricted indicator.
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.
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
.
standardNames | true for standard names. |
virtual void SetUrl | ( | std::string | url | ) | [virtual, inherited] |
std::string ToString | ( | ) | const [inherited] |
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.