private Dictionary<string, string> GetFormFieldDefaults(long formId)
    {
        var defaults = new Dictionary<string, string>();
        var formApi = new Ektron.Cms.API.Content.Form();
        var contentApi = new Ektron.Cms.API.Content.Content();

        var formFields = formApi.GetFormFieldList(formId);
        var formData = formApi.GetForm(formId); // Can't use FormData; have to use ContentAPI / ContentData to get the HTML
        //if (string.IsNullOrEmpty(formData.Html)) throw new Exception("FormData with empty HTML. Eeek!");

        var contentData = contentApi.GetContent(formId);

        var formXml = string.Concat("<ekForm>", contentData.Html, "</ekForm>");
        var ekForm = XElement.Parse(formXml);
        var inputs = ekForm.Descendants("input");

        //  xml.Text = formFields.Fields;
        foreach (var fieldDefinition in formFields.Fields)
        {
            var name = fieldDefinition.FieldName;

            //var input = inputs.FirstOrDefault(i => i.Attribute("id").Value == name);
            //if (input == null) continue;

            //var defaultValue = input.Attribute("value").Value;
            //defaults.Add(name, defaultValue);
        }
        return defaults;

        //long formID = Convert.ToInt64(105);

        //Ektron.Cms.API.Content.Form fapi = new Ektron.Cms.API.Content.Form();

        //// get the title of the form
        //ContentManager contentManager = new ContentManager();

        //var content = contentManager.GetItem(formID, true);

        //// get the list of form fields
        //var formFieldList = fapi.GetFormFieldList(formID);

        //var formCRUD = new Ektron.Cms.Framework.Content.FormManager();
        //var formSubmittedCriteria = new Ektron.Cms.Common.FormSubmittedCriteria();
        //formSubmittedCriteria.AddFilter(FormSubmittedProperty.FormId, CriteriaFilterOperator.EqualTo, 26424);
        //formSubmittedCriteria.AddFilter(FormSubmittedProperty.DateSubmitted, CriteriaFilterOperator.GreaterThan, DateTime.Now.AddMonths(-1));

        //var formData = formCRUD.GetSubmittedFormList(formSubmittedCriteria);
    }
    protected void uploadFile_Click(object sender, EventArgs e)
    {
        string fileName = string.Empty;
            HttpPostedFile fileUpld = ekFileUpload.PostedFile;
            string hasValidExtension = "";
            List<string> AllowedFileTypes = new List<string>();

            AllowedFileTypes.AddRange(DocumentManagerData.Instance.FileTypes.ToString().Split(','.ToString().ToCharArray()));
            if (fileUpld.ContentLength > 0)
            {
                Ektron.Cms.UserAPI uAPI = new UserAPI();

                _fileExtension = Path.GetExtension(fileUpld.FileName);
                //hasValidExtension = (string) (AllowedFileTypes.Find(new Predicate<string>(new System.EventHandler(CheckExtension))));
                hasValidExtension = AllowedFileTypes.Find(new Predicate<string>(CheckExtension));

                if ((hasValidExtension != null)&& hasValidExtension != "")
                {

                    //If Image Gallery, Should check if the file type is an image file type
                    if ((Request.QueryString["prop"] != null)&& Request.QueryString["prop"].ToLower() == "image")
                    {
                        if (! Ektron.Cms.Common.EkFunctions.IsImage(_fileExtension))
                        {
                            ltrStatus.Text = m_refMsg.GetMessage("msg invalid file upload images only");
                            setInvalid();
                            return;
                        }
                    }

                    fileName = Path.GetFileName(fileUpld.FileName);
                    int fileLength = fileUpld.ContentLength;
                    byte[] fileData = new byte[fileLength - 1+ 1];
                    string file = Convert.ToString(fileUpld.InputStream.Read(fileData, 0, fileLength));

                    if (fileData.Length > 0)
                    {
                        System.IO.MemoryStream stream = new System.IO.MemoryStream(fileData);
                        m_refContApi.RequestInformationRef.UserId = uAPI.UserId;
                        m_refContApi.ContentLanguage = _contentLanguage;

                        Ektron.ASM.AssetConfig.AssetData asstData = new Ektron.ASM.AssetConfig.AssetData();
                        Ektron.Cms.API.Content.Content cContent = new Ektron.Cms.API.Content.Content();
                        asstData = m_refContApi.EkContentRef.GetAssetDataBasedOnFileName(fileName, _folderID, _taxonomyID);
                        if ((asstData != null)&& asstData.ID != "" && asstData.Name != "")
                        {
                            Ektron.Cms.AssetUpdateData astData = new AssetUpdateData();
                            TaxonomyBaseData[] taxonomyCatArray = null;
                            _contentID = Convert.ToInt64(asstData.ID);
                            ContentData cData = cContent.GetContent(_contentID, Ektron.Cms.ContentAPI.ContentResultType.Published);

                            astData.FileName = fileName;
                            astData.FolderId = _folderID;
                            astData.ContentId = cData.Id;
                            astData.Teaser = cData.Teaser;
                            astData.Comment = cData.Comment;
                            astData.Title = cData.Title;
                            astData.GoLive = cData.GoLive;
                            astData.TaxonomyTreeIds = this._taxonomyID.ToString();

                            //Assigning the categories
                            taxonomyCatArray = m_refContApi.ReadAllAssignedCategory(_contentID);
                            if ((taxonomyCatArray != null)&& taxonomyCatArray.Length > 0)
                            {
                                foreach (TaxonomyBaseData tBaseData in taxonomyCatArray)
                                {
                                    if (astData.TaxonomyTreeIds == "")
                                    {
                                        astData.TaxonomyTreeIds = tBaseData.TaxonomyId.ToString();
                                    }
                                    else
                                    {
                                        astData.TaxonomyTreeIds += (string) ("," + tBaseData.TaxonomyId.ToString());
                                    }
                                }
                            }

                            //Assigning the metadatas
                            if ((cData.MetaData != null)&& cData.MetaData.Length > 0)
                            {
                                astData.MetaData = new Ektron.Cms.AssetUpdateMetaData[cData.MetaData.Length - 1 + 1];
                                for (int i = 0; i <= cData.MetaData.Length - 1; i++)
                                {
                                    astData.MetaData[i] = new AssetUpdateMetaData();
                                    astData.MetaData[i].TypeId = cData.MetaData[i].TypeId;
                                    astData.MetaData[i].ContentId = cData.Id;
                                    astData.MetaData[i].Text = cData.MetaData[i].Text;
                                }
                            }
                            astData.EndDate = cData.EndDate;
                            astData.EndDateAction = (Ektron.Cms.Common.EkEnumeration.CMSEndDateAction) (Enum.Parse(typeof(Ektron.Cms.Common.EkEnumeration.CMSEndDateAction), cData.EndDateAction.ToString(), true));

                            //Updating the Content
                            bool isUpdated = m_refContApi.EditAsset(stream, astData);
                        }
                        else
                        {
                            Ektron.Cms.AssetUpdateData astData = new AssetUpdateData();
                            astData.FileName = fileName;
                            astData.FolderId = _folderID;
                            astData.Title = Path.GetFileNameWithoutExtension(fileName);
                            astData.LanguageId = _contentLanguage;
                            astData.TaxonomyTreeIds = this._taxonomyID.ToString();
                            _contentID = m_refContApi.AddAsset(stream, astData);
                        }

                        jsMetaUrl.Text = "";
                        if (m_refContApi.EkContentRef.DoesFolderRequireMetadataOrTaxonomy(_folderID, _contentLanguage))
                        {
                            var _taxString = string.Empty;
                            if (this._taxonomyID != -1)
                            {
                                _taxString = (string) ("&taxonomyId=" + this._taxonomyID);
                            }
                            jsMetaUrl.Text = m_refContApi.AppPath + "DMSMetadata.aspx?contentId=" + _contentID + "&idString=" + _contentID + "&folderId=" + _folderID + _taxString + "&close=true&EkTB_iframe=true&height=550&width=650&modal=true&refreshCaller=true";
                        }

                        isFileUploadComplete.Value = "true";
                        ClientScript.RegisterStartupScript(this.GetType(), "closeThickBox", "uploadClick();", true);
                    }
                }
                else
                {
                    ltrStatus.Text = m_refMsg.GetMessage("msg invalid file upload");
                    setInvalid();
                }
            }
            else
            {
                ltrStatus.Text = m_refMsg.GetMessage("lbl upload file");
                setInvalid();
            }
    }
    protected void lbtn_processTaxMeta_Click(object sender, EventArgs e)
    {
        string m_idlist = "";
            if (Session["EkDavSessionVal"] != null)
            {
                m_idlist = Session["EkDavSessionVal"].ToString();
            }
            Ektron.Cms.API.Content.Content cContent = new Ektron.Cms.API.Content.Content();
            List<string> tmp_list = new List<string>();
            tmp_list.AddRange(m_idlist.Split(','));
            for(int i=0;i<tmp_list.Count;i++)
            {
                if (string.IsNullOrEmpty(tmp_list[i]))
                    tmp_list.RemoveAt(i);
            }

            string[] ID_arr = tmp_list.ToArray();

            foreach (string id in ID_arr)
            {

                Int64 _contentID = -1;
                if (Int64.TryParse(id, out _contentID))
                {
                    TaxonomyContentRequest t = new TaxonomyContentRequest();
                    t.ContentId = _contentID;
                    t.FolderID = _folderID;
                    t.TaxonomyList = _taxonomyID.ToString();
                    cContent.EkContentRef.AddTaxonomyItem(t);
                }

            }
            Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "close_box", "Close();", true);
    }
