#include <librets/UpdateRequest.h>
Public Types | |
enum | Method { GET, POST } |
Public Member Functions | |
UpdateRequest (std::string resourceName, std::string className) | |
Create a new update request. | |
std::string | ConstructRecord () |
Format the Record request. | |
void | ConstructRequest () |
Construct the update request. | |
std::string | ConstructWarningResponse () |
Format the WarningResponse request. | |
const std::string | GetDelimiter () |
Returns the current value of the delimiter for the current request. | |
void | SetDelimiter (std::string delimiter) |
Sets the value of the delimiter for the current request. | |
const StringVector | GetAllFields () |
Returns a string vector containing the names of all fields. | |
const std::string | GetField (std::string key) |
Returns the value for the given field. | |
void | SetField (std::string key, std::string value) |
Set the name of a field and its value. | |
const std::string | GetUpdateType () |
Returns the current value of the update parameter for the request. | |
void | SetUpdateType (std::string updateType) |
Set the value of the update type parameter for the current request. | |
const int | GetValidateFlag () |
Returns the current value of the validation flag for the current request. | |
void | SetValidateFlag (int flag) |
Sets the validation flag for the current request. | |
const StringVector | GetAllWarnings () |
Returns a string vector containing the warning numbers. | |
const std::string | GetWarningResponse (int warningNumber) |
Returns a string containing the user response for the given warning number. | |
const std::string | GetWarningResponse (std::string warningNumber) |
Returns a string containing the user response for the given warning number. | |
void | SetWarningResponse (int warningNumber, std::string userResponse) |
Set the warning number and response. | |
void | SetWarningResponse (std::string warningNumber, std::string userResponse) |
Set the warning number and response. | |
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 | UPDATE_OK = 0 |
This requests the server update the record if there are no errors. | |
static const int | AUTO_POPULATE = 1 |
Validation will happen on the host. | |
static const int | VALIDATE_ONLY = 2 |
The server validates the record and returns any errors found. |
enum Method [inherited] |
UpdateRequest | ( | std::string | resourceName, | |
std::string | className | |||
) |
Create a new update request.
resourceName | RETS resource name | |
className | RETS class name |
virtual void ClearHeader | ( | std::string | name | ) | [virtual, inherited] |
std::string ConstructRecord | ( | ) |
Format the Record request.
This is an internal method, primarily used by the tests.
void ConstructRequest | ( | ) |
Construct the update request.
This is an internal method that will format the "Record" and "WarningResponse" elements of the request and set them into the query.
std::string ConstructWarningResponse | ( | ) |
Format the WarningResponse request.
This is an internal method, primarily used by the tests.
virtual bool Equals | ( | const RetsObject * | object | ) | const [virtual, inherited] |
const StringVector GetAllFields | ( | ) |
Returns a string vector containing the names of all fields.
const StringVector GetAllWarnings | ( | ) |
Returns a string vector containing the warning numbers.
const std::string GetDelimiter | ( | ) |
Returns the current value of the delimiter for the current request.
const std::string GetField | ( | std::string | key | ) |
Returns the value for the given field.
key | A string containing the field name. |
StringMap GetHeaderMap | ( | ) | const [inherited] |
bool GetLogging | ( | ) | [inherited] |
virtual Method GetMethod | ( | ) | const [virtual, inherited] |
virtual std::string GetQueryString | ( | ) | const [virtual, inherited] |
const std::string GetUpdateType | ( | ) |
Returns the current value of the update parameter for the request.
virtual std::string GetUrl | ( | ) | const [virtual, inherited] |
const int GetValidateFlag | ( | ) |
Returns the current value of the validation flag for the current request.
const std::string GetWarningResponse | ( | std::string | warningNumber | ) |
Returns a string containing the user response for the given warning number.
warningNumber | A string containing the warning number. |
const std::string GetWarningResponse | ( | int | warningNumber | ) |
Returns a string containing the user response for the given warning number.
warningNumber | An integer containing the warning number. |
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 SetDelimiter | ( | std::string | delimiter | ) |
Sets the value of the delimiter for the current request.
delimiter | A string containing the delimiter value. |
void SetField | ( | std::string | key, | |
std::string | value | |||
) |
Set the name of a field and its value.
key | A string containing the name of the field. | |
value | A string containing the value for the field. |
virtual void SetHeader | ( | std::string | name, | |
std::string | value | |||
) | [virtual, inherited] |
void SetLogging | ( | ) | [inherited] |
virtual void SetMethod | ( | Method | method | ) | [virtual, inherited] |
void SetNoLogging | ( | ) | [inherited] |
virtual void SetQueryParameter | ( | std::string | , | |
int | value | |||
) | [virtual, inherited] |
virtual void SetQueryParameter | ( | std::string | , | |
std::string | value | |||
) | [virtual, inherited] |
void SetUpdateType | ( | std::string | updateType | ) |
Set the value of the update type parameter for the current request.
updateType | A string containing the value of the update type. |
virtual void SetUrl | ( | std::string | url | ) | [virtual, inherited] |
void SetValidateFlag | ( | int | flag | ) |
Sets the validation flag for the current request.
flag | One of UPDATE_OK, AUTO_POPULATE or VALIDATE_ONLY. |
void SetWarningResponse | ( | std::string | warningNumber, | |
std::string | userResponse | |||
) |
Set the warning number and response.
warningNumber | A string containing the warning number. | |
userResponse | A string containing the user response. |
void SetWarningResponse | ( | int | warningNumber, | |
std::string | userResponse | |||
) |
Set the warning number and response.
warningNumber | An integer containing the warning number. | |
userResponse | A string containing the user response. |
std::string ToString | ( | ) | const [inherited] |
const int AUTO_POPULATE = 1 [static] |
Validation will happen on the host.
Any fields with the "Autopop" attribute will have their values set by the server and returned to the client. The record in the database is not updated. This gives the client the opportunity to get server populated data inserted into the record and returned to the client without updating the database.
const int UPDATE_OK = 0 [static] |
This requests the server update the record if there are no errors.
const int VALIDATE_ONLY = 2 [static] |
The server validates the record and returns any errors found.
It does not update the database if there are no errors found.