GetObjectRequest Class Reference

A GetObjectRequest represents the parameters needed to perform a RETS GetObject transaction. More...

#include <librets/GetObjectRequest.h>

Inheritance diagram for GetObjectRequest:

RetsObject

List of all members.

Public Member Functions

 GetObjectRequest (std::string resource, std::string type)
 Creates a new GetObjectRequest.
virtual ~GetObjectRequest ()
bool GetLocation () const
 Returns if location URLs will be requested.
void SetLocation (bool location)
 If set to true, the object data will be requested as URLs instead of the actual data.
void AddObject (std::string resourceEntity, int objectId)
 Add a single object for a resource entity to the request.
void AddAllObjects (std::string resourceEntity)
 Adds all objects for a resource entity to the request.
RetsHttpRequestPtr CreateHttpRequest () const
 (Internal) Create the Http Request object that will control access to the server to fetch the objects.
void PrepareHttpRequest (RetsHttpRequestPtr httpRequest) const
 (Internal) Set up the Http Request.
bool HasDefaultObjectKeyAndId () const
 Returns true if a default object key and ID are available.
std::string GetDefaultObjectKey () const
 Returns the default object key.
int GetDefaultObjectId () const
 Returns the default object ID.
void SetIgnoreMalformedHeaders (bool ignore)
 Certain RETS servers have been known to violate the RETS spec by allowing Content-Description fields with CRLF in it when doing a multi-part response.
bool GetIgnoreMalformedHeaders () const
 Returns if the GetObject parsing should ignore malformed headers.
virtual std::ostream & Print (std::ostream &outputStream) const
std::string ToString () const
virtual bool Equals (const RetsObject *object) const

Static Public Attributes

static const char * PHOTO_TYPE
 The image well-known type.
static const char * PLAT_TYPE
 The property boundary well-known type.
static const char * VIDEO_TYPE
 The video well-known type.
static const char * AUDIO_TYPE
 The audio well-known type.
static const char * THUMBNAIL_TYPE
 The thubmail image well-known type.
static const char * MAP_TYPE
 The location image well-known type.
static const char * VRIMAGE_TYPE
 The muliple-view, interactive well-known type.


Detailed Description

A GetObjectRequest represents the parameters needed to perform a RETS GetObject transaction.

A server does not have to provide objects for all well-known types, but a server should use well-known types, where appropriate. Multiple objects for multiple resource entities may be retrieved in a single request.


Constructor & Destructor Documentation

GetObjectRequest ( std::string  resource,
std::string  type 
)

Creates a new GetObjectRequest.

The type may be a well-known type.

Parameters:
resource A valid resource as defined in the metadata
type A valid type as defined in the metadata

virtual ~GetObjectRequest (  )  [virtual]


Member Function Documentation

void AddAllObjects ( std::string  resourceEntity  ) 

Adds all objects for a resource entity to the request.

This should be used, for example, to request all photos for a property listing.

Parameters:
resourceEntity A value for the key field of the resource

void AddObject ( std::string  resourceEntity,
int  objectId 
)

Add a single object for a resource entity to the request.

This should be used, for example, to request a single photo for a property listing. Object IDs are always sequent, beginning with 1.

Parameters:
resourceEntity A value from the key field of the resource
objectId The particular object to be retrieved

RetsHttpRequestPtr CreateHttpRequest (  )  const

(Internal) Create the Http Request object that will control access to the server to fetch the objects.

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

int GetDefaultObjectId (  )  const

Returns the default object ID.

Returns:
An integer containing the default object ID.

std::string GetDefaultObjectKey (  )  const

Returns the default object key.

Returns:
A string containing the default object key.

bool GetIgnoreMalformedHeaders (  )  const

Returns if the GetObject parsing should ignore malformed headers.

Returns:
true if malformed headers will be ignored.

bool GetLocation (  )  const

Returns if location URLs will be requested.

Returns:
true if location URLs will be requested.

bool HasDefaultObjectKeyAndId (  )  const

Returns true if a default object key and ID are available.

A default object key and ID are availalbe if and only if a single object has been added. With more than one object added, there is no way to determine which is the default.

Returns:
true if a default object key and ID are available.

void PrepareHttpRequest ( RetsHttpRequestPtr  httpRequest  )  const

(Internal) Set up the Http Request.

This should only be called by CreateHttpRequest.

Parameters:
httpRequest A pointer to the RetsHttpRequest.

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

void SetIgnoreMalformedHeaders ( bool  ignore  ) 

Certain RETS servers have been known to violate the RETS spec by allowing Content-Description fields with CRLF in it when doing a multi-part response.

By the RETS spec, this is actually creating a new header. This causes an error when we parse as having malformed headers. By turning this on, you are saying you know that their are malformed headers, but you do not care. Do NOT turn this on unless you know what you are doing. It is NOT recommended that this be used. This only effects multi-part responses. The default is false.

Parameters:
ignore A boolean that when true indicates that malformed headers should be ignored.

void SetLocation ( bool  location  ) 

If set to true, the object data will be requested as URLs instead of the actual data.

Servers are not required to provide URLs for all objects, so a server may choose to ignore this request. By default, this is set to false.

Parameters:
location true if location URLs are requested

std::string ToString (  )  const [inherited]


Member Data Documentation

const char* AUDIO_TYPE [static]

The audio well-known type.

const char* MAP_TYPE [static]

The location image well-known type.

const char* PHOTO_TYPE [static]

The image well-known type.

const char* PLAT_TYPE [static]

The property boundary well-known type.

const char* THUMBNAIL_TYPE [static]

The thubmail image well-known type.

const char* VIDEO_TYPE [static]

The video well-known type.

const char* VRIMAGE_TYPE [static]

The muliple-view, interactive well-known type.


Generated by  doxygen