Esempio n. 1
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="databasesNode">XML-node for the General.Databases settings</param>
        public DatabasesSettings(XmlNode databasesNode)
        {
            string  xpath;
            XmlNode node;

            _logger = log4net.LogManager.GetLogger(typeof(DatabasesSettings));

            _pxDatabases = new List <string>();
            xpath        = "./pxDatabases";
            node         = databasesNode.SelectSingleNode(xpath);
            xpath        = ".//database";
            _pxDatabases = SettingsHelper.GetSettingValue(xpath, node);


            _cnmmDatabases = new List <string>();
            xpath          = "./cnmmDatabases";
            node           = databasesNode.SelectSingleNode(xpath);
            xpath          = ".//database";
            _cnmmDatabases = SettingsHelper.GetSettingValue(xpath, node);
        }
Esempio n. 2
0
        /// <summary>
        /// Save Features settings to the settings file
        /// </summary>
        /// <param name="generalNode">XML-node for the Features settings</param>
        public void Save(XmlNode featuresNode)
        {
            string  xpath;
            XmlNode node;

            // Save Features.General settings
            xpath = "./general";
            node  = SettingsHelper.GetNode(featuresNode, xpath);
            _featuresGeneralSettings.Save(node);

            // Save Features.Charts settings
            xpath = "./charts";
            node  = SettingsHelper.GetNode(featuresNode, xpath);
            _chartsSettings.Save(node);

            // Save Features.Api settings
            xpath = "./api";
            node  = SettingsHelper.GetNode(featuresNode, xpath);
            _apiSettings.Save(node);

            // Save Features.Search settings
            xpath = "./search";
            node  = SettingsHelper.GetNode(featuresNode, xpath);
            _searchSettings.Save(node);

            // Save Features.BackgroundWorker settings
            xpath = "./backgroundWorker";
            node  = SettingsHelper.GetNode(featuresNode, xpath);
            _backgroundWorkerSettings.Save(node);
            // Save Features.BackgroundWorker settings
            xpath = "./backgroundWorker";
            node  = SettingsHelper.GetNode(featuresNode, xpath);
            _backgroundWorkerSettings.Save(node);

            //Save Features.SavedQuery settings
            xpath = "./savedQuery";
            node  = SettingsHelper.GetNode(featuresNode, xpath);
            _savedQuerySettings.Save(node);
        }
Esempio n. 3
0
        /// <summary>
        /// Save the Presentation.CommandBar settings to the settings file
        /// </summary>
        /// <param name="commandBarNode">XML-node for the Presentation.CommandBar settings</param>
        public void Save(XmlNode commandBarNode)
        {
            string xpath;

            xpath = "./viewMode";
            SettingsHelper.SetSettingValue(xpath, commandBarNode, ViewMode.ToString());

            xpath = "./operations";
            SettingsHelper.SetSettingValue(xpath, commandBarNode, "plugin", Operations);

            xpath = "./operationShortcuts";
            SettingsHelper.SetSettingValue(xpath, commandBarNode, "plugin", OperationShortcuts);

            xpath = "./outputFormats";
            SettingsHelper.SetSettingValue(xpath, commandBarNode, "outputFormat", OutputFormats);

            xpath = "./outputFormatShortcuts";
            SettingsHelper.SetSettingValue(xpath, commandBarNode, "outputFormat", OutputFormatShortcuts);

            xpath = "./presentationViews";
            SettingsHelper.SetSettingValue(xpath, commandBarNode, "plugin", PresentationViews);

            xpath = "./presentationViewShortcuts";
            SettingsHelper.SetSettingValue(xpath, commandBarNode, "plugin", PresentationViewShortcuts);

            xpath = "./commandBarShortcuts";
            SettingsHelper.SetSettingValue(xpath, commandBarNode, "plugin", CommandBarShortcuts);

            xpath = "./operationButtons";
            SettingsHelper.SetSettingValue(xpath, commandBarNode, "plugin", OperationButtons);

            xpath = "./fileTypeButtons";
            SettingsHelper.SetSettingValue(xpath, commandBarNode, "outputFormat", FileTypeButtons);

            xpath = "./presentationViewButtons";
            SettingsHelper.SetSettingValue(xpath, commandBarNode, "plugin", PresentationViewButtons);
        }
