Beispiel #1
0
        public string BuildListViewTitleFromFormula(ListView viewSettings, ReadEventSearchSettingsResponse searchSettings)
        {
            string formula = string.Empty;
            if (Parameters.ContainsKey("EventText"))
                formula = searchSettings.SearchResultsEventNamePageTitle;
            else if (Parameters.ContainsKey("Keyword"))
                formula = searchSettings.SearchResultsKeywordPageTitle;
            else if (Parameters.ContainsKey("EventTopicText"))
                formula = searchSettings.SearchResultsTopicPageTitle;
            else if (Parameters.ContainsKey("EventTypeText"))
                formula = searchSettings.SearchResultsTypePageTitle;
            else if (Parameters.ContainsKey("PostalCode"))
                formula = searchSettings.SearchResultsZipCodePageTitle;
            else
                formula = searchSettings.SearchResultsBasePageTitle;

            var title = formula
                .Replace("{" + EventSearchResultsToken.EventNameSearched.ToString() + "}", Parameters.ContainsKey("EventText") ? Parameters["EventText"] : string.Empty)
                .Replace("{" + EventSearchResultsToken.KeywordSearched.ToString() + "}", Parameters.ContainsKey("Keyword") ? Parameters["Keyword"] : string.Empty)
                .Replace("{" + EventSearchResultsToken.TopicSearched.ToString() + "}", Parameters.ContainsKey("EventTopicText") ? Parameters["EventTopicText"] : string.Empty)
                .Replace("{" + EventSearchResultsToken.TypeSearched.ToString() + "}", Parameters.ContainsKey("EventTypeText") ? Parameters["EventTypeText"] : string.Empty)
                .Replace("{" + EventSearchResultsToken.ZipCodeSearched.ToString() + "}", Parameters.ContainsKey("PostalCode") ? Parameters["PostalCode"] : string.Empty)
                .Replace("{" + EventSearchResultsToken.PageNum.ToString() + "}", (viewSettings.PageNumber == 0 ? 1 : viewSettings.PageNumber).ToString(CultureInfo.InvariantCulture));

            return ApplyCommonTitleFormatting(title, searchSettings.SeoTitleReplacementValues);
        }
Beispiel #2
0
        public string GetModelData(string settingsData, IDictionary<string, string> parameters, bool isConfigView)
        {
            //Create Or Deserialize View Data
            if (string.IsNullOrEmpty(settingsData))
                _viewSettings = new ListView();
            else
                _viewSettings = CommonUtils.JsonDeserialize<ListView>(settingsData);

            // Load settings
            _viewSettings.EnsureStandardSettings();
            EnsureSettings();

            // Establish base URL for the event detail page
            _baseDetailPageUrl = _viewSettings.GetSettingValue("DetailPageUrl", string.Empty);

            // Handle specific commands
            if (parameters.ContainsKey(Constants.SystemParameters.Command))
            {
                var result = HandleCommand(parameters);
                if (result != null)
                    return result;
            }

            // Build Admin or Public View
            if (isConfigView)
                BuildAdminView();
            else
            {
                BuildPublicView(parameters);
                _viewSettings.AvailableFields.Clear();
            }

            return CommonUtils.JsonSerializeMinimum(_viewSettings);
        }
        public string GetModelData(ModuleInstanceView view, string settingsData, IDictionary<string, string> parameters, bool isConfigView)
        {
            _view = view;

            //Create Or Deserialize View Data
            if (string.IsNullOrEmpty(settingsData))
                _viewSettings = new ListView();
            else
                _viewSettings = CommonUtils.JsonDeserialize<ListView>(settingsData);

            _viewSettings.EnsureStandardSettings();
            EnsureSettings();

            // Establish base URL for the services detail page
            _baseDetailPageUrl = _viewSettings.GetSettingValue("DetailPageUrl", string.Empty);

            //Build View Admin or Public View
            if (isConfigView)
                BuildAdminView();
            else
            {
                BuildPublicView(parameters);
                _viewSettings.AvailableFields.Clear();
            }

            return CommonUtils.JsonSerializeMinimum(_viewSettings);
        }
