当前位置: 首页>>代码示例>>C#>>正文


C# ContentAPI.GetContentStatusById方法代码示例

本文整理汇总了C#中ContentAPI.GetContentStatusById方法的典型用法代码示例。如果您正苦于以下问题:C# ContentAPI.GetContentStatusById方法的具体用法?C# ContentAPI.GetContentStatusById怎么用?C# ContentAPI.GetContentStatusById使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在ContentAPI的用法示例。


在下文中一共展示了ContentAPI.GetContentStatusById方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Page_Load

    private void Page_Load(System.Object sender, System.EventArgs e)
    {
        try
        {
            bool fileChanged = true;
            string assetId;
            List<AssetFileData> assetIdFileNameList = null;
            List<AssetFileData> tempAssetIdFileNameList = new List<AssetFileData>();
            m_refContent = AppUI.EkContentRef;
            if (Request.Form["type"] != null)
            {
                actionType = (string)(Request.Form["type"].Trim().ToLower());
            }

            if (Request.Form["requireMetaTaxonomy"] != null)
            {
                isCallerDmsDragDropCtl = true;
            }

            m_refContApi = new ContentAPI();
            m_refMsg = m_refContApi.EkMsgRef;
            if (!String.IsNullOrEmpty(Request.Form["content_language"]))
            {

                ContentLanguage = Convert.ToInt32(Request.Form["content_language"]);
                if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED || ContentLanguage == Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
                {
                    ContentLanguage = AppUI.DefaultContentLanguage;
                }
                AppUI.ContentLanguage = ContentLanguage;
                m_refContApi.ContentLanguage = ContentLanguage;

            }
            if (actionType.ToLower() == "add" && (Request.QueryString["SelTaxonomyId"] != null) && Request.QueryString["SelTaxonomyId"] != "")
            {
                TaxonomySelectId = Convert.ToInt64(Request.QueryString["SelTaxonomyId"]);
            }
            userId = Convert.ToInt64(Ektron.Cms.CommonApi.GetEcmCookie()["user_id"]);
            loginToken = Convert.ToInt32(Ektron.Cms.CommonApi.GetEcmCookie()["unique_id"]);

            if ((Request.Form["taxonomyselectedtree"] != null) && Request.Form["taxonomyselectedtree"].ToString().Length > 1)
            {
                jsTaxonomyIdReloadFrame.Text = Request.Form["taxonomyselectedtree"].ToString();
                if (Request.Form["taxonomyselectedtree"].ToString().Split(",".ToCharArray()) != null)
                {
                    jsTaxonomyId.Text = (Request.Form["taxonomyselectedtree"].ToString().Split(",".ToCharArray()))[0];
                }
            }

            if (Request.Form["editaction"] == "cancel")
            {
                Session.Remove(Convert.ToString(userId) + Convert.ToString(loginToken) + "Attachments");
                if ((actionType != "add") && (Request.Form["content_id"] != "" && Convert.ToInt64(Request.Form["content_id"]) > 0))
                {
                    string status = m_refContApi.GetContentStatusById(Convert.ToInt64(Request.Form["content_id"]));
                    if (status.ToLower() == "o") //28710 - if asset is a office file status = "A" on saving in word
                    {
                        m_refContent.UndoCheckOutv2_0(Convert.ToInt64(Request.Form["content_id"]));
                    }
                    if (Request.Form["FromEE"] == "true" || Request.QueryString["close"] == "true")
                    {
                        if (Request.QueryString["close"] == "true")
                        {
                            Response.Redirect("close.aspx?reload=true", false);
                            return;
                        }
                        else
                        {
                            Response.Redirect("close.aspx", false);
                            return;
                        }
                    }
                    else
                    {
                        Response.Redirect((string)("content.aspx?id=" + Request.Form["content_id"] + "&action=viewstaged&LangType=" + m_refContApi.ContentLanguage), false);
                        return;
                    }
                }
                else
                {
                    if (Request.Form["FromEE"] == "true" || Request.QueryString["close"] == "true")
                    {
                        if (Request.QueryString["close"] == "true")
                        {
                            Response.Redirect("close.aspx?reload=true", false);
                            return;
                        }
                        else
                        {
                            Response.Redirect("close.aspx", false);
                            return;
                        }
                    }
                    else
                    {
                        Response.Redirect((string)("content.aspx?id=" + Request.Form["content_folder"] + "&action=ViewContentByCategory&LangType=" + m_refContApi.ContentLanguage), false);
                        return;
                    }
                }
            }
//.........这里部分代码省略.........
开发者ID:jaytem,项目名称:minGit,代码行数:101,代码来源:ProcessUpload.aspx.cs

示例2: PublishContent


//.........这里部分代码省略.........
                EditUrlAlias(long.Parse(contId),this.m_folderId);
                page_meta_data = new Collection();
                if (hasMeta == true)
                {
                    for (i = 1; i <= ValidCounter; i++)
                    {
                        acMetaInfo[1] = Page.Request.Form["frm_meta_type_id_" + i];
                        acMetaInfo[2] = contId;
                        MetaSeparator = Page.Request.Form["MetaSeparator_" + i];
                        MetaSelect = Page.Request.Form["MetaSelect_" + i];
                        if (Convert.ToInt32(MetaSelect) != 0)
                        {
                            MetaTextString = Strings.Replace(Page.Request.Form["frm_text_" + i], ", ", MetaSeparator.ToString(), 1, -1, 0);
                            if (MetaTextString.StartsWith(MetaSeparator))
                            {
                                MetaTextString = MetaTextString.Substring(MetaTextString.Length - (MetaTextString.Length - 1), (MetaTextString.Length - 1));
                            }
                            MetaTextString = CleanString(MetaTextString);
                            acMetaInfo[3] = MetaTextString;
                        }
                        else
                        {
                            MetaTextString = Strings.Replace(Page.Request.Form["frm_text_" + i], ";", MetaSeparator.ToString(), 1, -1, 0);
                            if (MetaTextString == null)
                                MetaTextString = "";
                            MetaTextString = CleanString(MetaTextString);
                            acMetaInfo[3] = MetaTextString;
                        }
                        page_meta_data.Add(acMetaInfo, i.ToString(), null, null);
                        acMetaInfo = new object[4];
                    }
                }
                if (!(string.IsNullOrEmpty(TaxonomyTreeIdList)))
                {

                    TaxonomyContentRequest request = new TaxonomyContentRequest();

                    request.ContentId = long.Parse(contId);
                    request.TaxonomyList = TaxonomyTreeIdList;
                    request.FolderID = m_folderId;
                    contObj.AddTaxonomyItem(request);
                }

                if (page_meta_data.Count > 0 && hasMeta == true)
                {
                    m_ContentApi.EkContentRef.UpdateMetaData(page_meta_data);
                }

            }
        }

        foreach (string tempLoopVar_contId in ids)
        {
            contId = tempLoopVar_contId;
            if (contId != "")
            {
                try
                {
                    string Status;
                    Status = (string)(contApi.GetContentStatusById(long.Parse(contId)));
                    long lcontId=long.Parse(contId);
                    if (htImagesAssets[lcontId] != null)// if item is exists in the hash table, the url alias is required.
                    {//process url alias required, publish image assets, checkin others
                        bool bIsPublish = (bool)htImagesAssets[lcontId];

                        if (Status == "O")
                        {
                            if (bIsPublish)
                                contApi.PublishContentById(lcontId, m_folderId, ContentLanguage, "true", -1, "");
                            else
                                contApi.EkContentRef.CheckIn(lcontId, "");
                        }
                        else if (Status == "I")
                        {
                            if(bIsPublish)
                                contApi.EkContentRef.SubmitForPublicationv2_0(lcontId, m_folderId, string.Empty);
                        }
                    }
                    else
                    {// normal process
                        if (Status == "O") // this will check in and publish
                        {
                            contApi.PublishContentById(lcontId, m_folderId, ContentLanguage, "true", -1, "");
                        }
                        else if (Status == "I") // this is just a publish
                        {
                            contApi.EkContentRef.SubmitForPublicationv2_0(lcontId, m_folderId, string.Empty);
                        }
                    }
                }
                catch (Exception)
                {
                    // I wrapped it in this try block because there is a current problem on the server where the content is already being put
                    // into published state if there are multiple pieces of content, the metadata still updates and is put in the right state.
                }
            }
        }

        return true;
    }
开发者ID:jaytem,项目名称:minGit,代码行数:101,代码来源:DmsMetadata.aspx.cs


注:本文中的ContentAPI.GetContentStatusById方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。