Esempio n. 4
0
        /// <summary>
        /// Save Features.Api settings to the settings file
        /// </summary>
        /// <param name="apiNode">XML-node for the Features.Api settings</param>
        public void Save(XmlNode apiNode)
        {
            string xpath;

            xpath = "./urlRoot";
            SettingsHelper.SetSettingValue(xpath, apiNode, UrlRoot);

            xpath = "./routePrefix";
            SettingsHelper.SetSettingValue(xpath, apiNode, RoutePrefix);

            xpath = "./maxValuesReturned";
            SettingsHelper.SetSettingValue(xpath, apiNode, MaxValuesReturned.ToString());

            xpath = "./limiterRequests";
            SettingsHelper.SetSettingValue(xpath, apiNode, LimiterRequests.ToString());

            xpath = "./limiterTimespan";
            SettingsHelper.SetSettingValue(xpath, apiNode, LimiterTimespan.ToString());

            xpath = "./fetchCellLimit";
            SettingsHelper.SetSettingValue(xpath, apiNode, FetchCellLimit.ToString());

            xpath = "./enableCORS";
            SettingsHelper.SetSettingValue(xpath, apiNode, EnableCORS.ToString());

            xpath = "./enableCache";
            SettingsHelper.SetSettingValue(xpath, apiNode, EnableCache.ToString());

            xpath = "./showQueryInformation";
            SettingsHelper.SetSettingValue(xpath, apiNode, ShowQueryInformation.ToString());

            xpath = "./infoURL";
            SettingsHelper.SetSettingValue(xpath, apiNode, InfoURL);

            xpath = "./defaultExampleResponseFormat";
            SettingsHelper.SetSettingValue(xpath, apiNode, DefaultExampleResponseFormat);
        }
Esempio n. 5
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="apiNode">XML-node for the API settings</param>
        public ApiSettings(XmlNode apiNode)
        {
            string xpath;

            xpath   = "./urlRoot";
            UrlRoot = SettingsHelper.GetSettingValue(xpath, apiNode, "");

            xpath       = "./routePrefix";
            RoutePrefix = SettingsHelper.GetSettingValue(xpath, apiNode, "api/v1/");

            xpath             = "./maxValuesReturned";
            MaxValuesReturned = SettingsHelper.GetSettingValue(xpath, apiNode, 1000);

            xpath           = "./limiterRequests";
            LimiterRequests = SettingsHelper.GetSettingValue(xpath, apiNode, 10);

            xpath           = "./limiterTimespan";
            LimiterTimespan = SettingsHelper.GetSettingValue(xpath, apiNode, 10);

            xpath          = "./fetchCellLimit";
            FetchCellLimit = SettingsHelper.GetSettingValue(xpath, apiNode, 100000);

            xpath      = "./enableCORS";
            EnableCORS = SettingsHelper.GetSettingValue(xpath, apiNode, true);

            xpath       = "./enableCache";
            EnableCache = SettingsHelper.GetSettingValue(xpath, apiNode, true);

            xpath = "./showQueryInformation";
            ShowQueryInformation = SettingsHelper.GetSettingValue(xpath, apiNode, true);

            xpath   = "./infoURL";
            InfoURL = SettingsHelper.GetSettingValue(xpath, apiNode, "");

            xpath = "./defaultExampleResponseFormat";
            DefaultExampleResponseFormat = SettingsHelper.GetSettingValue(xpath, apiNode, "px");
        }
