Genesys CTI User Forum
Genesys CTI User Forum => Genesys-related Development => Topic started by: genesyslearner on January 04, 2018, 07:11:49 PM
-
Hi All,
I am new to Genesys SDK and i want to learn on how to make a Java code to update the Options of an application through genesys SDK.
I have already written a code to establish the connection with Configuration Server but I am not sure on how to Update the Options of an application.
It would be a great help if I could get a pointer to class and method which I can use to update the options of any application using Genesys SDK.
-
[quote author=genesyslearner link=topic=10815.msg49163#msg49163 date=1515093109]
Hi All,
I am new to Genesys SDK and i want to learn on how to make a Java code to update the Options of an application through genesys SDK.
I have already written a code to establish the connection with Configuration Server but I am not sure on how to Update the Options of an application.
It would be a great help if I could get a pointer to class and method which I can use to update the options of any application using Genesys SDK.
[/quote]
Did you checked samples released with psdk? Isn't such basic example there?
Odoslané z D5803 pomocou Tapatalku
-
Use CfgApplicationQuery to obtain the application you are interested in. Example the APIs for CfgApplication to see how to access the options. After modifying them you can call the Save method to save any changes you made. If you search the board for CfgApplicationQuery you should find some examples.
-
Thanks RobertH for you reply but there isn't any example provided in PSDK examples 9.0.
Hi abudwill,
Thanks for the reference to classes. I am able to give the name of Application i want to update using CfgApplicationQuery but there are no examples of CfgApplication on how to access the options.
Could you please guide me to the URL where there are some examples on the same?
-
Hi folks,
I am struggling to update the Options of an application using Delta objects. I have set the new value for a application using key Value collection class object but now as i need to update the options i have to use the method "update(ICfgDelta deltaObject)" of cfgapplication.
Could you please suggest the way to pass the KeyValueCollection object as delta object?
-
Hi,
Here is some sample code that demonstrates how to update the option of an application using the COM Application Block, you just add error handling etc..:
[code] var applicQuery = new CfgApplicationQuery { Name = "InteractionWorkspace_ATOS" };
CfgApplication application = confService.RetrieveObject<CfgApplication>(applicQuery);
Console.WriteLine(application.Name);
KeyValueCollection kvcOptions = application.Options;
if (kvcOptions != null)
{
//Check for Section called 'Test'
if (kvcOptions.ContainsKey("Test"))
{
KeyValueCollection test = kvcOptions.GetAsKeyValueCollection("Test");
if (test != null)
{
//Check for Option called 'Option1'
if (test.ContainsKey("Option1"))
{
//Set new value if we have it
test["Option1"] = DateTime.UtcNow.ToString();
}
else
{
//Add it if we don't
test.Add("Option1", DateTime.UtcNow.ToString());
}
}
}
else
{
//Create enw section called 'Test' and add option called 'Option1'.
KeyValueCollection Option1 = new KeyValueCollection();
Option1.Add("Option1", DateTime.UtcNow.ToString());
kvcOptions.Add("Test", Option1);
}
}
application.Save();[/code]
-
Thanks PeteHole. the code helped me through to update the options field.