// bvpage is present here to have back compatability support if some sites private Uri c2013Uri() { BVContentType contentType = null; BVSubjectType subjectType = null; String subjectId = null; NameValueCollection parameters = HttpUtility.ParseQueryString(_queryString, Encoding.UTF8); for (int i = 0; i < parameters.Count; i++) { if (parameters.Keys[i] != null && parameters.Keys[i].Equals(BV_PAGE)) { string[] tokens = parameters[parameters.Keys[i]].Split('/'); foreach (string token in tokens) { if (token.StartsWith("pg") && !IsValidPageNumber(bvParameters.PageNumber)) { bvParameters.PageNumber = getValue(token); } else if (token.StartsWith("ct")) { contentType = new BVContentType(BVContentType.ctFromKeyWord(getValue(token))); } else if (token.StartsWith("st")) { subjectType = new BVSubjectType(BVSubjectType.subjectType(getValue(token))); } else if (token.StartsWith("id")) { subjectId = getValue(token); } } } } contentType = (contentType == null) ? bvParameters.ContentType : contentType; subjectType = (subjectType == null) ? bvParameters.SubjectType : subjectType; subjectId = (String.IsNullOrEmpty(subjectId)) ? bvParameters.SubjectId : subjectId; if (!IsValidPageNumber(bvParameters.PageNumber)) { bvParameters.PageNumber = NUM_ONE_STR; } String path = getPath(contentType, subjectType, bvParameters.PageNumber, subjectId, bvParameters.ContentSubType); if (isContentFromFile()) { return(fileUri(path)); } return(httpUri(path)); }
private void loadData( String currentUrl, String contentType, int index, HtmlGenericControl reviewSummaryControl, HtmlGenericControl reviewControl, HtmlGenericControl contentControl ) { String cloudKey = Request.QueryString["cloudkey" + index]; String staging = Request.QueryString["staging" + index]; String testing = Request.QueryString["testing" + index]; String rootFolder = Request.QueryString["site" + index]; String subjectType = Request.QueryString["subjecttype" + index]; String subjectId = Request.QueryString["subjectid" + index]; if (subjectType != null) { subjectType = BVSubjectType.subjectType(subjectType); } // Separate defaulting Logic for spotlight vs non-spotlight content if (contentType.Equals(BVContentType.SPOTLIGHTS, StringComparison.OrdinalIgnoreCase)) { if (subjectId == null) { subjectId = "category-1"; } if (cloudKey == null) { cloudKey = "spotlight-four-746e2fc1211dc8964560350c9f28b67a"; } if (staging == null) { staging = "false"; } if (testing == null) { testing = "true"; } if (rootFolder == null) { rootFolder = "Main_Site-en_US"; } if (subjectType == null) { subjectType = BVSubjectType.CATEGORY; } } else if (contentType.Equals(BVContentType.REVIEWS, StringComparison.OrdinalIgnoreCase)) { if (subjectId == null) { subjectId = "product1"; } if (cloudKey == null) { cloudKey = "spotlight-five-311f5a3337b8d5e0d817adb7af279b0a"; } if (staging == null) { staging = "true"; } if (testing == null) { testing = "false"; } if (rootFolder == null) { rootFolder = "Other_Zone-en_US"; } if (subjectType == null) { subjectType = BVSubjectType.PRODUCT; } } else if (contentType.Equals(BVContentType.QUESTIONS, StringComparison.OrdinalIgnoreCase)) { if (subjectId == null) { subjectId = "data-gen-u2y505e9u1l65i43l6zz22ve6"; } if (cloudKey == null) { cloudKey = "agileville-78B2EF7DE83644CAB5F8C72F2D8C8491"; } if (staging == null) { staging = "true"; } if (testing == null) { testing = "false"; } if (rootFolder == null) { rootFolder = "Main_Site-en_US"; } if (subjectType == null) { subjectType = BVSubjectType.PRODUCT; } } else { if (subjectId == null) { subjectId = "test1"; } if (cloudKey == null) { cloudKey = "Allergan-09b83694534c0d1bcd24851e9e9d172f"; } if (staging == null) { staging = "true"; } if (testing == null) { testing = "false"; } if (rootFolder == null) { rootFolder = "8183-en_us"; } if (subjectType == null) { subjectType = BVSubjectType.PRODUCT; } } // Setting up BVConfiguration and BVParameters BVConfiguration bvConfig = new BVSdkConfiguration(); bvConfig.addProperty(BVClientConfig.CLOUD_KEY, cloudKey); bvConfig.addProperty(BVClientConfig.STAGING, staging); bvConfig.addProperty(BVClientConfig.TESTING, testing); bvConfig.addProperty(BVClientConfig.BV_ROOT_FOLDER, rootFolder); bvConfig.addProperty(BVClientConfig.SEO_SDK_ENABLED, "true"); // use this as a kill switch bvConfig.addProperty(BVClientConfig.LOAD_SEO_FILES_LOCALLY, "false"); // set to false if using cloud-based content bvConfig.addProperty(BVClientConfig.LOCAL_SEO_FILE_ROOT, "/"); bvConfig.addProperty(BVClientConfig.CRAWLER_AGENT_PATTERN, "yandex"); bvConfig.addProperty(BVClientConfig.EXECUTION_TIMEOUT, "1500"); bvConfig.addProperty(BVClientConfig.EXECUTION_TIMEOUT_BOT, "2000"); var bvParameters = new BVParameters { BaseURI = currentUrl, PageURI = currentUrl, ContentType = new BVContentType(contentType), SubjectType = new BVSubjectType(subjectType), SubjectId = subjectId }; if (contentType.Equals(BVContentType.STORIES, StringComparison.OrdinalIgnoreCase)) { bvParameters.ContentSubType = new BVContentSubType(BVContentSubType.STORIES_LIST); } BVUIContent bvOutput = new BVManagedUIContent(bvConfig); if (contentType.Equals(BVContentType.REVIEWS, StringComparison.OrdinalIgnoreCase)) { reviewSummaryControl.InnerHtml = bvOutput.getAggregateRating(bvParameters); reviewControl.InnerHtml = bvOutput.getReviews(bvParameters); contentControl.InnerHtml = ""; } else { contentControl.InnerHtml = bvOutput.getContent(bvParameters); reviewSummaryControl.InnerHtml = ""; reviewControl.InnerHtml = ""; } }