Ejemplo n.º 1
0
    public static string CheckFileExists(string FileName, string FolderID, string ContLanguage, string taxonomyID)
    {
        ContentAPI cApi = new ContentAPI();
        string cStatus = string.Empty;
        cApi.ContentLanguage = Convert.ToInt32(ContLanguage);
        Ektron.ASM.AssetConfig.AssetData assetDat = new Ektron.ASM.AssetConfig.AssetData();

        assetDat = cApi.EkContentRef.GetAssetDataBasedOnFileName(Path.GetFileName(FileName.Replace("'", "_")), Convert.ToInt64(FolderID), Convert.ToInt64(taxonomyID));
        if (assetDat != null && assetDat.ID != "" && assetDat.Name != "")
        {
            ContentStateData myContentStateData = new ContentStateData();
            myContentStateData = cApi.GetContentState(Convert.ToInt64(assetDat.ID));
            cStatus = myContentStateData.Status;
            if (cStatus == "O")
            {
                //Set Property variable that identify the user by whom the content is checked out
                if (myContentStateData.CurrentUserId == cApi.UserId)
                    cStatus = "A";
            }
            return cStatus;
        }
        else
            return "";
    }