예제 #1
0
        public static void Initialize(ISFDCListener subscirber, IAgentDetails agentDetails, IConfService confService)
        {
            try
            {
                _logger = Log.GenInstance();
                _logger.Info("Initialize: Reading Configuration and Initializing Properties......");
                AgentDetails  = agentDetails;
                ConfigService = confService;
                SFDCListener  = subscirber;
                ReadAdvancedSearchOptions();// Reading Advanced Search Configurations
                foreach (string sfdcObjectName in SFDCOptions.SFDCPopupPages)
                {
                    switch (sfdcObjectName)
                    {
                    case "lead":
                        ReadLeadConfigurations(sfdcObjectName);
                        break;

                    case "contact":
                        ReadContactConfigurations(sfdcObjectName);
                        break;

                    case "account":
                        ReadAccountConfigurations(sfdcObjectName);
                        break;

                    case "case":
                        ReadCaseConfigurations(sfdcObjectName);
                        break;

                    case "opportunity":
                        ReadOpportunityConfigurations(sfdcObjectName);
                        break;

                    case "useractivity":
                        _logger.Info("Initialize: Reading User Profile Level Activity Configuration and Initializing Properties......");
                        UserActivityConfigs = ReadConfiguration.GetInstance().ReadSFDCUtilityConfig(AgentDetails.MyApplication, AgentDetails.AgentGroups, AgentDetails.Person, sfdcObjectName);
                        break;

                    default:
                        if (sfdcObjectName.Contains("customobject"))
                        {
                            ReadCustomObjectConfigurations(sfdcObjectName);
                        }
                        break;
                    }
                }
                //Read  Profile Activity/ UserActivity
                ReadProfileActivityLog();
                if (!String.IsNullOrEmpty(CommonPopupObjects))
                {
                    CommonPopupObjects = CommonPopupObjects.Substring(0, CommonPopupObjects.Length - 1);
                }
            }
            catch (Exception generalException)
            {
                _logger.Error("Initialize: Error Occurred while Reading SFDC Object configurations : " + generalException.ToString());
            }
        }
예제 #2
0
        private static void ReadProfileActivityLog()
        {
            // Reading User Profile Level Activity Log
            if (IsVoiceEnabled)
            {
                _logger.Info("Reading Voice Options for the UserActivity(Task) object");
                if (UserActivityConfigs != null)
                {
                    UserActivityVoiceOptions = ReadProperties.GetInstance().GetSFDCUserActivityVoiceProperties(UserActivityConfigs, "useractivity");
                }

                KeyValueCollection voiceUserActivityLog = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "voice.useractivity");
                if (voiceUserActivityLog != null)
                {
                    VoiceActivityLogCollection.Add("useractivity", voiceUserActivityLog);
                }
                else
                {
                    _logger.Info("User Profile Level Activity Log Configuration not found for the Voice Channel");
                }
            }
            if (IsChatEnabled)
            {
                _logger.Info("Reading Chat Options for the UserActivity(Task) object");
                if (UserActivityConfigs != null)
                {
                    UserActivityChatOptions = ReadProperties.GetInstance().GetSFDCUserActivityChatProperties(UserActivityConfigs, "useractivity");
                }

                KeyValueCollection chatuseractivitylog = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "chat.useractivity");
                if (chatuseractivitylog != null)
                {
                    ChatActivityLogCollection.Add("useractivity", chatuseractivitylog);
                }
                else
                {
                    _logger.Info("User Profile Level Activity Log Configuration not found for the Chat Channel");
                }
            }
            if (IsEmailEnabled)
            {
                _logger.Info("Reading Email Options for the UserActivity(Task) object");
                if (UserActivityConfigs != null)
                {
                    UserActivityEmailOptions = ReadProperties.GetInstance().GetSFDCUserActivityEmailProperties(UserActivityConfigs, "useractivity");
                }

                KeyValueCollection emailuseractivitylog = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "email.useractivity");
                if (emailuseractivitylog != null)
                {
                    EmailActivityLogCollection.Add("useractivity", emailuseractivitylog);
                }
                else
                {
                    _logger.Info("User Profile Level Activity Log Configuration not found for the Email Channel");
                }
            }
        }
