#include <Server.h>
Public Types | |
enum | FieldProperties |
Set of field properties to retrieve or update. More... | |
Public Member Functions | |
Server (const std::string &server, const std::string &user, const std::string &password) | |
Construct a session to the specified server, using the user name and password specified. | |
virtual | ~Server () |
Destructor. Will call ARTermination. | |
StatusList | getStatusList () |
Get the status list, if any resulting from the previous call. | |
ARControlStruct & | getControlStruct () |
Get the ARControlStruct representing this session. | |
void | setServerPort (const std::string &name, int portNum, int rpcNum) |
Set the port and/or RPC program number for the AR System Server. | |
void | lockToAdminRPC (const std::string &name) |
Lock to the RPC Program number of the admin server. | |
void | getListSchema (AssignableT< ARNameList > &out, unsigned int flags=AR_LIST_SCHEMA_ALL|AR_HIDDEN_INCREMENT, ARTimestamp timeStamp=0) |
Get a list of schemas (forms) on the AR System server. | |
void | getListSchema (AssignableT< ARNameList > &out, const IdList &idList, const std::string &name, unsigned int flags=AR_LIST_SCHEMA_ALL|AR_HIDDEN_INCREMENT, ARTimestamp timeStamp=0) |
Get a list of schemas (forms) that contain the specified fields and/or have a specific relationship to another form. | |
void | getListActiveLink (AssignableT< ARNameList > &out, const std::string &form, unsigned int timeStamp=0) |
Get a list of active links on the server. | |
void | getListFilter (AssignableT< ARNameList > &out, const std::string &form, unsigned int timeStamp=0) |
Get a list of filters on the server. | |
void | getListEscalation (AssignableT< ARNameList > &out, const std::string &form, unsigned int timeStamp=0) |
Get a list of escalations on the server. | |
void | getListCharMenu (AssignableT< ARNameList > &out, unsigned int timeStamp=0) |
Get a list of menus on the server. | |
void | getListCharMenu (AssignableT< ARNameList > &out, const NameList &formList, const NameList &activeLinkList, unsigned int timeStamp=0) |
Get a list of menus on the server. | |
void | getListField (AssignableT< ARInternalIdList > &out, const std::string &form) |
Get a list of fields on a form. | |
void | getListVUI (AssignableT< ARInternalIdList > &out, const std::string &form) |
Get a list of vuis (views) on a form. | |
void | getField (AssignableT< ARFieldInfoStruct > &out, const std::string &form, ARInternalId id, FieldProperties propertiesMask=fieldCommonUserProperties) |
get the definition of a field on a form. | |
void | getMultipleFields (AssignableT< ARFieldInfoList > &out, const std::string &form, const IdList &idList, FieldProperties propertiesMask=fieldCommonUserProperties) |
get the definition of fields on a form. | |
Id | createField (const std::string &form, const Field &field, bool reservedIdOk=true) |
create a field from a form. | |
void | setField (const std::string &form, const Field &field, unsigned int propertiesMask) |
update the definition of a field on a form. | |
void | deleteField (const std::string &form, ARInternalId id, unsigned int option=AR_FIELD_DATA_DELETE) |
delete a field from a form. | |
void | createEntry (EntryId &out, const std::string &form, const AssignableT< ARFieldValueList > &values) |
Create an entry in a form. | |
void | deleteEntry (const std::string &form, const EntryIdList &entryId, unsigned int option=AR_JOIN_DELOPTION_NONE) |
Delete an entry. | |
void | deleteEntry (const std::string &form, const EntryId &entryId, unsigned int option=0) |
Delete an entry. | |
void | getEntry (AssignableT< ARFieldValueList > &out, const std::string &form, const EntryIdList &entryId, const IdList &idList) |
Retrieve an entry. | |
void | getEntry (AssignableT< ARFieldValueList > &out, const std::string &form, const EntryIdList &entryId) |
Retrieve an entry. | |
void | mergeEntry (EntryId &out, const std::string &form, const AssignableT< ARFieldValueList > &values, unsigned int mergeType=AR_MERGE_ENTRY_DUP_MERGE) |
Import an entry. | |
void | setEntry (const std::string &form, const EntryIdList &entryId, const AssignableT< ARFieldValueList > &values, ARTimestamp getTime=0, unsigned int joinOption=AR_JOIN_SETOPTION_NONE) |
Update an entry. | |
void | getMultipleEntries (AssignableT< ARFieldValueListList > &out, const std::string &form, const EntryIdListList &entryIdList, const IdList &fields) |
Retrieve multiple entries. | |
void | parseQualification (Qualifier &out, const std::string &qualification, const std::string &form, const std::string &displayTag) |
Parse a qualification string and return a structure that can be used for getListEntry and getListEntryWithFields. | |
void | getListEntryWithFields (AssignableT< AREntryListFieldValueList > &out, const std::string &form, const Qualifier &qualifier, const IdList &idList, const SortList &sortList, unsigned int firstRetrieve=0, unsigned int maxRetrieve=0, unsigned int *numMatches=NULL) |
retrieve the entry id and field values for entries that match qualification criteria | |
void | getListSQL (AssignableT< ARValueListList > &out, const std::string &sqlCommand, unsigned int maxRetrieve=0, unsigned int *numMatches=NULL) |
retrieve values from execution of a SQL statement | |
void | getServerInfo (AssignableT< ARServerInfoList > &out, const ServerInfoRequestList &requestList) |
retrieve server information, such as host name, database type, etc. | |
void | setServerInfo (const AssignableT< ARServerInfoList > &infoList) |
update server information. | |
void | decodeStatusHistory (AssignableT< ARStatusHistoryList > &out, const std::string &statHistory) |
decode the character value for field 15 (status history) into a list of status history entries | |
void | decodeDiary (AssignableT< ARDiaryList > &out, const std::string &diaryValue) |
decode the diary value for a diary field int a list of diary entries |
ar::Server is the main class in RTL for communicating with AR System Servers. It represents an active user session, including the active server name and authentication information. For multi-threaded applications, one ar::Server instance should be created per thread.
Should you need to access the AR System C API directly, you can use the getControlStruct() method to retrieve a control structure directly. This can then be passed to any AR API function.
All calls will throw an Exception if there is an error. If you wish to check the result of any operation for warnings or notes, you can call getStatusList() to retrieve the status from the last API call made.
|
Set of field properties to retrieve or update. This is an enum because we can't declare static const members completely inline here, as we might in Java. You can actual combine values into a bitmask if fieldCommonUserProperties or fieldAllProperties do not suffice for your needs. |
|
Construct a session to the specified server, using the user name and password specified. Initiates a session. This will call ARInitialization. If you need to connect to a specific port or rpc program number, call setServerPort immediately after constructing the server object.
|
|
Destructor. Will call ARTermination.
|
|
Create an entry in a form. Create an entry in a form, equivalent to ARCreateEntry.
Example:
|
|
create a field from a form. Creates a field on a form, equivalent to ARCreateField. If the field id of the Field object is 0, the server will generate a new id for you. The id of the new field is returned (note that the Field object is is not updated with the new id automatically).
Example:
|
|
decode the diary value for a diary field int a list of diary entries
|
|
decode the character value for field 15 (status history) into a list of status history entries
|
|
Delete an entry. Delete an entry, equivalent to ARDeleteEntry.
|
|
Delete an entry. Delete an entry, equivalent to ARDeleteEntry.
Example:
|
|
delete a field from a form. Deletes a field on a form, equivalent to ARDeleteField.
Example:
|
|
Get the ARControlStruct representing this session. This is useful if you need to call an AR API function directly (perhaps one that is not implemented here in RTL yet).
|
|
Retrieve an entry. Retrieve all field values for an entry.
Example:
|
|
Retrieve an entry. Retrieve an entry, specifying specific fields for which values will be retrieved.
Example:
|
|
get the definition of a field on a form. Retrieves the definition of a field on a form, equivalent to ARGetField. You can specify which field properties should be returned by passing propertiesMask. (Note: propertiesMask is an enum, but a bitmask will be accepted if you combine values and cast it. An enum is used because static const unsigned int members cannot be declared inline using on header files in C++, unlike Java or .NET). If a property is not retrieved, that property will be empty in the returned Field object.
Example:
|
|
Get a list of active links on the server.
Example:
|
|
Get a list of menus on the server.
Example:
|
|
Get a list of menus on the server.
Example:
|
|
retrieve the entry id and field values for entries that match qualification criteria Retrieves the entry id and field values for matching entries, equivalent to ARGetListEntryWithFields.
Example:
|
|
Get a list of escalations on the server.
Example:
|
|
Get a list of fields on a form.
Example:
|
|
Get a list of filters on the server.
Example:
|
|
Get a list of schemas (forms) that contain the specified fields and/or have a specific relationship to another form.
Example:
|
|
Get a list of schemas (forms) on the AR System server.
Example:
|
|
retrieve values from execution of a SQL statement Retrieves the values from execution of a SQL statement.
|
|
Get a list of vuis (views) on a form.
Example:
|
|
Retrieve multiple entries. Retrieve multiple entries, specifying which field values to return. Equivalent to ARGetMultipleEntries.
|
|
get the definition of fields on a form. Retrieves the definition of fields on a form, equivalent to ARGetMultipleFields. You can specify which field properties should be returned by passing propertiesMask. (Note: propertiesMask is an enum, but a bitmask will be accepted if you combine values and cast it. An enum is used because static const unsigned int members cannot be declared inline using on header files in C++, unlike Java or .NET). If a property is not retrieved, that property will be empty in the returned Field object.
Example:
|
|
retrieve server information, such as host name, database type, etc. Retrieve server information, equivalent to ARGetServerInfo. See ar.h for AR_SERVER_INFO_* values.
Example:
|
|
Get the status list, if any resulting from the previous call.
|
|
Lock to the RPC Program number of the admin server. This is a shorthand for setServerPort(0, 390600). Call this is you are updating definitions on the server; it will force all calls to go to the admin server and will therefore always work against a current cache.
Example:
|
|
Import an entry. Imports an entry, equivalent to ARMergeEntry. This may created an entry, overwrite an entry, or merge new fields values, depending on the data and options.
|
|
Parse a qualification string and return a structure that can be used for getListEntry and getListEntryWithFields. Parse a qualification string (such as 'Assigned To' = $USER$) into a Qualification object, which is required for getListEntry and getListEntryWithFields. The Qualification object can be reused across any number of calls to getListEntry or getListEntryWithFields. Unfortunately, the API routine that is used to parse the qualification (ARLoadARQualifierStruct) is incredibly expensive, so wherever possible it is a good idea to pre-parse queries into Qualification objects so they are only parsed once.
Example:
|
|
Update an entry. Updates an entry, equivalent to ARSetEntry.
|
|
update the definition of a field on a form. Updates the definition of a field on a form, equivalent to ARSetField. You can specify which field properties should be saved by passing propertiesMask. (Note: propertiesMask is an enum, but a bitmask will be accepted if you combine values and cast it. An enum is used because static const unsigned int members cannot be declared inline using on header files in C++, unlike Java or .NET).
Example:
|
|
update server information. Update server information, equivalent to ARSetServerInfo. See ar.h for AR_SERVER_INFO_* values.
Example:
|
|
Set the port and/or RPC program number for the AR System Server. Call this immediately after constructing the Server object, if you need to connect to an AR System Server on a specific port or rpc program number.
Example:
|