Example #1
0
 private void Display_PurgeHistory()
 {
     Collection cFolder;
         EkDTSelector dateSel = m_refAPI.EkDTSelectorRef;
         m_contentRef = m_refAPI.EkContentRef;
         m_FolderId = System.Convert.ToInt64(Request.QueryString["folderid"]);
         cFolder = m_contentRef.GetFolderInfoWithPath(m_FolderId);
         litFolderPath.Text = cFolder["Path"].ToString();
         litFolderName.Text = cFolder["FolderName"].ToString();
         dateSel.formName = "frmMain";
         dateSel.formElement = "frm_purge_date";
         dateSel.spanId = "span_purge_date";
         litCal.Text = dateSel.displayCultureDate(true, "", "");
         frm_folder_id.Value = m_FolderId.ToString();
         ViewToolBar();
 }
Example #2
0
    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        // register JS and CSS
        RegisterResources();
        try
        {
            _Msg = _ContentApi.EkMsgRef;
            CheckAccess();
            ExtraQuery = "";
            if (!String.IsNullOrEmpty(Request.QueryString["LangType"]))
            {
                ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
                _ContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
            }
            else
            {
                if (_ContentApi.GetCookieValue("LastValidLanguageID") != "")
                {
                    ContentLanguage = int.Parse(_ContentApi.GetCookieValue("LastValidLanguageID"));
                }
            }

            ExtraQuery = (string)("&LangType=" + ContentLanguage);
            if (!(Request.QueryString["WantXmlInfo"] == null))
            {
                ExtraQuery += "&WantXmlInfo=1";
                m_nWantXmlInfo = 1;
            }
            else
            {
                m_nWantXmlInfo = 0;
            }

            if (!String.IsNullOrEmpty(Request.QueryString["FolderType"]))
            {
                FolderType = (EkEnumeration.FolderType)Enum.Parse(typeof(EkEnumeration.FolderType), EkFunctions.UrlEncode(Request.QueryString["FolderType"]), true);
                if (Information.IsNumeric(Request.QueryString["FolderType"]))
                {
                    ExtraQuery += (string)("&FolderType=" + FolderType);
                }
            }
            if (!(Request.QueryString["menuflag"] == null))
            {
                _menuFlag = System.Convert.ToBoolean(Request.QueryString["menuflag"].ToLower() == "true");
                ExtraQuery += (string)("&menuflag=" + Request.QueryString["menuflag"]);
            }

            _Msg = _ContentApi.EkMsgRef;
            //Put user code to initialize the page here
            AppImgPath = _ContentApi.AppImgPath;
            AppPath = _ContentApi.AppPath;
            AppName = _ContentApi.AppName;
            if ((!String.IsNullOrEmpty(Request.QueryString["FolderID"])) && Information.IsNumeric(Request.QueryString["FolderID"]))
            {
                FolderId = Convert.ToInt64(Request.QueryString["FolderID"]);
            }
            StyleSheetJS.Text = _Style.GetClientScript();
            if (!(Request.QueryString["listfolderfor"] == null))
            {
                ListFoldersFor = (string)(Request.QueryString["listfolderfor"].ToString().ToLower());
                ListFoldersFor = EkFunctions.UrlEncode(ListFoldersFor);
                ExtraQuery += (string)("&listfolderfor=" + ListFoldersFor);
            }

            _Content = _ContentApi.EkContentRef;
            gtNavs = _Content.GetFolderInfoWithPath(FolderId);
            currentFolderType = (EkEnumeration.FolderType)Enum.ToObject(typeof(EkEnumeration.FolderType), Convert.ToInt32(gtNavs["FolderType"]));
            FolderName = gtNavs["FolderName"];
            ParentFolderId = gtNavs["ParentID"];
            fPath = (string)(gtNavs["Path"]);
            m_nTargetFolderIsXml = ((Collection)gtNavs["XmlConfiguration"]).Count;

            cTmp = new Collection();
            cTmp.Add("name", "OrderBy", null, null);
            cTmp.Add(FolderId, "FolderID", null, null);
            cTmp.Add(FolderId, "ParentID", null, null);

            if ((!(Request.QueryString["noblogfolders"] == null)) && Information.IsNumeric(Request.QueryString["noblogfolders"]))
            {
                if (Convert.ToInt32(Request.QueryString["noblogfolders"]) > 0)
                    m_bBlockBlogFolders = true;
                else
                    m_bBlockBlogFolders = false;
            }
            cFolders = _Content.GetAllViewableChildFoldersv2_0(cTmp);

            if (!(Request.QueryString["action"] == null))
            {
                strPageAction = Request.QueryString["action"];
            }

            if (!(Request.QueryString["from_page"] == null))
            {
                strRedirectFromReport = Request.QueryString["from_page"];
            }

            if (!(Request.QueryString["subfolderchk"] == null))
            {
                m_bSubFolder = System.Convert.ToBoolean("true" == Request.QueryString["subfolderchk"].ToLower());
            }

            GenerateToolBar();

            // support for enhanced metadata (used with customfields.vb):
            if (!(Request.QueryString["metadataFormTagId"] == null))
            {
                ExtraQuery += (string)("&metadataFormTagId=" + EkFunctions.UrlEncode(Request.QueryString["metadataFormTagId"]));
                ExtraQuery += (string)("&separator=" + EkFunctions.UrlEncode(Request.QueryString["separator"]));
                frmFormTagId.Value = EkFunctions.UrlEncode(Request.QueryString["metadataFormTagId"]);
            }

            PopulateGridData();
            AssignJsTextStrings();
        }
        catch (Exception ex)
        {
            Utilities.ShowError(ex.Message);
        }
    }