Esempio n. 6
0
        /// <summary>
        /// Save the Presentation.Table settings to the settings file
        /// </summary>
        /// <param name="tableNode">XML-node for the Presentation.Table settings</param>
        public void Save(XmlNode tableNode)
        {
            string  xpath;
            XmlNode node;

            xpath = "./tableTransformation";
            SettingsHelper.SetSettingValue(xpath, tableNode, TableTransformation.ToString());

            xpath = "./defaultLayout";
            SettingsHelper.SetSettingValue(xpath, tableNode, DefaultLayout.ToString());

            xpath = "./maxColumns";
            SettingsHelper.SetSettingValue(xpath, tableNode, MaxColumns.ToString());

            xpath = "./maxRows";
            SettingsHelper.SetSettingValue(xpath, tableNode, MaxRows.ToString());

            xpath = "./titleVisible";
            SettingsHelper.SetSettingValue(xpath, tableNode, TitleVisible.ToString());

            xpath = "./attributes";
            node  = SettingsHelper.GetNode(tableNode, xpath);
            _attributeSettings.Save(node);
        }
Esempio n. 7
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="tableNode">XML-node for the Presentation.Table settings</param>
        public TableSettings(XmlNode tableNode)
        {
            string  xpath;
            XmlNode node;

            xpath = "./tableTransformation";
            TableTransformation = SettingsHelper.GetSettingValue(xpath, tableNode, PCAxis.Web.Controls.TableTransformationType.NoTransformation);

            xpath         = "./defaultLayout";
            DefaultLayout = SettingsHelper.GetSettingValue(xpath, tableNode, PCAxis.Web.Controls.TableLayoutType.Layout1);

            xpath      = "./maxColumns";
            MaxColumns = SettingsHelper.GetSettingValue(xpath, tableNode, 50);

            xpath   = "./maxRows";
            MaxRows = SettingsHelper.GetSettingValue(xpath, tableNode, 10000);

            xpath        = "./titleVisible";
            TitleVisible = SettingsHelper.GetSettingValue(xpath, tableNode, true);

            xpath = "./attributes";
            node  = SettingsHelper.GetNode(tableNode, xpath);
            _attributeSettings = new AttributeSettings(node);
        }
Esempio n. 8
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="selectionNode">XML-node for the Selection settings</param>
        public SelectionSettings(XmlNode selectionNode)
        {
            string  xpath;
            XmlNode node;

            xpath           = "./cellLimitScreen";
            CellLimitScreen = SettingsHelper.GetSettingValue(xpath, selectionNode, 10000);

            xpath             = "./showMandatoryMark";
            ShowMandatoryMark = SettingsHelper.GetSettingValue(xpath, selectionNode, true);

            xpath = "./showSelectionLimits";
            ShowSelectionLimits = SettingsHelper.GetSettingValue(xpath, selectionNode, true);

            xpath             = "./allowAggregations";
            AllowAggregations = SettingsHelper.GetSettingValue(xpath, selectionNode, true);

            xpath = "./hierarchies";
            node  = selectionNode.SelectSingleNode(xpath);
            _hierarchiesSettings = new HierarchiesSettings(node);

            xpath = "./markingTips";
            node  = selectionNode.SelectSingleNode(xpath);
            _markingTipsSettings = new MarkingTipsSettings(node);

            xpath = "./maxRowsWithoutSearch";
            MaxRowsWithoutSearch = SettingsHelper.GetSettingValue(xpath, selectionNode, 500);

            xpath = "./alwaysShowTimeVariableWithoutSearch";
            AlwaysShowTimeVariableWithoutSearch = SettingsHelper.GetSettingValue(xpath, selectionNode, false);

            xpath    = "./listSize";
            ListSize = SettingsHelper.GetSettingValue(xpath, selectionNode, 6);

            xpath = "./presentationViews";
            node  = SettingsHelper.GetNode(selectionNode, xpath);
            xpath = ".//plugin";
            _presentationViews = SettingsHelper.GetSettingValue(xpath, node);

            xpath          = "./outputFormats";
            node           = selectionNode.SelectSingleNode(xpath);
            xpath          = ".//outputFormat";
            _outputFormats = SettingsHelper.GetSettingValue(xpath, node);

            xpath = "./valuesetMustBeSelectedFirst";
            ValuesetMustBeSelectedFirst = SettingsHelper.GetSettingValue(xpath, selectionNode, false);

            xpath = "./showAllAvailableValuesSearchButton";
            ShowAllAvailableValuesSearchButton = SettingsHelper.GetSettingValue(xpath, selectionNode, false);

            xpath            = "./searchButtonMode";
            SearchButtonMode = SettingsHelper.GetSettingValue(xpath, selectionNode, PCAxis.Web.Controls.VariableSelectorSearchButtonViewMode.ManyValues);

            xpath         = "./titleFromMenu";
            TitleFromMenu = SettingsHelper.GetSettingValue(xpath, selectionNode, false);

            xpath = "./standardApplicationHeadTitle";
            StandardApplicationHeadTitle = SettingsHelper.GetSettingValue(xpath, selectionNode, false);

            xpath           = "./metadataAsLinks";
            MetadataAsLinks = SettingsHelper.GetSettingValue(xpath, selectionNode, true);

            xpath = "./selectValuesFromGroup";
            SelectValuesFromGroup = SettingsHelper.GetSettingValue(xpath, selectionNode, false);

            xpath = "./buttonsForContentVariable";
            ButtonsForContentVariable = SettingsHelper.GetSettingValue(xpath, selectionNode, false);

            xpath = "./searchValuesBeginningOfWordCheckBoxDefaultChecked";
            SearchValuesBeginningOfWordCheckBoxDefaultChecked = SettingsHelper.GetSettingValue(xpath, selectionNode, false);

            xpath = "./preSelectFirstContentAndTime";
            PreSelectFirstContentAndTime = SettingsHelper.GetSettingValue(xpath, selectionNode, false);
        }
