Ejemplo n.º 1
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());
            }
        }
Ejemplo n.º 2
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());
            }
        }