예제 #3
0
        private static void ReadOpportunityConfigurations(string sfdcObjectName)
        {
            try
            {
                _logger.Info("Initialize: Reading Opportunity Configuration and Initializing Properties......");
                CommonPopupObjects += "Opportunity,";
                OpportunityConfigs  = ReadConfiguration.GetInstance().ReadSFDCUtilityConfig(AgentDetails.MyApplication, AgentDetails.AgentGroups, AgentDetails.Person, sfdcObjectName);
                if (OpportunityConfigs != null)
                {
                    if (IsVoiceEnabled)
                    {
                        _logger.Info("Reading Voice Options for the Opportunity object");
                        VoiceNewRecordCollection.Add(sfdcObjectName, ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.NewRecordDataBusinessAttribute, "voice." + sfdcObjectName));
                        OpportunityVoiceOptions = ReadProperties.GetInstance().GetSFDCObjectVoiceProperties(OpportunityConfigs, sfdcObjectName);
                        ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "voice." + sfdcObjectName);
                        if (ConfigData != null)
                        {
                            VoiceActivityLogCollection.Add(sfdcObjectName, ConfigData);
                        }
                    }

                    if (IsChatEnabled)
                    {
                        _logger.Info("Reading Chat Options for the Opportunity object");
                        ChatNewRecordCollection.Add(sfdcObjectName, ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.NewRecordDataBusinessAttribute, "chat." + sfdcObjectName));
                        OpportunityChatOptions = ReadProperties.GetInstance().GetSFDCObjectChatProperties(OpportunityConfigs, sfdcObjectName);
                        ConfigData             = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "chat." + sfdcObjectName);
                        if (ConfigData != null)
                        {
                            ChatActivityLogCollection.Add(sfdcObjectName, ConfigData);
                        }
                    }

                    if (IsEmailEnabled)
                    {
                        _logger.Info("Reading Email Options for the Opportunity object");
                        EmailNewRecordCollection.Add(sfdcObjectName, ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.NewRecordDataBusinessAttribute, "email." + sfdcObjectName));
                        OpportunityEmailOptions = ReadProperties.GetInstance().GetSFDCObjectEmailProperties(OpportunityConfigs, sfdcObjectName);
                        ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "email." + sfdcObjectName);
                        if (ConfigData != null)
                        {
                            EmailActivityLogCollection.Add(sfdcObjectName, ConfigData);
                        }
                    }
                }
                else
                {
                    _logger.Info("Initialize: Opportunity Configuration Not Found.");
                }
            }
            catch (Exception generalException)
            {
                _logger.Error("Error occurred in ReadOpportunityConfigurations() method, Exception:" + generalException.ToString());
            }
        }