Esempio n. 9
0
        /// <summary>
        /// Save the Selection settings to the settings file
        /// </summary>
        /// <param name="selectionNode">XML-node for the Selection settings</param>
        public void Save(XmlNode selectionNode)
        {
            string  xpath;
            XmlNode node;

            xpath = "./cellLimitScreen";
            SettingsHelper.SetSettingValue(xpath, selectionNode, CellLimitScreen.ToString());

            xpath = "./showMandatoryMark";
            SettingsHelper.SetSettingValue(xpath, selectionNode, ShowMandatoryMark.ToString());

            xpath = "./showSelectionLimits";
            SettingsHelper.SetSettingValue(xpath, selectionNode, ShowSelectionLimits.ToString());

            xpath = "./allowAggregations";
            SettingsHelper.SetSettingValue(xpath, selectionNode, AllowAggregations.ToString());

            xpath = "./hierarchies";
            node  = selectionNode.SelectSingleNode(xpath);
            _hierarchiesSettings.Save(node);

            xpath = "./markingTips";
            node  = selectionNode.SelectSingleNode(xpath);
            _markingTipsSettings.Save(node);

            xpath = "./maxRowsWithoutSearch";
            SettingsHelper.SetSettingValue(xpath, selectionNode, MaxRowsWithoutSearch.ToString());

            xpath = "./alwaysShowTimeVariableWithoutSearch";
            SettingsHelper.SetSettingValue(xpath, selectionNode, AlwaysShowTimeVariableWithoutSearch.ToString());

            xpath = "./listSize";
            SettingsHelper.SetSettingValue(xpath, selectionNode, ListSize.ToString());

            xpath = "./presentationViews";
            SettingsHelper.SetSettingValue(xpath, selectionNode, "plugin", PresentationViews);

            xpath = "./outputFormats";
            SettingsHelper.SetSettingValue(xpath, selectionNode, "outputFormat", OutputFormats);

            xpath = "./valuesetMustBeSelectedFirst";
            SettingsHelper.SetSettingValue(xpath, selectionNode, ValuesetMustBeSelectedFirst.ToString());

            xpath = "./showAllAvailableValuesSearchButton";
            SettingsHelper.SetSettingValue(xpath, selectionNode, ShowAllAvailableValuesSearchButton.ToString());

            xpath = "./searchButtonMode";
            SettingsHelper.SetSettingValue(xpath, selectionNode, SearchButtonMode.ToString());

            xpath = "./titleFromMenu";
            SettingsHelper.SetSettingValue(xpath, selectionNode, TitleFromMenu.ToString());

            xpath = "./standardApplicationHeadTitle";
            SettingsHelper.SetSettingValue(xpath, selectionNode, StandardApplicationHeadTitle.ToString());

            xpath = "./metadataAsLinks";
            SettingsHelper.SetSettingValue(xpath, selectionNode, MetadataAsLinks.ToString());

            xpath = "./selectValuesFromGroup";
            SettingsHelper.SetSettingValue(xpath, selectionNode, SelectValuesFromGroup.ToString());

            xpath = "./buttonsForContentVariable";
            SettingsHelper.SetSettingValue(xpath, selectionNode, ButtonsForContentVariable.ToString());

            xpath = "./searchValuesBeginningOfWordCheckBoxDefaultChecked";
            SettingsHelper.SetSettingValue(xpath, selectionNode, SearchValuesBeginningOfWordCheckBoxDefaultChecked.ToString());

            xpath = "./preSelectFirstContentAndTime";
            SettingsHelper.SetSettingValue(xpath, selectionNode, PreSelectFirstContentAndTime.ToString());
        }
