private void FillContentInfo() { //cConts = m_refContent.GetAllViewableChildContentInfoV4_2(cTmp) if (folderType == EkEnumeration.FolderType.Catalog) { CatalogEntryApi catalogAPI = new CatalogEntryApi(); Criteria<EntryProperty> criteria = new Criteria<EntryProperty>(); criteria.PagingInfo = new PagingInfo(m_refContentApi.RequestInformationRef.PagingSize); criteria.PagingInfo.CurrentPage = _currentPageNumber; criteria.AddFilter(EntryProperty.CatalogId, CriteriaFilterOperator.EqualTo, FolderId); criteria.AddFilter(EntryProperty.LanguageId, CriteriaFilterOperator.EqualTo, ContentLanguage); criteria.OrderByField = EntryProperty.Title; entryList = catalogAPI.GetList(criteria); TotalPagesNumber = System.Convert.ToInt32(criteria.PagingInfo.TotalPages); } else { cConts = m_refContent.GetAllViewableChildInfov5_0(cTmp, _currentPageNumber, m_refContentApi.RequestInformationRef.PagingSize, ref TotalPagesNumber, Ektron.Cms.Common.EkEnumeration.CMSContentType.NonLibraryContent, EkEnumeration.CMSContentSubtype.AllTypes); } if (overrideContentEnum == "calfolder" || TotalPagesNumber <= 1) { TotalPages.Visible = false; CurrentPage.Visible = false; lnkBtnPreviousPage.Visible = false; NextPage.Visible = false; LastPage.Visible = false; FirstPage.Visible = false; PageLabel.Visible = false; OfLabel.Visible = false; } else { TotalPages.Visible = true; CurrentPage.Visible = true; lnkBtnPreviousPage.Visible = true; NextPage.Visible = true; LastPage.Visible = true; FirstPage.Visible = true; PageLabel.Visible = true; OfLabel.Visible = true; TotalPages.Text = (System.Math.Ceiling(Convert.ToDouble(TotalPagesNumber))).ToString(); TotalPages.ToolTip = TotalPages.Text; CurrentPage.Text = _currentPageNumber.ToString(); CurrentPage.ToolTip = CurrentPage.Text; if (_currentPageNumber == 1) { lnkBtnPreviousPage.Enabled = false; if (TotalPagesNumber > 1) { NextPage.Enabled = true; } else { NextPage.Enabled = false; } } else { lnkBtnPreviousPage.Enabled = true; if (_currentPageNumber == TotalPagesNumber) { NextPage.Enabled = false; } else { NextPage.Enabled = true; } } } DrawData(); }
private void Util_GetNewContent() { switch (m_ContentType) { case Ektron.Cms.Common.EkConstants.CMSContentType_CatalogEntry: CatalogEntryApi m_refCatalogAPI = new CatalogEntryApi(); EntryData entry_version_data = null; if (m_intHistoryId == 0) { entry_version_data = m_refCatalogAPI.GetItemEdit(m_intId, m_refContApi.ContentLanguage, false); } else { entry_version_data = m_refCatalogAPI.GetItemVersion(m_intId, m_refContApi.ContentLanguage, m_intHistoryId); } if (entry_version_data.ProductType.PackageDisplayXslt.Length > 0) { newcontent = m_refContApi.TransformXsltPackage(entry_version_data.Html, entry_version_data.ProductType.PackageDisplayXslt, false); } else { Collection collEntryVersion = (Collection)entry_version_data.ProductType.PhysPathComplete; Collection collEntryVersionLogical = (Collection)entry_version_data.ProductType.LogicalPathComplete; if (Convert.ToString(collEntryVersion["Xslt" + entry_version_data.ProductType.DefaultXslt]).Length > 0) { CurrentXslt = (string)(collEntryVersion["Xslt" + entry_version_data.ProductType.DefaultXslt]); } else { CurrentXslt = (string) (collEntryVersionLogical["Xslt" + entry_version_data.ProductType.DefaultXslt]); } newcontent = m_refContApi.TransformXSLT(entry_version_data.Html, CurrentXslt); } newcontent = newcontent.Replace("src=\"/", PageInfo); break; default: ContentData content_data; //Dim show_content_data As ContentData if (m_intHistoryId == 0) { content_data = m_refContApi.GetContentById(m_intId, ContentAPI.ContentResultType.Staged); //show_content_data = m_refContApi.GetContentById(m_intId, ContentAPI.ContentResultType.Staged) if (content_data == null) { content_data = m_refContApi.GetContentById(m_intId, ContentAPI.ContentResultType.Published); //content_data = show_content_data } strContentHtml = content_data.Html; } else { content_data = m_refContApi.GetContentById(m_intId, ContentAPI.ContentResultType.Published); strContentHtml = content_data.Html; } CurrentXslt = ""; IsXMLDoc = System.Convert.ToBoolean(!(content_data.XmlConfiguration == null)); if (IsXMLDoc) { if (content_data.XmlConfiguration.PackageDisplayXslt.Length > 0) { newcontent = m_refContApi.TransformXsltPackage(strContentHtml, content_data.XmlConfiguration.PackageDisplayXslt, false); } else { Collection collCData = (Collection)content_data.XmlConfiguration.PhysPathComplete; Collection collCDataLogical = (Collection)content_data.XmlConfiguration.LogicalPathComplete; if (Convert.ToString(collCData["Xslt" + content_data.XmlConfiguration.DefaultXslt]).Length > 0) { CurrentXslt = (string)(collCData["Xslt" + content_data.XmlConfiguration.DefaultXslt]); } else { CurrentXslt = (string) (collCDataLogical["Xslt" + content_data.XmlConfiguration.DefaultXslt]); } newcontent = m_refContApi.TransformXSLT(strContentHtml, CurrentXslt); } IsXMLDoc = false; } else { newcontent = strContentHtml; } newcontent = newcontent.Replace("src=\"/", PageInfo); if (! IsXMLDoc) { newcontent = RemoveHTML(newcontent); } break; } }
private void Util_GetBaseContent() { switch (m_ContentType) { case Ektron.Cms.Common.EkConstants.CMSContentType_CatalogEntry: CatalogEntryApi m_refCatalogAPI = new CatalogEntryApi(); EntryData entry_data = null; entry_data = m_refCatalogAPI.GetItem(m_intId); if (entry_data.ProductType.PackageDisplayXslt.Length > 0) { basecontent = m_refContApi.XSLTransform(entry_data.Html, entry_data.ProductType.PackageDisplayXslt, false, false, null, false, true); } else { Collection coll = (Collection)entry_data.ProductType.PhysPathComplete; Collection logicalColl = (Collection)entry_data.ProductType.LogicalPathComplete; if (Convert.ToString(coll["Xslt" + entry_data.ProductType.DefaultXslt]).Length > 0) { CurrentXslt = (string) (coll["Xslt" + entry_data.ProductType.DefaultXslt]); } else { CurrentXslt = (string) (logicalColl["Xslt" + entry_data.ProductType.DefaultXslt]); } basecontent = m_refContApi.TransformXSLT(entry_data.Html, CurrentXslt); } basecontent = Server.HtmlDecode(basecontent.Replace("src=\"/", PageInfo)); break; default: ContentData content_data; ContentData show_content_data; show_content_data = m_refContApi.GetContentById(m_intId, ContentAPI.ContentResultType.Published); if (m_intHistoryId == 0) { content_data = m_refContApi.GetContentById(m_intId, ContentAPI.ContentResultType.Published); } else { content_data = m_refContApi.GetContentByHistoryId(m_intHistoryId); } if (show_content_data == null) // only get staged content if there has never been published content { show_content_data = m_refContApi.GetContentById(m_intId, ContentAPI.ContentResultType.Staged); } if (content_data == null) { content_data = show_content_data; } //Published content IsXMLDoc = System.Convert.ToBoolean(!(content_data.XmlConfiguration == null)); if (IsXMLDoc) { if (content_data.XmlConfiguration.PackageDisplayXslt.Length > 0) { basecontent = m_refContApi.XSLTransform(content_data.Html, content_data.XmlConfiguration.PackageDisplayXslt, false, false, null, false, true); } else { Collection xmlConfig = (Collection)content_data.XmlConfiguration.PhysPathComplete; Collection xmlConfigPhy = (Collection)content_data.XmlConfiguration.LogicalPathComplete; if (Convert.ToString(xmlConfig["Xslt" + content_data.XmlConfiguration.DefaultXslt]).Length > 0) { CurrentXslt = (string) (xmlConfig["Xslt" + content_data.XmlConfiguration.DefaultXslt]); } else { CurrentXslt = (string) (xmlConfigPhy["Xslt" + content_data.XmlConfiguration.DefaultXslt]); } basecontent = m_refContApi.TransformXSLT(content_data.Html, CurrentXslt); } IsXMLDoc = false; } else { basecontent = content_data.Html; } basecontent = basecontent.Replace("src=\"/", PageInfo); if (! IsXMLDoc) { basecontent = RemoveHTML(basecontent); } IsPublished = show_content_data.IsPublished; break; } }
private void DisplayProducts() { CatalogEntryApi CatalogManager = new CatalogEntryApi(); System.Collections.Generic.List<EntryData> entryList = new System.Collections.Generic.List<EntryData>(); Ektron.Cms.Common.Criteria<EntryProperty> entryCriteria = new Ektron.Cms.Common.Criteria<EntryProperty>(); entryCriteria.PagingInfo.RecordsPerPage = this._FolderApi.EkContentRef.RequestInformation.PagingSize; entryCriteria.PagingInfo.CurrentPage = this.uxPaging.SelectedPage + 1; entryCriteria.AddFilter(EntryProperty.CatalogId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, this._FolderId); entryCriteria.AddFilter(EntryProperty.LanguageId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, long.Parse(Request.QueryString["languageId"])); entryList = CatalogManager.GetList(entryCriteria); if (entryCriteria.PagingInfo.TotalPages > 1) { this.uxPaging.Visible = true; this.uxPaging.TotalPages = entryCriteria.PagingInfo.TotalPages; this.uxPaging.CurrentPageIndex = this.uxPaging.SelectedPage; } else { this.uxPaging.Visible = false; } gvProducts.DataSource = entryList; gvProducts.DataBind(); }
protected void Display_ViewAll() { CatalogEntryApi CatalogManager = new CatalogEntryApi(); System.Collections.Generic.List<EntryData> entryList = new System.Collections.Generic.List<EntryData>(); Ektron.Cms.Common.Criteria<EntryProperty> entryCriteria = new Ektron.Cms.Common.Criteria<EntryProperty>(); string OrderBy = ""; entryCriteria.AddFilter(EntryProperty.CatalogId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, m_iID); entryCriteria.AddFilter(EntryProperty.LanguageId, Ektron.Cms.Common.CriteriaFilterOperator.EqualTo, m_refContentApi.RequestInformationRef.ContentLanguage); if (Request.QueryString["orderby"] != null) { OrderBy = Request.QueryString["orderby"]; } switch (m_sPageAction) { case "couponselect": case "crosssellselect": case "upsellselect": case "reportingselect": break; // do nothing default: GetProducts = true; GetBundles = false; GetComplexProducts = false; GetKits = false; long[] IdList = new long[2]; IdList[0] = Convert.ToInt64(Ektron.Cms.Common.EkEnumeration.CatalogEntryType.Product); entryCriteria.AddFilter(EntryProperty.EntryType, Ektron.Cms.Common.CriteriaFilterOperator.In, IdList); break; } switch (OrderBy.ToLower()) { case "title": entryCriteria.OrderByField = EntryProperty.Title; break; case "language": entryCriteria.OrderByField = EntryProperty.LanguageId; break; case "id": entryCriteria.OrderByField = EntryProperty.Id; break; case "status": entryCriteria.OrderByField = EntryProperty.Status; break; case "datemodified": entryCriteria.OrderByField = EntryProperty.EntryType; break; case "editor": entryCriteria.OrderByField = EntryProperty.ListPrice; break; default: entryCriteria.OrderByField = EntryProperty.LastEditDate; break; } entryCriteria.PagingInfo.CurrentPage = this.ucPaging.SelectedPage + 1; entryList = CatalogManager.GetList(entryCriteria); if (entryCriteria.PagingInfo.TotalPages > 1) { this.ucPaging.Visible = true; this.ucPaging.TotalPages = entryCriteria.PagingInfo.TotalPages; this.ucPaging.CurrentPageIndex = this.ucPaging.SelectedPage; } if (TotalPagesNumber <= 1) { TotalPages.Visible = false; CurrentPage.Visible = false; PageLabel.Visible = false; OfLabel.Visible = false; } else { TotalPages.Visible = true; CurrentPage.Visible = true; PageLabel.Visible = true; OfLabel.Visible = true; TotalPages.Text = (System.Math.Ceiling(Convert.ToDecimal(TotalPagesNumber))).ToString(); TotalPages.ToolTip = TotalPages.Text; CurrentPage.Text = _currentPageNumber.ToString(); CurrentPage.ToolTip = CurrentPage.Text; } Populate_ViewCatalogGrid(entryList); }
private void populateFolder(System.Collections.Generic.List<CatalogData> catalogData) { ltr_folder.Text = null; int i = 0; ContentAPI m_refContentApi = new ContentAPI(); string imageFolder = m_refContentApi.AppPath + "images/ui/icons/tree/folderCollapsed.png"; CatalogEntryApi CatalogManager = new CatalogEntryApi(); System.Collections.Generic.List<EntryData> entryList = new System.Collections.Generic.List<EntryData>(); for (i = 0; i <= catalogData.Count - 1; i++) { //entryList = CatalogManager.GetCatalogEntries(catalogData.Item(i).Id, m_refContentApi.RequestInformationRef.ContentLanguage, New EntryTypeFilter(GetProducts, GetBundles, GetComplexProducts, GetKits)) //If entryList.Count = 0 Then imageFolder = m_refContentApi.AppPath + "images/ui/icons/folderGreen.png"; //End If if (m_sPageAction == "coupon") { ltr_folder.Text += "<table><tr><td><a href=\"itemselection.aspx?action=" + m_sPageAction + "select&id=" + catalogData[i].Id + "\"><img style=\"border:0px;\" src=\"" + imageFolder + "\"/></a></td>"; } else { ltr_folder.Text += "<table><tr><td><a href=\"byproduct.aspx?action=" + m_sPageAction + "select&id=" + catalogData[i].Id + "\"><img style=\"border:0px;\" src=\"" + imageFolder + "\"/></a></td>"; } if (m_sPageAction == "coupon") { ltr_folder.Text += "<td><a href=\"itemselection.aspx?action=" + m_sPageAction + "select&id=" + catalogData[i].Id + "\">" + catalogData[i].Name + "</a></td></tr></table>"; } else { ltr_folder.Text += "<td><a href=\"byproduct.aspx?action=" + m_sPageAction + "select&id=" + catalogData[i].Id + "\">" + catalogData[i].Name + "</a></td></tr></table>"; } } }