Beispiel #4
0
        public string BuildListViewTitleFromFormula(ListView viewSettings, ReadServicesSearchSettingsResponse searchSettings)
        {
            string formula = string.Empty;
            if (Parameters.ContainsKey("Keyword"))
                formula = searchSettings.SearchResultsKeywordTitleFormula;
            else if (Parameters.ContainsKey("PostalCode"))
                formula = searchSettings.SearchResultsZipCodeTitleFormula;
            else
                formula = searchSettings.SearchResultsBaseTitleFormula;

            var title = formula
                .Replace("{" + ServiceSearchResultsToken.KeywordSearched.ToString() + "}", Parameters.ContainsKey("Keyword") ? Parameters["Keyword"] : string.Empty)
                .Replace("{" + ServiceSearchResultsToken.ZipCodeSearched.ToString() + "}", Parameters.ContainsKey("PostalCode") ? Parameters["PostalCode"] : string.Empty)
                .Replace("{" + ServiceSearchResultsToken.PageNum.ToString() + "}", (viewSettings.PageNumber + 1).ToString(CultureInfo.InvariantCulture));

            return ApplyCommonTitleFormatting(title, searchSettings.SeoTitleReplacementValues);
        }
Beispiel #5
0
        public string BuildListViewTitleFromFormula(ListView viewSettings, ProviderSearchSettings searchSettings)
        {
            string formula = string.Empty;
            if (Parameters.ContainsKey("ProviderText"))
                formula = searchSettings.SearchResultsPageTitleNameFormula;
            else if (Parameters.ContainsKey("Keyword"))
                formula = searchSettings.SearchResultsPageTitleKeywordFormula;
            else if (Parameters.ContainsKey("SpecialtyText"))
                formula = searchSettings.SearchResultsPageTitleSpecialtyFormula;
            else
                formula = searchSettings.SearchResultsPageTitleBaseFormula;

            var title = formula
                .Replace("{" + ProviderSearchResultsToken.ProviderNameSearched.ToString() + "}", Parameters.ContainsKey("ProviderText") ? Parameters["ProviderText"] : string.Empty)
                .Replace("{" + ProviderSearchResultsToken.SpecialtySearched.ToString() + "}", Parameters.ContainsKey("SpecialtyText") ? Parameters["SpecialtyText"] : string.Empty)
                .Replace("{" + ProviderSearchResultsToken.KeywordSearched.ToString() + "}", Parameters.ContainsKey("Keyword") ? Parameters["Keyword"] : string.Empty)
                .Replace("{" + ProviderSearchResultsToken.PageNum.ToString() + "}", (viewSettings.PageNumber == 0 ? 1 : viewSettings.PageNumber).ToString(CultureInfo.InvariantCulture));

            return ApplyCommonTitleFormatting(title, searchSettings.SeoTitleReplacementValues);
        }
        public string GetModelData(ModuleInstanceView parent, string settingsData, IDictionary<string, string> parameters, bool isConfigView)
        {
            //Create Or Deserialize View Data
            if (string.IsNullOrEmpty(settingsData))
                _viewSettings = new ListView();
            else
                _viewSettings = CommonUtils.JsonDeserialize<ListView>(settingsData);

            _viewSettings.GetOrCreateSettingGroup(PublicModelConstants.BasicSettingsGroup).AddSetting(new Setting("DetailPageUrl", "Provider Search Results URL", SettingFieldType.Text));

            //Build View Admin or Public View
            if (isConfigView)
                BuildAdminView(parent);
            else
            {
                BuildPublicView(parent, parameters);
                _viewSettings.AvailableFields.Clear();
            }

            return CommonUtils.JsonSerializeMinimum(_viewSettings);
        }
Beispiel #7
0
        public string PopulateListViewSeoData(ListView viewSettings, string pageTitle)
        {
            var seoData = new List<KeyValuePair<object, object>>();

            //SEO Title
            if (viewSettings.GetBoolSettingValue(Constants.OverwriteSeoTitleSettingName, true))
            {
                if (!string.IsNullOrEmpty(pageTitle))
                {
                    viewSettings.SeoPageTitle = pageTitle;
                    seoData.Add(new KeyValuePair<object, object>("SeoPageTitle", pageTitle));
                }
            }

            return CommonUtils.JsonSerialize(seoData);
        }