Exemple #4
0
    private void ProcessMenuRequest()
    {
        Ektron.Cms.ContentAPI myContent = new Ektron.Cms.ContentAPI();
        Ektron.Cms.CommonApi AppUI = new Ektron.Cms.CommonApi();
        Ektron.Cms.API.User.User myUser = new Ektron.Cms.API.User.User();

        long contentId = Convert.ToInt64(Request.QueryString["contentId"]);
        int languageId = -1;
        long taxonomyOverrideId = 0;
        if (Request.QueryString["dmsLanguageId"] != null)
        {
            if (Request.QueryString["dmsLanguageId"] != String.Empty)
            {
                languageId = Convert.ToInt32(Request.QueryString["dmsLanguageId"]);
                if (languageId == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED || languageId == Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
                {
                    languageId = AppUI.DefaultContentLanguage;
                }
                AppUI.ContentLanguage = languageId;
                myContent.ContentLanguage = languageId;
            }
        }

        //createIeSpecificMenu is an argument passed to the constructor of the DMSMenuContentAPI class
        //This arg tells DMSMenuContentAPI whether or not to include the IE specific functionality
        //namely, this funcitonality is the office-specific stuff (Edit In Microsoft Office, View in Microsoft Office).
        Boolean createIeSpecificMenu = false;
        if (Request.QueryString["createIeSpecificMenu"] != String.Empty)
        {
            createIeSpecificMenu = Convert.ToBoolean(Request.QueryString["createIeSpecificMenu"]);
        }

        string dmsMenuType = String.Empty;
        string dmsMenuSubtype = String.Empty;
        long communityGroupID = 0;

        if (!String.IsNullOrEmpty(Request.QueryString["communityDocuments"]))
        {
            // Dms community menus may carry additional data (i.e. group id).
            string[] splitDmsMenuTypeInfo = Request.QueryString["communityDocuments"].Split(
                new char[] { '_' },
                StringSplitOptions.RemoveEmptyEntries);

            dmsMenuType = splitDmsMenuTypeInfo[0];

            if (splitDmsMenuTypeInfo.Length == 2)
            {
                long.TryParse(splitDmsMenuTypeInfo[1], out communityGroupID);
            }
        }

        Ektron.Cms.ContentData myContentData = new Ektron.Cms.ContentData();
        Ektron.Cms.API.Content.Content apiCont = new Ektron.Cms.API.Content.Content();
        Ektron.Cms.ContentStateData stateData = apiCont.GetContentState(contentId);
        if (stateData.Status == "A")
            myContentData = apiCont.GetContent(contentId, Ektron.Cms.ContentAPI.ContentResultType.Published);
        else
            myContentData = apiCont.GetContent(contentId, Ektron.Cms.ContentAPI.ContentResultType.Staged);

        string dmsMenuGuid;
        XsltArgumentList myDMSMenuArguments = new XsltArgumentList();
        Ektron.Cms.Workarea.Dms.DmsMenu myDMSMenu;
        if (dmsMenuType != "")
        {
            bool queryDynamicContentBox = false;
            string controlID = String.Empty;

            if (Request.QueryString["dynamicContentBox"] != null)
            {
                queryDynamicContentBox = Convert.ToBoolean(Request.QueryString["DynamicContentBox"]);
                if (dmsMenuType.ToLower() == "communityuser" || dmsMenuType.ToLower() == "communitygroup" && EkConstants.IsAssetContentType(myContentData.ContType, true) && myContentData.ContType !=(int) EkEnumeration.CMSContentType.Multimedia)
                {
                    if (myContentData.AssetData != null && !EkFunctions.IsImage("." + myContentData.AssetData.FileExtension) && myContentData.Type !=(int) EkEnumeration.CMSContentType.Multimedia)
                    {
                        queryDynamicContentBox = false;
                    }
                }

                myDMSMenuArguments.AddParam("dynamicContentBox", String.Empty, queryDynamicContentBox);
            }
            if (Request.QueryString["dmsEktControlID"] != null)
            {
                controlID = Request.QueryString["dmsEktControlID"].ToString();
                myDMSMenuArguments.AddParam("dmsEktControlID", String.Empty, controlID);
            }
            if (Request.QueryString["taxonomyOverrideId"] != null)
            {
                taxonomyOverrideId = Convert.ToInt64(Request.QueryString["taxonomyOverrideId"]);
            }
        }

        if (Request.QueryString["dmsMenuGuid"] != null)
        {
            dmsMenuGuid = Request.QueryString["dmsMenuGuid"].ToString();
            myDMSMenuArguments.AddParam("dmsMenuGuid", String.Empty, dmsMenuGuid);
        }

        Boolean IsPhotoGallery = true;
        if (Request.QueryString["dmsMenuSubtype"] != null)
        {
            dmsMenuSubtype = Request.QueryString["dmsMenuSubtype"].ToString();
            myDMSMenuArguments.AddParam("dmsMenuSubtype", String.Empty, dmsMenuSubtype);
            IsPhotoGallery = (dmsMenuSubtype == "photo");
        }

        string fromPage = String.Empty;
        if (Request.QueryString["fromPage"] != null)
        {
            fromPage = Request.QueryString["fromPage"].ToString();
            myDMSMenuArguments.AddParam("fromPage", String.Empty, fromPage);
        }

        switch (dmsMenuType.ToLower())
        {
            case "taxonomy":
                //Taxonomy Implementation
                //Use Taxnonomy constructor overload
                //public DmsMenu(ektronDmsMenuMenuType menuType, int contentId, int userId, int contentLanguage, int folderId, int contentType, Boolean createIESpecificMenu, int taxonomyOverrideId)
                if (Request.QueryString["communityGroupid"] != null)
                {
                    long.TryParse(Request.QueryString["communityGroupid"].ToString(), out communityGroupID);
                }
                myDMSMenu = new Ektron.Cms.Workarea.Dms.DmsMenu(ektronDmsMenuMenuType.Taxonomy,
                    contentId, myUser.UserId, languageId, myContentData.FolderId,
                    myContentData.Type, createIeSpecificMenu, taxonomyOverrideId, communityGroupID);
                break;
            case "communityuser":
                //Community User Implementation
                //Use Community User constructor overload
                //public DmsMenu(ektronDmsMenuMenuType menuType, int contentId, int userId, int contentLanguage, int folderId, int contentType, Boolean createIESpecificMenu, Boolean isPhotoGallery)
                myDMSMenu = new Ektron.Cms.Workarea.Dms.DmsMenu(ektronDmsMenuMenuType.CommunityUser,
                    contentId, myUser.UserId, languageId, myContentData.FolderId,
                    myContentData.Type, createIeSpecificMenu, IsPhotoGallery);
                break;
            case "communitygroup":
                //Community Group Implementation
                //Use Community Group constructor overload
                //public DmsMenu(ektronDmsMenuMenuType menuType, int contentId, int userId, int contentLanguage, int folderId, int contentType, Boolean createIESpecificMenu, int taxonomyOverrideId, int communityGroupId, Boolean isPhotoGallery)
                myDMSMenu = new Ektron.Cms.Workarea.Dms.DmsMenu(ektronDmsMenuMenuType.CommunityGroup,
                    contentId, myUser.UserId, languageId, myContentData.FolderId, myContentData.Type,
                    createIeSpecificMenu, taxonomyOverrideId, communityGroupID, IsPhotoGallery, fromPage);
                break;
            case "favorites":
                //Favorites Menu Implementation
                //Use Favorites constructor overload
                //public DmsMenu(ektronDmsMenuMenuType menuType, int contentId, int userId, int contentLanguage, int folderId, int contentType, Boolean createIESpecificMenu, int taxonomyOverrideId, int communityGroupId, Boolean isPhotoGallery)
                myDMSMenu = new Ektron.Cms.Workarea.Dms.DmsMenu(ektronDmsMenuMenuType.Favorites,
                    contentId, myUser.UserId, languageId, myContentData.FolderId,
                    myContentData.Type, createIeSpecificMenu, taxonomyOverrideId,
                    communityGroupID, IsPhotoGallery, fromPage);
                break;
            case "workarea":
            default:
                //Workarea Implementation
                //Use Workarea constructor overload
                //public DmsMenu(ektronDmsMenuMenuType menuType, int contentId, int userId, int contentLanguage, int folderId, int contentType, Boolean createIESpecificMenu)
                myDMSMenu = new Ektron.Cms.Workarea.Dms.DmsMenu(ektronDmsMenuMenuType.Workarea,
                    contentId, myUser.UserId, languageId, myContentData.FolderId,
                    myContentData.Type, createIeSpecificMenu, fromPage);
                break;
        }

        DMSMenu.Text = myDMSMenu.GetDmsMenu(myDMSMenuArguments);
    }
Exemple #5
0
    private void PopulateContentGridData()
    {
        TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("CHECK", "<input type=\"checkbox\" name=\"checkall\" onclick=\"checkAll(\'selected_items\',false);\">", "title-header", HorizontalAlign.Center, HorizontalAlign.Center, Unit.Percentage(2), Unit.Percentage(2), false, false));
            TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("TITLE", _MessageHelper.GetMessage("generic title"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(30), Unit.Percentage(50), false, false));
            TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("ID", _MessageHelper.GetMessage("generic id"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
            TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("LANGUAGE", _MessageHelper.GetMessage("generic language"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
            TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("URL", _MessageHelper.GetMessage("generic url link"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(30), false, false));
            TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("ARCHIVED", _MessageHelper.GetMessage("lbl archived"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));

            DataTable dt = new DataTable();
            DataRow dr;
            LibraryData libraryInfo;
            ContentData contData = new ContentData();
            dt.Columns.Add(new DataColumn("CHECK", typeof(string)));
            dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
            dt.Columns.Add(new DataColumn("ID", typeof(string)));
            dt.Columns.Add(new DataColumn("LANGUAGE", typeof(string)));
            dt.Columns.Add(new DataColumn("URL", typeof(string)));
            dt.Columns.Add(new DataColumn("ARCHIVED", typeof(string)));
            if (_ViewItem != "folder")
            {
                PageSettings();
                if ((taxonomy_data != null)&& (taxonomy_data.TaxonomyItems != null)&& taxonomy_data.TaxonomyItems.Length > 0)
                {
                    AddDeleteIcon = true;
                    foreach (TaxonomyItemData item in taxonomy_data.TaxonomyItems)
                    {
                        TaxonomyItemCount++;
                        dr = dt.NewRow();
                        dr["CHECK"] = "<input type=\"checkbox\" name=\"selected_items\" id=\"selected_items\" value=\"" + item.TaxonomyItemId + "\" onclick=\"checkAll(\'selected_items\',true);\">";
                        string contenturl = "";
                        switch (Convert.ToInt32(item.ContentType))
                        {
                            case 1:
                                if (item.ContentSubType == EkEnumeration.CMSContentSubtype.WebEvent)
                                {
                                    long fid = _Common.EkContentRef.GetFolderIDForContent(item.TaxonomyItemId);
                                    contenturl = (string) ("content.aspx?action=ViewContentByCategory&LangType=" + item.TaxonomyItemLanguage + "&id=" + fid + "&callerpage=taxonomy.aspx&origurl=" + EkFunctions.UrlEncode((string) ("action=view&view=item&taxonomyid=" + TaxonomyId + "&treeViewId=-1&LangType=" + TaxonomyLanguage)));
                                }
                                else
                                {
                                    contenturl = (string) ("content.aspx?action=View&LangType=" + item.TaxonomyItemLanguage + "&id=" + item.TaxonomyItemId + "&callerpage=taxonomy.aspx&origurl=" + EkFunctions.UrlEncode((string) ("action=view&view=item&taxonomyid=" + TaxonomyId + "&treeViewId=-1&LangType=" + TaxonomyLanguage)));
                                }
                                break;
                            case 7: // Library Item
                                libraryInfo = m_refContentApi.GetLibraryItemByContentID(item.TaxonomyItemId);
                                if(libraryInfo != null)
                                  contenturl = (string) ("library.aspx?LangType=" + libraryInfo.LanguageId + "&action=ViewLibraryItem&id=" + libraryInfo.Id + "&parent_id=" + libraryInfo.ParentId);
                                break;
                            case 1111:
                                // forum id, board id, taskid
                                DiscussionBoard board_data = _Content.GetTopicbyID(item.TaxonomyItemId.ToString());
                                string taskId = GetTaskIdForTopic(m_refContentApi.EkTaskRef.GetTopicReplies(item.TaxonomyItemId, board_data.Id), item.TaxonomyItemId);
                                contenturl = (string)("threadeddisc/addeditreply.aspx?action=Edit&topicid=" + item.TaxonomyItemId.ToString() + "&forumid=" + board_data.Forums[0].Id.ToString() + "&id=" + taskId.ToString() + "&boardid=" + board_data.Id.ToString());
                                break;
                            default:
                                contenturl = (string) ("content.aspx?action=View&LangType=" + item.TaxonomyItemLanguage + "&id=" + item.TaxonomyItemId + "&callerpage=taxonomy.aspx&origurl=" + EkFunctions.UrlEncode((string) ("action=view&view=item&taxonomyid=" + TaxonomyId + "&treeViewId=-1&LangType=" + TaxonomyLanguage)));
                                break;
                        }
                        dr["TITLE"] = m_refContentApi.GetDmsContextMenuHTML(item.TaxonomyItemId, Convert.ToInt64(item.TaxonomyItemLanguage), Convert.ToInt64(item.ContentType),Convert.ToInt32(item.ContentSubType), item.TaxonomyItemTitle.ToString(), _MessageHelper.GetMessage("generic Title") + " " + item.TaxonomyItemTitle.ToString(), contenturl, item.TaxonomyItemAssetInfo.FileName, item.TaxonomyItemAssetInfo.ImageUrl);
                        //dr["TITLE"] = m_refContentApi.GetDmsContextMenuHTML(item.TaxonomyItemId, item.TaxonomyItemLanguage, item.ContentType, item.ContentSubType, item.TaxonomyItemTitle, (string) (_MessageHelper.GetMessage("generic Title") + " " + item.TaxonomyItemTitle), contenturl, item.TaxonomyItemAssetInfo.FileName, item.TaxonomyItemAssetInfo.ImageUrl);
                        dr["ID"] = item.TaxonomyItemId;
                        dr["LANGUAGE"] = item.TaxonomyItemLanguage;
                        switch (Convert.ToInt32(item.ContentType))
                        {
                            case 102: // ManagedAsset (non-office documents)
                                libraryInfo = m_refContentApi.GetLibraryItemByContentID(item.TaxonomyItemId);
                                if(libraryInfo != null)
                                    dr["URL"] = libraryInfo.FileName.Replace("//", "/");
                                break;
                            case 103: // Generic asset content type
                                libraryInfo = m_refContentApi.GetLibraryItemByContentID(item.TaxonomyItemId);
                                if (libraryInfo != null)
                                    dr["URL"] = libraryInfo.FileName.Replace("//", "/");
                                break;
                            case 106: // All images have content_Type 106
                                libraryInfo = m_refContentApi.GetLibraryItemByContentID(item.TaxonomyItemId);
                                if (libraryInfo != null)
                                    dr["URL"] = libraryInfo.FileName.Replace("//", "/");
                                break;
                            default:
                                Ektron.Cms.API.Content.Content api = new Ektron.Cms.API.Content.Content();
                                contData = api.GetContent(item.TaxonomyItemId);
                                //contData = m_refContentApi.GetContentById(item.TaxonomyItemId)
                                dr["URL"] = contData.Quicklink;
                                break;
                        }
                        if (item.ContentType == Convert.ToInt32(EkEnumeration.CMSContentType.Archive_Content).ToString() || item.ContentType == Convert.ToInt32(EkEnumeration.CMSContentType.Archive_Forms).ToString() || item.ContentType == Convert.ToInt32(EkEnumeration.CMSContentType.Archive_Media).ToString() || (Convert.ToInt32(item.ContentType) >= EkConstants.Archive_ManagedAsset_Min && Convert.ToInt32(item.ContentType) < EkConstants.Archive_ManagedAsset_Max && Convert.ToInt32(item.ContentType) != 3333 && Convert.ToInt32(item.ContentType) != 1111))
                        {
                            dr["ARCHIVED"] = "<span class=\"Archived\"></span>";
                        }
                        dt.Rows.Add(dr);
                    }
                }
                else
                {
                    dr = dt.NewRow();
                    dt.Rows.Add(dr);
                    TaxonomyItemList.GridLines = GridLines.None;
                }
            }
            else
            {
                VisiblePageControls(false);
                TaxonomyFolderSyncData[] taxonomy_sync_folder = null;
                TaxonomyBaseRequest tax_sync_folder_req = new TaxonomyBaseRequest();
                tax_sync_folder_req.TaxonomyId = TaxonomyId;
                tax_sync_folder_req.TaxonomyLanguage = TaxonomyLanguage;
                taxonomy_sync_folder = _Content.GetAllAssignedCategoryFolder(tax_sync_folder_req);
                if ((taxonomy_sync_folder != null)&& taxonomy_sync_folder.Length > 0)
                {
                    AddDeleteIcon = true;
                    for (int i = 0; i <= taxonomy_sync_folder.Length - 1; i++)
                    {
                        TaxonomyItemCount++;
                        dr = dt.NewRow();
                        dr["CHECK"] = "<input type=\"checkbox\" name=\"selected_items\" id=\"selected_items\" value=\"" + taxonomy_sync_folder[i].FolderId + "\" onclick=\"checkAll(\'selected_items\',true);\">";

                        string contenturl;
                        contenturl = "content.aspx?action=ViewContentByCategory&id=" + taxonomy_sync_folder[i].FolderId + "&treeViewId=0";

                        dr["TITLE"] = "<a href=\"" + contenturl + "\">";
                        dr["TITLE"] += "<img src=\"";
                        switch ((EkEnumeration.FolderType)taxonomy_sync_folder[i].FolderType)
                        {
                            case EkEnumeration.FolderType.Catalog:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderGreen.png";
                                break;
                            case EkEnumeration.FolderType.Community:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderCommunity.png";
                                break;
                            case EkEnumeration.FolderType.Blog:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderBlog.png";
                                break;
                            case EkEnumeration.FolderType.DiscussionBoard:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderBoard.png";
                                break;
                            case EkEnumeration.FolderType.DiscussionForum:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderBoard.png";
                                break;
                            default:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folder.png";
                                break;
                        }
                        dr["TITLE"] += "\"></img>";
                        dr["TITLE"] += "</a><a href=\"" + contenturl + "\">";
                        dr["TITLE"] += taxonomy_sync_folder[i].FolderTitle; //& GetRecursiveTitle(item.FolderRecursive)
                        dr["TITLE"] += "</a>";

                        dr["ID"] = taxonomy_sync_folder[i].FolderId;
                        dr["LANGUAGE"] = taxonomy_sync_folder[i].TaxonomyLanguage;
                        dt.Rows.Add(dr);
                    }
                }
                else
                {
                    dr = dt.NewRow();
                    dt.Rows.Add(dr);
                    TaxonomyItemList.GridLines = GridLines.None;
                }
            }
            DataView dv = new DataView(dt);
            TaxonomyItemList.DataSource = dv;
            TaxonomyItemList.DataBind();
    }
Exemple #6
0
 private string GetOldFileName(long id)
 {
     Ektron.Cms.API.Content.Content cContent = new Ektron.Cms.API.Content.Content();
     ContentData cData = cContent.GetContent(id, Ektron.Cms.ContentAPI.ContentResultType.Published);
     if (cData != null)
     {
         AssetManagement.AssetManagementService assetmanagementService = new AssetManagement.AssetManagementService();
         Ektron.ASM.AssetConfig.AssetData assetData = assetmanagementService.GetAssetData(cData.AssetData.Id);
         if (assetData != null)
             return assetData.Handle;
     }
     return "";
 }
Exemple #7
0
    protected void uploadFile_Click(object sender, EventArgs e)
    {
        string fileName = string.Empty;
        HttpPostedFile fileUpld = ekFileUpload.PostedFile;
        string hasValidExtension = "";
        List<string> AllowedFileTypes = new List<string>();
        bool createOverwriteThumbnail = false;
        bool isImageAsset = false;
        ContentData cData;

        long _checkTaxID = -1;
        AllowedFileTypes.AddRange(DocumentManagerData.Instance.FileTypes.ToString().Split(','));
        if (fileUpld.ContentLength > 0)
        {
            Ektron.Cms.UserAPI uAPI = new UserAPI();

            _fileExtension = Path.GetExtension(fileUpld.FileName);

            //If its an image asset then create/overwrite the thumbnail
            isImageAsset = Ektron.Cms.Common.EkFunctions.IsImage(_fileExtension);
            if (isImageAsset && !isMetadataOrTaxonomyRequired)
                createOverwriteThumbnail = true;

            hasValidExtension = AllowedFileTypes.Find(new Predicate<string>(delegate(string t) { return t.ToLower().Replace(" ", "") == ("*" + _fileExtension.ToLower()); }));
            if (hasValidExtension != null && hasValidExtension != "")
            {
                //If Image Gallery, Should check if the file type is an image file type
                if (Request.QueryString["isimage"] != null && Request.QueryString["isimage"] != "" && Convert.ToInt32(Request.QueryString["isimage"]) == 1)
                {
                    if (!isImageAsset)
                    {
                        _bTrue = false;
                        ltrStatus.Text = _messageHelper.GetMessage("msg invalid file upload images only");
                        setInvalid();
                    }

                }

                fileName = Path.GetFileName(fileUpld.FileName);
                if (fileName.IndexOf("&") > -1 || fileName.IndexOf("+") > -1 || fileName.IndexOf("%") > -1)
                {
                    _bTrue = false;
                    ltrStatus.Text = _messageHelper.GetMessage("msg cannot add file with add and plus");
                    setInvalid();
                }

                if (_bTrue)
                {
                    int fileLength = fileUpld.ContentLength;
                    byte[] fileData = new byte[fileLength];
                    string file = Convert.ToString(fileUpld.InputStream.Read(fileData, 0, fileLength));

                    if (fileData.Length > 0)
                    {
                        System.IO.Stream stream = new System.IO.MemoryStream(fileData);

                        if (isImageAsset)
                        {
                            if (!EkFunctions.isImageStreamValid(stream))
                            {
                                stream.Flush();
                                stream.Close();
                                setInvalid();
                                ltrStatus.Text = "The image is corrupted or not in correct format.";
                                return;
                            }
                            stream.Position = 0;
                        }

                        contentAPI.RequestInformationRef.UserId = uAPI.UserId;
                        contentAPI.ContentLanguage = _contentLanguage;

                        Ektron.ASM.AssetConfig.AssetData asstData = new Ektron.ASM.AssetConfig.AssetData();
                        Ektron.Cms.API.Content.Content cContent = new Ektron.Cms.API.Content.Content();
                        if (_isImageGallery)
                            _checkTaxID = Convert.ToInt64(_taxonomyIdList);
                        asstData = contentAPI.EkContentRef.GetAssetDataBasedOnFileName(fileName.Replace("'", "_"), _folderID, _checkTaxID);
                        if ((asstData != null && asstData.ID != "" && asstData.Name != "") || !String.IsNullOrEmpty(Request.QueryString["AssetID"]))
                        {
                            Ektron.Cms.AssetUpdateData astData = new AssetUpdateData();
                            TaxonomyBaseData[] taxonomyCatArray = null;
                            if (!String.IsNullOrEmpty(Request.QueryString["AssetID"]))
                                _contentID = Convert.ToInt64(Request.QueryString["AssetID"]);
                            else
                                _contentID = Convert.ToInt64(asstData.ID);
                            cData = cContent.GetContent(_contentID, Ektron.Cms.ContentAPI.ContentResultType.Published);

                            astData.FileName = fileName;
                            astData.FolderId = _folderID;
                            astData.ContentId = cData.Id;
                            astData.Teaser = cData.Teaser;
                            astData.Comment = cData.Comment;
                            astData.Title = cData.Title;
                            astData.GoLive = cData.GoLive;

                            //Assigning the categories
                            taxonomyCatArray = contentAPI.ReadAllAssignedCategory(_contentID);
                            if (taxonomyCatArray != null && taxonomyCatArray.Length > 0)
                            {
                                foreach (TaxonomyBaseData tBaseData in taxonomyCatArray)
                                {
                                    if (astData.TaxonomyTreeIds == "")
                                        astData.TaxonomyTreeIds = tBaseData.TaxonomyId.ToString();
                                    else
                                        astData.TaxonomyTreeIds += "," + tBaseData.TaxonomyId.ToString();
                                }
                            }

                            //Assigning the metadata
                            if (cData.MetaData != null && cData.MetaData.Length > 0)
                            {
                                astData.MetaData = new AssetUpdateMetaData[cData.MetaData.Length - 1];
                                for (int i = 0; i < cData.MetaData.Length - 1; i++)
                                {
                                    astData.MetaData[i] = new AssetUpdateMetaData();
                                    astData.MetaData[i].TypeId = cData.MetaData[i].TypeId;
                                    astData.MetaData[i].ContentId = cData.Id;
                                    astData.MetaData[i].Text = cData.MetaData[i].Text;
                                }
                            }
                            astData.EndDate = cData.EndDate;
                            astData.EndDateAction = (Ektron.Cms.Common.EkEnumeration.CMSEndDateAction)cData.EndDateAction;

                            //Updating the Content
                            bool isUpdated = contentAPI.EditAsset(stream, astData);

                            //Creating the thumbnail, as service takes a while to generate and we see a broken Image in that time.
                            if (!isUpdated && createOverwriteThumbnail)
                            {
                                cData = contentAPI.ShowContentById(cData.Id, contentAPI.CmsPreview, !contentAPI.CmsPreview);
                                if (cData.Status.ToLower() == "a")
                                    CreateThumbNailIfOneDoesntExist(GetPath(cData), 125, true);
                            }
                        }
                        else
                        {
                            Ektron.Cms.AssetUpdateData astData = new AssetUpdateData();
                            astData.FileName = fileName;
                            astData.FolderId = _folderID;
                            astData.TaxonomyTreeIds = _taxonomyIdList;
                            astData.Teaser = FillImageGalleryDescription();
                            astData.Title = Path.GetFileNameWithoutExtension(fileName);
                            astData.LanguageId = _contentLanguage;
                            _contentID = contentAPI.AddAsset(stream, astData);
                            //----------------searchable---------------------
                            IsContentSearchableSection(_contentID);
                            //----------------searchableEnd------------------
                            //Creating the thumbnail, as service takes a while to generate and we see a broken Image in that time.
                            if (_contentID > 0 && createOverwriteThumbnail)
                            {
                                cData = contentAPI.ShowContentById(_contentID, contentAPI.CmsPreview, !contentAPI.CmsPreview);
                                if (cData.Status.ToLower() == "a")
                                    CreateThumbNailIfOneDoesntExist(GetPath(cData), 125, false);
                            }
                        }
                        jsMetaUrl.Text = "";

                        if (isMetadataOrTaxonomyRequired || (isUrlAliasRequired && !EkFunctions.IsImage(Path.GetExtension(fileName))))
                        {
                            //put item into check-in state:
                            contentAPI.EkContentRef.CheckContentOutv2_0(_contentID);
                            contentAPI.EkContentRef.CheckIn(_contentID, "");

                            string _taxString = string.Empty;
                            if (_taxonomyIdList != "")
                                _taxString = "&taxonomyId=" + _taxonomyIdList;
                            jsMetaUrl.Text = contentAPI.AppPath + "DMSMetadata.aspx?contentId=" + _contentID + "&idString=" + _contentID + "&folderId=" + _folderID + _taxString + "&close=true&EkTB_iframe=true&height=550&width=650&modal=true&refreshCaller=true"; ;
                        }

                        isFileUploadComplete.Value = "true";
                        ClientScript.RegisterStartupScript(this.GetType(), "closeThickBox", "uploadClick();", true);
                    }
                }
            }
            else
            {
                setInvalid();
                ltrStatus.Text = _messageHelper.GetMessage("msg invalid file upload");
            }
        }
        else
        {
            setInvalid();
            ltrStatus.Text = _messageHelper.GetMessage("lbl upload file");
        }
    }
Exemple #8
0
    /// <summary>
    ///  Edit Event Click
    /// </summary>
    /// <param name="settings">Setting String</param>
    void EditEvent(string settings)
    {
        string webserviceURL = sitePath + "widgets/RotatingBanner/ImageHandler.ashx";
        // Register JS
        JS.RegisterJSInclude(this, JS.ManagedScript.EktronJS);
        Ektron.Cms.API.JS.RegisterJSInclude(this, Ektron.Cms.API.JS.ManagedScript.EktronJQueryClueTipJS);
        JS.RegisterJSInclude(this, JS.ManagedScript.EktronScrollToJS);
        JS.RegisterJSInclude(this, sitePath + "widgets/RotatingBanner/behavior.js", "RotatingBannerWidgetBehaviorJS");
        // Insert CSS Links
        Css.RegisterCss(this, sitePath + "widgets/RotatingBanner/ImageStyle.css", "RotatingBannerWidgetCSS"); //cbstyle will include the other req'd stylesheets

        JS.RegisterJSBlock(this, "Ektron.PFWidgets.Image.webserviceURL = \"" + webserviceURL + "\"; Ektron.PFWidgets.Image.setupAll('" + uniqueId + "');", "EktronPFWidgetsFlashInit" + this.ID);
        long folderid = -1;

        hdnFolderId.Value = folderid.ToString();
        hdnFolderPath.Value = folderid.ToString();

        //while (folderid != 0)
        //{
        //    folderid = _api.GetParentIdByFolderId(folderid);
        //    if (folderid > 0) hdnFolderPath.Value += "," + folderid.ToString();
        //}

        //this will open the properties tab in edit mode
        JS.RegisterJSBlock(this, "LoadPropertiesTab('" + uniqueId + "');", "LoadPropertiesTab" + this.ID);

        Ektron.Cms.API.Content.Content oCol = new Ektron.Cms.API.Content.Content();
        Ektron.Cms.CollectionListData[] oCollList = oCol.EkContentRef.GetCollectionList();
        uxCollections.DataSource = oCollList;
        uxCollections.DataValueField = "Id";
        uxCollections.DataTextField = "Title";
        uxCollections.DataBind();
        if (CollectionID > 0 && uxCollections.Items.FindByValue(CollectionID.ToString())!=null)
            uxCollections.SelectedValue = CollectionID.ToString();
        CollectionID = Convert.ToInt64(uxCollections.SelectedValue);
        CollectionName = uxCollections.SelectedItem.Text;
        uxImageHeight.Text = ImageHeight;
        uxImageWidth.Text = ImageWidth;
        uxMaxResult.Text = MaxResult.ToString();
        uxRotatingDuration.Text = Duration.ToString();
        uxShowTeaser.Checked = Teaser;
        uxShowTitle.Checked = Title;
        uxShowMediaControl.Checked = ShowMediaControl;

        //this will open the properties tab in edit mode
        JS.RegisterJSBlock(this, "LoadPropertiesTab('" + uniqueId + "');", "LoadPropertiesTab" + this.ID);
        ViewSet.SetActiveView(Edit);
    }
    private void PopulateContentGridData()
    {
        TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("CHECK", "<input type=\"checkbox\" name=\"checkall\" onclick=\"checkAll('selected_items',false);\">", "title-header", HorizontalAlign.Center, HorizontalAlign.Center, Unit.Percentage(2), Unit.Percentage(2), false, false));
        TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("TITLE", _MessageHelper.GetMessage("generic title"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(30), Unit.Percentage(50), false, false));
        TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("ID", _MessageHelper.GetMessage("generic id"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
        TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("LANGUAGE", _MessageHelper.GetMessage("generic language"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));
        TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("URL", _MessageHelper.GetMessage("generic url link"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(30), false, false));
          //  TaxonomyItemList.Columns.Add(_StyleHelper.CreateBoundField("ARCHIVED", _MessageHelper.GetMessage("lbl archived"), "title-header", HorizontalAlign.Left, HorizontalAlign.NotSet, Unit.Percentage(5), Unit.Percentage(5), false, false));

        DataTable dt = new DataTable();
        DataRow dr = default(DataRow);
        LibraryData libraryInfo = default(LibraryData);
        ContentData contData = new ContentData();
        dt.Columns.Add(new DataColumn("CHECK", typeof(string)));
        dt.Columns.Add(new DataColumn("TITLE", typeof(string)));
        dt.Columns.Add(new DataColumn("ID", typeof(string)));
        dt.Columns.Add(new DataColumn("LANGUAGE", typeof(string)));
        dt.Columns.Add(new DataColumn("URL", typeof(string)));
           // dt.Columns.Add(new DataColumn("ARCHIVED", typeof(string)));
        if ((_ViewItem != "folder"))
        {
            PageSettings();
            if ((taxonomy_data != null && taxonomy_data.TaxonomyItems != null && taxonomy_data.TaxonomyItems.Length > 0))
            {
                AddDeleteIcon = true;
                foreach (TaxonomyItemData item in taxonomy_data.TaxonomyItems)
                {
                    TaxonomyItemCount = TaxonomyItemCount + 1;
                    dr = dt.NewRow();
                    dr["CHECK"] = "<input type=\"checkbox\" name=\"selected_items\" id=\"selected_items\" value=\"" + item.TaxonomyItemId + "\" onclick=\"checkAll('selected_items',true);\">";
                    string contenturl = "";
                    switch (Convert.ToInt32(item.ContentType))
                    {
                        case 1:
                            if ((item.ContentSubType == EkEnumeration.CMSContentSubtype.WebEvent))
                            {
                                long fid = _Common.EkContentRef.GetFolderIDForContent(item.TaxonomyItemId);
                                contenturl = "content.aspx?action=ViewContentByCategory&LangType=" + item.TaxonomyItemLanguage + "&id=" + fid + "&callerpage=Localization/LocaleTaxonomy.aspx&origurl=" + EkFunctions.UrlEncode("action=view&view=item&taxonomyid=" + TaxonomyId + "&treeViewId=-1&LangType=" + TaxonomyLanguage);
                            }
                            else
                            {
                                contenturl = "content.aspx?action=View&LangType=" + item.TaxonomyItemLanguage + "&id=" + item.TaxonomyItemId + "&callerpage=Localization/LocaleTaxonomy.aspx&origurl=" + EkFunctions.UrlEncode("action=view&view=item&taxonomyid=" + TaxonomyId + "&treeViewId=-1&LangType=" + TaxonomyLanguage);
                            }
                            break;
                        case 7:
                            // Library Item
                            libraryInfo = m_refContentApi.GetLibraryItemByContentID(item.TaxonomyItemId);
                            contenturl = "library.aspx?LangType=" + libraryInfo.LanguageId + "&action=ViewLibraryItem&id=" + libraryInfo.Id + "&parent_id=" + libraryInfo.ParentId;
                            break;
                        default:
                            contenturl = "content.aspx?action=View&LangType=" + item.TaxonomyItemLanguage + "&id=" + item.TaxonomyItemId + "&callerpage=Localization/LocaleTaxonomy.aspx&origurl=" + EkFunctions.UrlEncode("action=view&view=item&taxonomyid=" + TaxonomyId + "&treeViewId=-1&LangType=" + TaxonomyLanguage);
                            break;
                    }

                    long q = item.TaxonomyItemId;
                    long r = Convert.ToInt64(item.TaxonomyItemLanguage);
                    long s = Convert.ToInt64(item.ContentType);
                    long h = Convert.ToInt64((EkEnumeration.CMSContentSubtype)item.ContentSubType);
                    string i = item.TaxonomyItemTitle.ToString();
                    string n = _MessageHelper.GetMessage("generic Title") + " " + item.TaxonomyItemTitle.ToString();
                    string l = _Common.ApplicationPath + contenturl;
                    string po = item.TaxonomyItemAssetInfo.FileName;
                    string qpo = item.TaxonomyItemAssetInfo.ImageUrl;

                    dr["TITLE"] = m_refContentApi.GetDmsContextMenuHTML(item.TaxonomyItemId, Convert.ToInt64(item.TaxonomyItemLanguage), Convert.ToInt64(item.ContentType), h, item.TaxonomyItemTitle.ToString(), _MessageHelper.GetMessage("generic Title") + " " + item.TaxonomyItemTitle.ToString(), _Common.ApplicationPath + contenturl, item.TaxonomyItemAssetInfo.FileName, item.TaxonomyItemAssetInfo.ImageUrl);
                    dr["ID"] = item.TaxonomyItemId;
                    dr["LANGUAGE"] = item.TaxonomyItemLanguage;
                    if (item.ContentType == "102" || item.ContentType == "106")
                    {
                        libraryInfo = m_refContentApi.GetLibraryItemByContentID(item.TaxonomyItemId);
                        dr["URL"] = libraryInfo.FileName.Replace("//", "/");
                    }
                    else
                    {
                        Ektron.Cms.API.Content.Content api = new Ektron.Cms.API.Content.Content();
                        contData = api.GetContent(item.TaxonomyItemId);
                        //contData = m_refContentApi.GetContentById(item.TaxonomyItemId)
                        dr["URL"] = contData.Quicklink;
                    }
                    //if (item.ContentType == EkEnumeration.CMSContentType.Archive_Content.ToString() || item.ContentType == EkEnumeration.CMSContentType.Archive_Forms.ToString() || item.ContentType == EkEnumeration.CMSContentType.Archive_Media.ToString() || (Convert.ToInt32(item.ContentType) >= EkConstants.Archive_ManagedAsset_Min && Convert.ToInt32(item.ContentType) < EkConstants.Archive_ManagedAsset_Max && Convert.ToInt32(item.ContentType) != 3333 && Convert.ToInt32(item.ContentType) != 1111))
                    //{
                    //    dr["ARCHIVED"] = "<span class=\"Archived\"></span>";
                    //}
                    dt.Rows.Add(dr);
                }

            }
            else
            {
                dr = dt.NewRow();
                dt.Rows.Add(dr);
                TaxonomyItemList.GridLines = GridLines.None;
            }
        }
        else
        {
            VisiblePageControls(false);
            //TaxonomyFolderSyncData[] taxonomy_sync_folder = null;
            //TaxonomyBaseRequest tax_sync_folder_req = new TaxonomyBaseRequest();
            //tax_sync_folder_req.TaxonomyId = TaxonomyId;
            //tax_sync_folder_req.TaxonomyLanguage = TaxonomyLanguage;
            //taxonomy_sync_folder = _Content.GetAllAssignedCategoryFolder(tax_sync_folder_req);
            Ektron.Cms.BusinessObjects.Localization.LocaleTaxonomy api = new Ektron.Cms.BusinessObjects.Localization.LocaleTaxonomy(_Common.RequestInformationRef);
            List<LocalizableItem> folderItemList = api.GetList(TaxonomyId, _Common.ContentLanguage, false);
            int totalFolderCount = 0;
            if ((folderItemList != null && folderItemList.Count > 0))
            {

                for (int i = 0; i <= folderItemList.Count - 1; i++)
                {
                    if (folderItemList[i].LocalizableType == LocalizableCmsObjectType.FolderContents)
                    {
                        AddDeleteIcon = true;
                        totalFolderCount = totalFolderCount + 1;
                        //get the folder data from folder id.
                        FolderData assignedFolderData = folderApi.GetFolder(folderItemList[i].Id);
                        TaxonomyItemCount = TaxonomyItemCount + 1;
                        dr = dt.NewRow();
                        dr["CHECK"] = "<input type=\"checkbox\" name=\"selected_items\" id=\"selected_items\" value=\"" + assignedFolderData.Id + "\" onclick=\"checkAll('selected_items',true);\">";

                        string contenturl = null;
                        contenturl =_Common.ApplicationPath + "content.aspx?action=ViewContentByCategory&id=" + assignedFolderData.Id + "&treeViewId=0";

                        dr["TITLE"] = "<a href=\"" + contenturl + "\">";
                        dr["TITLE"] += "<img src=\"";
                        switch ((EkEnumeration.FolderType)assignedFolderData.FolderType)
                        {
                            case EkEnumeration.FolderType.Catalog:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderGreen.png";
                                break;
                            case EkEnumeration.FolderType.Community:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderCommunity.png";
                                break;
                            case EkEnumeration.FolderType.Blog:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderBlog.png";
                                break;
                            case EkEnumeration.FolderType.DiscussionBoard:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderBoard.png";
                                break;
                            case EkEnumeration.FolderType.DiscussionForum:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folderBoard.png";
                                break;
                            default:
                                dr["TITLE"] += m_refContentApi.AppPath + "images/ui/icons/folder.png";
                                break;
                        }
                        dr["TITLE"] += "\"></img>";
                        dr["TITLE"] += "</a><a href=\"" + contenturl + "\">";
                        dr["TITLE"] += assignedFolderData.Name;
                        //& GetRecursiveTitle(item.FolderRecursive)
                        dr["TITLE"] += "</a>";

                        dr["ID"] = assignedFolderData.Id;
                        dr["LANGUAGE"] = TaxonomyLanguage;
                        dt.Rows.Add(dr);
                    }
                }
            }
            else
            {
                dr = dt.NewRow();
                dt.Rows.Add(dr);
                TaxonomyItemList.GridLines = GridLines.None;
            }
            //ltrItemCount.Text = totalFolderCount.ToString();
        }
        DataView dv = new DataView(dt);
        TaxonomyItemList.DataSource = dv;
        TaxonomyItemList.DataBind();
    }
    /// <summary>
    /// Returns the markup to display the redistribution details.
    /// </summary>
    /// <param name="destinationContentID">Destination content ID</param>
    /// <returns>Markup to display the redistribution details</returns>
    private string GetRedistributionDetails(long destinationContentID)
    {
        Ektron.Cms.API.Content.Content contentAPI = new Ektron.Cms.API.Content.Content();
        ContentData destinationContent = contentAPI.GetContent(
            destinationContentID,
            ContentAPI.ContentResultType.Published);

        string destinationContentTitle = destinationContent.Title;
        string destinationFolderPath = contentAPI.EkContentRef.GetFolderPath(destinationContent.FolderId);

        StringBuilder sbDetails = new StringBuilder();
        sbDetails.Append("<ul><li>");
        sbDetails.Append("It was previously distributed to the following location:");
        sbDetails.Append("<ul><li>");
        sbDetails.Append(destinationFolderPath);
        if (destinationFolderPath.LastIndexOf("\\") != destinationFolderPath.Length - 1)
        {
            sbDetails.Append("\\");
        }
        sbDetails.Append(destinationContentTitle);
        sbDetails.Append("</li></ul></li></ul>");
        sbDetails.Append("<div id=\"DistributionWizardRedistributionInformation\">You cannot currently distribute this document to a different folder. If you want to do that, first go to ");
        sbDetails.Append(destinationFolderPath);
        sbDetails.Append(" and delete the document from there.</div>");

        return sbDetails.ToString();
    }