Example #3
0
    private void FillContentFolderInfo()
    {
        try
        {
            bool bCheckout = false;
            NextPage.Attributes.Add("onclick", "return resetPostback()");
            lnkBtnPreviousPage.Attributes.Add("onclick", "return resetPostback()");
            FirstPage.Attributes.Add("onclick", "return resetPostback()");
            LastPage.Attributes.Add("onclick", "return resetPostback()");
            m_refMsg = m_refContentApi.EkMsgRef;
            //Put user code to initialize the page here
            AppImgPath = m_refContentApi.AppImgPath;
            AppName = m_refContentApi.AppName;
            ContentIcon = "<img src=\"" + AppPath + "images/UI/Icons/contentHtml.png\" alt=\"Content\" />"; //-HC-
            WebEventIcon = "<img src=\"" + AppPath + "images/UI/Icons/calendarViewDay.png\" alt=\"WebEvent\" />";
            formsIcon = "<img src=\"" + AppPath + "images/UI/Icons/contentForm.png\" alt=\"Form\" />"; //-HC-
            pageIcon = "<img src=\"" + AppPath + "images/UI/Icons/layout.png\" alt=\"Page\" />"; //-HC-
            //intQString = Request.QueryString
            AddType = Strings.LCase(Request.QueryString["addto"]);
            nId = Convert.ToInt64(Request.QueryString["nid"]);
            subfolderid = Convert.ToInt64(Request.QueryString["subfolderid"]);
            FolderId = Convert.ToInt64(Request.QueryString["folderid"]);
            bool showQDContentOnly = System.Convert.ToBoolean(Request.QueryString["qdo"] == "1");

            m_refContent = m_refContentApi.EkContentRef;

            if (!(Request.QueryString["subfolderid"] == null))
            {
                locID = subfolderid;
            }
            else
            {
                locID = FolderId;
            }
            gtNavs = m_refContent.GetFolderInfoWithPath(locID);
            if (!Ektron.Cms.Common.EkFunctions.DoesKeyExist(gtNavs, "FolderName"))
            {
                // invalid folder, so start at root instead of taking an error
                locID = 0;
                gtNavs = m_refContent.GetFolderInfoWithPath(0);
            }

            //Set content type
            if (Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam] != "")
            {
                if (Information.IsNumeric(Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]))
                {
                    g_ContentTypeSelected = System.Convert.ToInt32(Request.QueryString[Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]);
                    m_refContentApi.SetCookieValue(Ektron.Cms.Common.EkConstants.ContentTypeUrlParam, g_ContentTypeSelected.ToString());
                }
            }
            else if (Request.Cookies["ecm"][Ektron.Cms.Common.EkConstants.ContentTypeUrlParam] != "")
            {
                if (Information.IsNumeric(Request.Cookies["ecm"][Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]))
                {
                    g_ContentTypeSelected = System.Convert.ToInt32(Request.Cookies["ecm"][Ektron.Cms.Common.EkConstants.ContentTypeUrlParam]);
                }
            }

            ///end set content type

            if (AddType == "menu")
            {
                if (m_refContentApi.TreeModel == 1)
                {
                    cRecursive = m_refContent.GetMenuByID(nId, 0, false);
                }
                else
                {
                    cRecursive = m_refContent.GetMenuByID(nId, 0, false);
                }
                if (cRecursive.Count > 0)
                {
                    MenuTitle = cRecursive["MenuTitle"].ToString();
                    rec = Convert.ToBoolean(cRecursive["Recursive"]);
                }
            }
            else
            {
                if (Request.QueryString["checkout"] != null)
                {
                    bCheckout = System.Convert.ToBoolean(Request.QueryString["checkout"].ToString());
                }
                if (bCheckout)
                {
                    cRecursive = m_refContent.GetEcmStageCollectionByID(nId, false, false, ref ErrorString, true, false, true);
                }
                else
                {
                    cRecursive = m_refContent.GetEcmCollectionByID(nId, false, false, ref ErrorString, true, false, true);
                }
                if (cRecursive.Count > 0)
                {
                    CollectionTitle = cRecursive["CollectionTitle"].ToString();
                    rec = Convert.ToBoolean(cRecursive["Recursive"]);
                }

            }
            perm_data = m_refContentApi.LoadPermissions(locID, "folder", 0);
            if (!perm_data.CanTraverseFolders)
            {
                rec = false;
            }
            if (rec)
            {
                cTmp = new Collection();

                cTmp.Add(locID, "ParentID", null, null);
                cTmp.Add("name", "OrderBy", null, null);
                cFolders = m_refContent.GetAllViewableChildFoldersv2_0(cTmp);
            }

            FolderName = gtNavs["FolderName"].ToString();
            backId = Convert.ToInt64(gtNavs["ParentID"]);
            fPath = gtNavs["Path"].ToString();

            EkEnumeration.FolderType folderType = (EkEnumeration.FolderType)Enum.Parse(typeof(EkEnumeration.FolderType), gtNavs["FolderType"].ToString());

            cTmp = new Collection();
            cTmp.Add("name", "OrderBy", null, null);
            cTmp.Add(FolderId, "FolderID", null, null);
            cTmp.Add(FolderId, "ParentID", null, null);
            EkEnumeration.CMSContentType ContentTypeSelected = (EkEnumeration.CMSContentType)Enum.Parse(typeof(EkEnumeration.CMSContentType), g_ContentTypeSelected.ToString());

            if (AddType == "menu")
            {
                cConts = m_refContent.GetAllContentNotInEcmMenu(nId, locID, "title", _currentPageNumber, m_refContentApi.RequestInformationRef.PagingSize, ref TotalPagesNumber, ContentTypeSelected);
            }
            else
            {
                if (bCheckout || ((Request.QueryString["status"] != null) && Request.QueryString["status"].ToUpper() == "O"))
                {
                    cConts = m_refContent.GetAllContentNotInEcmCollection(nId, locID, "title", _currentPageNumber, m_refContentApi.RequestInformationRef.PagingSize, ref TotalPagesNumber, ContentTypeSelected, Ektron.Cms.Content.EkContent.ContentResultType.Staged);
                }
                else
                {
                    // Defect#: 49013
                    // cConts = m_refContent.GetAllContentNotInEcmCollection(nId, CLng(locID), "title", _currentPageNumber, m_refContentApi.RequestInformationRef.PagingSize, TotalPagesNumber, g_ContentTypeSelected)

                    EkEnumeration.CMSContentType myContentType = (EkEnumeration.CMSContentType)Enum.Parse(typeof(EkEnumeration.CMSContentType), g_ContentTypeSelected.ToString());
                    cConts = GetAllContent(nId, locID, "title", _currentPageNumber, m_refContentApi.RequestInformationRef.PagingSize, ref TotalPagesNumber, myContentType);
                }
            }

            if (showQDContentOnly && (gtNavs["ReplicationMethod"].ToString() != "1") && m_refContentApi.RequestInformationRef.EnableReplication)
            {
                // only display QD content, clean out the content list
                cConts.Clear();
            }
            gtNavs = null;

            if (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;
                    }

                }
            }

            Ektron.Cms.TemplateData[] templatelist = m_refContentApi.GetEnabledTemplatesByFolder(locID);
            bool hasNormalTemplate = false;

            foreach (TemplateData template in templatelist)
            {
                if (template.Type == EkEnumeration.TemplateType.Default && template.SubType == EkEnumeration.TemplateSubType.Default)
                {
                    hasNormalTemplate = true;
                    break;
                }
            }
            CanCreateContent = System.Convert.ToBoolean((perm_data.CanAdd && hasNormalTemplate) && !(folderType == EkEnumeration.FolderType.Catalog || folderType == EkEnumeration.FolderType.Calendar));

            asset_data = m_refContent.GetAssetSuperTypes();

            if (Ektron.Cms.Common.EkConstants.CMSContentType_Content == g_ContentTypeSelected || Ektron.Cms.Common.EkConstants.CMSContentType_Archive_Content == g_ContentTypeSelected)
            {
                lContentType = g_ContentTypeSelected;
            }
            else if (Ektron.Cms.Common.EkConstants.ManagedAsset_Min <= g_ContentTypeSelected & g_ContentTypeSelected <= Ektron.Cms.Common.EkConstants.ManagedAsset_Max)
            {
                if (DoesAssetSupertypeExist(asset_data, g_ContentTypeSelected))
                {
                    lContentType = g_ContentTypeSelected;
                }
            }
            DisplayToolBarAndContent();
        }
        catch (Exception ex)
        {
            Utilities.ShowError(ex.Message);
        }
    }