You can use the Configuration Platform SDK to write Java or .NET applications that access and update information from the Genesys Configuration Layer. These applications can range from the simple to the advanced.
This document shows how to implement the basic functions you will need to write a simple Java Configuration Layer application. It covers the following topics:
Once you have reviewed the information in this document, you should familiarize yourself with the section of this API reference that describes the Configuration Layer Objects. Since the Configuration Platform SDK uses these objects for nearly everything it does, you will need to understand them before you start using this SDK.
Note: The Platform SDK includes the Configuration Object Model Application Block, which is a high-performance component you can use to query on, and to create, update, and delete, Configuration Layer objects. Genesys recommends that you use this application block for most of the work you do with Configuration Layer objects. For more information, consult the Configuration Object Model Application Block Guide. There is also a blog post available from the Genesys Developer Zone that includes in-depth samples of how to use this application block.
After reading about the Configuration Layer Objects, you may want to look at the Configuration Platform SDK code example, which this section was based on. This example is a working application that carries out the functionality outlined here.
When you are ready to write more complicated applications, take a look at the classes and methods described in this API reference. You will find some powerful functionality here.
The first thing you need to do to use the Configuration Platform SDK is instantiate a
ConfServerProtocol
object. To do that, you must supply information
about the Configuration Server you want to connect with. This example uses the
URI of the Configuration Server, but you can also use the server's name, host,
and port information:
[Java]
ConfServerProtocol confServerProtocol =
new ConfServerProtocol(
new Endpoint(
confServerUri));
Configuration Server needs some additional information in order to create a successful connection. This information includes the type of client you wish to create, your client's name, and your user name and password:
[Java]
confServerProtocol.setClientType(ConfServerClientType.SCE);
confServerProtocol.setClientName("default");
confServerProtocol.setUserName(userName);
confServerProtocol.setUserPassword(password);
After instantiating the ConfServerProtocol object, you need to open the connection to the Configuration Server:
[Java]
confServerProtocol.open();
Now that you have opened a connection, you can create a query and send it to Configuration Server. Let's say that you want to get information about a particular agent. To do this, you will need to supply the agent's user name using a filter key.
The filter key tells Configuration Server to narrow your query to a specific agent, rather than retrieving information about all of the persons in your contact center:
[Java]
KeyValueCollection filterKey = new KeyValueCollection();
filterKey.addObject("user_name", userName);
You can find the names of the filter keys for Person
objects by
looking in the Filter Keys section of the
CfgPerson entry in the
Configuration Objects
section of this API reference. This section has a similar reference page for each
Configuration Layer object.
Now you are ready to create the request.
As you may know, Configuration Server considers agents to be objects of type
CfgPerson. So you will need to create a
request for information about a Person
who has the user name
you specified in the filter key:
[Java]
CfgObjectType objectType = CfgObjectType.Person;
int intPerson = objectType.asInteger();
RequestReadObjects requestReadObjects =
RequestReadObjects.create(
intPerson,
filterKey);
After you have created your request, you can send it to Configuration Server, as shown here:
[Java]
confServerProtocol.send(requestReadObjects);
If the request is successful, you will receive an
EventObjectsRead
message.
Note: When you send a RequestReadObjects
message,
Configuration Server may send more than one EventObjectsRead
messages in response, depending on whether there is too much data to be handled
by a single EventObjectsRead
. Once you have received all of the
EventObjectsRead
messages, Configuration Server will also send an
EventObjectsSent
, which confirms that it has completed your
request. For more information, refer to the article on
event handling at the beginning of this API
Reference.
The information you asked for is returned by invoking the getConfObject
method of the EventObjectsRead
message. This method returns an
org.w3c.dom.Document representation of the object.
Here is a sample of how you might print the XML document:
[Java]
EventObjectsRead objectsRead =
(EventObjectsRead) theMessage;
System.out.println(theMessage.messageName());
System.out.println("There are "
+ objectsRead.getObjectTotalCount() + " objects of this type.");
Document resultDocument =
(Document) objectsRead.getConfObject();
... Add code to parse and print...
And this is what the XML document might look like:
<ConfData>
<CfgPerson>
<DBID value="105"/>
<tenantDBID value="101"/>
<lastName value="agent1"/>
<firstName value="Agent"/>
<employeeID value="agent1"/>
<userName value="agent1"/>
<password value="204904E461002B28511D5880E1C36A0F"/>
<isAgent value="2"/>
<CfgAgentInfo>
<placeDBID value="102"/>
<skillLevels>
<CfgSkillLevel>
<skillDBID value="101"/>
<level value="9"/>
</CfgSkillLevel>
</skillLevels>
<agentLogins>
<CfgAgentLoginInfo>
<agentLoginDBID value="103"/>
<wrapupTime value="0"/>
</CfgAgentLoginInfo>
</agentLogins>
<capacityRuleDBID value="127"/>
</CfgAgentInfo>
<isAdmin value="1"/>
<state value="1"/>
<userProperties>
<list_pair key="desktop-redial">
<str_pair key="phone-number0" value="5551212"/>
<str_pair key="phone-number1" value=""/>
<str_pair key="phone-number2" value=""/>
<str_pair key="phone-number3" value=""/>
<str_pair key="phone-number4" value=""/>
<str_pair key="phone-number5" value=""/>
<str_pair key="phone-number6" value=""/>
<str_pair key="phone-number7" value=""/>
<str_pair key="phone-number8" value=""/>
<str_pair key="phone-number9" value=""/>
</list_pair>
<list_pair key="multimedia">
<str_pair key="last-media-logged"
value="voice,email"/>
</list_pair>
</userProperties>
<emailAddress value="agent1@techpubs3"/>
</CfgPerson>
</ConfData>
This XML document contains information about a Person
.
To interpret the information contained in the document, look at the
Parameters section of the
CfgPerson entry in the
Configuration Objects section of this
API reference.
If you compare the elements in this XML document to the
CfgPerson entry, you can see that some
of them contain information that is explained in detail in another entry. For
example, the CfgAgentInfo
element contains information that is
described in the CfgAgentInfo entry.
Similarly, the CfgAgentLoginInfo
element contains information
described in the
CfgAgentLoginInfo entry.
You can update a Configuration Layer object by passing in an XML
Document
containing the appropriate information about that object:
[Java]
CfgObjectType objectType = CfgObjectType.Person;
int intPerson = objectType.asInteger();
RequestUpdateObject requestUpdateObject =
RequestUpdateObject.create(
intPerson,
xmlDocument);
You can also create a new Configuration Layer object by sending an XML
Document
to Configuration Server, as shown here:
[Java]
CfgObjectType objectType = CfgObjectType.Person;
int intPerson = objectType.asInteger();
RequestCreateObject requestCreateObject =
RequestCreateObject.create(
intPerson,
xmlDocument);
Finally, when you are finished communicating with the Configuration Server, you should close the connection, in order to minimize resource utilization:
[Java]
confServerProtocol.close();
For more information about the Genesys SDKs, including the latest versions of all SDK documents, check out the Genesys Developer Zone, which also contains forums and other important sources of developer-related information. DevZone is available at http://www.genesyslab.com/developer.
Additional information on Genesys Telecommunications Laboratories, Inc. is available on our Technical Support website. The following documentation also contains information about this software. Please consult the Deployment Guide first.
The Platform SDK 7.6 Deployment Guide
The Platform SDK 7.6 Developer's Guide