예제 #4
0
        public static void InitializeUtils(ISFDCListener _subscirber, IAgentDetails _agentDetails, IConfService _confService)
        {
            try
            {
                logger = Log.GenInstance();
                logger.Info("InitializeUtils : Reading Configuration and Initializing Properties......");
                AgentDetails  = _agentDetails;
                ConfigService = _confService;
                SFDCListener  = _subscirber;

                foreach (string sfdcObject in SFDCOptions.SFDCPopupPages)
                {
                    KeyValueCollection ConfigData = null;
                    if (sfdcObject == "lead")
                    {
                        CommonPopupObjects += "Lead,";
                        logger.Info("InitializeUtils : Reading SFDCLead Configuration and Initializing Properties......");
                        LeadConfigs = ReadConfiguration.GetInstance().ReadSFDCObjectConfig(_agentDetails.MyApplication, _agentDetails.AgentGroups, _agentDetails.Person, sfdcObject);
                        if (LeadConfigs != null)
                        {
                            LeadVoiceOptions = ReadProperties.GetInstance().GetSFDCObjectVoiceProperties(LeadConfigs, sfdcObject);
                            LeadChatOptions  = ReadProperties.GetInstance().GetSFDCObjectChatProperties(LeadConfigs, sfdcObject);

                            ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "voice." + sfdcObject);
                            if (ConfigData != null)
                            {
                                VoiceActivityLogCollection.Add(sfdcObject, ConfigData);
                            }

                            ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "chat." + sfdcObject);
                            if (ConfigData != null)
                            {
                                ChatActivityLogCollection.Add(sfdcObject, ConfigData);
                            }

                            LeadNewRecordConfigs = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.NewRecordDataBusinessAttribute, sfdcObject);
                        }
                        else
                        {
                            logger.Info("InitializeUtils : No Lead Configuration Found.");
                        }
                    }
                    else if (sfdcObject == "contact")
                    {
                        CommonPopupObjects += "Contact,";
                        logger.Info("InitializeUtils : Reading SFDCContact Configuration and Initializing Properties......");
                        ContactConfigs = ReadConfiguration.GetInstance().ReadSFDCObjectConfig(_agentDetails.MyApplication, _agentDetails.AgentGroups, _agentDetails.Person, sfdcObject);
                        if (ContactConfigs != null)
                        {
                            ContactVoiceOptions = ReadProperties.GetInstance().GetSFDCObjectVoiceProperties(ContactConfigs, sfdcObject);
                            ContactChatOptions  = ReadProperties.GetInstance().GetSFDCObjectChatProperties(ContactConfigs, sfdcObject);

                            ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "voice." + sfdcObject);
                            if (ConfigData != null)
                            {
                                VoiceActivityLogCollection.Add(sfdcObject, ConfigData);
                            }

                            ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "chat." + sfdcObject);
                            if (ConfigData != null)
                            {
                                ChatActivityLogCollection.Add(sfdcObject, ConfigData);
                            }

                            ContactNewRecordConfigs = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.NewRecordDataBusinessAttribute, sfdcObject);
                        }
                        else
                        {
                            logger.Info("InitializeUtils : No Contact Configuration Found.");
                        }
                    }
                    else if (sfdcObject == "account")
                    {
                        CommonPopupObjects += "Account,";
                        logger.Info("InitializeUtils : Reading SFDCAccount Configuration and Initializing Properties......");
                        AccountConfigs = ReadConfiguration.GetInstance().ReadSFDCObjectConfig(_agentDetails.MyApplication, _agentDetails.AgentGroups, _agentDetails.Person, sfdcObject);
                        if (AccountConfigs != null)
                        {
                            AccountVoiceOptions = ReadProperties.GetInstance().GetSFDCObjectVoiceProperties(AccountConfigs, sfdcObject);
                            AccountChatOptions  = ReadProperties.GetInstance().GetSFDCObjectChatProperties(AccountConfigs, sfdcObject);

                            AccountNewRecordConfigs = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.NewRecordDataBusinessAttribute, sfdcObject);

                            ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "voice." + sfdcObject);
                            if (ConfigData != null)
                            {
                                VoiceActivityLogCollection.Add(sfdcObject, ConfigData);
                            }

                            ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "chat." + sfdcObject);
                            if (ConfigData != null)
                            {
                                ChatActivityLogCollection.Add(sfdcObject, ConfigData);
                            }
                        }
                        else
                        {
                            logger.Info("InitializeUtils : No Account Configuration Found.");
                        }
                    }
                    else if (sfdcObject == "case")
                    {
                        CommonPopupObjects += "Case,";
                        logger.Info("InitializeUtils : Reading SFDCCase Configuration and Initializing Properties......");
                        CaseConfigs = ReadConfiguration.GetInstance().ReadSFDCObjectConfig(_agentDetails.MyApplication, _agentDetails.AgentGroups, _agentDetails.Person, sfdcObject);
                        if (CaseConfigs != null)
                        {
                            CaseVoiceOptions     = ReadProperties.GetInstance().GetSFDCObjectVoiceProperties(CaseConfigs, sfdcObject);
                            CaseChatOptions      = ReadProperties.GetInstance().GetSFDCObjectChatProperties(CaseConfigs, sfdcObject);
                            CaseNewRecordConfigs = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.NewRecordDataBusinessAttribute, sfdcObject);

                            ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "voice." + sfdcObject);
                            if (ConfigData != null)
                            {
                                VoiceActivityLogCollection.Add(sfdcObject, ConfigData);
                            }

                            ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "chat." + sfdcObject);
                            if (ConfigData != null)
                            {
                                ChatActivityLogCollection.Add(sfdcObject, ConfigData);
                            }
                        }
                        else
                        {
                            logger.Info("InitializeUtils : No Case Configuration Found.");
                        }
                    }
                    else if (sfdcObject == "opportunity")
                    {
                        CommonPopupObjects += "Opportunity,";
                        logger.Info("InitializeUtils : Reading SFDCOpportunity Configuration and Initializing Properties......");
                        OpportunityConfigs = ReadConfiguration.GetInstance().ReadSFDCObjectConfig(_agentDetails.MyApplication, _agentDetails.AgentGroups, _agentDetails.Person, sfdcObject);
                        if (OpportunityConfigs != null)
                        {
                            OpportunityVoiceOptions     = ReadProperties.GetInstance().GetSFDCObjectVoiceProperties(OpportunityConfigs, sfdcObject);
                            OpportunityChatOptions      = ReadProperties.GetInstance().GetSFDCObjectChatProperties(OpportunityConfigs, sfdcObject);
                            OpportunityNewRecordConfigs = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.NewRecordDataBusinessAttribute, sfdcObject);

                            ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "voice." + sfdcObject);
                            if (ConfigData != null)
                            {
                                VoiceActivityLogCollection.Add(sfdcObject, ConfigData);
                            }

                            ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "chat." + sfdcObject);
                            if (ConfigData != null)
                            {
                                ChatActivityLogCollection.Add(sfdcObject, ConfigData);
                            }
                        }
                        else
                        {
                            logger.Info("InitializeUtils : No Opportunity Configuration Found.");
                        }
                    }
                    else if (sfdcObject.Contains("customobject"))
                    {
                        logger.Info("InitializeUtils : Reading SFDCCustomObject Configuration and Initializing Properties......");
                        logger.Info("InitializeUtils : Object Name : " + sfdcObject);
                        KeyValueCollection customConfig = ReadConfiguration.GetInstance().ReadSFDCObjectConfig(_agentDetails.MyApplication, _agentDetails.AgentGroups, _agentDetails.Person, sfdcObject);
                        if (customConfig != null)
                        {
                            CustomObjectConfigs.Add(sfdcObject, customConfig);
                            VoiceOptions voiceOptions = ReadProperties.GetInstance().GetSFDCObjectVoiceProperties(customConfig, sfdcObject);
                            if (voiceOptions != null)
                            {
                                if (voiceOptions.ObjectName != null)
                                {
                                    CommonPopupObjects += voiceOptions.ObjectName + ",";
                                    CustomObjectNames.Add(voiceOptions.ObjectName, sfdcObject);
                                }
                                CustomObjectVoiceOptions.Add(sfdcObject, voiceOptions);
                            }
                            ChatOptions chatOptions = ReadProperties.GetInstance().GetSFDCObjectChatProperties(customConfig, sfdcObject);
                            if (chatOptions != null)
                            {
                                CustomObjectChatOptions.Add(sfdcObject, chatOptions);
                            }
                            CustomObjectNewRecordConfigs.Add(sfdcObject, ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.NewRecordDataBusinessAttribute, sfdcObject));

                            ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "voice." + sfdcObject);
                            if (ConfigData != null)
                            {
                                VoiceActivityLogCollection.Add(sfdcObject, ConfigData);
                            }

                            ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "chat." + sfdcObject);
                            if (ConfigData != null)
                            {
                                ChatActivityLogCollection.Add(sfdcObject, ConfigData);
                            }
                        }
                        else
                        {
                            logger.Info("InitializeUtils : No Configuration Found for the CustomObject : " + sfdcObject);
                        }
                    }
                    else if (sfdcObject == "useractivity")
                    {
                        logger.Info("InitializeUtils : Reading SFDCUserActivity Configuration and Initializing Properties......");
                        UserActivityConfigs = ReadConfiguration.GetInstance().ReadSFDCObjectConfig(_agentDetails.MyApplication, _agentDetails.AgentGroups, _agentDetails.Person, sfdcObject);
                        if (UserActivityConfigs != null)
                        {
                            UserActivityVoiceOptions = ReadProperties.GetInstance().GetSFDCUserActivityVoiceProperties(UserActivityConfigs, sfdcObject);
                            KeyValueCollection voiceUserActivityLog = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "voice." + sfdcObject);
                            if (voiceUserActivityLog != null)
                            {
                                VoiceActivityLogCollection.Add(sfdcObject, voiceUserActivityLog);
                            }
                            UserActivityChatOptions = ReadProperties.GetInstance().GetSFDCUserActivityChatProperties(UserActivityConfigs, sfdcObject);
                            KeyValueCollection chatuseractivitylog = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "chat." + sfdcObject);
                            if (chatuseractivitylog != null)
                            {
                                ChatActivityLogCollection.Add(sfdcObject, chatuseractivitylog);
                            }
                        }
                        else
                        {
                            logger.Info("InitializeUtils : No SFDCUserActivity Configuration Found.");
                        }
                    }
                }
                if (!String.IsNullOrEmpty(CommonPopupObjects))
                {
                    CommonPopupObjects = CommonPopupObjects.Substring(0, CommonPopupObjects.Length - 1);
                }
                if (SFDCOptions.CanUseCommonSearchData)
                {
                    //Read business attribute for Profile level activity
                    if (!string.IsNullOrWhiteSpace(SFDCOptions.ProfileActivityBusinessAttributeName))
                    {
                        ProfileLevelActivity = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, _agentDetails.Person.Tenant.DBID, SFDCOptions.ProfileActivityBusinessAttributeName, "voice.useractivity");
                    }
                    else
                    {
                        logger.Info("ProfileLevel Activity Log Creation is not configured");
                    }
                }
            }
            catch (Exception generalException)
            {
                logger.Error("InitializeUtils : Error Occurred while Reading SFDC Object configurations : " + generalException.ToString());
            }
        }
        /// <summary>
        /// Initialize SFDC Adapter
        /// </summary>
        /// <param name="agentDetails">Agent Details</param>
        /// <param name="tServer">T-Server Protocol</param>
        /// <param name="configProtocol">Config Server Protocol</param>
        private void InitializeSFDCIntegration(ISFDCListener subscirber, IAgentDetails agentDetails, IConfService confService)
        {
            try
            {
                _logger.Info("InitializeSFDCIntegration : Initializing Common Properties for SFDC Popup");

                Settings.GeneralConfigs = ReadConfiguration.GetInstance().ReadGeneralConfigurations(agentDetails.MyApplication, agentDetails.AgentGroups, agentDetails.Person);

                if (Settings.GeneralConfigs != null)
                {
                    Settings.SFDCOptions = Pointel.Salesforce.Adapter.Configurations.ReadProperties.GetInstance().GetSFDCGeneralProperties(Settings.GeneralConfigs);
                    if (Settings.SFDCOptions != null)
                    {
                        if (Settings.SFDCOptions.EnableSFDCIntegration)
                        {
                            // Initializing Common Properties in Settings
                            Settings.Initialize(subscirber, agentDetails, confService);

                            //Start SFDC Server
                            if (Settings.SFDCOptions.SFDCPopupChannels != null && Settings.SFDCOptions.SFDCConnectPort != 0)
                            {
                                SFDCHttpServer.GetInstance().StartListener(Environment.CurrentDirectory + @"\Files", Settings.SFDCOptions.SFDCConnectPort);
                                if (Settings.IsVoiceEnabled)
                                {
                                    _voicePopup = new VoiceEventHandler();
                                }
                                if (Settings.IsChatEnabled)
                                {
                                    _chatPopup = new ChatEventHandler();
                                }
                                if (Settings.IsEmailEnabled)
                                {
                                    _emailPopup = new EmailEventHandler();
                                }
                                //PopupBrowser
                                if (Settings.SFDCOptions.SFDCPopupContainer != null)
                                {
                                    if (Settings.SFDCOptions.SFDCPopupContainer.Equals("browser"))
                                    {
                                        if (Settings.SFDCOptions.SFDCLoginURL != null)
                                        {
                                            this._logger.Info("Lauching SFDC URL : " + PopupURL(Settings.SFDCOptions.SFDCLoginURL, Settings.SFDCOptions.SFDCPopupBrowserName,
                                                                                                Settings.SFDCOptions.EnableAddressbar, Settings.SFDCOptions.EnableStatusbar));
                                        }
                                        else
                                        {
                                            this._logger.Info("SFDC Login URL is null. ");
                                        }
                                    }
                                    else
                                    {
                                        Settings.SFDCListener.ReceiveSFDCWindow(new SFDCPopupWindow(Settings.SFDCOptions.SFDCLoginURL));
                                    }
                                }
                                else
                                {
                                    this._logger.Info("SFDC Popup Container is null. ");
                                }
                                if (!Settings.SFDCListener.IsSFDCConnected && Settings.SFDCOptions.AlertSFDCConnectionStatus)
                                {
                                    Settings.SFDCListener.SFDCConnectionStatus(LogMode.Error, Settings.SFDCOptions.SFDCConnectionFailureMessage);
                                }
                            }
                            else
                            {
                                this._logger.Info("SFDC Popup Aborted, because either popup channel or port number is empty ");
                                this._logger.Info("SFDC Popup Channels : " + Settings.SFDCOptions.SFDCPopupChannels);
                                this._logger.Info("SFDC Port Number : " + Settings.SFDCOptions.SFDCConnectPort);
                            }
                        }
                        else
                        {
                            _logger.Info("InitializeSFDCIntegration : SFDC Integration Disabled");
                        }
                    }
                    else
                    {
                        _logger.Info("InitializeSFDCIntegration : SFDC General Config object is null...");
                    }
                }
                else
                {
                    _logger.Info("InitializeSFDCIntegration : SFDC popup can not be started because SFDC General Configuration has is found.");
                }
            }
            catch (Exception generalException)
            {
                _logger.Error("InitializeSFDCIntegration : Error Occurred while start SFDC Popup " + generalException.ToString());
            }
        }
