Author Topic: Accessing CME via ActiveX  (Read 17195 times)

Offline dbudi

  • Newbie
  • *
  • Posts: 9
  • Karma: 0
Re: Accessing CME via ActiveX
« Reply #15 on: September 07, 2007, 01:43:01 AM »
Hi Paul,

Your contribution is very useful for us here. Thanks for sharing your knowledge here in this forum.
I am sure it will benefit many of us programming some app to use with Genesys.
Victor is right, you are genius  :)


dbudi

Offline René

  • Administrator
  • Hero Member
  • *****
  • Posts: 1832
  • Karma: 62
Re: Accessing CME via ActiveX
« Reply #16 on: September 07, 2007, 06:42:02 AM »
Hi all,

I definitely don't want to decrease genius of Paul but described way of configuration's modification is very discussable from legal perspective. If you check license agreement between Genesys and Customer or Genesys and Partner (VAR) you find that such usage of provided software is not allowed by the license. So be very careful and check with your legal department twice before using that solution...

René

Offline victor

  • Administrator
  • Hero Member
  • *****
  • Posts: 1416
  • Karma: 18
Re: Accessing CME via ActiveX
« Reply #17 on: September 12, 2007, 12:06:55 PM »
René,

I think I have to side with you. I am not sure if this is ok or not, but I would err on a side of caution and would think twice about using it inside a full-blown project. It is interesting though :P

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Accessing CME via ActiveX
« Reply #18 on: October 01, 2007, 05:27:59 PM »
Hi guys,
Do you know anyway i can get the Action Codes folder content directly from ActiveX without connecting to the DB of Genesys?

Offline cavagnaro

  • Administrator
  • Hero Member
  • *****
  • Posts: 7639
  • Karma: 56330
Re: Accessing CME via ActiveX
« Reply #19 on: October 07, 2007, 07:58:28 PM »
Nobody? Any other options maybe?

Offline Jiggolo

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Accessing CME via ActiveX
« Reply #20 on: October 18, 2007, 03:51:32 AM »
Hi guys

    Thank you for your sample. Now I can create DN,Add Skill, Add DN Group
but I cannot create section on each DN and add key value on section. I ever
use this function
COMKVLISTLib.IKVList sections = (COMKVLISTLib.IKVList) objectToChange[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgApplication_options];

for create section or key value on Apllication. But for DN I have no idea about it. Please teach me about this. ???

Best regrads,
Jiggolo
« Last Edit: October 18, 2007, 03:30:07 PM by victor »

Offline Jiggolo

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Accessing CME via ActiveX
« Reply #21 on: October 31, 2007, 10:47:06 AM »
Hi Guys

    I found solution for create new section and option value on DN object ("Annex Option").  For this code I load section data and option value from dataset then add this section into DN object.

[code]                            MATool.ConnectToServer(server);
                            COMCFGMGRLib.ICfgQuery query = server.CreateQuery();
                            query.ObjectType = COMCFGMGRLib.enum_COMCfgObjectType.COMCFGDN;
                            object value;
                            value = txtDN.Text.Trim();
                            query.AddFilterValue(_CfgFilterType.FILTER_DN_NUMBER, ref value);
                            query.Execute(1, 0);
                            if (query.Count > 0)
                            {
                                ICfgObject objectToChange = (COMCFGMGRLib.ICfgObject)query[1];
                                COMKVLISTLib.IKVList sections = (COMKVLISTLib.IKVList)objectToChange[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgDN_userProperties];
                                for (int i = 0; i < ds.Tables[0].Rows.Count; i++)
                                {
                                    COMKVLISTLib.IKVPair p = sections.CreatePair(TKVType.KVTypeList);
                                    p.Key = ds.Tables[0].Rows[i].ItemArray[1].ToString();
                                    DataView dv = new DataView();
                                    dv = ds.Tables[1].DefaultView;
                                    dv.RowFilter = "secId='" + ds.Tables[0].Rows[i].ItemArray[0].ToString() + "'";
                                    if (dv.Count > 0)
                                    {
                                        for (int k = 0; k < dv.Count; k++)
                                        {
                                            object pvalue;
                                            pvalue = dv[k][2];
                                            p.ListValue.AddValue(dv[k][1].ToString(), pvalue);
                                        }
                                    }
                                    sections.AddPair(p);
                                }
                                objectToChange[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgDN_userProperties] = sections;

                                objectToChange.Update();
                            }
                            server.Disconnect();[/code]

If you have any suggestion. Please tell me.
Thank you.

