예제 #1
0
        private void setConfiguration(string facadeName)
        {
            setDefaults();

            if (base.AllConfigs == null || base.AllConfigs.Count == 0)
            {
                return; // no config items present
            }

            if (!String.IsNullOrEmpty(facadeName) && base.AllConfigs.ContainsKey(facadeName))
            {
                _facadeConfiguration = new FacadeConfiguration(base.AllConfigs[facadeName]);
            }

            if (base.AllConfigs.ContainsKey(MdwsConfigConstants.MDWS_CONFIG_SECTION))
            {
                if (base.AllConfigs[MdwsConfigConstants.MDWS_CONFIG_SECTION].ContainsKey(MdwsConfigConstants.SESSIONS_LOG_LEVEL))
                {
                    try
                    {
                        _applicationSessionsLogLevel = (ApplicationSessionsLogLevel)Enum.Parse(typeof(ApplicationSessionsLogLevel),
                                                                                               base.AllConfigs[MdwsConfigConstants.MDWS_CONFIG_SECTION][MdwsConfigConstants.SESSIONS_LOG_LEVEL]);
                    }
                    catch (Exception) { }
                }
                if (base.AllConfigs[MdwsConfigConstants.MDWS_CONFIG_SECTION].ContainsKey(MdwsConfigConstants.SESSIONS_LOGGING))
                {
                    Boolean.TryParse(base.AllConfigs[MdwsConfigConstants.MDWS_CONFIG_SECTION][MdwsConfigConstants.SESSIONS_LOGGING],
                                     out _applicationSessionsLogging);
                }
            }
        }
예제 #2
0
        private void setDefaults()
        {
            _applicationSessionsLogging  = false;
            _applicationSessionsLogLevel = mdws.ApplicationSessionsLogLevel.info;
            _isProduction        = true;
            _facadeConfiguration = new FacadeConfiguration(null);

            if (base.AllConfigs == null || base.AllConfigs.Count == 0)
            {
                base.AllConfigs = new Dictionary <string, Dictionary <string, string> >();
            }
            if (!base.AllConfigs.ContainsKey(MdwsConfigConstants.MDWS_CONFIG_SECTION))
            {
                // MySession depends on these 3 config items - set to defaults
                Dictionary <string, string> mdwsConfigs = new Dictionary <string, string>();
                mdwsConfigs.Add(MdwsConfigConstants.DEFAULT_VISIT_METHOD, "NON-BSE CREDENTIALS");
                mdwsConfigs.Add(MdwsConfigConstants.EXCLUDE_SITE_200, "true");
                mdwsConfigs.Add(MdwsConfigConstants.DEFAULT_CONTEXT, "OR CPRS GUI CHART");
                base.AllConfigs.Add(MdwsConfigConstants.MDWS_CONFIG_SECTION, mdwsConfigs);
            }
        }
예제 #3
0
        private void setDefaults()
        {
            _applicationSessionsLogging = false;
            _applicationSessionsLogLevel = mdws.ApplicationSessionsLogLevel.info;
            _isProduction = true;
            _facadeConfiguration = new FacadeConfiguration(null);

            if (base.AllConfigs == null || base.AllConfigs.Count == 0)
            {
                base.AllConfigs = new Dictionary<string, Dictionary<string, string>>();
            }
            if (!base.AllConfigs.ContainsKey(MdwsConfigConstants.MDWS_CONFIG_SECTION))
            {
                // MySession depends on these 3 config items - set to defaults
                Dictionary<string, string> mdwsConfigs = new Dictionary<string, string>();
                mdwsConfigs.Add(MdwsConfigConstants.DEFAULT_VISIT_METHOD, "NON-BSE CREDENTIALS");
                mdwsConfigs.Add(MdwsConfigConstants.EXCLUDE_SITE_200, "true");
                mdwsConfigs.Add(MdwsConfigConstants.DEFAULT_CONTEXT, "OR CPRS GUI CHART");
                base.AllConfigs.Add(MdwsConfigConstants.MDWS_CONFIG_SECTION, mdwsConfigs);
            }
        }