예제 #6
0
        private static void ReadCustomObjectConfigurations(string sfdcObjectName)
        {
            try
            {
                _logger.Info("Initialize: Reading CustomObject Configuration and Initializing Properties......");
                _logger.Info("Initialize: Object Name : " + sfdcObjectName);
                KeyValueCollection customConfig = ReadConfiguration.GetInstance().ReadSFDCUtilityConfig(AgentDetails.MyApplication, AgentDetails.AgentGroups, AgentDetails.Person, sfdcObjectName);
                if (customConfig != null)
                {
                    CustomObjectConfigs.Add(sfdcObjectName, customConfig);
                    if (IsVoiceEnabled)
                    {
                        _logger.Info("Reading Voice Options for the " + sfdcObjectName + " object");
                        VoiceNewRecordCollection.Add(sfdcObjectName, ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.NewRecordDataBusinessAttribute, "voice." + sfdcObjectName));
                        VoiceOptions voiceOptions = ReadProperties.GetInstance().GetSFDCObjectVoiceProperties(customConfig, sfdcObjectName);
                        if (voiceOptions != null)
                        {
                            if (voiceOptions.ObjectName != null && !CustomObjectNames.ContainsKey(voiceOptions.ObjectName + ","))
                            {
                                CommonPopupObjects += voiceOptions.ObjectName + ",";
                                CustomObjectNames.Add(voiceOptions.ObjectName, sfdcObjectName);
                            }
                            CustomObjectVoiceOptions.Add(sfdcObjectName, voiceOptions);
                        }
                        ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "voice." + sfdcObjectName);
                        if (ConfigData != null)
                        {
                            VoiceActivityLogCollection.Add(sfdcObjectName, ConfigData);
                        }
                    }

                    if (IsChatEnabled)
                    {
                        _logger.Info("Reading Chat Options for the " + sfdcObjectName + " object");
                        ChatNewRecordCollection.Add(sfdcObjectName, ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.NewRecordDataBusinessAttribute, "chat." + sfdcObjectName));
                        ChatOptions chatOptions = ReadProperties.GetInstance().GetSFDCObjectChatProperties(customConfig, sfdcObjectName);
                        if (chatOptions != null)
                        {
                            if (chatOptions.ObjectName != null && !CustomObjectNames.ContainsKey(chatOptions.ObjectName + ","))
                            {
                                CommonPopupObjects += chatOptions.ObjectName + ",";
                                CustomObjectNames.Add(chatOptions.ObjectName, sfdcObjectName);
                            }
                            CustomObjectChatOptions.Add(sfdcObjectName, chatOptions);
                        }
                        ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "chat." + sfdcObjectName);
                        if (ConfigData != null)
                        {
                            ChatActivityLogCollection.Add(sfdcObjectName, ConfigData);
                        }
                    }

                    if (IsEmailEnabled)
                    {
                        _logger.Info("Reading Email Options for the " + sfdcObjectName + " object");
                        EmailOptions emailOptions = ReadProperties.GetInstance().GetSFDCObjectEmailProperties(customConfig, sfdcObjectName);
                        if (emailOptions != null)
                        {
                            if (emailOptions.ObjectName != null && !CustomObjectNames.ContainsKey(emailOptions.ObjectName + ","))
                            {
                                CommonPopupObjects += emailOptions.ObjectName + ",";
                                CustomObjectNames.Add(emailOptions.ObjectName, sfdcObjectName);
                            }
                            CustomObjectEmailOptions.Add(sfdcObjectName, emailOptions);
                        }
                        EmailNewRecordCollection.Add(sfdcObjectName, ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.NewRecordDataBusinessAttribute, "email." + sfdcObjectName));
                        ConfigData = ReadConfiguration.GetInstance().ReadBusinessAttribuiteConfig(ConfigService, AgentDetails.Person.Tenant.DBID, SFDCOptions.ActivityLogBusinessAttribute, "email." + sfdcObjectName);
                        if (ConfigData != null)
                        {
                            EmailActivityLogCollection.Add(sfdcObjectName, ConfigData);
                        }
                    }
                }
                else
                {
                    _logger.Info("Initialize: CustomObject Configuration Not Found.");
                }
            }
            catch (Exception generalException)
            {
                _logger.Error("Error occurred in CustomObjectConfigurations() method, Exception:" + generalException.ToString());
            }
        }