Offline Jiggolo

  • Newbie
  • *
  • Posts: 5
  • Karma: 0
Re: Accessing CME via ActiveX
« Reply #22 on: November 29, 2007, 10:44:08 AM »
                After I developed many solution on CME active X I found a problem about folder creating. I cannot create any folder under parent folder . Please suggest me.  :o

Offline dneisler

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Accessing CME via ActiveX
« Reply #23 on: February 02, 2012, 04:48:15 PM »
Anyone successfully get a Add Person/Agent process going? I can add a person but I am stuck on addking skills and login ID's to them. Any help would be great.

[code]
        Dim server As New COMCFGMGRLib.COMCfgManager
        server.Connect("MyHost", "2020", COMCFGMGRLib._CfgAppType.CFGSCE, "default", "default", "password")

        'Create Person
        Dim NewEmp As COMCFGMGRLib.ICfgObject = server.CreateObject(COMCFGMGRLib.enum_COMCfgObjectType.COMCFGPerson)
        NewEmp(COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_firstName) = "Test"
        NewEmp(COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_lastName) = "User"
        NewEmp(COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_employeeID) = "1234"
        NewEmp(COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_userName) = "4321"
        NewEmp(COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_password) = "123456789"

        'Define Agent Skills
        Dim agSkills As COMCFGMGRLib.ICfgObject = server.CreateObject(COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_agentInfo_skillLevels)
        Dim Skill As COMCFGMGRLib.ICfgObject = server.CreateObject(COMCFGMGRLib.enum_COMCfgObjectType.CFGLINKSkillLevel)
        Skill(COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgSkillLevel_level) = 2
        Skill(COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgSkillLevel_skillDBID) = 133
        Skill.Create(server)
        agSkills.

        'Add Skills to agent
        NewEmp(COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_agentInfo_skillLevels) = agSkills

        NewEmp.Create(server)

        server.Disconnect()
        MsgBox("User Added!")
[/code]

Offline dneisler

  • Newbie
  • *
  • Posts: 4
  • Karma: 0
Re: Accessing CME via ActiveX
« Reply #24 on: February 02, 2012, 09:45:44 PM »
Ok I made it further. I can now add a agent as long as I know the DBID of the LoginID I am assiging to them. I have to figure out how to get that information now and this will be complete.

            //Connect to Config Server
            COMCFGMGRLib.COMCfgManager server = new COMCFGMGRLib.COMCfgManager();
            server.Connect("myserver", "8888", COMCFGMGRLib._CfgAppType.CFGSCE, "default", "default", "password");

            //Create New Person/Agent
            COMCFGMGRLib.ICfgObject Emp = server.CreateObject(COMCFGMGRLib.enum_COMCfgObjectType.COMCFGPerson);
            Emp[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_firstName] = "Test";
            Emp[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_lastName] = "Test";
            Emp[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_userName] = "1234";
            Emp[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_employeeID] = "4321";
            Emp[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_password] = "0123456789";

            //Create Skill to Assign
            COMCFGMGRLib.ICfgObject skill = server.CreateObject(COMCFGMGRLib.enum_COMCfgObjectType.CFGLINKSkillLevel);
            skill[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgSkillLevel_level] = 2;
            skill[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgSkillLevel_skillDBID] = 133;
            skill.Create(server);

            //Create Skills Object
            COMCFGMGRLib.ICfgFolder agSkills = (COMCFGMGRLib.ICfgFolder)Emp[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_agentInfo_skillLevels];
            agSkills.Add(skill);

            //Attach Skills to Person
            Emp[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_agentInfo_skillLevels] = agSkills;
                       
            //Create LoginID to assign
            COMCFGMGRLib.ICfgObject LoginID = server.CreateObject(COMCFGMGRLib.enum_COMCfgObjectType.CFGLINKAgentLoginInfo);
            LoginID[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgAgentLogin_DBID] = 104;
            LoginID.Create(server);
           
            //Create LoginIDs Object
            COMCFGMGRLib.ICfgFolder agLoginIDs = (COMCFGMGRLib.ICfgFolder)Emp[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_agentInfo_agentLogins];
            agLoginIDs.Add(LoginID);

            //Attach LoginIDs to Person
            Emp[COMCFGMGRLib.enum_CFG_PropertyID.PID_CfgPerson_agentInfo_agentLogins] = agLoginIDs;

            //Add New Person
            Emp.Create(server);

            //Disconnect from ConfigServer
            server.Disconnect();
            MessageBox.Show("Employee Created!");