Trying to read from CME >Application>options in.Net

Hi Genesys Wizards,

I am trying to read the values from CME servers Application → Properties → Options (via .Net PSDK API)

I am trying to read it manually like Configuration>environment>applications>Desktop ( Right click on listed application Name>properties>options).

if its the cfgapplication object , then I am looking at a method called getoptions() to probably achieve the same in JAVA
URL :http://www.genesyslab.info/repository/PSDK/8.0-Java_API_Reference/com/genesyslab/platform/applicationblocks/com/objects/CfgApplication.html#getOptions()

But I don’t see a similar method listed in .Net PSDK chm file :frowning:

So I tried to do it like the below in .net as a first step I was trying to read the application Name but no luck. (then I would want to read the options )

Could you please advice if am missing anything or is there a equivalent method like getoptions in .net?



var CfgapplicQuery = new CfgApplicationQuery(service) { Name = "MY APPLIC NAME"};
var CfgApplication_Query_Values = CfgapplicQuery.Execute();
foreach (CfgApplication values in CfgApplication_Query_values)
{
MessageBox.Show(Values.Name); // I would expect it to display the Applic Name passed in query while it isn't!!
}

You have to work with CfgApplication object to allow using method getOptions(). Did you try to retype the retrieved object to the CfgApplication?

That code works for me..

In .Net to get the options use .Options

var CfgapplicQuery = new CfgApplicationQuery(confService) { Name = "Stat_Server" };
                var CfgApplication_Query_Values = CfgapplicQuery.Execute();
                foreach (CfgApplication values in CfgApplication_Query_Values)
                {
                    Console.WriteLine(values.Name);
                    var kvLog = values.Options["Log"];
                    if (kvLog != null)
                    {
                    }
                }

Another way to do the same…

CfgApplication app = configService.MyApplication;

And then, app.UserProperties (annex) , appOptions (options)

Regards!

Thanks PeteHoyle :slight_smile: with your code I got some idea how to do this .. :slight_smile:

Thanks Kubig and Daniel San for your responses.

Need a clarification here…this code would be for WDE, right? IConfigurationService?

Yes, just for WDE.

I have made the following code to read options from an app (URS option has URI and other values)
APP
|> URL1
|
>URI: http://www.yahoo.com
|__>q=123456



IConfService confService = ConfServiceFactory.CreateConfService(p);
            CfgApplicationQuery cfgapp = new CfgApplicationQuery(confService) { Name = "SampleAPP" };
            //var cfgApp_Values = cfgapp.Execute();


            //foreach (CfgApplication values in cfgApp_Values)
            //{
            //    Console.WriteLine(values.Name);
            //    writeToLogArea("Option values: " + values.Name);
            //}


            CfgApplication app = confService.RetrieveObject<CfgApplication>(cfgapp);




            KeyValueCollection kvp1 = new KeyValueCollection(app.Options);
            writeToLogArea("SampleAPP Options: " + kvp1.ToString());


            //kvp1.GetAsKeyValueCollection("URL1");


            foreach (DictionaryEntry x in kvp1)
            {
                if (x.Key.ToString().StartsWith("URL")) { 
                    writeToLogArea("URL Section >" + x.Key + ":" + x.Value);
                    KeyValueCollection values = new KeyValueCollection();
                    values = kvp1.GetAsKeyValueCollection(x.Key.ToString());
                    foreach(DictionaryEntry val in values)
                    {
                        writeToLogArea("URL Parameters > " + val.Key + ":" + val.Value);
                        if(val.Key.ToString().StartsWith("URI"))
                        writeToLogArea("URI for " + x.Key + " is " + val.Value.ToString());
                    }
                    
            }
            }

What do you think? Works for me but wondering if there is a more effective way?