Introduction
This document accompanies the SDK package, and describes the XERA API structures and functions to obtain XERA client and database information, create a database and add users, create panels, panel items, and word lists, and import/export data into and from an XERA database.
Constants
Constants Class
The Constants class currently holds the following two members:
- OBJECT_ID_FIELD: Used for UpdateRecords to define the Object_ID_FIELD.
- NOT_ASSOCIATED: Used to retrieve all objects, rather than just associated objects.
NOTE: Class usage may vary slightly, depending on the language you are using.
Enumerators
DataServerType
This enumerator distinguishes between SQL Server and Oracle Data Servers.
- ORACLE: Used to signify an Oracle data server.
- MSSQL: Used to signify a Microsoft SQL Server data server.
FieldType
This enumerator distinguishes the type of field used in a Field structure.
- FULL_TEXT: Used to signify a full text field.
- LIMITED_TEXT: Used to signify a limited text field.
- DATE: Used to signify a date field. See DateFormat for more information.
- DATETIME: Used to signify a Date Time field. You must use the format ‘YYYY-MM-DD HH24:MI:SS’. See TimeFormat for more information. To generate DateTime in the correct format, see FormatDateTime for more information.
- NUMERIC: Used to signify a numeric field. See NumericFormat for more information.
- NATIVE_FILE: Used to signify a field that contains a link to a native file.
- IMAGE_LINK: Used to signify a field that contains a link to an image table.
- CURRENCY: Used to signify a currency format for a numeric field. See CurrencyFormat for more information.
- DURATION: Used to signify a format for duration fields. See DurationFormat for more information.
DateFormat
This enumerator distinguishes the date format used for a Date or a Date Time field.
- NOT_APPLICABLE: Default value for fields that are not Date or Date Time fields.
- DDMMYY: Signifies the DD/MM/YY date format.
- DDMMYYYY: Signifies the DD/MM/YYYY date format.
- MMDDYY: Signifies the MM/DD/YY date format.
- MMDDYYYY: Signifies the MM/DD/YYYY date format.
- YYMMDD: Signifies the YY/MM/DD date format.
- YYYYMMDD: Signifies the YYYY/MM/DD date format.
- YYYYMMDDNOSPLIT: Signifies the YYYYMMDD date format.
TimeFormat
This enumerator distinguishes the time format used for a Date Time field.
- NOT_APPLICABLE: Default value for fields that are not Date Time fields.
- HHMMSSAMPM: Signifies the HH:MM:SS AM/PM time format.
NumericFormat
This enumerator distinguishes the type of formatting used for a Numeric field.
- NOT_APPLICABLE: Default value for fields that are not a Numeric field.
- NORMAL: Signifies that empty values remain empty.
- ZERO_FILLED: Signifies that any leading spaces are filled with zeroes to match the maximum size of the numeric field before the decimal place.
- PERCENTAGE: Signifies that this field is a formatted as a percentage.
CurrencyFormat
This enumerator distinguishes the type of currency format used for a Currency field.
- NOT_APPLICABLE: Default value for fields that are not a Currency field.
- DOLLARS: Signifies that the dollar sign ($) will be used for this field.
- EUROS: Signifies that the Euro sign (€) will be used for this field.
- POUND: Signifies that the Pound sign (£) will be used for this field.
DurationFormat
This enumerator distinguishes the type of duration format used for a Duration field.
- NOT_APPLICABLE: Default value for fields that are not a Duration field.
- DAYS_PLUS_HHMMSS: Signifies the DDD+HH:MM:SS duration format.
Color
This enumerator distinguishes color options that can be used. Currently, the FolderSettings structure and WordList structure supports color.
- NOT_APPLICABLE: Used when a color isn’t required.
- BLACK: Represents the color Black.
- BLUE: Represents the color Blue.
- FUCHSIA: Represents the color Fuchsia.
- GRAY: Represents the color Gray.
- GREEN: Represents the color Green.
- AQUA: Represents the color Aqua.
- LIME: Represents the color Lime.
- MAROON: Represents the color Maroon.
- NAVY: Represents the color Navy.
- OLIVE: Represents the color Olive.
- PURPLE: Represents the color Purple.
- RED: Represents the color Red.
- SILVER: Represents the color Silver.
- TEAL: Represents the color Teal.
- WHITE: Represents the color White.
- YELLOW: Represents the color Yellow.
- MANILA: Represents the color Manila (a buff color, halfway between white and yellow).
- ORANGE: Represents the color Orange.
PanelType
This enumerator distinguishes the Panel type.
- STANDARD: This is a standard panel to which panel items can be added.
- CUSTOM_RELATED: This is a custom related panel.
PanelLocation
This enumerator distinguishes the location of a standard panel. This does not apply to Custom Related panels as they are only displayed in Document View.
- NOT_APPLICABLE: Signifies that the panel is not displayed anywhere.
- TABLE_VIEW: The panel will be displayed in Table View.
- DOCUMENT_VIEW: The panel will be displayed in Document View.
PanelItemType
This enumerator distinguishes the types of items that can be added to a standard panel.
- FOLDER: The panel item that represents a folder.
- EDIT: The panel item that represents an input which allows for text insertion or selection (known as an edit control).
- SEPARATOR: The panel item that represents a separator (a horizontal line).
PanelItemIcon
This enumerator distinguishes the icons that can be associated with a folder panel item.
- NOT_APPLICABLE: Used for edit and separators panel items, as they do not have icons.
- FOLDER: Used to represent the folder icon for a folder.
- CODING: Used to represent the pencil icon for a folder.
EditItemType
This enumerator distinguishes how data is added to an edit control panel item.
- NOT_APPLICABLE: Used for folder and separator panel items only.
- APPEND: Signifies that the edit item appends data.
- PREPEND: Signifies that the edit item prepends data.
- REPLACE: Signifies that the edit item replaces the data.
HighlightType
This enumerator contains the values for highlight types that are used for Word Lists.
- NOT_APPLICABLE: Currently unused.
- FOREGROUND: Signifies that the words used in a Word List are highlighted.
- BACKGROUND: Signifies that the background (rather than words) used in a Word List are highlighted.
SettingDataType
- STRING: Any value is accepted.
- BOOLEAN: Must be either 0 for FALSE or 1 for TRUE
- INTEGER: Any valid integer number.
- ENUM: An integer number, corresponding to one of the values appropriate the that settings enum.
- NETWORK_LOCATION: A valid network location, must already exist to be accepted.
- FIELD_ID: A valid field ID for the database being acted upon.
UserSetting
- FORCE_PASSWORD_CHANGE: Forces the user to change their password at the next login. Value is a SettingDataType.BOOLEAN.
- FORCE_EULA: Forces the user to agree to the EULA at next login. Value is a SettingDataType.BOOLEAN.
DatabaseSetting
- NATIVE_FILE_FIELD: The default Native File field in the database. Value is a SettingDataType.FIELD_ID.
- CONVERSION_ERROR_FIELD: The field that native file conversion errors should be written to. Value is a SettingDataType.FIELD_ID
- TEMPORARY_FILE_SIZE_LIMIT: The maximum drive space that should be taken up while converting a native file. Value is a SettingDataType.INTEGER.
- NATIVE_FILE_TIMEOUT: The maximum time (in seconds) that the system should wait for a native file conversion to complete. Value is a SettingDataType.INTEGER.
- BIT_DEPTH: The default bit depth to use for the images when converting native files. Value is a SettingDataType.ENUM.
- RESIZE_PAGES: Whether or not to force the sizing of the images created during native conversion to a particular page size. Value is a SettingDataType.ENUM.
State
This enumerator is used for Client, Database and User objects to indicate if the object is active or disabled.
- Active: The object is accessible and usable if it’s in an active state.
- Disabled: The object is inaccessible and not usuable when it’s in a disabled state.
UserGroupType
This enumerator distinguishes the UserGroup type.
- User: Represents an ordinary user group.
- Template: Represents a user group template.
UserRoleType
This enumerator distinguishes the UserRole type.
- User: Represents an ordinary user role.
- GlobalRole: The user role isn’t associated with any specific client but has no special properties.
Schedule
This enumerator is used in ScheduleInfo
- None: The job does not run on a schedule.
- Scheduled: The job will run once.
- Recurring: The job will run more than once.
Authentication
Login
try {
TTransport transport = new TSocket("localhost", 7780);
transport.open();
TGUIDProtocol protocol = new TGUIDProtocol(transport, Direction.SEND);
AdminService.Client client = new AdminService.Client(protocol);
protocol.SetGUID(client.Login("myusername", "mypassword"));
/* client can now be used to make subsequent calls to the API */
} catch ( AdminError | TException e) {
e.printStackTrace();
}
try
{
boost::shared_ptr< TSocket > oSocket;
boost::shared_ptr< TTransport > oTransport;
boost::shared_ptr< TProtocol > oProtocol;
boost::shared_ptr< AdminServiceClient > oClient;
oSocket.reset(new TSocket("localhost", (int)7780));
oTransport.reset(new TBufferedTransport(oSocket));
oProtocol.reset( new TGUIDMemberProtocol<TBinaryProtocol,
unique_ptr<string_t>>( oTransport,enDirection::dirSend ) );
oClient.reset(new AdminServiceClient(oProtocol));
oTransport->open();
wstring sGUID;
oClient->Login(sGUID, L"myusername", L"mypassword");
static_cast<TGUIDMemberProtocol<TBinaryProtocol,
unique_ptr<string_t>>*>(oProtocol.get())->SetMemberGUID(sGUID);
/* oClient can now be used to make subsequent calls to the API */
}
catch (AdminError& oError)
{
_tprintf(oError.sError.c_str());
}
try {
TcpClient tcpclient = new TcpClient("localhost", 7780);
TGUIDProtocol protocol = new TGUIDProtocol(new TBinaryProtocol(new TSocket(tcpclient)),
"", TGUIDProtocol.enDirection.dirSend);
AdminService.Client client = new AdminService.Client(protocol, protocol);
TGUIDProtocol.t_strGUID = client.Login("myusername", "mypassword");
}
catch(AdminError e) {
Console.WriteError(e.SError)
}
String Login(String sUsername, String sPassword)
This function will validate an administrative username and password.
Parameters
- sUsername: A string representing the login username.
- sPassword: A string representing the login password.
Returns
A string containing the session ID.
Data Server Structures
DataServer
DataServer oDataServer = new DataServer();
oDataServer.eType = DataServerType.MSSQL;
oDataServer.sName = "SQL Data Server";
::iconect::api::structs::DataServer oDataServer;
oDataServer.eType = ::iconect::api::structs::DataServerType.MSSQL;
oDataServer.sName = L"SQL Data Server";
DataServer oDataServer = new DataServer();
oDataServer.EType = DataServerType.MSSQL;
oDataServer.SName = "SQL Data Server";
public DataServer()public DataServer(long lID, String sName, DataServerType eType)
This structure contains a data server ID, its name, and the database connection.
- lID: An integer representing the ID of the data server.
- sName: A string containing the data server’s name.
- eType: Contains the data server type value. See DataServerType for more information.
Data Server Methods
GetDataServers
List<DataServer> aDataServers = client.GetDataServers();
for(DataServer ds : aDataServers) {
System.out.println(ds.sName);
}
std::vector<::iconect::api::structs::DataServer> aDataServers;
oClient->GetDataServers(aDataServers);
for(::iconect::api::structs::DataServer ds : aDataServers) {
std::cout << ds.sName << " ";
}
List<DataServer> aDataServers = new List<DataServer>();
aDataServers = oClient.GetDataServers();
foreach(DataServer ds in aDataServers) {
Console.WriteLine(ds.SName);
}
List<DataServer> GetDataServers()
This function returns an array of DataServer objects in use on the XERA instance.
Returns
An array of DataServer structures.
GetDataServerForDatabase
DataServer GetDataServerForDatabase(long lDatabaseID)
long lDatabaseID = 1;
DataServer oDataServer = client.GetDataServerForDatabase(lDatabaseID);
System.out.println(oDataServer.sName);
::iconect::api::structs::DataServer oDataServer;
int64_t lDatabaseID = 1;
oClient->GetDataServerForDatabase(oDataServer,lDatabaseID);
std::cout << oDataServer.sName << " ";
long lDatabaseID = 1;
DataServer oDataServer = oClient.GetDataServerForDatabase(lDatabaseID);
Console.WriteLine(oDataServer.SName);
This function returns the DataServer configured for the database.
Parameters
- lDatabaseID: Contains an ID representing a database.
Returns
A DataServer object that represents the data server configured for the database.
Client Structures
Client
Client oClient = new Client();
oClient.sName = "My client";
oClient.sDescription = "Client descripton";
oClient.eState = State.Active;
::iconect::api::structs::Client oClient;
oClient.sName = L"My client";
oClient.sDescription = "Client descripton";
oClient.eState = ::iconect::api::structs::State::Active;
Client oClient = new Client();
oClient.SName = "My client";
oClient.SDescription = "Client descripton";
oClient.EState = State.Active;
public Client()public Client(long lID, String sName, String sDescription, State eState)
This structure contains a Client ID and its name.
- lID: An integer representing the Client ID.
- sName: A string containing the name of the client.
- sDescription: A string containing the description of the client.
- eState: An enum value representing whether the client is active or inactive.
Client Methods
GetClients
List<Client> aClients = client.GetClients();
for(Client oClient : aClients, State.Active) {
System.out.println(oClient.sName);
}
std::vector<::iconect::api::structs::Client> aClients;
oClient->GetClients(aClients, ::iconect::api::structs::State::Active);
for(::iconect::api::structs::Client client : aClients) {
std::cout << client.sName << " ";
}
List<Client> aClients = new List<Client>();
aClients = client.GetClients(State.Active);
foreach(Client oClient in aClients) {
Console.WriteLine(oClient.SName);
}
List<Client> GetClients(State eStateFilter)
This function returns an array of client objects that represent all the clients available on the XERA instance.
Parameters
- eState: An enumerator used to filter out Active/Disabled clients.
Returns
An array of Client structures.
CreateClient
Client oClient = new Client();
oClient.sName = "My client";
oClient.sDescription = "Client descripton";
oClient.eState = State.Active;
Client oCreatedClient = client.CreateClient(oClient);
::iconect::api::structs::Client oClient;
oClient.sName = L"My client";
oClient.sDescription = "Client descripton";
oClient.eState = ::iconect::api::structs::State::Active;
::iconect::api::structs::Client oCreatedClient;
oClient->CreateClient(oCreatedClient,oClient);
Client oClient = new Client();
oClient.SName = "My client";
oClient.SDescription = "Client descripton";
oClient.EState = State.Active;
Client oCreatedClient = client.CreateClient(oClient);
Client CreateClient(Client oClient)
Parameters
- Client: A populated client object to be added
Returns
The final Client with the id populated.
UpdateClient
Client oClient = client.GetClient(1);
oClient.sName = "My updated name";
client.UpdateClient(oClient);
::iconect::api::structs::Client oClient;
oClient->GetClient(oClient,1);
oClient.sName = L"My updated name";
oClient->UpdateClient(oClient);
Client oClient = client.GetClient(1);
oClient.SName = "My updated name";
client.UpdateClient(oClient);
void UpdateClient(Client oClient)
Parameters
- Client: An existing client object with changes to be updated
DeleteClient
client.DeleteClient(1);
oClient->DeleteClient(1);
client.DeleteClient(1);
void DeleteClient(long lClientID)
Parameters
- lClientID: The ID of the client you want to remove.
GetClient
Client oClient = client.GetClient(1);
::iconect::api::structs::Client oClient;
oClient->GetClient(oClient,1);
Client oClient = client.GetClient(1);
void GetClient(long lClientID)
Parameters
- lClientID: The ID of the client you want to fetch.
Returns
Returns a Client object.
ActivateClient
long lClientID = 1;
client.ActivateClient(lClientID);
int64_t lClientID = 1;
oClient->ActivateClient(lClientID);
long lClientID = 1;
client.ActivateClient(lClientID);
bool ActivateClient(long lClientID)
This function is used to activate an existing XERA client.
Parameters
- lClientID: The ID of the client to activate
Returns
The previous status of the client.
DeactivateClient
long lClientID = 1;
client.DeacivateClient(lClientID);
int64_t lClientID = 1;
oClient->DeactivateClient(lClientID);
long lClientID = 1;
client.DeactivateClient(lClientID);
bool DeactivateClient(long lClientID)
This function is used to deactivate an existing XERA client.
Parameters
- lClientID: The ID of the client to deactivate
Returns
The previous status of the client.
GetClientsForDatabase
int64_t lDatabaseID = 1;
std::vector< ::iconect::api::structs::Client> aClients;
oClient.GetClientsForDatabase(aClients,lDatabaseID);
for(::iconect::api::structs::Client client : aClients) {
std::cout << client.sName << " ";
}
List<Client> aClients = new List<Client>();
long lDatabaseID = 1;
aClients = client.GetClientsForDatabase(lDatabaseID);
foreach(Client client in aClients) {
Console.WriteLine(client.SName);
}
long lDatabaseID = 1;
List<Client> aClients = client.GetClientsForDatabase(lDatabaseID);
for(Client client : aClients) {
System.out.println(client.sName);
}
list<Client> GetClientsForDatabase(long lDatabaseID)
This function returns an array of client objects that represent all the clients associated with the specified database.
Parameters
- lDatabaseID: Contains an ID representing a database.
Returns
An array of Client structures.
Database Structures
IDList Type Definition
This defines IDList as an array of identity integer numbers, same as List<long>.
Field
Field oField = new Field();
oField.sName = "Native File Link";
oField.eType = FieldType.NATIVE_FILE;
oField.eDateFormat = DateFormat.NOT_APPLICABLE
oField.eTimeFormat = TimeFormat.NOT_APPLICABLE;
oField.iDecimalPlaces = 0;
oField.iLength = 100;
oField.eCurrency = CurrencyFormat.NOT_APPLICABLE;
oField.eDuration = DurationFormat.NOT_APPLICABLE;
::iconect::api::structs::Field oField;
oField.sName = L"Native File Link";
oField.eType = FieldType.NATIVE_FILE;
oField.eDateFormat = ::iconect::api::structs::DateFormat::NOT_APPLICABLE
oField.eTimeFormat = ::iconect::api::structs::TimeFormat::NOT_APPLICABLE;
oField.iDecimalPlaces = 0;
oField.iLength = 100;
oField.eCurrency = ::iconect::api::structs::CurrencyFormat::NOT_APPLICABLE;
oField.eDuration = ::iconect::api::structs::DurationFormat::NOT_APPLICABLE;
Field oField = new Field();
oField.SName = "Native File Link";
oField.EType = FieldType.NATIVE_FILE;
oField.EDateFormat = DateFormat.NOT_APPLICABLE
oField.ETimeFormat = TimeFormat.NOT_APPLICABLE;
oField.IDecimalPlaces = 0;
oField.ILength = 100;
oField.ECurrency = CurrencyFormat.NOT_APPLICABLE;
oField.EDuration = DurationFormat.NOT_APPLICABLE;
public Field()public Field(long lID, FieldType eType, String sName, int iLength, DateFormat eDateFormat, NumericFormat eNumericFormat, int iDecimalPlaces, CurrencyFormat eCurrencyFormat, TimeFormat eTimeFormat, DurationFormat eDurationFormat)
This structure contains the properties of a field.
- lID: An integer that contains the field ID.
NOTE: This integer is not required when creating a new field. - eType: Contains the value for the FieldType enum and can be used to determine the type of field.
- eDateFormat: Contains the value for the DateFormat enum value for the field. Fields other than date and datetime fields will be populated by the NOT_APPLICABLE enum value.
- eTimeFormat: Contains the value for the TimeFormat enum value for the field. Fields other than datetime fields will be populated by the NOT_APPLICABLE enum value.
NOTE: Both eDateFormat and eTimeFormat must be specified for Date Time fields. - iDecimalPlaces: An integer that represents the number of digits after the decimal place.
NOTE: This value cannot be equal or larger than the field length (iLength) and is only used for Numeric or Currency fields. - sName: A string representing the display name of the field.
NOTE: For new fields, the display name must be unique to the database. - iLength: An integer representing the length of a field.
NOTE: For numeric fields this size cannot be less than the iDecimalPlaces value. For FULL_TEXT and DATE fields the length is ignored. - eCurrency: Contains the value for the CurrencyFormat enumerator to denote the currency notation.
- eDuration: Contains the value for the DurationFormat enum value for the field. Fields other than duration type will be populated by the NOT_APPLICABLE enum value.
Database
Database oNewDatabase = new Database();
oNewDatabase.sName = "ACL Research";
oNewDatabase.sDescription = "A Database Description";
oNewDatabase.eState = State.Active;
::iconect::api::structs::Database oNewDatabase;
oNewDatabase.sName = L"ACL Research";
oNewDatabase.sDescription = L"A Database Description";
oNewDatabase.eState = ::iconect::api::structs::State::Active;
Database oNewDatabase = new Database();
oNewDatabase.SName = "ACL Research";
oNewDatabase.SDescription = "A Database Description";
oNewDatabase.EState = State.Active;
public Database()public Database(long lID, String sName, String sDescription, State eState)
This structure contains the properties of a database.
- lID: An integer representing the database’s unique ID.
- sName: A string representing the database’s name.
- sDescription: A string representing the database’s description.
- eState: A enumerator indicating whether or not the database is active (and therefore accessible through the XERA web interface) or disabled.
Record
long lFieldID = 1;
String sFieldData = new String("Field data for the record");
Record oRecord = new Record();
oRecord.mapFieldIDToData = new HashMap<>();
oRecord.mapFieldIDToData.put(lFieldID, sFieldData);
int64_t lFieldID = 1;
std::wstring sFieldData = L"Field data for the record";
::iconect::api::structs::Record oRecord;
oRecord.mapFieldIDToData[lFieldID] = sFieldData;
long lFieldID = 1;
String sFieldData = "Field data for the record";
Record oRecord = new Record();
oRecord.MapFieldIDToData = new Dictionary<long, string>();
oRecord.MapFieldIDToData.Add(lFieldID, sFieldData);
public Record()public Record(Map<Long,String> mapFieldIDToData, long ID, long Version, long Order)
This structure represents a single record.
- mapFieldIDToData: A map of field IDs to their data value as a string. Use an empty string for any value that should be empty. Null is not permitted.
- ID: An integer represents the object_id of the record.
- Version: An integer represents the row version of the record.
- Order: An integer reserved for future release.
Record Reading
- ID field is the object_id of the record
- Version field is the row version of the record
Record Adding
long lFieldID = 1;
String sFieldData = new String("Field data for the record");
Record oRecord = new Record();
oRecord.mapFieldIDToData = new HashMap<>();
oRecord.mapFieldIDToData.put(lFieldID, sFieldData);
int64_t lFieldID = 1;
std::wstring sFieldData = L"Field data for the record";
::iconect::api::structs::Record oRecord;
oRecord.mapFieldIDToData[lFieldID] = sFieldData;
long lFieldID = 1;
String sFieldData = "Field data for the record";
Record oRecord = new Record();
oRecord.MapFieldIDToData = new Dictionary<long, string>();
oRecord.MapFieldIDToData.Add(lFieldID, sFieldData);
- ID field will be ignored; defualtly it will be set to 0
- Version field will be ignored; defualtly it will be set to 0
Record Updating
long lFieldID = 1;
String sFieldData = new String("Field data for the record");
Record oRecord = new Record();
oRecord.ID = 1;
oRecord.Version = 6114138;
oRecord.mapFieldIDToData = new HashMap<>();
oRecord.mapFieldIDToData.put(lFieldID, sFieldData);
int64_t lFieldID = 1;
std::wstring sFieldData = L"Field data for the record";
::iconect::api::structs::Record oRecord;
oRecord.ID = 1;
oRecord.Version = 6114138;
oRecord.mapFieldIDToData[lFieldID] = sFieldData;
long lFieldID = 1;
String sFieldData = "Field data for the record";
Record oRecord = new Record();
oRecord.ID = 1;
oRecord.Version = 6114138;
oRecord.MapFieldIDToData = new Dictionary<long, string>();
oRecord.MapFieldIDToData.Add(lFieldID, sFieldData);
- ID must be set to the object_id of the target record to be updated
- Applies to
UpdateRecordsWithFieldsReturned(): if Version is set to 0, no version matching will be performed for the updating; otherwise, update will be performed only when the target record’s current row version is equal to the Version field value here
Record Deleting
long lFieldID = 1;
String sFieldData = new String("Field data for the record");
Record oRecord = new Record();
oRecord.ID = 1;
oRecord.Version = 0;
oRecord.mapFieldIDToData = new HashMap<>();
oRecord.mapFieldIDToData.put(lFieldID, sFieldData);
int64_t lFieldID = 1;
std::wstring sFieldData = L"Field data for the record";
::iconect::api::structs::Record oRecord;
oRecord.ID = 1;
oRecord.Version = 0;
oRecord.mapFieldIDToData[lFieldID] = sFieldData;
long lFieldID = 1;
String sFieldData = "Field data for the record";
Record oRecord = new Record();
oRecord.ID = 1;
oRecord.Version = 0;
oRecord.MapFieldIDToData = new Dictionary<long, string>();
oRecord.MapFieldIDToData.Add(lFieldID, sFieldData);
- ID must be set to the object_id of the target record to be deleted
- Version field will be ignored; usually it shall be set to 0
RecordList
long lFieldID = 1;
String sFieldData = new String("Field data for the record");
Record oRecord = new Record();
oRecord.mapFieldIDToData = new HashMap<>();
oRecord.mapFieldIDToData.put(lFieldID, sFieldData);
ArrayList<Record> aList = new ArrayList<>();
aList.add(oRecord);
RecordList oNewRecords = new RecordList();
oNewRecords.aData = aList;
int64_t lFieldID = 1;
std::wstring sFieldData = L"Field data for the record";
::iconect::api::structs::Record oRecord;
oRecord.mapFieldIDToData[lFieldID] = sFieldData;
RecordList oNewRecords;
oNewRecords.aData.push_back(oRecord);
long lFieldID = 1;
String sFieldData = "Field data for the record";
Record oRecord = new Record();
oRecord.MapFieldIDToData = new Dictionary<long, string>();
oRecord.MapFieldIDToData.Add(lFieldID, sFieldData);
List<Record> aList = new List<Record>();
aList.Add(oRecord);
RecordList oNewRecords = new RecordList();
oNewRecords.AData = aList;
public RecordList()public RecordList(List<Record> aData)
This structure represents a list of records.
- aData: An array of record structures.
NOTE: All records must have the same field list as the first record in the array.
DuplicateNewRecordList
This structure represents the return result of AddRecordsNoDuplicatesWithFieldsReturned(), and it contains two records arraies as following:
- NewRecordsList: An array of records which have been successfully added into the database
- DuplicatedList: An array of records which have NOT been added into the database because there are duplicated records in the database already.
NOTE: All records must have the same field list as the first record in the array.
Database Methods
CreateDatabase
Database oNewDatabase = new Database();
oNewDatabase.sName = "ACL Research";
oNewDatabase.sDescription = "A Database Description";
oNewDatabase.bActive = true;
ArrayList<Integer> aClientIDs = new ArrayList<>();
aClientIDs.add(1);
long lDataServerID = 1;
client.CreateDatabase(oNewDatabase, lDataServerID, aClientIDs);
::iconect::api::structs::Database oNewDatabase;
oNewDatabase.sName = L"ACL Research";
oNewDatabase.sDescription = L"A Database Description";
oNewDatabase.bActive = true;
std::vector<int64_t> aClientIDs;
aClientIDs.push_back(1);
int64_t lDataServerID = 1;
oClient->CreateDatabase(oNewDatabase, lDataServerID, aClientIDs);
Database oNewDatabase = new Database();
oNewDatabase.SName = "ACL Research";
oNewDatabase.SDescription = "A Database Description";
oNewDatabase.BActive = true;
List<long> aClientIDs = new List<long>();
aClientIDs.Add(1);
long lDataServerID = 1;
client.CreateDatabase(oNewDatabase, lDataServerID, aClientIDs);
Database CreateDatabase(Database oNewDatabase, long lDataServerID, List<Long> aClientIDs)
This function is used to create a new XERA database.
Parameters
- oNewDatabase: A database structure that represents the database information. See Database for more information.
- lDataServerID: An integer that represents the data server that will be associated with the database.
- aClientIDs: An array of integers that represent the clients that will be associated to the new database.
Returns
A Database structure populated with the database ID.
CreateDatabaseBasedOnTemplate
import com.iconect.api.structs.*;
import java.util.List;
import java.util.stream.Collectors;
/* This code assumes that the template has the database ID 5000 ... */
long lTemplatelDatabaseID = 5000;
/* ... and creates a new database called "New Database" ... */
Database oDatabaseInfo = new Database();
oDatabaseInfo.setSName("New Database");
oDatabaseInfo.setSDescription("This database was created as an example");
oDatabaseInfo.setEState(State.Active);
/* ... on the same server as the template ... */
long lDataServerID = client.GetDataServerForDatabase(lTemplatelDatabaseID);
/* ... and with the same clients as the template ... */
List<Client> aClients = client.GetClientsForDatabase(lTemplatelDatabaseID);
List<Long> aClientIDs = aClients.stream().map(Client::getLID).collect(Collectors.<Long>toList())
/* ... but with no new user groups. */
bool bCreateNewGroups = false;
Database oNewDatabase = client.CreateDatabaseBasedOnTemplate(
oDatabaseInfo, lDataServerID, lTemplatelDatabaseID,
aClientIDs, bCreateNewGroups);
using namespace iconect::api::structs;
/* This code assumes that the template has the database ID 5000 ... */
std::int64_t lTemplatelDatabaseID = 5000;
/* ... and creates a new database called "New Database" ... */
Database oDatabaseInfo;
oDatabaseInfo.__set_sName(L"New Database");
oDatabaseInfo.__set_sDescription(L"This database was created as an example");
oDatabaseInfo.__set_eState(State::Active);
/* ... on the same server as the template ... */
long lDataServerID = oClient->GetDataServerForDatabase(lTemplatelDatabaseID);
/* ... and with the same clients as the template ... */
std::vector<Client> aClients (client.GetClientsForDatabase(lTemplatelDatabaseID));
std::vector<std::int64_t> aClientIDs;
std::transform(aClients.cbegin(), aClients.cend(), std::back_inserter(aClientIDs), std::mem_fn(&Client::lID));
/* ... but with no new user groups. */
bool bCreateNewGroups = false;
Database oNewDatabase (oClient->CreateDatabaseBasedOnTemplate(
oDatabaseInfo, lDataServerID, lTemplatelDatabaseID,
aClientIDs, bCreateNewGroups));
using iconect.api.structs;
using System.Linq; /* for Select and ToList */
/* This code assumes that the template has the database ID 5000 ... */
long lTemplateDatabaseID = 5000;
/* ... and creates a new database called "New Database" ... */
Database oDatabaseInfo = new Database() {
SName = "New Database",
SDescription = "This database was created as an example",
EState = State.Active };
/* ... on the same server as the template ... */
long lDataServerID = client.GetDataServerForDatabase(lTemplateDatabaseID);
/* ... and with the same clients as the template ... */
List<Client> aClients = client.GetClientsForDatabase(lTemplateDatabaseID);
List<long> aClientIDs = aClients.Select(oClient => oClient.lID).ToList<long>();
/* ... but with no new user groups. */
bool bCreateNewGroups = false;
Database oNewDatabase = client.CreateDatabaseBasedOnTemplate(
oDatabaseInfo, lDataServerID, lTemplateDatabaseID,
aClientIDs, bCreateNewGroups);
Database CreateDatabaseBasedOnTemplate(Database oNewDatabase, long lDataServerID, long lSourceDBID, List<Long> aClientIDs, boolean bCreateNewGroup)
This function is used to create an XERA database from a database template.
Parameters
- oNewDatabase: A database structure that represents the database information. See Database for more information.
- lDataServerID: An integer that represents the data server that will be associated with the database.
- lSourceDBID: An integer that represents the database template to use as the base for the new database.
- aClientIDs: An array of integers that represent the clients that will be associated to the new database.
- bCreateNewGroup: A boolean value that represents whether a set of user groups will be created for the new database or if the existing security settings will be copied to the existing user groups.
Returns
A Database structure populated with the database ID.
GetDatabases
long lClientID = 1;
List<Database> databases = client.GetDatabases(lClientID, State.Active);
for (int i = 0; i < databases.size(); i++)
{
System.out.println(databases.get(i).lID);
}
int64_t lClientID = 1;
std::vector< ::iconect::api::structs::Database> databases =
oClient->GetDatabases(lClientID,::iconect::api::structs::State::Active);
for (::iconect::api::structs::Database database : databases)
{
std::cout << database.lID << " ";
}
List<Database> aDatabases = new List<Database>();
long lClientID = 1;
aDatabases = client.GetDatabases(lClientID,State.Active);
foreach(Database oDatabase in aDatabases){
Console.WriteLine(oDatabase.LID);
}
List<Database> GetDatabases(long lClientID, State eStateFilter)
This function returns an array of Database objects.
Use NOT_ASSOCIATED for lClientID to return all the databases on the system.
Parameters
- lClientID: Provide a Client ID to limit the databases returned to only the ones associated with the Client ID.
- eStateFilter: Used to filter to either Active or Disabled databases.
Returns
An array of Database structures.
GetDatabase
long lDatabaseID = 10;
Database oDatabase = client.GetDatabase(lDatabaseID);
System.out.println(oDatabase.lID);
System.out.println(oDatabase.sName);
int64_t lDatabaseID = 10;
::iconect::api::structs::Database oDatabase = oClient->GetDatabase(lDatabaseID);
std::cout << oDatabase.lID << " ";
std::cout << oDatabase.sName << " ";
long lDatabaseID = 10;
Database oDatabase = client.GetDatabases(lDatabaseID);
Console.WriteLine(oDatabase.LID);
Console.WriteLine(oDatabase.SName);
Database GetDatabase(long lDatabaseID)
This function returns a Database object.
Parameters
- lDatabaseID: An integer representing a Database ID.
Returns
A Database object.
DeleteDatabase
long lDatabaseID = 1;
Database oDatabase = new Database(lDatabaseID);
client.DeleteDatabase(oDatabase);
int64_t lDatabaseID = 1;
::iconect::api::structs::Database oDatabase;
oDatabase.lID = lDatabaseID;
oClient->DeleteDatabase(oDatabase);
long lDatabaseID = 1;
Database oDatabase = new Database();
oDatabase.LID = lDatabaseID;
client.DeleteDatabase(oDatabase);
void DeleteDatabase(Database oDatabase)
This function is used to delete an existing XERA database. This function will match on the Database ID.
Parameters
- oDatabase: A Database structure that represents the database information. See Database for more information.
Returns
None.
ActivateDatabase
long lDatabaseID = 1;
client.ActivateDatabase(lDatabaseID);
int64_t lDatabaseID = 1;
oClient->ActivateDatabase(lDatabaseID);
long lDatabaseID = 1;
client.ActivateDatabase(lDatabaseID);
bool ActivateDatabase(long lDatabaseID)
This function is used to activate an existing XERA database.
Parameters
- lDatabaseID: The ID of the database to activate
Returns
The previous status of the database.
DeactivateDatabase
long lDatabaseID = 1;
client.DeacivateDatabase(lDatabaseID);
int64_t lDatabaseID = 1;
oClient->DeactivateDatabase(lDatabaseID);
long lDatabaseID = 1;
client.DeactivateDatabase(lDatabaseID);
bool DeactivateDatabase(long lDatabaseID)
This function is used to deactivate an existing XERA database.
Parameters
- lDatabaseID: The ID of the database to deactivate
Returns
The previous status of the database.
AddDatabaseToClient
long lClientID = 1;
long lDatabaseID = 123;
client.AddDatabaseToClient(lClientID, lDatabaseID);
int64_t lClientID = 1;
int64_t lDatabaseID = 123;
oClient->AddDatabaseToClient(lClientID, lDatabaseID);
long lClientID = 1;
long lDatabaseID = 123;
client.AddDatabaseToClient(lClientID, lDatabaseID);
void AddDatabaseToClient(long lClientID, long lDatabaseID)
This function associates a given database with a given client.
Parameters
- lClientID: An integer representing the ID of the client for association.
- lDatabaseID: An integer representing the ID of the database for association.
Returns
None
RemoveDatabaseFromClient
long lClientID = 1;
long lDatabaseID = 123;
client.RemoveDatabaseFromClient(lClientID, lDatabaseID);
int64_t lClientID = 1;
int64_t lDatabaseID = 123;
oClient->RemoveDatabaseFromClient(lClientID, lDatabaseID);
long lClientID = 1;
long lDatabaseID = 123;
client.RemoveDatabaseFromClient(lClientID, lDatabaseID);
void RemoveDatabaseFromClient(long lClientID, long lDatabaseID)
This function removes the association between a given database and client.
Parameters
- lClientID: An integer representing the ID of the client.
- lDatabaseID: An integer representing the ID of the database.
Returns
None
AddFields
Field oField = new Field();
oField.sName = "Native File Link";
oField.eType = FieldType.NATIVE_FILE;
oField.eDateFormat = DateFormat.NOT_APPLICABLE
oField.eTimeFormat = TimeFormat.NOT_APPLICABLE;
oField.iDecimalPlaces = 0;
oField.iLength = 100;
oField.eCurrency = CurrencyFormat.NOT_APPLICABLE;
oField.eDuration = DurationFormat.NOT_APPLICABLE;
List<Field> listFields = new ArrayList<Field>();
listFields.add(oField);
long lDatabaseID = 1;
client.AddFields(lDatabaseID, listFields);
::iconect::api::structs::Field oField;
oField.sName = L"Native File Link";
oField.eType = FieldType.NATIVE_FILE;
oField.eDateFormat = ::iconect::api::structs::DateFormat::NOT_APPLICABLE
oField.eTimeFormat = ::iconect::api::structs::TimeFormat::NOT_APPLICABLE;
oField.iDecimalPlaces = 0;
oField.iLength = 100;
oField.eCurrency = ::iconect::api::structs::CurrencyFormat::NOT_APPLICABLE;
oField.eDuration = ::iconect::api::structs::DurationFormat::NOT_APPLICABLE;
std::vector<iconect::api::structs::Field> listFields;
listFields.push_back(oField);
int64_t lDatabaseID = 1;
std::vector<iconect::api::structs::Field> retFields;
oClient->AddFields(retFields, lDatabaseID, listFields);
Field oField = new Field();
oField.SName = "Native File Link";
oField.EType = FieldType.NATIVE_FILE;
oField.EDateFormat = DateFormat.NOT_APPLICABLE
oField.ETimeFormat = TimeFormat.NOT_APPLICABLE;
oField.IDecimalPlaces = 0;
oField.ILength = 100;
oField.ECurrency = CurrencyFormat.NOT_APPLICABLE;
oField.EDuration = DurationFormat.NOT_APPLICABLE;
List<Field> aFields = new List<Field>();
aFields.Add(oField);
long lDatabaseID = 1;
client.AddFields(lDatabaseID, aFields);
List<Field> AddFields(long lDatabaseID, List<Field> aNewFieldList)
This function adds a field to a database.
Parameters
- lDatabaseID: An integer that represents the database ID. This is used to determine the database to which the field(s) are added.
- aNewFieldList: An array of Field objects to be added to the database.
Returns
An array of Field objects with populated sColumnName and lFieldID fields. These new Field objects must be used to perform any operation on the new fields.
GetFields
long lDatabaseID = 1;
List<Field> fields = client.GetFields(lDatabaseID);
for (int i = 0; i < fields.size(); i++)
{
System.out.println(fields.get(i).lID);
}
int64_t lDatabaseID = 1;
std::vector<iconect::api::structs::Field> fields = oClient->GetFields(lDatabaseID);
for (iconect::api::structs::Field field : fields)
{
std::cout << field.lID << " ";
}
List<Field> aFields = new List<Field>();
long lDatabaseID = 1;
aFields = client.GetFields(lDatabaseID);
foreach(Field oField in aFields){
Console.WriteLine(oField.LID);
}
List<Field> GetFields(long lDatabaseID)
This function returns all the fields associated with a database.
Parameters
- lDatabaseID: An integer that represents the database ID.
Returns
An array of Field objects that are associated with the database.
UpdateField
long lDatabaseID = 1;
List<Field> fields = client.GetFields(lDatabaseID);
for (int i = 0; i < fields.size(); i++) {
Field field = fields.get(i);
if (field.sName.equals("Native File Link") && field.eType == FieldType.NATIVE_FILE) {
field.iLength = 200;
Field oUpdatedField = client.UpdateField(lDatabaseID, field);
}
}
int64_t lDatabaseID = 1;
std::vector<iconect::api::structs::Field> fields;
oClient->GetFields(fields, lDatabaseID);
for (iconect::api::structs::Field field : fields)
{
if (field.sName == "Native File Link" && field.eType == iconect::api::structs::FieldType::NATIVE_FILE)
{
field.iLength = 200;
iconect::api::structs::Field oUpdatedField;
oClient->UpdateField(oUpdatedField, lDatabaseID, oNewField);
}
}
long lDatabaseID = 1;
List<Field> aFields = client.GetFields(lDatabaseID);
foreach(Field oField in aFields)
{
if (oField.SName == "Native File Link" && oField.EType == FieldType.NATIVE_FILE)
{
oField.ILength = 200;
Field oUpdatedField = client.UpdateField(lDatabaseID, oField);
}
}
Field UpdateField(long lDatabaseID, Field oNewField)
This function changes the definition of a field. Note: At present, UpdateField can only increase the length of a LIMITED_TEXT field,
a NATIVE_FILE field, or an IMAGE_LINK field.
Parameters
- lDatabaseID: An integer that represents the database ID. This is used to determine the database to which the field(s) are added.
- oNewField: An existing Field object (as returned by GetFields) whose iLength member has been set to the desired length.
Returns
A Field object representing the field with its new length.
GetDatabaseSetting
List<Long> listDatabaseIDs = new ArrayList<Long>();
listFields.add(1);
List<String> listValues = client.GetDatabaseSetting(listDatabaseIDs, DatabaseSetting.NATIVE_FILE_FIELD);
std::vector<int64_t> listDatabaseIDs;
listFields.push_back(1);
std::vector<wstring> listValues;
oClient->GetDatabaseSetting(listValues, listDatabaseIDs, DatabaseSetting.NATIVE_FILE_FIELD);
List<long> aFields = new List<long>();
aFields.Add(1);
List<string> listValues = client.GetDatabaseSetting(listDatabaseIDs, DatabaseSetting.NATIVE_FILE_FIELD);
List<string> GetDatabaseSetting(List<long> listDatabaseIDs, DatabaseSetting oSetting)
This function returns values for a set of databases for a specific database setting.
Parameters
- listDatabaseIDs: An array of database IDs to query for the specific setting.
- oSetting: The DatabaseSetting to query for.
Returns
An array of strings containing the current values for the requested database IDs.
SetDatabaseSetting
List<Long> listDatabaseIDs = new ArrayList<Long>();
listFields.add(1);
client.SetDatabaseSetting(listDatabaseIDs, DatabaseSetting.NATIVE_FILE_FIELD, "1");
std::vector<int64_t> listDatabaseIDs;
listFields.push_back(1);
oClient->SetDatabaseSetting(listDatabaseIDs, DatabaseSetting.NATIVE_FILE_FIELD, "1");
List<long> aFields = new List<long>();
aFields.Add(1);
client.GetDatabaseSetting(listDatabaseIDs, DatabaseSetting.NATIVE_FILE_FIELD, "1");
void GetDatabaseSetting(List<long> listDatabaseIDs, DatabaseSetting oSetting, string sValue)
This function set a specific database setting for a set of databases.
Parameters
- listDatabaseIDs: An array of database IDs to query for the specific setting.
- oSetting: The DatabaseSetting to modify.
- sValue: The appropriate value to set.
Returns
None.
AddRecords
long lFieldID = 1;
String sFieldData = new String("Field data for the record");
Record oRecord = new Record();
oRecord.mapFieldIDToData = new HashMap<>();
oRecord.mapFieldIDToData.put(lFieldID, sFieldData);
ArrayList<Record> aList = new ArrayList<>();
aList.add(oRecord);
RecordList oNewRecords = new RecordList();
oNewRecords.aData = aList;
long lDatabaseID = 1;
client.AddRecords(lDatabaseID, oNewRecords);
int64_t lFieldID = 1;
std::wstring sFieldData = L"Field data for the record";
::iconect::api::structs::Record oRecord;
oRecord.mapFieldIDToData[lFieldID] = sFieldData;
RecordList oNewRecords;
oNewRecords.aData.push_back(oRecord);
int64_t lDatabaseID = 1;
oClient->AddRecords(lDatabaseID, oNewRecords);
long lFieldID = 1;
String sFieldData = "Field data for the record";
Record oRecord = new Record();
Dictionary<long, string> aFieldData = new Dictionary<long, string>();
aFieldData.Add(lFieldID, sFieldData);
oRecord.MapFieldIDToData = aFieldData;
List<Record> aList = new List<Record>();
aList.Add(oRecord);
RecordList oNewRecords = new RecordList();
oNewRecords.AData = aList;
long lDatabaseID = 1;
oClient->AddRecords(lDatabaseID, oNewRecords);
List<Long> AddRecords(long lDatabaseID, RecordList oNewRecords)
This function is used to add data to a database.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- oNewRecords: A RecordList object.
Returns
An array of database object IDs that represent the inserted records in the database.
Note
A GetFields() call is required before calling this function if the records list includes any field that is not added in the same thread as this function call or does not exist before this function call.
AddRecordsWithFieldsReturned
long lFieldID = 1;
String sFieldData = new String("Sample Field Data");
Record oRecord = new Record();
oRecord.mapFieldIDToData = new HashMap<>();
oRecord.mapFieldIDToData.put(lFieldID, sFieldData);
ArrayList<Record> aList = new ArrayList<>();
aList.add(oRecord);
RecordList oNewRecords = new RecordList();
oNewRecords.aData = aList;
long lDatabaseID = 1;
ArrayList<Integer> oFields = new ArrayList<>();
for(Field fld : client.GetFields(lDatabaseID)){
oFields.add(fld.lID);
}
client.AddRecordsWithFieldsReturned(lDatabaseID, oNewRecords, oFields);
int64_t lFieldID = 1;
std::wstring sFieldData = L"Field data for the record";
::iconect::api::structs::Record oRecord;
oRecord.mapFieldIDToData[lFieldID] = sFieldData;
RecordList oNewRecords;
oNewRecords.aData.push_back(oRecord);
int64_t lDatabaseID = 1;
std::vector<int64_t> oFields;
for(::iconect::api::structs::Field fld : oClient->GetFields(lDatabaseID)){
oFields.push_back(fld.lID);
}
oClient->AddRecordsWithFieldsReturned(lDatabaseID, oNewRecords, oFields);
long lFieldID = 1;
string sFieldData = "Sample Field Data";
Record oRecord = new Record();
oRecord.MapFieldIDToData = new Dictionary<long, string>();
oRecord.MapFieldIDToData.Add(lFieldID, sFieldData);
List<Record> aList = new List<Record>(){{oRecord}};
RecordList oNewRecords = new RecordList();
oNewRecords.AData = aList;
long lDatabaseID = 1;
List<long> oFields = new List<long>();
foreach (Field fld : client.GetFields(lDatabaseID)){
oFields.Add(fld.LID);
}
client.AddRecordsWithFieldsReturned(lDatabaseID, oNewRecords, oFields);
Map<Long, Record> AddRecordsWithFieldsReturned(long lDatabaseID, RecordList oNewRecords, List<Long> oFields)
This function is used to add data to a database and return the added data.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- oNewRecords: A RecordList object.
- oFields: An array of field IDs to return once the data has been added.
Returns
A map object with record ID as the key and a Record object as the value.
GetRecordCount
long lDatabaseID = 1;
long recordCount = client.GetRecordCount(lDatabaseID);
System.out.println("Record count: "+recordCount);
int64_t lDatabaseID = 1;
int64_t recordCount;
oClient->GetRecordCount(recordCount, lDatabaseID);
std::cout << "Record Count: " << recordCount << " ";
long lDatabaseID = 1;
long recordCount = client.GetRecordCount(lDatabaseID);
Console.WriteLine("Record Count: " + recordCount);
long GetRecordCount(long lDatabaseID)
This function returns the total number of records in a database.
Parameters
- lDatabaseID: An integer that represents the database ID.
Returns
The total record count for the database.
GetRecords
long lDatabaseID = 1;
long lPage = 1;
long lPageSize = 1;
List<Long> aFieldIDList = new ArrayList<Long>();
List<Field> aFieldList = client.GetFields(lDatabaseID);
for(int i=0; i< aFieldList.size(); i++) {
aFieldIDList.Add(aFieldList.get(i).lID);
}
List<Long> aRecordIDList = Arrays.asList(1L,2L,3L);
long ISizeLimit = 0;
RecordList rl = client.GetRecords(lDatabaseID, lPage, lPageSize, aFieldIDList, aRecordIDList, ISizeLimit);
System.out.println("Record count: " + rl.aData.size());
int64_t lDatabaseID = 1;
int64_t lPage = 1;
int64_t lPageSize = 1;
int64_t ISizeLimit = 0;
std::vector<iconect::api::structs::Field> aFieldList;
std::vector<int64_t> aFieldIDList;
oClient->GetFields(aFieldList);
for (int i = 0; i < aFieldList.size(); i++) {
aFieldIDList.push_back(aFieldList[i].lID);
}
std::vector<int64_t> aRecordIDList = {1, 2, 3, 4};
::iconect::api::structs::RecordList rl;
oClient->GetRecords(rl, lDatabaseID, lPage, lPageSize, aFieldIDList, aRecordIDList, ISizeLimit);
std::cout << "Record count: " << rl.aData.size();
long lDatabaseID = 1;
long lPage = 1;
long lPageSize = 1;
List<long> aFieldIDList = new List<long>();
List<Field> aFieldList = client.GetFields(lDatabaseID);
foreach(Field oField in aFieldList) {
aFieldIDList.Add(oField.LID);
}
List<long> aRecordIDList = new List<long>(){1,2,3};
long ISizeLimit = 0;
RecordList rl = client.GetRecords(lDatabaseID, lPage, lPageSize, aFieldIDList, aRecordIDList, ISizeLimit);
Console.WriteLine("Record count: " + rl.aData.size());
RecordList GetRecords(long lDatabaseID, long lPage, int iPageSize, List<Long> aFieldIDList, List<Long> aRecordIDList, long lSizeLimit)
This function returns a specific range of records in a database, which allows the caller to page through the result set. For example, using a database with 100 records, the caller can pass lPage as 2 and lPageSize as 10 to get records 11-20.
Parameters
- lDatabaseID: An integer that represents the database ID.
- IPage: An integer that represents the requested page number.
- iPageSize: An integer that represents the requested page size.
- aFieldIDList: An array of the field IDs for which the data is to be fetched for each record.
- aRecordIDList: An array of the specific record IDs to be fetched. Pass in an empty array to retrieve all records.
- lSizeLimit: An integer that represents the character size limit of all the field data to be fetched for text-based fields.
Returns
A RecordList object.
UpdateRecords
long lDatabaseID = 1;
long lFieldID = 1;
String sFieldData = new String("Sample Field Data");
Record oRecord = new Record();
oRecord.ID = 1;
oRecord.mapFieldIDToData = new HashMap<>();
oRecord.mapFieldIDToData.put(lFieldID, sFieldData);
ArrayList<Record> aList = new ArrayList<>();
aList.add(oRecord);
RecordList oNewRecords = new RecordList();
oNewRecords.aData = aList;
client.UpdateRecords(lDatabaseID, oNewRecords);
int64_t lDatabaseID = 1;
int64_t lFieldID = 1;
::iconect::api::structs::Record oRecord;
::iconect::api::structs::RecordList oNewRecords;
auto & aList = oNewRecords.aData;
std::wstring sFieldData = L"Sample Field Data";
oRecord.ID = 1;
oRecord.mapFieldIDToData[lFieldID] = sFieldData;
aList.push_back(oRecord);
oClient->UpdateRecords(lDatabaseID, oNewRecords);
long lDatabaseID = 1;
long lFieldID = 1;
string sFieldData = "Sample Field Data";
Record oRecord = new Record();
oRecord.ID = 1;
oRecord.MapFieldIDToData = new Dictionary<long, string>();
oRecord.MapFieldIDToData.Add(lFieldID, sFieldData);
List<Record> aList = new List<Record>();
aList.Add(oRecord);
RecordList oNewRecords = new RecordList();
oNewRecords.AData = aList;
client.UpdateRecords(lDatabaseID, oNewRecords);
void UpdateRecords(long lDatabaseID, RecordList oNewRecords)
This function is used to update existing records.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- oNewRecords: A RecordList object. A RecordList has one property, a list of Record objects called aData. A Record object must have a mapFieldIDToData object. The mapFieldIDToData maps field IDs for the data. In order to update a record correctly, it must have a mapping from the OBJECT_ID field to the actual object ID.
Returns
None.
AddRecordsNoDuplicatesWithFieldsReturned
long lDatabaseID = 1;
long lFieldID = 1;
String sFieldData = new String("Sample Field Data");
long lHashFieldID = 2;
String sHash = new String("abcd23456eaff2288");
Record oRecord = new Record();
oRecord.mapFieldIDToData = new HashMap<>();
oRecord.mapFieldIDToData.put(lFieldID, sFieldData);
oRecord.mapFieldIDToData.put(lHashFieldID, sHash);
RecordList oNewRecords = new RecordList();
oNewRecords.aData = new ArrayList<>();
oNewRecords.aData.add(oRecord);
ArrayList<long> aHashList = new ArrayList<>();
aHashList.add(lHashFieldID);
ArrayList<long> aReturnList = new ArrayList<>();
aReturnList.add(lHashFieldID);
DuplicateNewRecordList oRetrun =
client.AddRecordsNoDuplicatesWithFieldsReturned(lDatabaseID, oNewRecords, aHashList, aReturnList);
int64_t lDatabaseID = 1;
int64_t lFieldID = 1;
std::wstring sFieldData = L"Sample Field Data";
int64_t lHashFieldID = 2;
std::wstring sHash = L"abcd23456eaff2288";
::iconect::api::structs::Record oRecord;
::iconect::api::structs::RecordList oNewRecords;
oRecord.mapFieldIDToData[lFieldID] = sFieldData;
oRecord.mapFieldIDToData[lHashFieldID] = sHash;
oNewRecords.aData.push_back(oRecord);
::iconect::api::structs::IDList aHashList;
aHashList.push_back(lHashFieldID);
::iconect::api::structs::IDList aReturnList;
aReturnList.push_back(lHashFieldID);
DuplicateNewRecordList oRetrun =
client.AddRecordsNoDuplicatesWithFieldsReturned(lDatabaseID, oNewRecords, aHashList, aReturnList);
long lDatabaseID = 1;
long lFieldID = 1;
string sFieldData = "Sample Field Data";
long lHashFieldID = 2;
string sHash = "abcd23456eaff2288";
Record oRecord = new Record();
oRecord.MapFieldIDToData = new Dictionary<long, string>();
oRecord.MapFieldIDToData.Add(lFieldID, sFieldData);
oRecord.MapFieldIDToData.Add(lHashFieldID, sHash);
RecordList oNewRecords = new RecordList();
oNewRecords.aData = new List<Record>();
oNewRecords.aData.Add(oRecord);
List<long> aHashList = new ArrayList<>();
aHashList.Add(lHashFieldID);
List<long> aReturnList = new ArrayList<>();
aReturnList.Add(lHashFieldID);
DuplicateNewRecordList oRetrun =
client.AddRecordsNoDuplicatesWithFieldsReturned(lDatabaseID, oNewRecords, aHashList, aReturnList);
DuplicateNewRecordList AddRecordsNoDuplicatesWithFieldsReturned(long lDatabaseID, RecordList oNewRecords, IDList aHashFields, IDList aReturnFields)
This function is used to add data to a database without duplication and return the added data or the duplicated data.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- oNewRecords: A RecordList object. A RecordList has one property, a list of Record objects called aData. A Record object must have a mapFieldIDToData object. The mapFieldIDToData maps field IDs for the data.
- oHashFields: An array of hash field ids. The corresponding hash fields data must be in the mapFieldIDToData object of oNewRecords. Comparing to each hash field value of the existing records in the database, a record that has identical hash value in each of the hash fields shall be added into the database and returned in the
NewRecordsListrecord array of the returned object; otherwise, the record will not be added into the database, and will be returned in theDuplicatedListrecord array of the returned object. - oReturnFields: An array of field ids of the fields to be included in the returned data.
Returns
DuplicateNewRecordList object.
UpdateRecordsWithFieldsReturned
long lDatabaseID = 1;
long lFieldID = 1;
String sFieldData = new String("Sample Field Data");
Record oRecord = new Record();
oRecord.mapFieldIDToData = new HashMap<>();
oRecord.mapFieldIDToData.put(lFieldID, sFieldData);
oRecord.ID = 1;
oRecord.Version = 6114138;
RecordList oRecords = new RecordList();
oRecords.aData = new ArrayList<>();
oRecords.aData.add(oRecord);
ArrayList<long> aReturnList = new ArrayList<>();
aReturnList.add(lFieldID);
RecordList oRetrun =
client.UpdateRecordsWithFieldsReturned(lDatabaseID, oRecords, aReturnList);
int64_t lDatabaseID = 1;
int64_t lFieldID = 1;
std::wstring sFieldData = L"Sample Field Data";
::iconect::api::structs::Record oRecord;
::iconect::api::structs::RecordList oRecords;
oRecord.mapFieldIDToData[lFieldID] = sFieldData;
oRecord.ID = 1;
oRecord.Version = 6114138;
oRecords.aData.push_back(oRecord);
::iconect::api::structs::IDList aReturnList;
aReturnList.push_back(lFieldID);
RecordList oRetrun =
client.UpdateRecordsWithFieldsReturned(lDatabaseID, oRecords, aReturnList);
long lDatabaseID = 1;
long lFieldID = 1;
string sFieldData = "Sample Field Data";
Record oRecord = new Record();
oRecord.MapFieldIDToData = new Dictionary<long, string>();
oRecord.MapFieldIDToData.Add(lFieldID, sFieldData);
oRecord.ID = 1;
oRecord.Version = 6114138;
RecordList oRecords = new RecordList();
oRecords.aData = new List<Record>();
oRecords.aData.Add(oRecord);
List<long> aReturnList = new ArrayList<>();
aReturnList.Add(lFieldID);
RecordList oRetrun =
client.UpdateRecordsWithFieldsReturned(lDatabaseID, oRecords, aReturnList);
RecordList UpdateRecordsWithFieldsReturned(long lDatabaseID, RecordList oRecords, IDList aReturnFields)
This function is used to update data in a database with/without specific record version and return the records not being added because of the record version mismatching.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- oRecords: A RecordList object. A RecordList has one property, a list of Record objects called aData. A Record object must have a mapFieldIDToData object. The mapFieldIDToData maps field IDs for the data. The ID of the Record must be set to the OBJECT_ID of the record to be updated. The Version of the record shall be set to the row version number of the record to be updated, Version set to 0 will not skip the row version matching (row level) during the updating.
- oReturnFields: An array of field ids of the fields to be included in the returned data.
Returns
RecordList object.
DeleteRecords
long lDatabaseID = 1;
ArrayList<long> aDeleteRecordIDs = new ArrayList<>();
aDeleteRecordIDs.add(1);
aDeleteRecordIDs.add(2);
client.DeleteRecords(lDatabaseID, aDeleteRecordIDs);
int64_t lDatabaseID = 1;
::iconect::api::structs::IDList aDeleteRecordIDs;
aDeleteRecordIDs.push_back(1);
aDeleteRecordIDs.push_back(2);
client.DeleteRecords(lDatabaseID, aDeleteRecordIDs);
long lDatabaseID = 1;
List<long> aDeleteRecordIDs = new ArrayList<>();
aReturnList.Add(1);
aReturnList.Add(2);
client.DeleteRecords(lDatabaseID, aDeleteRecordIDs);
void DeleteRecords(lDatabaseID, IDList aDeleteRecordIDs)
This function is used to delete a list of record(s) from a database.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- aDeleteRecordIDs: An array of OBJECT_ID(s) of the record(s) to be deleted.
Returns
None.
OptimizeIndexFragmentation
long lDatabaseID = 1;
ArrayList<long> aFieldIDs = new ArrayList<>();
aFieldIDs.add(1);
aFieldIDs.add(2);
client.OptimizeIndexFragmentation(lDatabaseID, aFieldIDs, 0.3);
int64_t lDatabaseID = 1;
::iconect::api::structs::IDList aFieldIDs;
aFieldIDs.push_back(1);
aFieldIDs.push_back(2);
client.OptimizeIndexFragmentation(lDatabaseID, aFieldIDs, 0.3);
long lDatabaseID = 1;
List<long> aFieldIDs = new ArrayList<>();
aFieldIDs.Add(1);
aFieldIDs.Add(2);
client.OptimizeIndexFragmentation(lDatabaseID, aFieldIDs, 0.3);
void OptimizeIndexFragmentation(lDatabaseID, IDList aFieldIDs, double FragmentationPercentage)
This function is used to optimize index fragmentation of a database.
Parameters
- lDatabaseID: The ID of the database to have the indexes optimized.
- aFieldIDs: An array of field IDs whose indexes are to be optimized. Pass in an empty list to optimize all field level indexes.
- FragmentationPercentage: Indexes with fragmentation percentage above this value will be optimized. Recommended value is 0.3.
Returns
None.
User Roles Structures
UserRole
UserRole oUserRole = new UserRole();
oUserRole.sName = "My user role";
oUserRole.sDescription = "User role descripton";
oUserRole.UserRoleType = UserRoleType.User;
oUserRole.lClientID = 0;
::iconect::xera::UserRole oUserRole;
oUserRole.sName = L"My user role";
oUserRole.sDescription = L"User role descripton";
oUserRole.UserRoleType = ::iconect::xera::UserRoleType::User;
oUserGroup.lClientID = 0;
UserRole oUserRole = new UserRole();
oUserRole.SName = "My user role";
oUserRole.SDescription = "User role descripton";
oUserRole.UserRoleType = UserRoleType.User;
oUserRole.LClientID = 0;
public UserRole()public UserRole(long lID, String sName, String sDescription, UserRoleType eType, long lClientID)
This structure contains a UserRole ID and its name.
- lID: An integer representing the UserRole ID.
- sName: A string containing the name of the user role.
- sDescription: A string containing the description of the user role.
- eType: An enum value representing the type of the user role.
- lClientID: An integer representing the client id that the user role is associated with.
User Role Methods
GetUserRoles
List<UserRoleType> = new ArrayList<UserRoleType> aTypes;
aTypes.add(UserRoleType.User);
List<UserRole> aUserRoles = client.GetUserRoles(aTypes, null);
for(UserRole oUserRole : aUserRoles) {
System.out.println(oUserRole.sName);
}
std::vector<::iconect::xera::UserRole> aUserRoles;
vector<UserRoleType> aTypes;
aTypes.push_back(::iconect::xera::UserRoleType::User);
oClient->GetUserRoles(aUserRoles, aTypes, null);
for(::iconect::xera::UserRole oUserRole : aUserRoles) {
std::cout << oUserRole.sName << " ";
}
List<UserRole> aUserRoles = new List<UserRole>();
List<UserRoleType> aTypes = new List<UserRoleType>();
aTypes.Add(UserRoleType.User);
aUserRoles = client.GetUserRoles(aTypes, null);
foreach(UserRole oUserRole in aUserRoles) {
Console.WriteLine(oUserRole.SName);
}
List<UserRole> GetUserRoles(List<UserRoleType> aTypes, null)
This function returns an array of user role objects that represent all the user roles filtered by the given user role types.
Parameters
- aTypes: An array of enumerators used to filter out types of user roles.
Returns
An array of UserRole structures.
User Structures
User
User oUserInfoNew = new User();
oUserInfoNew.sUsername = "jsmith";
oUserInfoNew.sFirstName = "John";
oUserInfoNew.sLastName = "Smith";
oUserInfoNew.sEmail = "jsmith@example.com";
oUserInfoNew.sPhoneNumber = "555-555-1212";
oUserInfoNew.sDescription = "Created by the Admin API";
oUserInfoNew.eState = State.Active;
::iconect::api::structs::User oUserInfoNew;
oUserInfoNew.sUsername = L"jsmith";
oUserInfoNew.sFirstName = L"John";
oUserInfoNew.sLastName = L"Smith";
oUserInfoNew.sEmail = L"jsmith@example.com";
oUserInfoNew.sPhoneNumber = L"555-555-1212";
oUserInfoNew.sDescription = L"Created by the Admin API";
oUserInfoNew.eState = ::iconect::api::structs::State::Active
User oUserInfoNew = new User();
oUserInfoNew.SUsername = "jsmith";
oUserInfoNew.SFirstName = "John";
oUserInfoNew.SLastName = "Smith";
oUserInfoNew.SEmail = "jsmith@example.com";
oUserInfoNew.SPhoneNumber = "555-555-1212";
oUserInfoNew.SDescription = "Created by the Admin API";
oUserInfoNew.EState = State.Active;
public User()public User(long lID, String sUsername, String sFirstName, String sLastName, String sPhoneNumber, String sEmail, String sDescription, State eState)
This structure contains the properties of a user.
- lID: An integer representing the ID of the user.
NOTE: This integer is not required when creating a new user. - sUsername: A string that represents the user name of the user.
- sFirstName: A string that represents the first name of the user.
- sLastName: A string that represents the last name of the user.
- sPhoneNumber: A string that represents the phone number of the user.
- sEmail: A string that represents the email address of the user.
- sDescription: A string that contains the description of the user profile.
- eState: An enumerator indicating if the User is Active or Disabled
User Methods
CreateUser
User oUserInfoNew = new User();
oUserInfoNew.sUsername = "jsmith";
oUserInfoNew.sFirstName = "John";
oUserInfoNew.sLastName = "Smith";
oUserInfoNew.sEmail = "jsmith@example.com";
oUserInfoNew.sPhoneNumber = "555-555-1212";
oUserInfoNew.sDescription = "Created by the Admin API";
oUserInfoNew.eState = State.Active;
oUserInfoNew = client.CreateUser(oUserInfoNew);
::iconect::api::structs::User oUserInfoNew;
oUserInfoNew.sUsername = L"jsmith";
oUserInfoNew.sFirstName = L"John";
oUserInfoNew.sLastName = L"Smith";
oUserInfoNew.sEmail = L"jsmith@example.com";
oUserInfoNew.sPhoneNumber = L"555-555-1212";
oUserInfoNew.sDescription = L"Created by the Admin API";
oUserInfoNew.eState = ::iconect::api::structs::State::Active;
::iconect::api::structs::User oUserReturn;
oClient->CreateUser(oUserReturn, oUserInfoNew);
User oUserInfoNew = new User();
oUserInfoNew.SUsername = "jsmith";
oUserInfoNew.SFirstName = "John";
oUserInfoNew.SLastName = "Smith";
oUserInfoNew.SEmail = "jsmith@example.com";
oUserInfoNew.SPhoneNumber = "555-555-1212";
oUserInfoNew.SDescription = "Created by the Admin API";
oUserInfoNew.EState = State.Active;
oUserInfoNew = client.CreateUser(oUserInfoNew);
User CreateUser(User oUser)
This function creates a user and returns a populated object.
Parameters
- oUserInfoNew: Contains a User object.
Returns
A User object with the lID field populated.
GetUsers
List<User> users = client.GetUsers(State.Active);
for (int i = 0; i < users.size(); i++) {
if(users.get(i).sUsername == "jsmith") {
System.out.println(users.get(i).sEmail);
}
}
::iconect::api::structs::UserList aUserList;
oClient->GetUsers(aUserList,::iconect::api::structs::State::Active);
for (int i = 0; i < aUserList.size(); i++) {
if(aUserList[i].sUsername == "jsmith") {
std::cout << aUserList[i].sEmail << " ";
}
}
List<User> aUserList = client.GetUsers(State.Active);
foreach(User ui in aUserList) {
if(ui.SUsername == "jsmith") {
Console.WriteLine(ui.SEmail);
}
}
List<User> GetUsers(State eStateFilter)
This function returns a list of populated User structures for the entire system.
Parameters
- eStateFilter: Used to filter to either Active or Disabled users.
Returns
An array of User objects.
GetUser
User oUser = client.GetUser(1);
::iconect::api::structs::User oUser;
m_oClient->GetUser(oUser,1);
User oUser = client.GetUser(1);
User GetUser(long lUserID)
This function returns a user specified by User ID.
Parameters
- lUserID: The user id of the user you want to retrieve.
Returns
A User object.
UpdateUser
User oUserInfoNew = new User();
oUserInfoNew.lID = 1;
oUserInfoNew.sUsername = "jsmith";
oUserInfoNew.sFirstName = "John";
oUserInfoNew.sLastName = "Smith";
oUserInfoNew.sEmail = "jsmith@example.com";
oUserInfoNew.sPhoneNumber = "555-555-1212";
oUserInfoNew.sDescription = "Updated by the Admin API";
oUserInfoNew.eState = State.Active;
User oUserReturn;
oUserReturn = client.UpdateUser(oUserInfoNew);
::iconect::api::structs::User oUserInfoNew;
oUserInfoNew.lID = 1;
oUserInfoNew.sUsername = L"jsmith";
oUserInfoNew.sFirstName = L"John";
oUserInfoNew.sLastName = L"Smith";
oUserInfoNew.sEmail = L"jsmith@example.com";
oUserInfoNew.sPhoneNumber = L"555-555-1212";
oUserInfoNew.sDescription = L"Updated by the Admin API";
oUserInfoNew.eState = ::iconect::api::structs::State::Active
oClient->UpdateUser(oUserInfoNew);
User oUserInfoNew = new User();
oUserInfoNew.LID = 1;
oUserInfoNew.SUsername = "jsmith";
oUserInfoNew.SFirstName = "John";
oUserInfoNew.SLastName = "Smith";
oUserInfoNew.SEmail = "jsmith@example.com";
oUserInfoNew.SPhoneNumber = "555-555-1212";
oUserInfoNew.SDescription = "Updated by the Admin API";
oUserInfoNew.EState = State.Active;
client.UpdateUser(oUserInfoNew);
void UpdateUser(User oUser)
This function updates the specified user. A user can be matched on UserID.
Parameters
- oUserReturn: Contains a User object that will be updated.
Returns
None
DeleteUser
User oUser = new User();
oUser.lID = 1;
client.DeleteUser(oUser);
::iconect::api::structs::User oUser;
oUser.lID = 1;
oClient->DeleteUser(oUser);
User oUser = new User();
oUser.LID = 1;
client.DeleteUser(oUser);
void DeleteUser(User oUser)
This function deletes the specific user.
Parameters
- oUser: Contains a User object that will be deleted.
Returns
None
ActivateUser
long lUserID = 1;
client.ActivateUser(lUserID);
int64_t lUserID = 1;
oClient->ActivateUser(lUserID);
long lUserID = 1;
client.ActivateUser(lUserID);
bool ActivateUser(long lUserID)
This function is used to activate an existing XERA user.
Parameters
- lUserID: The ID of the user to activate
Returns
The previous status of the user.
DeactivateUser
long lUserID = 1;
client.DeacivateUser(lUserID);
int64_t lUserID = 1;
oClient->DeactivateUser(lUserID);
long lUserID = 1;
client.DeactivateUser(lUserID);
bool DeactivateUser(long lUserID)
This function is used to deactivate an existing XERA user.
Parameters
- lUserID: The ID of the user to deactivate
Returns
The previous status of the user.
AddUserToClient
long lClientID = 1;
long lUserID = 123;
client.AddUserToClient(lClientID, lUserID);
int64_t lClientID = 1;
int64_t lUserID = 123;
oClient->AddUserToClient(lClientID, lUserID);
long lClientID = 1;
long lUserID = 123;
client.AddUserToClient(lClientID, lUserID);
void AddUserToClient(long lClientID, long lUserID)
This function associates a given user with a given client.
Parameters
- lClientID: An integer representing the ID of the client for association.
- lUserID: An integer representing the ID of the user for association.
Returns
None
RemoveUserFromClient
long lClientID = 1;
long lUserID = 123;
client.RemoveUserFromClient(lClientID, lUserID);
int64_t lClientID = 1;
int64_t lUserID = 123;
oClient->RemoveUserFromClient(lClientID, lUserID);
long lClientID = 1;
long lUserID = 123;
client.RemoveUserFromClient(lClientID, lUserID);
void RemoveUserFromClient(long lClientID, long lUserID)
This function removes the association between a given user and client.
Parameters
- lClientID: An integer representing the ID of the client.
- lUserID: An integer representing the ID of the user.
Returns
None
GetUsersByClient
long lClientID = 1;
List<long> aUsers = client.GetUsersByClient(lClientID);
for (int i = 0; i < aUsers.size(); i++) {
System.out.println(aUsers[i]);
}
std::vector<int64_t> aUsers;
int64_t lClientID = 1;_
oClient->GetUsersByClient(aUsers, lClientID);
for (int64_t lUserID : aUsers) {
std::cout << lUserID << " ";
}
long lClientID = 1;
list<long> aUsers = client.GetUsersByClient(lClientID);
foreach(long userid in aUsers) {
Console.WriteLine(userid);
}
List<Long> GetUsersByClient(long lClientID)
This function returns a list of associated user IDs for the given client.
Parameters
- lClientID: An integer representing the ID of the client.
Returns
An array of user IDs that represent the users associated with the client.
GetClientForUser
List<Integer> oClientForUser = client.GetClientForUser(lUserID);
long lUserID = 123;
for (Integer lClientID : oClientForUser) {
System.out.println(lClientID);
}
std::vector<int64_t> oClientForUser;
int64_t lUserID = 123;
oClient->GetClientForUser(oClientForUser, lUserID);
for( int64_t lClientID : oClientForUser ) {
std::cout << lClientID << " ";
}
List<long> oClientForUser = client.GetClientForUser(lUserID);
long lUserID = 123;
foreach(long lClientID in oClientForUser) {
Console.WriteLine(lClientID);
}
List<Long> GetClientForUser(long lUserID)
This function returns a list of associated client IDs for the given user.
Parameters
- lUserID: An integer representing the ID of the user.
Returns
An array of client IDs that represent the clients associated with the user.
GetUserSetting
List<Long> listUserIDs = new ArrayList<Long>();
listFields.add(1);
List<String> listValues = client.GetUserSetting(listUserIDs, UserSetting.FORCE_PASSWORD_CHANGE);
std::vector<int64_t> listUserIDs;
listFields.push_back(1);
std::vector<wstring> listValues;
oClient->GetUserSetting(listValues, listUserIDs, UserSetting.FORCE_PASSWORD_CHANGE);
List<long> aFields = new List<long>();
aFields.Add(1);
List<string> listValues = client.GetUserSetting(listUserIDs, UserSetting.FORCE_PASSWORD_CHANGE);
List<string> GetUserSetting(List<long> listUserIDs, UserSetting oSetting)
This function returns values for a set of databases for a specific database setting.
Parameters
- listUserIDs: An array of database IDs to query for the specific setting.
- oSetting: The UserSetting to query for.
Returns
An array of strings containing the current values for the requested database IDs.
SetUserSetting
List<Long> listUserIDs = new ArrayList<Long>();
listFields.add(1);
client.SetUserSetting(listUserIDs, UserSetting.FORCE_PASSWORD_CHANGE, "1");
std::vector<int64_t> listUserIDs;
listFields.push_back(1);
oClient->SetUserSetting(listUserIDs, UserSetting.FORCE_PASSWORD_CHANGE, "1");
List<long> aFields = new List<long>();
aFields.Add(1);
client.GetUserSetting(listUserIDs, UserSetting.FORCE_PASSWORD_CHANGE, "1");
void GetUserSetting(List<long> listUserIDs, UserSetting oSetting, string sValue)
This function set a specific database setting for a set of databases.
Parameters
- listUserIDs: An array of database IDs to query for the specific setting.
- oSetting: The UserSetting to modify.
- sValue: The appropriate value to set.
Returns
None.
Panel Structures
CustomRelatedSettings
CustomRelatedSettings oCustomRelatedSettings = new CustomRelatedSettings();
oCustomRelatedSettings.aMatchingFieldIDs = {1,2,3};
oCustomRelatedSettings.aDisplayFieldIDs = {1,4,5};
::iconect::api::structs::CustomRelatedSettings oCustomRelatedSettings;
oCustomRelatedSettings.aMatchingFieldIDs = {1,2,3};
oCustomRelatedSettings.aDisplayFieldIDs = {1,4,5};
CustomRelatedSettings oCustomRelatedSettings = new CustomRelatedSettings();
oCustomRelatedSettings.aMatchingFieldIDs = {1,2,3};
oCustomRelatedSettings.aDisplayFieldIDs = {1,4,5};
public CustomRelatedSettings()public CustomRelatedSettings(List<Long> aMatchingFieldIDs, List<Long> aDisplayFieldIDs)
This structure contains the configuration of a Custom Related panel.
- aMatchingFieldIDs: Contains an array of field IDs that are used to list the fields that can be matched on for the custom related panel. At least one ID must be provided.
- aDisplayFieldIDs: Contains a list of field IDs that will be displayed with the matching field value. At least one ID must be provided.
Panel
Panel oPanel = new Panel();
oPanel.sName = "Review";
oPanel.eType = PanelType.STANDARD;
oPanel.eLocation = enPanelLocation.locDocView;
::iconect::api::structs::Panel oPanel;
oPanel.sName = L"Review";
oPanel.eType = ::iconect::api::structs::PanelType::STANDARD;
oPanel.lLocation = ::iconect::api::structs::enPanelLocation::type::locDocView;
Panel oPanel = new Panel();
oPanel.SName = "Review";
oPanel.EType = PanelType.STANDARD;
oPanel.LLocation = enPanelLocation.locDocView;
public Panel()public Panel(long lID, String sName, PanelType eType, long lLocation, CustomRelatedSettings oCustomRelatedSettings)
This structure contains the properties of a panel.
- lID: An integer that contains the ID of the panel.
NOTE: This integer is not required when creating a new Panel. - sName: A string that contains the name of the panel.
- eType: Contains the type value from the PanelType enumerator.
- lLocation: Contains the bit flag values determined by PanelLocation that controls where the panel is displayed. This is used for Standard panels only, not for Custom Related panels.
- oCustomRelatedSettings: Contains the settings for a Custom Related Panel type. This is required for a Custom Related Panel only.
Panel Methods
CreatePanel
long lDatabaseID = 1;
Panel oPanel = new Panel();
oPanel.sName = "Review";
oPanel.eType = PanelType.STANDARD;
oPanel.eLocation = enPanelLocation.locDocView;
Panel oNewPanel = client.CreatePanel(lDatabaseID, oPanel);
System.out.println("The new id is: " + oNewPanel.lID);
int64_t lDatabaseID = 1;
::iconect::api::structs::Panel oPanel;
oPanel.sName = L"Review";
oPanel.eType = ::iconect::api::structs::PanelType::STANDARD;
oPanel.lLocation = ::iconect::api::structs::enPanelLocation::type::locDocView;
::iconect::api::structs::Panel oNewPanel;
oClient->CreatePanel(oNewPanel, lDatabaseID, oPanel);
cout << "The new id is: " << oNewPanel.lID << " ";
long lDatabaseID = 1;
Panel oPanel = new Panel();
oPanel.SName = "Review";
oPanel.EType = PanelType.STANDARD;
oPanel.LLocation = enPanelLocation.locDocView;
Panel oNewPanel = new Panel();
oNewPanel = client.CreatePanel(lDatabaseID, oPanel);
Console.WriteLine("The new id is: " + oNewPanel.LID);
Panel CreatePanel(long lDatabaseID, Panel oPanel)
This function creates a panel and returns a populated structure.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- oPanel: Contains a populated Panel that describes the panel to be created.
Returns
A fully populated Panel that represents the panel item created.
GetPanels
long lDatabaseID = 1;
List<Panel> aPanels = client.GetPanels(lDatabaseID);
for(Panel oPanel : aPanels) {
System.out.println(oPanel.sName);
}
int64_t lDatabaseID = 1;
std::vector<::iconect::api::structs::Panel> aPanels;
oClient->GetPanels(aPanels, lDatabaseID);
for(::iconect::api::structs::Panel oPanel : aPanels) {
std::cout << oPanel.sName << " ";
}
long lDatabaseID = 1;
List<Panel> aPanels = new List<Panel>();
aPanels = oClient.GetPanels(lDatabaseID);
foreach(Panel oPanel in aPanels) {
Console.WriteLine(oPanel.SName);
}
List<Panel> GetPanels(long lDatabaseID, PanelType eType)
This function returns a list of panel items for the database.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
Returns
An array of Panel objects.
DeletePanel
long lDatabaseID = 1;
Panel oPanel = new Panel();
oPanel.lID = 1;
oPanel.eType = PanelType.STANDARD;
client.DeletePanel(lDatabaseID, oPanel);
int64_t lDatabaseID = 1;
::iconect::api::structs::Panel oPanel;
oPanel.lID = 1;
oPanel.eType = PanelType.STANDARD;
oClient->DeletePanel(lDatabaseID, oPanel);
long lDatabaseID = 1;
Panel oPanel = new Panel();
oPanel.LID = 1;
oPanel.EType = PanelType.STANDARD;
client.DeletePanel(lDatabaseID, oPanel);
void DeletePanel(long lDatabaseID, Panel oPanel)
This function deletes the specified panel.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- oPanel: Contains a populated Panel item that describes the object panel to be deleted.
Returns
None
UpdatePanel
long lDatabaseID = 1;
Panel oPanel = new Panel();
oPanel.lID = 1;
oPanel.eType = PanelType.STANDARD;
oPanel.sName = "Completed";
client.UpdatePanel(lDatabaseID, oPanel);
int64_t lDatabaseID = 1;
::iconect::api::structs::Panel oPanel;
oPanel.lID = 1;
oPanel.eType = PanelType.STANDARD;
oPanel.sName = L"Completed";
oClient->UpdatePanel(lDatabaseID, oPanel);
long lDatabaseID = 1;
Panel oPanel = new Panel();
oPanel.LID = 1;
oPanel.SName = "Completed";
oPanel.EType = PanelType.STANDARD;
client.UpdatePanel(lDatabaseID, oPanel);
Panel UpdatePanel(long lDatabaseID, Panel oPanel)
This function updates the properties of the specified panel.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- oPanel: Contains a populated Panel item that describes the panel to be updated.
Returns
None
Panel Item Structures
FolderSettings
FolderSettings oFolderSettings = new FolderSettings();
oFolderSettings.eIcon = PanelItemIcon.FOLDER;
oFolderSettings.eColor = Color.RED;
::iconect::api::structs::FolderSettings oFolderSettings;
oFolderSettings.eIcon = ::iconect::api::structs::PanelItemIcon::FOLDER;
oFolderSettings.eColor = ::iconect::api::structs::Color::RED;
FolderSettings oFolderSettings = new FolderSettings();
oFolderSettings.eIcon = PanelItemIcon.FOLDER;
oFolderSettings.eColor = Color.RED;
public FolderSettings()public FolderSettings(PanelItemIcon eIcon, Color eColor)
This structure contains the properties of a folder. These settings are only used if the panel item type is set to “FOLDER”.
- eIcon: Contains a value from PanelItemIcon which determines which icon is displayed for the folder panel item. Default is NOT_APPLICABLE.
- eColor: Contains a value from the Color for the folder panel item. Default is NOT_APPLICABLE.
EditSettings
EditSettings oEditSettings = new EditSettings();
oEditSettings.eType = EditItemType.APPEND;
oEditSettings.sDelimiter = ",";
oEditSettings.lFieldID = 123;
::iconect::api::structs::EditSettings oEditSettings;
oEditSettings.eType = ::iconect::api::structs::EditItemType::APPEND;
oEditSettings.sDelimiter = L",";
oEditSettings.lFieldID = 123;
EditSettings oEditSettings = new EditSettings();
oEditSettings.EType = EditItemType.APPEND;
oEditSettings.SDelimiter = ",";
oEditSettings.LFieldID = 123;
public EditSettings()public EditSettings(EditItemType eType, String sDelimiter, long lFieldID)
This structure contains the properties of an edit item. These settings are only used if the panel item type is set to “EDIT”.
- eType: Contains the value of EditItemType which determines the behavior of an edit item. Default is NOT_APPLICABLE.
- sDelimiter: Contains the delimiter used for append and prepend edit control types, and cannot be more than three characters in length.
- lFieldID: Contains the ID of the field used for an edit item.
PanelItem
PanelItem oPanelItem = new PanelItem();
oPanelItem.sName = "Reviewed";
oPanelItem.eType = PanelItemType.FOLDER;
oPanelItem.sDescription= "a Description";
oPanelItem.lPanelID = 1;
oPanelItem.lParentID = 0;
FolderSettings oFolderSettings = new FolderSettings();
oFolderSettings.eIcon = PanelItemIcon.FOLDER;
oFolderSettings.eColor = Color.RED;
oPanelItem.oFolderSettings = oFolderSettings;
::iconect::api::structs::PanelItem oPanelItem;
oPanelItem.sName = "Reviewed";
oPanelItem.eType = ::iconect::api::structs::PanelItemType::FOLDER;
oPanelItem.sDescription= "a Description";
oPanelItem.lPanelID = 1;
oPanelItem.lParentID = 0;
::iconect::api::structs::FolderSettings oFolderSettings;
oFolderSettings.eIcon = ::iconect::api::structs::PanelItemIcon::FOLDER;
oFolderSettings.eColor = ::iconect::api::structs::Color::RED;
oPanelItem.oFolderSettings = oFolderSettings;
PanelItem oPanelItem = new PanelItem();
oPanelItem.SName = "Reviewed";
oPanelItem.EType = iconect.xera.api.structs.PanelItemType.FOLDER;
oPanelItem.SDescription= "a Description";
oPanelItem.LPanelID = 1;
oPanelItem.LParentID = 0;
FolderSettings oFolderSettings = new FolderSettings();
oFolderSettings.EIcon = PanelItemIcon.FOLDER;
oFolderSettings.EColor = Color.RED;
oPanelItem.OFolderSettings = oFolderSettings;
public PanelItem()public PanelItem(long lID, String sName, PanelItemType eType, String sDescription, long lPanelID, long lParentID, boolean bHasChildren, FolderSettings oFolderSettings, EditSettings oEditSettings)
This structure contains the properties of a panel item.
- lID: An integer that contains the Panel item ID.
NOTE: This integer is not required when creating a new panel item. - sName: A string representing the name of the panel item.
- sDescription: A string representing the description of a panel item.
- lPanelID: An integer containing the ID of the panel on which the panel item exists.
NOTE: This cannot be modified after the panel item has been created. - lParentID: An integer containing the ID of the parent panel item. Parent ID of 0 means top level item.
NOTE: This cannot be modified after the panel item has been created. - eType: Contains the value of PanelItemType, which indicates the type of panel item (folder, edit, or separator).
NOTE: This cannot be modified after the panel item has been created. - bHasChildren: A flag indicating whether or not the panel item has child panel items.
NOTE: This cannot be directly modified. - oFolderSettings: A structure that holds the settings for a folder/coding item.
- oEditSettings: A structure that holds the settings for an edit control.
Panel Item Methods
CreatePanelItem
long lDatabaseID = 1;
PanelItem oPanelItem = new PanelItem();
oPanelItem.sName = "Reviewed";
oPanelItem.eType = PanelItemType.FOLDER;
oPanelItem.sDescription= "a Description";
oPanelItem.lPanelID = 1;
oPanelItem.lParentID = 0;
FolderSettings oFolderSettings = new FolderSettings();
oFolderSettings.eIcon = PanelItemIcon.FOLDER;
oFolderSettings.eColor = Color.RED;
oPanelItem.oFolderSettings = oFolderSettings;
oPanelItem.oEditSettings = new EditSettings();
PanelItem oNewPanelItem = client.CreatePanelItem(lDatabaseID, oPanelItem);
System.out.println("The new panel item id is: " + oNewPanelItem.lID);
int64_t lDatabaseID = 1;
::iconect::api::structs::PanelItem oPanelItem;
oPanelItem.sName = "Reviewed";
oPanelItem.eType = ::iconect::api::structs::PanelItemType::FOLDER;
oPanelItem.sDescription= "a Description";
oPanelItem.lPanelID = 1;
oPanelItem.lParentID = 0;
::iconect::api::structs::FolderSettings oFolderSettings;
oFolderSettings.eIcon = ::iconect::api::structs::PanelItemIcon::FOLDER;
oFolderSettings.eColor = ::iconect::api::structs::Color::RED;
oPanelItem.oFolderSettings = oFolderSettings;
PanelItem oNewPanelItem;
oClient->CreatePanelItem(oNewPanelItem, lDatabaseID, oPanelItem);
std::cout << "The new panel item id is: " << oNewPanelItem.lID;
long lDatabaseID = 1;
PanelItem oPanelItem = new PanelItem();
oPanelItem.SName = "Reviewed";
oPanelItem.EType = iconect.xera.api.structs.PanelItemType.FOLDER;
oPanelItem.SDescription= "a Description";
oPanelItem.LPanelID = 1;
oPanelItem.LParentID = 0;
FolderSettings oFolderSettings = new FolderSettings();
oFolderSettings.EIcon = PanelItemIcon.FOLDER;
oFolderSettings.EColor = Color.RED;
oPanelItem.OFolderSettings = oFolderSettings;
PanelItem oNewPanelItem = client.CreatePanelItem(lDatabaseID, oPanelItem);
Console.WriteLine("The new panel item id is: " + oNewPanelItem.lID);
PanelItem CreatePanelItem(long lDatabaseID, PanelItem oPanelItem)
This function creates a panel item. A panel item can be a folder, an edit control or a separator.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- oPanelItem: Contains the populated PanelItem structure for the panel item to be created.
Returns
A PanelItem object with the lID field populated.
UpdatePanelItem
long lDatabaseID = 1;
PanelItem oPanelItem = new PanelItem();
oPanelItem.lID = 1;
oPanelItem.sName = "Reviewed";
oPanelItem.eType = PanelItemType.FOLDER;
oPanelItem.sDescription= "a Description";
oPanelItem.lPanelID = 1;
FolderSettings oFolderSettings = new FolderSettings();
oFolderSettings.eIcon = PanelItemIcon.FOLDER;
oFolderSettings.eColor = Color.BLUE;
oPanelItem.oFolderSettings = oFolderSettings;
oPanelItem.oEditSettings = new EditSettings();
PanelItem oNewPanelItem = client.UpdatePanelItem(lDatabaseID, oPanelItem);
System.out.println("The new panel item name is: " + oNewPanelItem.sName);
int64_t lDatabaseID = 1;
::iconect::api::structs::PanelItem oPanelItem;
oPanelItem.lID = 1;
oPanelItem.sName = L"Reviewed";
oPanelItem.eType = ::iconect::api::structs::PanelItemType::FOLDER;
oPanelItem.sDescription = L"a Description";
oPanelItem.lPanelID = 1;
::iconect::api::structs::FolderSettings oFolderSettings;
oFolderSettings.eIcon = ::iconect::api::structs::PanelItemIcon::FOLDER;
oFolderSettings.eColor = ::iconect::api::structs::Color::BLUE;
oPanelItem.oFolderSettings = oFolderSettings;
PanelItem oNewPanelItem;
oClient->UpdatePanelItem(oNewPanelItem, lDatabaseID, oPanelItem);
std::cout << "The new panel item name is: " << oNewPanelItem.sName.c_str;
long lDatabaseID = 1;
PanelItem oPanelItem = new PanelItem();
oPanelItem.LID = 1;
oPanelItem.SName = "Reviewed";
oPanelItem.EType = PanelItemType.FOLDER;
oPanelItem.SDescription = "a Description";
oPanelItem.LPanelID = 1;
FolderSettings oFolderSettings = new FolderSettings();
oFolderSettings.EIcon = PanelItemIcon.FOLDER;
oFolderSettings.EColor = Color.BLUE;
oPanelItem.OFolderSettings = oFolderSettings;
PanelItem oNewPanelItem = client.CreatePanelItem(lDatabaseID, oPanelItem);
Console.WriteLine("The new panel item name is: " + oNewPanelItem.SName);
PanelItem UpdatePanelItem(long lDatabaseID, PanelItem oPanelItem)
This function updates an existing panel item.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- oPanelItem: Contains the populated PanelItem structure for the panel item to be updated.
Returns
A populated PanelItem structure for the updated Panel Item.
DeletePanelItems
long lDatabaseID = 1;
long[] aPanelItemList = {1,2,3,4};
client.DeletePanelItems(lDatabaseID, aPanelItemList);
long lDatabaseID = 1;
std::vector<int> aPanelItemList = { 1,2,3,4 };
oClient->DeletePanelItems(lDatabaseID, aPanelItemList);
long lDatabaseID = 1;
long[] aPanelItemList = { 1,2,3,4 };
client.DeletePanelItems(lDatabaseID, aPanelItemList);
void DeletePanelItems(long lDatabaseID, List<Long> aPanelItemList)
This function deletes specified panel items.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- aPanelItemList: Contains a list of the panel item IDs to be removed.
Returns
None
GetPanelItemList
long lDatabaseID = 1;
long lPanelID = 1;
long lParentID = 1;
List<PanelItem> aPanelItems = client.GetPanelItemList(lDatabaseID, lPanelID, lParentID);
for(PanelItem oPanelItem : aPanelItems) {
System.out.println("Panel Item name: " + oPanelItem.sName);
}
int64_t lDatabaseID = 1;
int64_t lPanelID = 1;
int64_t lParentID = 1;
std::vector<::iconect::api::structs::PanelItem> aPanelItems;
oClient->GetPanelItemList(aPanelItems, lDatabaseID, lPanelID, lParentID);
for(::iconect::api::structs::PanelItem oPanelItem : aPanelItems) {
std::cout << "Panel Item name: " << oPanelItem.sName << " ";
}
long lDatabaseID = 1;
long lPanelID = 1;
long lParentID = 1;
List<PanelItem> aPanelItems = new List<PanelItem>();
aPanelItems = oClient->GetPanelItemList(lDatabaseID, lPanelID, lParentID);
foreach (PanelItem oPanelItem in aPanelItems) {
Console.WriteLine("Panel Item name: " + oPanelItem.SName);
}
List<PanelItem> GetPanelItemList(long lDatabaseID, long lPanelID, long lParentID)
This function returns the populated panel item structure for a specified panel.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- lPanelID: An integer that represents the panel ID for which panel items will be returned.
- lParentID: An integer that represents the parent item ID for which children will be returned. To fetch top level panel items, 0 should be passed for this value otherwise the children of the specified panel item are returned.
Returns
A list of PanelItem objects for the specified panel.
GetPanelItemMap
long lDatabaseID = 1;
long[] aPanelItemIDList = {1,2,3,4};
Map<Long,PanelItem> aPanelItems = client.GetPanelItemMap(lDatabaseID, aPanelItemIDList);
for(PanelItem oPanelItem : aPanelItems){
System.out.println("Panel Item name: " + oPanelItem.sName);
}
int64_t lDatabaseID = 1;
std::vector<int> aPanelItemIDList = { 1,2,3,4 };
std::map<int64_t, ::iconect::api::structs::PanelItem> aPanelItems;
oClient->GetPanelItemMap(aPanelItems, lDatabaseID, aPanelItemIDList);
for(::iconect::api::structs::PanelItem oPanelItem : aPanelItems){
std::cout << "Panel Item name: " << oPanelItem.sName << " ";
}
long lDatabaseID = 1;
List<long> aPanelItemIDList = new List<long>() { 1, 2, 3, 4 };
Dictionary<long, PanelItem> aPanelItems = new Dictionary<long, PanelItem>();
aPanelItems = client.GetPanelItemMap(lDatabaseID, aPanelItemIDList);
foreach(PanelItem oPanelItem in aPanelItems.Values)
{
Console.WriteLine("Panel Item name: " + oPanelItem.SName);
}
Map<Long,PanelItem> GetPanelItemMap(long lDatabaseID, List<Long> aPanelItemIDList)
This function returns the populated panel item structures for the specified panel items. Consider using this function with the GetFoldersForRecords function.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- aPanelItemIDList: An array of panel item IDs to fetch.
Returns
A map of panel item IDs to PanelItem objects.
GetRecordsInFolders
long lDatabaseID = 1;
long[] aFolderIDList = {1,2,3,4};
Map<Long,List<Long>> mapFolderToRecords = client.GetRecordsInFolders(lDatabaseID, aFolderIDList);
for(Entry<Long, List<Long>> aRecsInFolder : mapFolderToRecords.entrySet()) {
List<long> value = aRecsInFolder.getValue();
for(long lRecordID : value){
System.out.println("Record ID: " + oRecordID);
}
}
int64_t lDatabaseID = 1;
std::vector<int> aFolderIDList = { 1,2,3,4 };
std::map<int64_t, std::vector<int64_t>> mapFolderToRecords;
oClient->GetRecordsInFolders(mapFolderToRecords, lDatabaseID, aFolderIDList);
for (std::vector<int64_t> aRecsInFolder : mapFolderToRecords) {
for (int64_t lRecordID : aRecsInFolder) {
std::cout << "Record: " << lRecordID << std::endl;
}
}
long lDatabaseID = 1;
long[] aFolderIDList = { 1, 2, 3, 4 };
Dictionary<long, List<long>> mapFolderToRecords = client.GetRecordsInFolders(lDatabaseID, aFolderIDList);
foreach (List<long> aRecsInFolder in mapFolderToRecords.Values) {
foreach (long lRecordID in aRecsInFolder) {
Console.WriteLine("Record: " + oRecordID);
}
}
Map<Long,List<Long>> GetRecordsInFolders(long lDatabaseID, List<Long> aFolderIDList)
This function returns the records associated to a list of specific folders, and is used to retrieve the map required for adding records to folders, or removing them (AddRecordsToFolders and RemoveRecordsFromFolders).
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- aFolderIDList: An array of integers that contains a list of folders for which records are retrieved.
Returns
A map of folder IDs with a list of associated record IDs.
GetFoldersForRecords
long lDatabaseID = 1;
List<Integer> aRecordIDList = Arrays.asList(1,2,3,4);
Map<Long,List<Long>> mapRecordToFolders = client.GetFoldersForRecords(lDatabaseID, aRecordIDList );
for(List<Long> aFolderIDs : mapRecordToFolders.values()) {
for(Long lFolderID : aFolderIDs) {
System.out.println("Folder ID: " + lFolderID);
}
}
int64_t lDatabaseID = 1;
std::vector<int64_t> aRecordIDList = {1, 2, 3, 4};
std::map<int64_t, std::vector<int64_t>> mapRecordToFolders;
oClient->GetFoldersForRecords(mapRecordToFolders, lDatabaseID, aRecordIDList );
for (std::vector<int64_t> aFolders : mapRecordToFolders) {
for (int64_t lFolderID : aFolders) {
std::cout << "Folder ID: " << lFolderID << std::endl;
}
}
long lDatabaseID = 1;
List<long> aRecordIDList = new List<long>{1, 2, 3, 4};
Dictionary<long, List<long>> mapRecordToFolders = client.GetFoldersForRecords(lDatabaseID, aRecordIDList );
foreach(List<long> aFolderIDs in mapRecordToFolders.Values) {
foreach(long lFolderID in aFolderIDs) {
Console.WriteLine("Folder ID:" + lFolderID);
}
}
Map<Long,List<Long>> GetFoldersForRecords(long lDatabaseID, List<Long> aRecordIDList)
This function returns the folders associated to a list of records, listing all the folders each record is in.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- aRecordIDList: An array of integers that contains a list of records for which folders are retrieved.
Returns
A map of records IDs with a list of associated folder IDs.
AddRecordsToFolders
long lDatabaseID = 1;
List<Integer> aFolderIDList = Arrays.asList(1,2,3);
List<Integer> aDocumentList = Arrays.asList(1,2,3);
client.AddRecordsToFolders(lDatabaseID,aFolderIDList, aDocumentIDList );
int64_t lDatabaseID = 1;
std::vector<int64_t> aFolderIDList = {1,2,3};
std::vector<int64_t> aDocumentList = {1,2,3};
oClient->AddRecordsToFolders(lDatabaseID, aFolderIDList, aDocumentIDList);
long lDatabaseID = 1;
ArrayList aFolderIDList = new ArrayList(){ 1, 2, 3 };
ArrayList aDocumentList = new ArrayList(){ 1, 2, 3 };
client.AddRecordsToFolders(lDatabaseID, aFolderIDList, aDocumentIDList);
void AddRecordsToFolders(long lDatabaseID, Map<Long,List<Long>> mapFolderIDToRecordIDList)
This function adds a series of documents to the list of specified folders. A folder is a type of panel item that can be added to a panel.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- aFolderIDList: A list of folder IDs
- aDocumentList: A list of Record IDs
Returns
None
RemoveRecordsFromFolders
long lDatabaseID = 1;
List<Integer> aFolderIDList = Arrays.asList(1,2,3);
List<Integer> aDocumentList = Arrays.asList(1,2,3);
client.RemoveRecordsFromFolders(lDatabaseID, aFolderIDList, aDocumentIDList);
int64_t lDatabaseID = 1;
std::vector<int64_t> aFolderIDList = {1,2,3};
std::vector<int64_t> aDocumentList = {1,2,3};
oClient->RemoveRecordsFromFolders(lDatabaseID, aFolderIDList, aDocumentIDList);
long lDatabaseID = 1;
ArrayList aFolderIDList = new ArrayList(){1, 2, 3};
ArrayList aDocumentList = new ArrayList(){1, 2, 3};
client.RemoveRecordsFromFolders(lDatabaseID, aFolderIDList, aDocumentIDList);
void RemoveRecordsFromFolders(long lDatabaseID, Map<Long,List<Long>> mapFolderIDToRecordIDList)
This function removes a series of documents from the list of specified folders. A folder is a type of panel item that can be added to a panel.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- aFolderIDList: An array of integers that represent the folders from which the documents will be removed
- aDocumentList: An array of integers that represent the records which will be removed from the folders.
Returns
None
GetFolderIDForFullName
long lDatabaseID = 1;
String[] aFullNameList = { "|GENERAL|935017 - Produce Natives|", "|GENERAL|935017 - Produce Images|" };
Map< String, long > oFolderIDMap = client.GetFolderIDForFullName( lDatabaseID, aFullNameList );
for( Map.Entry< String, long > entry : oFolderIDMap.entrySet() ){
System.out.println( entry.getKey() + ": " + entry.getValue() );
}
int64_t lDatabaseID = 1;
std::vector< std::wstring > aFullNameList = { "|GENERAL|935017 - Produce Natives|", "|GENERAL|935017 - Produce Images|" };
std::map< std::wstring, int64_t > oFolderIDMap;
oClient->GetPanelItemMap( oFolderIDMap, lDatabaseID, aFullNameList );
for( auto const& oPair : aFolderIDMap )
{
std::wcout << oPair.first << L": " << oPair.second << std::endl;
}
long lDatabaseID = 1;
List< String > aFullNameList = new List< String >() { "|GENERAL|935017 - Produce Natives|", "|GENERAL|935017 - Produce Images|" };
Dictionary< String, long > oFolderIDMap = client.GetPanelItemMap( lDatabaseID, aFullNameList );
foreach( var entry in oFolderIDMap )
{
Console.WriteLine( entry.Key + ": " + entry.Value );
}
Map< string, long > GetFolderIDForFullName( long lDatabaseID, List< string > aFullNameList )
This function returns a map of the requested Folder Full Names and the respective ID of that folder. The full name is composed of the panel name, followed by the folder name tree, each level separated by the | character, with another | at the beginning and the end.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- aFullNameList: An array of full names of the folder IDs to fetch.
Returns
A map of folder full names to the ID of the folder.
Word List Structures
WordList
WordList oWordList = new WordList();
oWordList.aTermList = new ArrayList<String>();
oWordList.aTermList.add("Akerman");
oWordList.aTermList.add("Akin Gump");
oWordList.aTermList.add("Alston & Bird");
oWordList.aTermList.add("Arnold & Porter");
oWordList.aTermList.add("Baker Botts");
oWordList.eColor = Color.NAVY;
oWordList.sName = "AM Law";
oWordList.eHighlightType = HighlightType.FOREGROUND;
::iconect::api::structs::WordList oWordList;
oWordList.aTermList.push_back(L"Akerman");
oWordList.aTermList.push_back(L"Akin Gump");
oWordList.aTermList.push_back(L"Alston & Bird");
oWordList.aTermList.push_back(L"Arnold & Porter");
oWordList.aTermList.push_back(L"Baker Botts");
oWordList.eColor = ::iconect::api::structs::Color.NAVY;
oWordList.sName = L"AM Law";
oWordList.eHighlightType = ::iconect::api::structs::HighlightType.FOREGROUND;
WordList oWordList = new WordList();
oWordList.ATermList = new List<string>();
oWordList.ATermList.Add("Akerman");
oWordList.ATermList.Add("Akin Gump");
oWordList.ATermList.Add("Alston & Bird");
oWordList.ATermList.Add("Arnold & Porter");
oWordList.ATermList.Add("Baker Botts");
oWordList.EColor = Color.NAVY;
oWordList.SName = "AM Law";
oWordList.EHighlightType = HighlightType.FOREGROUND;
public WordList()public WordList(long lID, String sName, List<String> aTermList, Color eColor, HighlightType eHighlightType)
This structure contains the properties of a Word List.
- lID: An integer that represents the ID of a Word List.
NOTE: This integer is not required when creating a new word list. - sName: A string that contains the name of the word list.
- aList: An array of strings that contain the terms in the word list.
- eColor: Contains the color of the list. See Color for more information.
- eHighlightType: Contains the highlight type value. See HighlightType for more information.
Word List Methods
CreateWordList
WordList oWordList = new WordList();
oWordList.aTermList = new ArrayList<>();
oWordList.aTermList.add("Akerman");
oWordList.aTermList.add("Akin Gump");
oWordList.aTermList.add("Alston & Bird");
oWordList.aTermList.add("Arnold & Porter");
oWordList.aTermList.add("Baker Botts");
oWordList.eColor = Color.NAVY;
oWordList.sName = "aTest";
oWordList.eHighlightType = HighlightType.FOREGROUND;
int lDatabaseID = 1;
long lID = client.CreateWordList(lDatabaseID, oWordList);
System.out.println("Wordlist created with id: " + lID);
::iconect::api::structs::WordList oWordList;
oWordList.aTermList.push_back(L"Akerman");
oWordList.aTermList.push_back(L"Akin Gump");
oWordList.aTermList.push_back(L"Alston & Bird");
oWordList.aTermList.push_back(L"Arnold & Porter");
oWordList.aTermList.push_back(L"Baker Botts");
oWordList.eColor = ::iconect::api::structs::Color.NAVY;
oWordList.sName = L"aTest";
oWordList.eHighlightType = ::iconect::api::structs::HighlightType.FOREGROUND;
int64_t lID = -1;
int64_t lDatabaseID = 1;
oClient->CreateWordList(lID, lDatabaseID, oWordList);
std::cout << "Wordlist created with id: " << lID;
WordList oWordList = new WordList();
oWordList.ATermList = new List<string>();
oWordList.ATermList.Add("Akerman");
oWordList.ATermList.Add("Akin Gump");
oWordList.ATermList.Add("Alston & Bird");
oWordList.ATermList.Add("Arnold & Porter");
oWordList.ATermList.Add("Baker Botts");
oWordList.EColor = Color.NAVY;
oWordList.SName = "aTest";
oWordList.EHighlightType = HighlightType.FOREGROUND;
long lID = -1;
long lDatbaseID = 1;
lID = oClient.CreateWordList(lDatabaseID, oWordList);
Console.WriteLine("Wordlist created with id: " + lID);
long CreateWordList(long lDatabaseID, WordList oWordList)
This function adds a word list to the database.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- oWordList: A populated WordList object that will be added to the database.
Returns
The ID of the newly added list.
UpdateWordList
WordList oWordList = new WordList();
oWordList.aTermList = new ArrayList<>();
oWordList.aTermList.add("Akerman");
oWordList.aTermList.add("Akin Gump");
oWordList.aTermList.add("Alston & Bird");
oWordList.aTermList.add("Arnold & Porter");
oWordList.aTermList.add("Baker Botts");
oWordList.eColor = Color.NAVY;
oWordList.sName = "My Word List";
oWordList.lID = 2;
oWordList.eHighlightType = HighlightType.FOREGROUND;
client.UpdateWordList(lDatabaseID, oWordList);
::iconect::api::structs::WordList oWordList;
oWordList.aTermList.push_back(L"Akerman");
oWordList.aTermList.push_back(L"Akin Gump");
oWordList.aTermList.push_back(L"Alston & Bird");
oWordList.aTermList.push_back(L"Arnold & Porter");
oWordList.aTermList.push_back(L"Baker Botts");
oWordList.eColor = ::iconect::api::structs::Color.NAVY;
oWordList.sName = L"My Word List";
oWordList.lID = 2;
oWordList.eHighlightType = ::iconect::api::structs::HighlightType.FOREGROUND;
oClient->UpdateWordList(lDatabaseID, oWordList);
WordList oWordList = new WordList();
oWordList.ATermList = new List<string>();
oWordList.ATermList.Add("Akerman");
oWordList.ATermList.Add("Akin Gump");
oWordList.ATermList.Add("Alston & Bird");
oWordList.ATermList.Add("Arnold & Porter");
oWordList.ATermList.Add("Baker Botts");
oWordList.EColor = Color.NAVY;
oWordList.SName = "My Word List";
oWordList.LID = 2;
oWordList.EHighlightType = HighlightType.FOREGROUND;
client.UpdateWordList(lDatabaseID, oWordList);
void UpdateWordList(long lDatabaseID, WordList oWordList)
This function updates the specified word list.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- oWordList: A populated WordList object that will be updated.
Returns
None
GetWordList
long lDatabaseID = 1;
long lWordListID = 1;
WordList oWordlist = client.GetWordList(lDatabaseID, lWordListID);
System.out.println("The word list name is: " + oWordList.sName);
long lDatabaseID = 1;
long lWordListID = 1;
WordList oWordList;
client->GetWordList(oWordList, lDatabaseID, lWordListID);
std::cout << "The word list name is: " << oWordList.sName;
long lDatabaseID = 1;
long lWordListID = 1;
WordList oWordList = client.GetWordList(lDatabaseID, lWordListID);
Console.Writeline("The word list name is: "+ oWordList.SName);
WordList GetWordList(long lDatabaseID, long lWordListID)
This function returns the word list with the specified ID for the database.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- lWordListID: An integer that represents the word list’s ID.
Returns
The requested WordList object.
DeleteWordList
long lDatabaseID = 1;
WordList oWordList = new WordList();
oWordList.lID = 1;
client.DeleteWordList(lDatabaseID, oWordList);
int64_t lDatabaseID = 1;
WordList oWordList;
oWordList.lID = 1;
oClient->DeleteWordList(lDatabaseID, oWordList);
long lDatabaseID = 1;
WordList oWordList = new WordList();
oWordList.LID = 1;
client.DeleteWordList(lDatabaseID, oWordList);
void DeleteWordList(long lDatabaseID, WordList oWordList)
This function removes the specified word list.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- lWordListID: A WordList object that represents the word list that will be deleted.
Returns
None
Error Handling
The Admin API uses exceptions when errors occur within the service. AdminError objects are thrown with descriptive error messages.
AdminError Structure
try {
long lInvalidID = -234;
Database oDatabase = client.GetDatabase(lInvalidID);
}
catch ( AdminError e) {
System.out.println(e.sError);
}
try
{
long lInvalidID = -234;
::iconect::api::structs::Database oDatabase = oClient.GetDatabase(lInvalidID);
}
catch (AdminError& oError) {
cout << oError.sError;
}
try {
long lInvalidID = -234;
Database oDatabase = client.GetDatabase(lInvalidID);
}
catch ( AdminError e) {
Console.WriteLine(e.SError);
}
sError: A string containing the error that occurred within the service call.
Utility Methods
The Admin API provides the following functions as utility functions for working with Date and Date Time fields.
FormatDate
org.joda.time.DateTime oDate = new org.joda.time.DateTime();
String sXeraDateString = FormatDate(oDate);
/* this function is only available for Java */
/* This function is only available for Java */
String FormatDate(org.joda.time.DateTime dt)
This function converts an org.joda.time.DateTime object to a string format consumable by the XERA Date fields.
Parameters
- oDateTime: A DateTime object.
Returns
A string representation of the DateTime object.
FormatDate
String sXeraDateString = FormatDate(1969, 7, 24);
wstring sXeraDateString = FormatDate(1969, 7, 24);
string sXeraDateString = FormatDate(1969, 7, 24);
String FormatDate(int year, int month, int day)
This function creates a string representation of the given year, month, and day in a format that can be used by XERA Date fields.
Parameters
- year: An integer that represents the year portion of the date.
- month: An integer that represents the month portion of the date.
- day: An integer that represents the day portion of the date.
Returns
A string representation of the given date.
FormatDateTime
org.joda.time.DateTime oDate = new org.joda.time.DateTime();
String sXeraDateTimeString = FormatDateTime(oDate);
/* this function is only available for Java */
/* this function is only available for Java */
String FormatDateTime(org.joda.time.DateTime dt)
This function converts an org.joda.time.DateTime object to a string format that can be used by XERA Date Time fields.
Parameters
- oDateTime: A DateTime object.
Returns
A string representation of the DateTime object.
FormatDateTime
String sXeraDateTimeString = FormatDateTime(1969, 7, 24, 16, 50, 36);
wstring sXeraDateTimeString = FormatDateTime(1969, 7, 24, 16, 50, 36);
string sXeraDateTimeString = FormatDateTime(1969, 7, 24, 16, 50, 36);
String FormatDateTime(int year, int month, int day, int hour, int minute, int second)
This function creates a string representation of the given year, month, day, hour, minute, and second in a format that can be used by XERADateTime fields.
Parameters
- year: An integer that represents the year portion of the date.
- month: An integer that represents the month portion of the date.
- day: An integer that represents the day portion of the date.
- hour: An integer that represents the hour portion of the time.
- minute: An integer that represents the minute portion of the time.
- second: An integer that represents the second portion of the time.
Returns
A string representation of the given DateTime.
package com.iconect.api.util;
public class Util {
public static
package com.iconect.api.util;
public class Util {
public static
ThriftToJSON
import static com.iconect.api.util.Util.ThriftToJSON;
import com.iconect.api.structs.jobs.NativeToImageJob; // for example
...
NativeToImageJob oJob = new NativeToImageJob();
oJob.setFieldID(3);
oJob.setLMaxTempFileSize(10);
oJob.setLFileSizeLimit(10);
oJob.setLTimeOut(60);
String sJSON = ThriftToJSON(oJob);
iconect::api::structs::jobs::NativeToImageJob oJob; // for example
oJob.__set_FieldID(3);
oJob.__set_lMaxTempFileSize(10);
oJob.__set_lFileSizeLimit(10);
oJob.__set_lTimeOut(60);
std::wstring sJSON = iconect::ThriftToJSON(oJob);
using static iconect.api.Utils;
using iconect.api.structs.jobs; // for example
....
NativeToImageJob oJob = new NativeToImageJob();
oJob.FieldID = (3);
oJob.LMaxTempFileSize = (10);
oJob.LFileSizeLimit = (10);
oJob.LTimeOut = (60);
string sJSON = ThriftToJSON(oJob);
<E extends org.apache.thrift.TBase> String ThriftToJSON(E oObject)
This function serializes an iCONECT Thrift object into a string using JSON.
Parameters
- oObject : The object to be serialized. Its class must be a subclass of TBase.
Returns
A JSON string that represents the object. This string can be saved to a file, passed to other functions, or passed to JSONToThrift to make a new copy of the object.
JSONToThrift
import static com.iconect.api.util.Util.JSONToThrift;
import com.iconect.api.structs.jobs.NativeToImageJob;
...
try {
String sJSON;
/* Set sJSON to a JSON string here. */
NativeToImageJob oJob = new NativeToImageJob();
JSONToThrift(oJob, sJSON);
/* Your code here */
} catch (org.apache.thrift.TException oException) {
System.out.println("Could not extract NativeToImageJob: " + oException.toString());
}
try
{
std::wstring sJSON;
/* Set sJSON to a JSON string here. */
iconect::api::structs::jobs::NativeToImageJob oJob;
iconect::JSONToThrift(oJob, sJSON);
/* Your code here */
}
catch (const apache::thrift::TException& oException)
{
std::wcout << _T("Could not extract NativeToImageJob: ") << oException.message;
}
using static iconect.api.Utils;
using NativeToImageJob = iconect.api.structs.jobs.NativeToImageJob;
...
try
{
string sJSON;
/* Set sJSON to a JSON string here. */
NativeToImageJob oJob = new NativeToImageJob();
JSONToThrift(oJob, sJSON);
/* Your code here */
}
catch (Thrift.TException oException)
{
std::wcout << _T("Could not extract NativeToImageJob: ") << oException.Message;
}
<E extends org.apache.thrift.TBase> void JSONToThrift(E oObject, String sJSON)
This function deserializes an iCONECT Thrift object from a string in JSON.
Parameters
- oObject : An object that JSONToThrift will copy the settings from sJSON into. Its class must be a subclass of TBase.
- sJSON : The string that is to be deserialized. It must be in JSON format. Normally, this string would have been created by a call to ThriftToJSON.
Exceptions
If sJSON represents an object of a struct type other than oObject’s type, JSONToThrift may throw an exception of class TException.
Job Control Structures
NativeConversionJob
import com.iconect.api.structs.jobs.Cache;
import com.iconect.api.structs.jobs.ImageColorPalette;
import com.iconect.api.structs.jobs.NativeConversionJob;
import com.iconect.api.structs.jobs.Resize;
...
NativeConversionJob oJob = new NativeConversionJob();
oJob.setFieldID(3);
oJob.setOutputBPP(ImageColorPalette.AutoSelectBPP);
oJob.setMaxTempFileSizeMB(10);
oJob.setFileSizeLimitMB(10);
oJob.setTimeOutMilliseconds(10 * 60 * 1000); // ten minutes
oJob.setCache(Cache.HTML5);
oJob.setResize(Resize.None);
oJob.setRenderEmbeddedFonts(false);
using ::iconect::api::structs::jobs::Cache;
using ::iconect::api::structs::jobs::ImageColorPalette;
using ::iconect::api::structs::jobs::NativeConversionJob;
using ::iconect::api::structs::jobs::Resize;
...
NativeConversionJob oJob;
oJob.__set_FieldID(3);
oJob.__set_OutputBPP(ImageColorPalette::AutoSelectBPP);
oJob.__set_MaxTempFileSizeMB(10);
oJob.__set_FileSizeLimitMB(10);
oJob.__set_TimeOutMilliseconds(10 * 60 * 1000); // ten minutes
oJob.__set_Cache((Cache::type)(Cache::HTML5 | Cache::ThumbnailImage));
oJob.__set_Resize(Resize::None);
oJob.__set_RenderEmbeddedFonts(false);
using Cache = iconect.api.structs.jobs.Cache;
using ImageColorPalette = iconect.api.structs.jobs.ImageColorPalette;
using NativeConversionJob = iconect.api.structs.jobs.NativeConversionJob;
using Resize = iconect.api.structs.jobs.Resize;
...
NativeConversionJob oJob = new NativeConversionJob();
oJob.FieldID = 3;
oJob.OutputBPP = ImageColorPalette.AutoSelectBPP;
oJob.MaxTempFileSizeMB = 10;
oJob.FileSizeLimitMB = 10;
oJob.TimeOutMilliseconds = 10 * 60 * 1000; // ten minutes
oJob.Cache = Cache.HTML5 | Cache.ThumbnailImage;
oJob.Resize = Resize.None;
oJob.RenderEmbeddedFonts = false;
public NativeConversionJob()
This structure contains the information needed to convert a native file in a Native File field into images.
- type : Must be set to Type.NativeConversion. This is set by default in the constructor.
- FieldID: Contains the ID of the Native File field.
- OutputBPP : The constructor sets this to ImageColorPalette.AutoSelectBPP. You can select from:
- ImageColorPalette.Monochrome
- ImageColorPalette.GreyScale
- ImageColorPalette.EightBit
- ImageColorPalette.TwentyFourBit
- ImageColorPalette.AutoSelectBPP (converts to EightBit if EightBit is possible, but converts to TwentyFourBit if EightBit is not possible)
Note: ImageColorPalette.DownSampleBPP and ImageColorPalette.Unknown are for internal use only.
- MaxTempFileSizeMB : This is the maximum size of the temporary files that are used by the conversion. This is measured in megabytes. Set to 0 if there should not be a limit. The constructor sets this member to 0.
- FileSizeLimitMB : This is the maximum total size of all image files generated by the conversion. This is measured in megabytes. Set to 0 if there should not be a limit. The constructor sets this member to 0.
- TimeOutMilliseconds : This is the maximum time that conversion should take. This is measured in milliseconds. Set to 0 if there is to be no timeout. The constructor sets this member to 3600000 (one hour).
- Cache : This specifies the result of the conversion. You can select from:
- Cache.HTML5 : this caches images for display in Document View.
- Cache.Image : this caches images for productions.
- Cache.ThumbnailImage : this caches thumbnail images for Table View.
Note: In C#, you can use the bitwise-or operator to ask for two or all three results in one conversion. In C++, you can also combine options and then cast to Cache::type. Java does not support combining options.
- Resize : Specify Resize.UsLetter to convert to US Letter (8½″ × 11″). The default is Resize.None.
- RenderEmbeddedFonts : This is reserved for future use.
OCRJob
import com.iconect.api.structs.jobs.OCRJob;
...
OCRJob oJob = new OCRJob();
oJob.setSourceFieldID(5);
oJob.setTargetOCRTextFieldID(8);
oJob.setTargetOCRConfidenceFieldID(13);
oJob.setTargetOCRErrorFieldID(14);
oJob.setTimeoutInMinutes(5);
oJob.setAutoRotate(true);
oJob.setOCREngine(OCREngine.Tesseract3);
oJob.setOCRWarningPanelID(1);
oJob.setOCRWarningParentFolderID(0);
::iconect::api::structs::jobs::OCRJob oJob;
oJob.__set_SourceFieldID(5);
oJob.__set_TargetOCRTextFieldID(8);
oJob.__set_TargetOCRConfidenceFieldID(13);
oJob.__set_TargetOCRErrorFieldID(14);
oJob.__set_TimeoutInMinutes(5);
oJob.__set_AutoRotate(true);
oJob.__set_OCREngine(OCREngine.Tesseract3);
oJob.__set_OCRWarningPanelID(1);
oJob.__set_OCRWarningParentFolderID(0);
OCRJob oJob = new OCRJob();
oJob.SourceFieldID = 5;
oJob.TargetOCRTextFieldID = 8;
oJob.TargetOCRConfidenceFieldID = 13;
oJob.TargetOCRErrorFieldID = 14;
oJob.TimeoutInMinutes = 5;
oJob.AutoRotate = true;
oJob.OCREngine = OCREngine.Tesseract3;
oJob.OCRWarningPanelID = 1;
oJob.OCRWarningParentFolderID = 0;
public OCRJob()
This structure contains the information needed to apply OCR to a converted native file.
- type : Must be set to Type.OCR. This is set by default in the constructor.
- SourceFieldID : Contains the field ID of the Native File field or the Imagelink field. If this field is a Native File field, the field must be converted to images (NativeConversionJob).
- TargetOCRTextFieldID : Contains the ID of a Full Text field. The OCR output will be written to this field.
- TargetOCRConfidenceFieldID : Contains the ID of a Numeric field. The confidence that OCR has in its output is written to this field. Confidence is expressed as a percentage (from 0 to 100); the numeric field must have a length of three or greater. If TargetOCRConfidenceFieldID is set to 0, confidence is not written out.
- TargetOCRErrorFieldID : Contains the ID of a Full Text field. If OCR encounters errors, those errors will be written to this field. If TargetOCRErrorFieldID is 0, errors are not written out.
- TimeoutInMinutes : OCR will fail if it would take more than this many minutes to process a single page. TimeoutInMinutes must be between 1 and 30 (inclusive).
- AutoRotate : If true, the OCR engine will try to detect if each page should be rotated 90° or 180°. If false, the OCR engine will assume that every page is right-side up.
- OCREngine : Determines which supported OCR engine should be used. Must be OCREngine.Tesseract3 or OCREngine.Tesseract4.
- OCRWarningPanelID : If OCRWarningPanelID is not zero, OCR will create a folder named “[job-id-number] - Mass Action OCR” in the panel with this ID. There will be two subfolders called “Low Confidence” and “Error”. Documents which have a low confidence or have errors will be put into the appropriate subfolder. If OCRWarningPanelID is zero, then documents will not be foldered based on errors or confidence.
- OCRWarningParentFolderID : If OCRWarningParentFolderID is not zero, the “[job-id-number] - Mass Action OCR” folder will be created as a subfolder of OCRWarningParentFolderID. If OCRWarningParentFolderID is zero, * OCRWarningParentFolderID : If OCRWarningParentFolderID is not zero, the “[job-id-number] - Mass Action OCR” folder will be created as a subfolder of OCRWarningParentFolderID. If OCRWarningParentFolderID is zero, the “[job-id-number] - Mass Action OCR” folder will be created as a top-level folder on the panel. If OCRWarningParentFolderID is not zero, then OCRWarmingPanelID must be set to the panel that contains the folder.
dtSearchIndexOptimizationJob
import com.iconect.api.structs.jobs.dtSearchIndexOptimizationJob;
...
dtSearchIndexOptimizationJob oJob = new dtSearchIndexOptimizationJob();
::iconect::api::structs::jobs::dtSearchIndexOptimizationJob oJob;
dtSearchIndexOptimizationJob oJob = new dtSearchIndexOptimizationJob();
public dtSearchIndexOptimizationJob()
This structure must be passed to CreateJob when creating an optimization job.
- type : Must be set to Type.dtSearchOptimization. This is set by default in the constructor.
ProductionJob
import com.iconect.api.structs.jobs.ProductionJob;
...
ProductionJob oJob = new ProductionJob();
oJob.setProductionName("productionName");
oJob.setTemplateID(1);
::iconect::api::structs::jobs::ProductionJob oJob;
oJob.__set_ProductionName("productionName");
oJob.__set_TemplateID(1);
ProductionJob oJob = new ProductionJob();
oJob.ProductionName = "productionName";
oJob.TemplateID = 1;
public ProductionJob()
This structure must be passed to CreateJob when creating a production job.
- type : Must be set to Type.Production. This is set by default in the constructor.
- ProductionID : Contains the ID of the internal production job
- ProductionName : The name of the internal production job
- TemplateID : The ID of the mass action production template. The production is created based on the template.
NotificationSetting
struct NotificationSetting
{
1: list< i32 > UserIDList
2: bool SendMessage = true
3: bool SendEmail = true
}
Job
struct Job
{
1: i64 ID
2: Type Type
3: string Name
4: string Description
5: string CreatedUTC
6: string LastRunUTC
7: string StatusMessage
8: i64 CreatedUserID
9: Status Status
10: State State
11: i32 Progress = 0
12: ScheduleInfo Schedule
14: i64 DatabaseID
15: i64 ParentID = 0
}
ScheduleInfo
package com.iconect.api.structs.jobs;
public class ScheduleInfo {
public Schedule eSchedule;
public java.lang.String sScheduledUTC;
}
class iconect::api::structs::jobs::ScheduleInfo
{
public:
enum iconect::api::structs::jobs::Schedule::type eSchedule;
std::wstring sScheduledUTC;
};
namespace iconect.api.structs.jobs
{
public class ScheduleInfo
{
public Schedule ESchedule;
public string SScheduledUTC;
}
}
- eSchedule: is None or Scheduled or Recurring
- None: The job is not scheduled to run. You can run the job immediately by calling StartJob.
- Scheduled: The job is scheduled to run only once.
- Recurring: The job is scheduled to run more than once (for example, once every hour).
- sScheduledUTC: The time at which the job is scheduled to be run, using Cron format.
- Example: “28 15 9 10 * 2019” represents 3:28 p.m. on October 9, 2019.
- Example: “45 11 19 8 * 2019” represents 11:45 a.m. on August 19, 2019.
- Example: “0 2 1 7 “ represents 2:00 a.m. on July 1 of any year.
- Example: “0 11 1 *” represents 11:00 a.m. on Monday.
- Example: “0 18 5 *” represents 6:00 p.m. on Friday.
- Example: “0 18 L *” represents 6:00 p.m. on the last day of the month.
Job Control Methods
CreateJob
import com.iconect.api.structs.jobs.*;
import com.iconect.api.util.Util;
...
try
{
dtSearchIndexOptimizationJob oIndexOpt = new dtSearchIndexOptimizationJob();
RecordIDs oList = new RecordIDs();
NotificationSetting oNotifications = new NotificationSetting();
Job oJob = client.CreateJob(oJob, lDatabaseID, ("Job Name"), ("Job Description"), Util.ThriftToJSON(oIndexOpt));
client.StartJob(lDatabaseID, oJob.ID, oList.IDs, oNotifications);
while (true)
{
Job oStatusJob = client.GetJob(lDatabaseID, oJob.ID);
if (oStatusJob.State == State.Stopped)
{
System.out.println (oStatusJob.Status == Status.Error ? "Error" : "Success");
break;
}
Thread.Sleep(1000);
}
}
catch (AdminError oError)
{
System.out.println ("RunJobTest test failed because " + oError.sError);
}
try
{
iconect::api::structs::jobs::dtSearchIndexOptimizationJob oIndexOpt;
iconect::api::structs::jobs::Job oJob;
iconect::api::structs::jobs::RecordIDs oList;
iconect::api::structs::jobs::NotificationSetting oNotifications;
m_oClient->CreateJob(oJob, lDatabaseID, _T("Job Name"), _T("Job Description"), iconect::ThriftToJSON(oIndexOpt));
m_oClient->StartJob(lDatabaseID, oJob.ID, oList.IDs, oNotifications);
while (true)
{
iconect::api::structs::jobs::Job oStatusJob;
m_oClient->GetJob(oStatusJob, lDatabaseID, oJob.ID);
if (oStatusJob.State == iconect::api::structs::jobs::State::Stopped)
{
wcout << _T("Completed ") << (oStatusJob.Status == iconect::api::structs::jobs::Status::Error ? _T("Error") : _T("Success")) << endl;
break;
}
Sleep(1000);
}
}
catch (AdminError& oError)
{
wcout << _T("RunJobTest test failed because ") << oError.sError << _T(".") << endl;
}
using com.iconect.api.structs.jobs;
...
try
{
dtSearchIndexOptimizationJob oIndexOpt = new dtSearchIndexOptimizationJob();
RecordIDs oList = new RecordIDs();
NotificationSetting oNotifications = new NotificationSetting();
Job oJob = client.CreateJob(oJob, lDatabaseID, ("Job Name"), ("Job Description"), iconect.ThriftToJSON(oIndexOpt));
client.StartJob(lDatabaseID, oJob.ID, oList.IDs, oNotifications);
while (true)
{
Job oStatusJob = client.GetJob(lDatabaseID, oJob.ID);
if (oStatusJob.State == State.Stopped)
{
System.Console.WriteLine (oStatusJob.Status == Status.Error ? "Error" : "Success");
break;
}
Thread.Sleep(1000);
}
}
catch (AdminError oError)
{
System.Console.WriteLine ("RunJobTest test failed because " + oError.sError);
}
Job CreateJob(long lDatabaseID, string sName, string sDescription, string sParameters)
This function creates a job in the iCONECT system.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- sName: A unique name that can be used to identify the job in the Jobs tile.
- sDescription: A description that can appear in the Jobs tile.
- sParameters: The JSON representation of one of the structure types NativeConversionJob, OCRJob, or dtSearchIndexOptimizationJob.
Use ThriftToJSON to convert a structure to JSON so that it can be passed to CreateJob.
Returns
A new Job structure with the ID field filled in. You can use the ID in the structure to manage the job.
UpdatePanelItem
List<Job> oJobs = client.GetJobs(lDatabaseID, Type.dtSearchOptimization, 1, 100);
std::vector<Job> oJobs;
m_oClient.GetJobs(oJobs, lDatabaseID, Type.dtSearchOptimization, 1, 100);
List<Job> oJobs = client.GetJobs(oJobs, lDatabaseID, Type.dtSearchOptimization, 1, 100);
list<Jobs> GetJobs(long lDatabaseID, Jobs.Type eType, long lStartRow, long lJobCount)
This function gets a list of jobs.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- eType: The type of jobs to be queried.
- lStartRow: Only return jobs starting at this one. For example, if 1, get all jobs starting at the first;
if 500, skip the first 499 jobs and return the 500th job first. - lJobCount: Only return this many jobs; if there are more jobs, they won’t be returned.
Returns
A collection of Job objects.
GetJobParameters
long lDatabaseID = 1;
String sJobParams = client.GetJobParameters(lDatabaseID, oJob.ID);
OCRJob oJobParams = new OCRJob();
Util.JSONToThrift(oJobParams, sJobParams);
long lDatabaseID = 1;
std::wstring sJobParams;
client.GetJobParameters(sJobParams, lDatabaseID, oJob.ID);
OCRJob oJobParams;
iconect::JSONToThrift(oJobParams, sJobParams);
long lDatabaseID = 1;
string sJobParams = client.GetJobParameters(lDatabaseID, oJob.ID);
OCRJob oJobParams = new OCRJob();
Util.JSONToThrift(oJobParams, sJobParams);
string GetJobParameters(long lDatabaseID, long lJobID)
This function gets the parameters (the last parameter of CreateJob and UpdateJobParameters) for the specified job.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- lJobID: The job’s unique ID.
Returns
The JSON representation of the job’s parameters. You must convert it to the correct struct type –
NativeConversionJob, OCRJob, or dtSearchIndexOptimizationJob – using JSONToThrift.
GetJob
long lDatabaseID = 1;
Job oCreatedJob = client.CreateJob (lDatabaseID, ...);
...
Job oJobStatus = client.GetJob (lDatabaseID, oCreatedJob.ID);
long lDatabaseID = 1;
Job oCreatedJob;
m_oClient.CreateJob (oCreatedJob, lDatabaseID, ...);
...
Job oJobStatus;
m_oClient.GetJob (oJobStatus, lDatabaseID, oCreatedJob.ID);
long lDatabaseID = 1;
Job oCreatedJob;
client.CreateJob (oCreatedJob, lDatabaseID, ...);
...
Job oJobStatus;
client.GetJob (oJobStatus, lDatabaseID, oCreatedJob.ID);
Job GetJob(lDatabaseID, lJobID)
This function returns the Job struct for the specified job so you can get its status and state. Note that this struct does not contain the parameters specific to the type of job; use GetJobParameters for these parameters.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- lJobID: The job ID.
Returns
The Job struct.
UpdateJobParameters
import com.iconect.api.structs.jobs.*;
import com.iconect.api.util.Util;
...
try
{
dtSearchIndexOptimizationJob oIndexOpt = new dtSearchIndexOptimizationJob();
RecordIDs oList = new RecordIDs();
NotificationSetting oNotifications = new NotificationSetting();
Job oJob = client.CreateJob(oJob, lDatabaseID, ("Job Name"), ("Job Description"), Util.ThriftToJSON(oIndexOpt));
...
client.UpdateJobParameters(lDatabaseID, oJob.ID, Util.ThriftToJSON(oIndexOpt));
client.StartJob(lDatabaseID, oJob.ID, oList.IDs, oNotifications);
while (true)
{
Job oStatusJob = client.GetJob(lDatabaseID, oJob.ID);
if (oStatusJob.State == State.Stopped)
{
System.out.println (oStatusJob.Status == Status.Error ? "Error" : "Success");
break;
}
Thread.Sleep(1000);
}
}
catch (AdminError oError)
{
System.out.println ("RunJobTest test failed because " + oError.sError);
}
try
{
iconect::api::structs::jobs::dtSearchIndexOptimizationJob oIndexOpt;
iconect::api::structs::jobs::Job oJob;
iconect::api::structs::jobs::RecordIDs oList;
iconect::api::structs::jobs::NotificationSetting oNotifications;
m_oClient->CreateJob(oJob, lDatabaseID, _T("Job Name"), _T("Job Description"), iconect::ThriftToJSON(oIndexOpt));
....
m_oClient->UpdateJobParameters(lDatabaseID, oJob.ID, Util.ThriftToJSON(oIndexOpt));
m_oClient->StartJob(lDatabaseID, oJob.ID, oList.IDs, oNotifications);
while (true)
{
iconect::api::structs::jobs::Job oStatusJob;
m_oClient->GetJob(oStatusJob, lDatabaseID, oJob.ID);
if (oStatusJob.State == iconect::api::structs::jobs::State::Stopped)
{
wcout << _T("Completed ") << (oStatusJob.Status == iconect::api::structs::jobs::Status::Error ? _T("Error") : _T("Success")) << endl;
break;
}
Sleep(1000);
}
}
catch (AdminError& oError)
{
wcout << _T("RunJobTest test failed because ") << oError.sError << _T(".") << endl;
}
using com.iconect.api.structs.jobs;
...
try
{
dtSearchIndexOptimizationJob oIndexOpt = new dtSearchIndexOptimizationJob();
RecordIDs oList = new RecordIDs();
NotificationSetting oNotifications = new NotificationSetting();
Job oJob = client.CreateJob(oJob, lDatabaseID, ("Job Name"), ("Job Description"), iconect.ThriftToJSON(oIndexOpt));
....
client.UpdateJobParameters(lDatabaseID, oJob.ID, Util.ThriftToJSON(oIndexOpt));
client.StartJob(lDatabaseID, oJob.ID, oList.IDs, oNotifications);
while (true)
{
Job oStatusJob = client.GetJob(lDatabaseID, oJob.ID);
if (oStatusJob.State == State.Stopped)
{
System.Console.WriteLine (oStatusJob.Status == Status.Error ? "Error" : "Success");
break;
}
Thread.Sleep(1000);
}
}
catch (AdminError oError)
{
System.Console.WriteLine ("RunJobTest test failed because " + oError.sError);
}
void UpdateJobParameters(long lDatabaseID, long lJobID, string sParameters)
This function changes the parameters of an existing job.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- lJobID: The ID of the job to be changed.
- sParameters: The JSON representation of a NativeConversionJob, OCRJob, or dtSearchIndexOptimizationJob struct.
DeleteJob
import com.iconect.api.structs.jobs.*;
import com.iconect.api.util.Util;
...
try
{
dtSearchIndexOptimizationJob oIndexOpt = new dtSearchIndexOptimizationJob();
RecordIDs oList = new RecordIDs();
NotificationSetting oNotifications = new NotificationSetting();
Job oJob = client.CreateJob(oJob, lDatabaseID, ("Job Name"), ("Job Description"), Util.ThriftToJSON(oIndexOpt));
...
client.DeleteJob(lDatabaseID, oJob.ID);
}
catch (AdminError oError)
{
System.out.println ("RunJobTest test failed because " + oError.sError);
}
try
{
iconect::api::structs::jobs::dtSearchIndexOptimizationJob oIndexOpt;
iconect::api::structs::jobs::Job oJob;
iconect::api::structs::jobs::RecordIDs oList;
iconect::api::structs::jobs::NotificationSetting oNotifications;
m_oClient->CreateJob(oJob, lDatabaseID, _T("Job Name"), _T("Job Description"), iconect::ThriftToJSON(oIndexOpt));
....
m_oClient->DeleteJob(lDatabaseID, oJob.ID);
}
catch (AdminError& oError)
{
wcout << _T("RunJobTest test failed because ") << oError.sError << _T(".") << endl;
}
using com.iconect.api.structs.jobs;
...
try
{
dtSearchIndexOptimizationJob oIndexOpt = new dtSearchIndexOptimizationJob();
RecordIDs oList = new RecordIDs();
NotificationSetting oNotifications = new NotificationSetting();
Job oJob = client.CreateJob(oJob, lDatabaseID, ("Job Name"), ("Job Description"), iconect.ThriftToJSON(oIndexOpt));
....
client.DeleteJob(lDatabaseID, oJob.ID);
}
catch (AdminError oError)
{
System.Console.WriteLine ("RunJobTest test failed because " + oError.sError);
}
void DeleteJob(long lDatabaseID, long lJobID)
This function deletes an existing job.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- lJobID: The ID of the job to be deleted.
StartJob
import com.iconect.api.structs.jobs.*;
import com.iconect.api.util.Util;
...
try
{
dtSearchIndexOptimizationJob oIndexOpt = new dtSearchIndexOptimizationJob();
RecordIDs oList = new RecordIDs();
NotificationSetting oNotifications = new NotificationSetting();
Job oJob = client.CreateJob(oJob, lDatabaseID, ("Job Name"), ("Job Description"), Util.ThriftToJSON(oIndexOpt));
client.StartJob(lDatabaseID, oJob.ID, oList.IDs, oNotifications);
while (true)
{
Job oStatusJob = client.GetJob(lDatabaseID, oJob.ID);
if (oStatusJob.State == State.Stopped)
{
System.out.println (oStatusJob.Status == Status.Error ? "Error" : "Success");
break;
}
Thread.Sleep(1000);
}
}
catch (AdminError oError)
{
System.out.println ("RunJobTest test failed because " + oError.sError);
}
try
{
iconect::api::structs::jobs::dtSearchIndexOptimizationJob oIndexOpt;
iconect::api::structs::jobs::Job oJob;
iconect::api::structs::jobs::RecordIDs oList;
iconect::api::structs::jobs::NotificationSetting oNotifications;
m_oClient->CreateJob(oJob, lDatabaseID, _T("Job Name"), _T("Job Description"), iconect::ThriftToJSON(oIndexOpt));
m_oClient->StartJob(lDatabaseID, oJob.ID, oList.IDs, oNotifications);
while (true)
{
iconect::api::structs::jobs::Job oStatusJob;
m_oClient->GetJob(oStatusJob, lDatabaseID, oJob.ID);
if (oStatusJob.State == iconect::api::structs::jobs::State::Stopped)
{
wcout << _T("Completed ") << (oStatusJob.Status == iconect::api::structs::jobs::Status::Error ? _T("Error") : _T("Success")) << endl;
break;
}
Sleep(1000);
}
}
catch (AdminError& oError)
{
wcout << _T("RunJobTest test failed because ") << oError.sError << _T(".") << endl;
}
using com.iconect.api.structs.jobs;
...
try
{
dtSearchIndexOptimizationJob oIndexOpt = new dtSearchIndexOptimizationJob();
RecordIDs oList = new RecordIDs();
NotificationSetting oNotifications = new NotificationSetting();
Job oJob = client.CreateJob(oJob, lDatabaseID, ("Job Name"), ("Job Description"), iconect.ThriftToJSON(oIndexOpt));
client.StartJob(lDatabaseID, oJob.ID, oList.IDs, oNotifications);
while (true)
{
Job oStatusJob = client.GetJob(lDatabaseID, oJob.ID);
if (oStatusJob.State == State.Stopped)
{
System.Console.WriteLine (oStatusJob.Status == Status.Error ? "Error" : "Success");
break;
}
Thread.Sleep(1000);
}
}
catch (AdminError oError)
{
System.Console.WriteLine ("RunJobTest test failed because " + oError.sError);
}
void StartJob(long lDatabaseID, long lJobID, list<long> aRecordList, Jobs.NotificationSetting oNotifications)
This function starts the job in the background.
Parameters
- lDatabaseID: An integer that represents the database’s unique ID.
- lJobID: The unique ID of the job.
- aRecordIDList: The OBJECT_IDs of the records to be processed for the job. For dtSearchIndexOptimization jobs, this parameter is ignored.
- oNotifications: The users to notify when the job is finished, and how to notify them.
View Structures
SelectedRecordQuery
SelectedRecordQuery query = new SelectedRecordQuery();
ArrayList<long> list = new ArrayList<>();
list.add(1);
query.SelectedDocIDs = list;
SelectedRecordQuery query;
query.SelectedDocIDs.push_back(1);
SelectedRecordQuery query = new SelectedRecordQuery();
List<long> list = new List<long>();
list.Add(1);
query.SelectedDocIDs = list;
public SelectedRecordQuery()public SelectedRecordQuery( List
This is for creating a view with a specific set of record IDs. The IsExceptionList parameter inverts it, and the view will contain every record except the ID list.
- SelectedDocIDs: A list of IDs to either include or exclude for the view.
- IsExceptionList: Determines if the list of IDs is inclusive or exclusive. Defaults to false.
SearchQuery
SearchQuery query = new SearchQuery();
query.SearchString = "knee";
SearchQuery query;
query.SearchString = L"knee";
SearchQuery query = new SearchQuery();
query.SearchString = "knee";
public SearchQuery()public SearchQuery(String SearchString)
This creates a view based on the search string provided. This is the same string that is generated in the Custom Search area in Xera.
- SearchString: The search to be performed.
ViewQuery
SearchQuery query = new SearchQuery();
query.SearchString = "knee";
ViewQuery viewQuery = new ViewQuery();
viewQuery.SearchQueryParam = query;
SearchQuery query;
query.SearchString = L"knee";
ViewQuery viewQuery;
viewQuery.__set_SearchQueryParam(query);
SearchQuery query = new SearchQuery();
query.SearchString = "knee";
ViewQuery viewQuery = new ViewQuery();
viewQuery.SearchQueryParam = query;
`public ViewQuery()
This is the structure passed to CreateView() to actually create the view. The query types are processed from first to last, and the first set one will be used exclusively. Please notice, in C++ it is not sufficient to simply set the member variable, the example code must be used instead.
- SelRecordQueryParam: The view is to be based on a SelectedRecordQuery.
- SearchQueryParam: The view is to be based on a SearchQuery.
View Methods
CreateView
long databaseID = 1;
SelectedRecordQuery query = new SelectedRecordQuery();
ArrayList<long> list = new ArrayList<>();
list.add(1);
query.SelectedDocIDs = list;
ViewQuery viewQuery = new ViewQuery();
viewQuery.SelRecordQueryParam = query;
String taskID = client.CreateView( databaseID, viewQuery, "2019-12-31 00:00:00" );
int64_t databaseID = 1;
SelectedRecordQuery query;
query.SelectedDocIDs.push_back(1);
ViewQuery viewQuery;
viewQuery.__set_SearchQueryParam(query);
std::wstring taskID;
client.CreateView( taskID, databaseID, viewQuery, "2019-12-31 00:00:00" );
long databaseID = 1;
SelectedRecordQuery query = new SelectedRecordQuery();
List<long> list = new List<long>();
list.Add(1);
query.SelectedDocIDs = list;
ViewQuery viewQuery = new ViewQuery();
viewQuery.SearchQueryParam = query;
string = client.CreateView( databaseID, viewQuery, "2019-12-31 00:00:00" );
string CreateView( 1: i64 DatabaseID, 2: AdminAPIStructs.ViewQuery ViewQuery, 3: string ExpirationDate ) throws ( 1: AdminAPIStructs.AdminError oException )
This function initiates the creation of a view and returns a task GUID that is passed to the IsViewReady function to determine when the view is ready for use.
Parameters
- lDatabaseID: a long integer that represents the database’s unique ID.
- ViewQuery: The container ViewQuery that represents the desired records in the view.
- ExpirationDate: The date and time the view can be auto-deleted, in the format (in 24 hour time): YYYY-MM-DD HH:MM:SS
Returns
A GUID used by IsViewReady to determine when the view has been created.
IsViewReady
long databaseID = 1;
long viewID = client.IsViewReady( taskID );
int64_t databaseID = 1;
int64_t viewID = client.IsViewReady( taskID );
long databaseID = 1;
long viewID = client.IsViewReady( taskID );
i64 IsViewReady( 1: string GUID ) throws ( 1: AdminAPIStructs.AdminError oException )
This function checks if the GUID provided by CreateView has completed. If it is not, the returned value will be 0 (zero) and the consumer should sleep for a short period before calling this again. When a non-zero number is return, it is the newly created View ID and is ready for use.
Parameters
- GUID: the value returned from a sucessful call to CreateView
Returns
0 (zero) if the view is not yet ready, otherwise the ID of the newly created view which is now ready to use.
DeleteView
long databaseID = 1;
long viewID = 23;
client.DeleteView( databaseID, viewID );
int64_t databaseID = 1;
int64_t viewID = 23;
client.DeleteView( databaseID, viewID );
long databaseID = 1;
long viewID = 23;
client.DeleteView( databaseID, viewID );
void DeleteView( 1: i64 DatabaseID, 2: i64 ViewID ) throws ( 1: AdminAPIStructs.AdminError oException )
This function is used to manually delete a view when it is no longer needed. After this call, the View ID passed in is no longer valid and will result in an error if provided to any other method that requires a View ID.
Parameters
- lDatabaseID: a long integer that represents the database’s unique ID.
- lViewID: a long integer that represents a valid View ID returned by IsViewReady.
Change Log
December 2019
- Added Create/Delete functions for Views
August 2019
- Added CRUD functions for User Groups
- Added a function to list User Roles
July 2019
- Added single object get calls for Users and Clients.
- Added Create/Update/Delete functions for Clients.
Breaking Changes
- GetUsers,GetClients and GetDatabases now have a filtering clause for Active/Disabled.
- User,Database and Client objects now have a State enumerator and the bActive flag removed.
March 2019
- Job Control API (structures and methods) have been added.
February 2019
- Security is now enforced on API calls.
July 2018
Changes
- FieldType DATETIME documents. Added information about datetime string format.
- Documents of Record structure. Added how to pass empty string for arguements of empty value. Added information of Order parameter.
January 2018
Additions
- AddRecordsWithFieldsReturned method
- Support for Datetime and Duration fields:
- eTimeFormat and eDurationFormat properties were added to the Field struct
- TimeFormat and DurationFormat enums
- FormatDateTime methods have been added to the com.iconect.xera.util Java package
Changes
- DeleteDatabase method. This method will no longer look up the database to delete based on the name provided.
- Removals
- Projects functionality:
- The GetProjects method
- GetDatabasees method. This method no longer accepts a project ID when looking up databases.
- AddUserToClientProject, RemoveUserFromClientProject, GetUsersByClientProject and GetClientCaseByUser methods were transitioned to AddUserToClient, RemoveUserFromClient, GetUsersByClient and GetClientForUser respectively.
- Project and ClientProjectAssociation structs
- The aAssociatedProjectList field was removed from the Client struct