Esempio n. 10
0
        /// <summary>
        /// Save the General.Global.ShowInformationTypes settings to the settings file
        /// </summary>
        /// <param name="infoNode">XML-node for the General.Global.ShowInformationTypes settings</param>
        public void Save(XmlNode infoNode)
        {
            string xpath;

            xpath = "./officialStatistics";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, OfficialStatistics.ToString());

            xpath = "./unit";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Unit.ToString());

            xpath = "./contact";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Contact.ToString());

            xpath = "./lastUpdated";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, LastUpdated.ToString());

            xpath = "./refPeriod";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, RefPeriod.ToString());

            xpath = "./stockFA";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, StockFa.ToString());

            xpath = "./cfPrices";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, CFPrices.ToString());

            xpath = "./dayADj";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, DayAdj.ToString());

            xpath = "./seasAdj";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, SeasAdj.ToString());

            xpath = "./basePeriod";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, BasePeriod.ToString());

            xpath = "./updateFrequency";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, UpdateFrequency.ToString());

            xpath = "./nextUpdate";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, NextUpdate.ToString());

            xpath = "./survey";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Survey.ToString());

            xpath = "./link";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Link.ToString());

            xpath = "./creationDate";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, CreationDate.ToString());

            xpath = "./copyright";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Copyright.ToString());

            xpath = "./source";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Source.ToString());

            xpath = "./matrix";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Matrix.ToString());

            xpath = "./database";
            SettingsHelper.SetSettingAttributeValue(xpath, "enabled", infoNode, Database.ToString());
        }
Esempio n. 11
0
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="infoNode">XML-node for the General.Global.ShowInformationTypes settings</param>
        public ShowInformationTypesSettings(XmlNode infoNode)
        {
            string xpath;

            //XmlNode node;

            xpath = "./officialStatistics";
            OfficialStatistics = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath = "./unit";
            Unit  = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath   = "./contact";
            Contact = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath       = "./lastUpdated";
            LastUpdated = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath     = "./refPeriod";
            RefPeriod = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath   = "./stockFA";
            StockFa = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath    = "./cfPrices";
            CFPrices = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath  = "./dayADj";
            DayAdj = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath   = "./seasAdj";
            SeasAdj = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath      = "./basePeriod";
            BasePeriod = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath           = "./updateFrequency";
            UpdateFrequency = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath      = "./nextUpdate";
            NextUpdate = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath  = "./survey";
            Survey = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath = "./link";
            Link  = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath        = "./creationDate";
            CreationDate = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath     = "./copyright";
            Copyright = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath  = "./source";
            Source = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath  = "./matrix";
            Matrix = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);

            xpath    = "./database";
            Database = SettingsHelper.GetSettingAttributeValue(xpath, "enabled", infoNode, true);
        }