예제 #4
0
        private void setConfiguration(string facadeName)
        {
            setDefaults();

            if (base.AllConfigs == null || base.AllConfigs.Count == 0)
            {
                return; // no config items present
            }

            if (!String.IsNullOrEmpty(facadeName) && base.AllConfigs.ContainsKey(facadeName))
            {
                _facadeConfiguration = new FacadeConfiguration(base.AllConfigs[facadeName]);
            }

            if (base.AllConfigs.ContainsKey(MdwsConfigConstants.MDWS_CONFIG_SECTION))
            {
                if (base.AllConfigs[MdwsConfigConstants.MDWS_CONFIG_SECTION].ContainsKey(MdwsConfigConstants.SESSIONS_LOG_LEVEL))
                {
                    try
                    {
                        _applicationSessionsLogLevel = (ApplicationSessionsLogLevel)Enum.Parse(typeof(ApplicationSessionsLogLevel),
                                                                                               base.AllConfigs[MdwsConfigConstants.MDWS_CONFIG_SECTION][MdwsConfigConstants.SESSIONS_LOG_LEVEL]);
                    }
                    catch (Exception) { }
                }
                if (base.AllConfigs[MdwsConfigConstants.MDWS_CONFIG_SECTION].ContainsKey(MdwsConfigConstants.SESSIONS_LOGGING))
                {
                    Boolean.TryParse(base.AllConfigs[MdwsConfigConstants.MDWS_CONFIG_SECTION][MdwsConfigConstants.SESSIONS_LOGGING],
                                     out _applicationSessionsLogging);
                }

                TimeSpan.TryParse(getString(MdwsConfigConstants.TIMEOUT, base.AllConfigs[MdwsConfigConstants.MDWS_CONFIG_SECTION]), out _timeout);
                Boolean.TryParse(getString(MdwsConfigConstants.CONNECTION_POOL_CONFIG_SECTION, base.AllConfigs[MdwsConfigConstants.MDWS_CONFIG_SECTION]), out _useConnectionPool);
            }
            if (base.AllConfigs.ContainsKey(MdwsConfigConstants.APP_PROXY_CONFIG_SECTION))
            {
                string name = getString(MdwsConfigConstants.APP_PROXY_NAME, base.AllConfigs[MdwsConfigConstants.APP_PROXY_CONFIG_SECTION]);
                _appProxy.UserName = getString(MdwsConfigConstants.APP_PROXY_USERNAME, base.AllConfigs[MdwsConfigConstants.APP_PROXY_CONFIG_SECTION]);
                _appProxy.Pwd      = getString(MdwsConfigConstants.APP_PROXY_PASSWORD, base.AllConfigs[MdwsConfigConstants.APP_PROXY_CONFIG_SECTION]);
                _appProxy.Uid      = getString(MdwsConfigConstants.APP_PROXY_UID, base.AllConfigs[MdwsConfigConstants.APP_PROXY_CONFIG_SECTION]);
                string feduid = getString(MdwsConfigConstants.APP_PROXY_FEDUID, base.AllConfigs[MdwsConfigConstants.APP_PROXY_CONFIG_SECTION]);
                _appProxy.Phone = getString(MdwsConfigConstants.APP_PROXY_PHONE, base.AllConfigs[MdwsConfigConstants.APP_PROXY_CONFIG_SECTION]);
                string permission = getString(MdwsConfigConstants.APP_PROXY_PERMISSION, base.AllConfigs[MdwsConfigConstants.APP_PROXY_CONFIG_SECTION]);
                string siteId     = getString(MdwsConfigConstants.APP_PROXY_SITE_ID, base.AllConfigs[MdwsConfigConstants.APP_PROXY_CONFIG_SECTION]);
                string siteName   = getString(MdwsConfigConstants.APP_PROXY_SITE_NAME, base.AllConfigs[MdwsConfigConstants.APP_PROXY_CONFIG_SECTION]);
                _appProxy.PermissionString = getString(MdwsConfigConstants.APP_PROXY_CRED_TYPE, base.AllConfigs[MdwsConfigConstants.APP_PROXY_CONFIG_SECTION]);
                if (!String.IsNullOrEmpty(name))
                {
                    _appProxy.Name = new PersonName(name);
                }
                if (SocSecNum.isValid(feduid))
                {
                    _appProxy.SSN = new SocSecNum(feduid);
                }
                if (!String.IsNullOrEmpty(permission))
                {
                    _appProxy.PrimaryPermission = new gov.va.medora.mdo.dao.vista.MenuOption(permission);
                }
                if (!String.IsNullOrEmpty(siteId))
                {
                    _appProxy.LogonSiteId = new SiteId(siteId, siteName);
                }
            }
        }
예제 #5
0
        private void setConfiguration(string facadeName)
        {
            setDefaults();

            if (base.AllConfigs == null || base.AllConfigs.Count == 0)
            {
                return; // no config items present
            }

            if (!String.IsNullOrEmpty(facadeName) && base.AllConfigs.ContainsKey(facadeName))
            {
                _facadeConfiguration = new FacadeConfiguration(base.AllConfigs[facadeName]);
            }

            if (base.AllConfigs.ContainsKey(MdwsConfigConstants.MDWS_CONFIG_SECTION))
            {
                if (base.AllConfigs[MdwsConfigConstants.MDWS_CONFIG_SECTION].ContainsKey(MdwsConfigConstants.SESSIONS_LOG_LEVEL))
                {
                    try
                    {
                        _applicationSessionsLogLevel = (ApplicationSessionsLogLevel)Enum.Parse(typeof(ApplicationSessionsLogLevel),
                            base.AllConfigs[MdwsConfigConstants.MDWS_CONFIG_SECTION][MdwsConfigConstants.SESSIONS_LOG_LEVEL]);
                    }
                    catch (Exception) { }
                }
                if (base.AllConfigs[MdwsConfigConstants.MDWS_CONFIG_SECTION].ContainsKey(MdwsConfigConstants.SESSIONS_LOGGING))
                {
                    Boolean.TryParse(base.AllConfigs[MdwsConfigConstants.MDWS_CONFIG_SECTION][MdwsConfigConstants.SESSIONS_LOGGING],
                        out _applicationSessionsLogging);
                }
            }
        }