本文整理汇总了C#中ContentAPI.SetCookieValue方法的典型用法代码示例。如果您正苦于以下问题:C# ContentAPI.SetCookieValue方法的具体用法?C# ContentAPI.SetCookieValue怎么用?C# ContentAPI.SetCookieValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentAPI
的用法示例。
在下文中一共展示了ContentAPI.SetCookieValue方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Page_Load
protected void Page_Load(object sender, System.EventArgs e)
{
try
{
m_refContentApi = new ContentAPI();
AppImgPath = m_refContentApi.AppImgPath;
m_refMsg = m_refContentApi.EkMsgRef;
Utilities.ValidateUserLogin();
RegisterResources();
if (!(Request.QueryString["folderid"] == null))
{
if (Request.QueryString["folderid"] != "")
{
m_intFolderId = Convert.ToInt64(Request.QueryString["folderid"]);
}
}
if (Request.QueryString["LangType"] != "")
{
ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
}
else
{
if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
{
ContentLanguage = int.Parse(m_refContentApi.GetCookieValue("LastValidLanguageID"));
}
}
m_refContentApi.ContentLanguage = ContentLanguage;
SearchStyleSheet = "<link rel=\'stylesheet\' type=\'text/css\' href=\'csslib/worksearch.css\'>" + "\r\n";
StyleSheetJS = m_refStyle.GetClientScript();
if (ProductSearch1 != null)
{
ProductSearch1.CatalogId = m_intFolderId;
ProductSearch1.LanguageID = ContentLanguage;
ProductSearch1.IsInWorkArea = true;
ProductSearch1.DisplayXslt = "Xslt/WA_ProductSearch.xsl";
//ProductSearch1.TemplateProduct = "ProductView.aspx"
}
if (Page.IsPostBack == false)
{
Display_ToolBar();
}
}
catch (Exception ex)
{
if (ex.Message.ToLower().IndexOf("service is not running") != -1)
{
Utilities.ShowError("Error: Index service is not running. You cannot search on Products. Restart the service.");
}
else
{
Utilities.ShowError(ex.Message);
}
}
}
示例2: Page_Load
protected override void Page_Load(object sender, System.EventArgs e)
{
base.Page_Load(sender, e);
m_refContApi = new ContentAPI();
Utilities.ValidateUserLogin();
RegisterResources();
if (!(Request.QueryString["LangType"] == null))
{
if (Request.QueryString["LangType"] != "")
{
m_intContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
m_refContApi.SetCookieValue("SiteLanguage", m_intContentLanguage.ToString());
}
else
{
if (m_refContApi.GetCookieValue("SiteLanguage") != "")
{
m_intContentLanguage = Convert.ToInt32(m_refContApi.GetCookieValue("SiteLanguage"));
}
}
}
else
{
if (m_refContApi.GetCookieValue("SiteLanguage") != "")
{
m_intContentLanguage = Convert.ToInt32(m_refContApi.GetCookieValue("SiteLanguage"));
}
}
if (m_intContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED || m_intContentLanguage == Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
{
m_intContentLanguage = m_refContApi.DefaultContentLanguage;
}
if (m_intContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
{
m_refContApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
}
else
{
m_refContApi.ContentLanguage = m_intContentLanguage;
}
if (!Ektron.Cms.DataIO.LicenseManager.LicenseManager.IsFeatureEnable(m_refContentApi.RequestInformationRef, Ektron.Cms.DataIO.LicenseManager.Feature.SocialNetworking))
{
Utilities.ShowError(m_refContentApi.EkMsgRef.GetMessage("feature locked error"));
}
SetLabels();
}
示例3: Page_Load
private void Page_Load(System.Object sender, System.EventArgs e)
{
ContentAPI m_refContApi = new ContentAPI();
string strAction = "";
string showBackButton = "";
m_refMsg = m_refContApi.EkMsgRef;
AppName = m_refContApi.AppName;
if (!(Request.QueryString["LangType"] == null))
{
if (Request.QueryString["LangType"] != "")
{
m_intContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
m_refContApi.SetCookieValue("LastValidLanguageID", m_intContentLanguage.ToString());
}
else
{
if (m_refContApi.GetCookieValue("LastValidLanguageID") != "")
{
m_intContentLanguage = Convert.ToInt32(m_refContApi.GetCookieValue("LastValidLanguageID"));
}
}
}
else
{
if (m_refContApi.GetCookieValue("LastValidLanguageID") != "")
{
m_intContentLanguage = Convert.ToInt32(m_refContApi.GetCookieValue("LastValidLanguageID"));
}
}
if (Request.QueryString["action"] != null && Request.QueryString["action"] != "")
{
strAction = (string)("&action=" + Request.QueryString["action"]);
}
if (!(Request.QueryString["showbackbutton"] == null) && Request.QueryString["showbackbutton"] != "")
{
showBackButton = (string)("&showbackbutton=" + Request.QueryString["showBackButton"]);
}
//list_frame.Attributes("src") = "historylist.aspx?LangType=" & m_intContentLanguage & "&id=" & Request.QueryString("id") & strAction
history_frame.Attributes["src"] = "history.aspx?LangType=" + m_intContentLanguage + "&id=" + Request.QueryString["id"] + strAction + showBackButton;
}
示例4: Page_Load
protected void Page_Load(object sender, System.EventArgs e)
{
try
{
m_refContentApi = new ContentAPI();
AppImgPath = m_refContentApi.AppImgPath;
m_refMsg = m_refContentApi.EkMsgRef;
Utilities.ValidateUserLogin();
RegisterResources();
if (!(Request.QueryString["folderid"] == null))
{
if (!string.IsNullOrEmpty(Request.QueryString["folderid"]))
{
m_intFolderId = long.Parse(Request.QueryString["folderid"].ToString()) ;
}
}
if (!string.IsNullOrEmpty(Request.QueryString["LangType"]))
{
ContentLanguage = int.Parse(Request.QueryString["LangType"].ToString()) ;
m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
}
else
{
if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
{
ContentLanguage = int.Parse(m_refContentApi.GetCookieValue("LastValidLanguageID"));
}
}
m_refContentApi.ContentLanguage = ContentLanguage;
StyleSheetJS = m_refStyle.GetClientScript();
if (Page.IsPostBack == false)
{
Display_ToolBar();
}
}
catch (Exception ex)
{
Utilities.ShowError(ex.Message);
}
}
示例5: Page_Init
protected void Page_Init(object sender, EventArgs e)
{
int langid = 0;
ContentAPI m_refContApi = new ContentAPI();
if (Request.QueryString["LangType"] != null)
{
if (Request.QueryString["LangType"] != string.Empty)
{
langid = int.Parse(Request.QueryString["LangType"]);
m_refContApi.SetCookieValue("SiteLanguage", langid.ToString());
}
else
{
if (m_refContApi.GetCookieValue("SiteLanguage") != string.Empty)
{
langid = int.Parse(m_refContApi.GetCookieValue("SiteLanguage"));
}
}
}
else
{
if (m_refContApi.GetCookieValue("SiteLanguage") != string.Empty)
{
langid = int.Parse(m_refContApi.GetCookieValue("SiteLanguage"));
}
}
if (langid == EkConstants.CONTENT_LANGUAGES_UNDEFINED || langid == EkConstants.ALL_CONTENT_LANGUAGES)
{
langid = m_refContApi.DefaultContentLanguage;
}
if (langid == EkConstants.CONTENT_LANGUAGES_UNDEFINED)
{
m_refContApi.ContentLanguage = EkConstants.ALL_CONTENT_LANGUAGES;
}
else
{
m_refContApi.ContentLanguage = langid;
}
}
示例6: Page_Init
protected void Page_Init(object sender, System.EventArgs e)
{
m_refContApi = new ContentAPI();
if (Request.QueryString["LangType"] == null)
{
if (Request.QueryString["LangType"] != "")
{
m_intContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
m_refContApi.SetCookieValue("SiteLanguage", m_intContentLanguage.ToString());
}
else
{
if (m_refContApi.GetCookieValue("SiteLanguage") != "")
{
m_intContentLanguage = Convert.ToInt32(m_refContApi.GetCookieValue("SiteLanguage"));
}
}
}
else
{
if (m_refContApi.GetCookieValue("SiteLanguage") != "")
{
m_intContentLanguage = Convert.ToInt32(m_refContApi.GetCookieValue("SiteLanguage"));
}
}
if (m_intContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED || m_intContentLanguage == Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
{
m_intContentLanguage = m_refContApi.DefaultContentLanguage;
}
if (m_intContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
{
m_refContApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
}
else
{
m_refContApi.ContentLanguage = m_intContentLanguage;
}
}
示例7: SetLanguage
//public static void AddLBpaths(Collection data)
//{
// ContentAPI apiCont = new ContentAPI();
// Ektron.Cms.Library.EkLibrary objLib;
// int lbICount;
// int lbFCount;
// Collection lb;
// Collection cLbs;
// lbICount = 0;
// lbFCount = 0;
// objLib = apiCont.EkLibraryRef;
// cLbs = objLib.GetAllLBPaths("images");
// if (cLbs.Count > 0)
// {
// foreach (Collection tempLoopVar_lb in cLbs)
// {
// lb = tempLoopVar_lb;
// lbICount++;
// data.Add(HttpContext.Current.Server.MapPath((string)(lb["LoadBalancePath"])), "LoadBalanceImagePath_" + lbICount, null, null);
// }
// }
// data.Add(lbICount, "LoadBalanceImageCount", null, null);
// cLbs = null;
// lb = null;
// cLbs = objLib.GetAllLBPaths("files");
// if (cLbs.Count > 0)
// {
// foreach (Collection tempLoopVar_lb in cLbs)
// {
// lb = tempLoopVar_lb;
// lbFCount++;
// data.Add(HttpContext.Current.Server.MapPath((string)(lb["LoadBalancePath"])), "LoadBalanceFilePath_" + lbFCount, null, null);
// }
// }
// data.Add(lbFCount, "LoadBalanceFileCount", null, null);
// cLbs = null;
//}
//public static void SetLanguage(object api)
//{
// int ContentLanguage = -1;
// if (!(System.Web.HttpContext.Current.Request.QueryString["LangType"] == null))
// {
// if (System.Web.HttpContext.Current.Request.QueryString["LangType"] != "")
// {
// ContentLanguage = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["LangType"]);
// Ektron.Cms.API.SetCookieValue("LastValidLanguageID", ContentLanguage);
// }
// else
// {
// if (Ektron.Cms.API.GetCookieValue("LastValidLanguageID") != "")
// {
// ContentLanguage = Convert.ToInt32(Ektron.Cms.API.GetCookieValue("LastValidLanguageID"));
// }
// }
// }
// else
// {
// if (Ektron.Cms.API.GetCookieValue("LastValidLanguageID") != "")
// {
// ContentLanguage = Convert.ToInt32(Ektron.Cms.API.GetCookieValue("LastValidLanguageID"));
// }
// }
// if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
// {
// Ektron.Cms.API.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
// }
// else
// {
// Ektron.Cms.API.ContentLanguage = ContentLanguage;
// }
//}
public static void SetLanguage(ContentAPI api)
{
int ContentLanguage = -1;
if (!(System.Web.HttpContext.Current.Request.QueryString["LangType"] == null))
{
if (System.Web.HttpContext.Current.Request.QueryString["LangType"] != "")
{
ContentLanguage = Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["LangType"]);
api.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
}
else
{
if (api.GetCookieValue("LastValidLanguageID") != "")
{
ContentLanguage = Convert.ToInt32(api.GetCookieValue("LastValidLanguageID"));
}
}
}
else
{
if (api.GetCookieValue("LastValidLanguageID") != "")
{
ContentLanguage = Convert.ToInt32(api.GetCookieValue("LastValidLanguageID"));
}
}
if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
{
api.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
}
//.........这里部分代码省略.........
示例8: Page_Load
private void Page_Load(System.Object sender, System.EventArgs e)
{
try
{
m_refContentApi = new ContentAPI();
_analyticsEnabled = AnalyticsSecurity.Enabled(m_refContentApi.RequestInformationRef);
RegisterResources();
if (!(Request.QueryString["LangType"] == null))
{
if (Request.QueryString["LangType"] != "")
{
ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
}
else
{
if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
{
ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID"));
}
}
}
else
{
if (m_refContentApi.GetCookieValue("LastValidLanguageID") != "")
{
ContentLanguage = Convert.ToInt32(m_refContentApi.GetCookieValue("LastValidLanguageID"));
}
}
if (ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
{
m_refContentApi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
}
else
{
m_refContentApi.ContentLanguage = ContentLanguage;
}
m_refMsg = m_refContentApi.EkMsgRef;
if (!(Request.QueryString["id"] == null))
{
if (Request.QueryString["id"] != "")
{
ContentId = Convert.ToInt64(Request.QueryString["id"]);
}
}
if (!(Request.QueryString["showbackbutton"] == null))
{
if (Request.QueryString["showbackbutton"] != "")
{
ShowBackButton = Convert.ToBoolean(Request.QueryString["showbackbutton"]);
}
}
if (ContentId > 0)
{
m_contentType = m_refContentApi.EkContentRef.GetContentType(ContentId);
}
switch (m_contentType)
{
case Ektron.Cms.Common.EkConstants.CMSContentType_CatalogEntry:
Populate_EntryHistoryListGrid(ContentId);
DisplayEntryHistoryToolBar();
Util_SetResources();
break;
default:
Populate_HistoryListGrid(ContentId);
DisplayHistoryToolBar();
Util_SetResources();
break;
}
}
catch (Exception ex)
{
Response.Redirect(m_refContentApi.ApplicationPath + "reterror.aspx?info=" + ex.Message, false);
}
}
示例9: Page_Load
private void Page_Load(System.Object sender, System.EventArgs e)
{
m_refContentApi = new ContentAPI();
m_refMsg = m_refContentApi.EkMsgRef;
AppName = m_refContentApi.AppName;
AppImgPath = m_refContentApi.AppImgPath;
StyleSheetJS.Value = m_refStyle.GetClientScript();
nId = Convert.ToInt64(Request.Params["nid"]);
menu = m_refContentApi.EkContentRef.GetMenuDataByID(nId);
ParentMenuId = menu.ParentID;
AncestorMenuId = menu.AncestorID;
FolderID = menu.FolderID;
EnableMultilingual = m_refContentApi.EnableMultilingual;
if (!Utilities.ValidateUserLogin())
{
return;
}
if (Convert.ToBoolean(m_refContentApi.RequestInformationRef.IsMembershipUser))
{
Response.Redirect((string)("reterror.aspx?info=" + m_refMsg.GetMessage("msg login cms user")), false);
return;
}
RegisterResources();
if (!string.IsNullOrEmpty(Request.QueryString["LangType"]))
{
ContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
m_refContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
}
else
{
if (!string.IsNullOrEmpty(m_refContentApi.GetCookieValue("LastValidLanguageID")))
{
ContentLanguage = int.Parse(m_refContentApi.GetCookieValue("LastValidLanguageID"));
}
}
m_selectedFolderList = GetFolderList(nId);
MenuToolBar();
}
示例10: PublishContent
private bool PublishContent()
{
ContentAPI contApi = new ContentAPI();
EkContent contObj;
int ContentLanguage = EkConstants.CONTENT_LANGUAGES_UNDEFINED;
if (!(Page.Request.QueryString["LangType"] == null))
{
if (Page.Request.QueryString["LangType"] != "")
{
ContentLanguage = Convert.ToInt32(Page.Request.QueryString["LangType"]);
contApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
}
else
{
if (contApi.GetCookieValue("LastValidLanguageID") != "")
{
ContentLanguage = Convert.ToInt32(contApi.GetCookieValue("LastValidLanguageID"));
}
}
}
else
{
if (contApi.GetCookieValue("LastValidLanguageID") != "")
{
ContentLanguage = Convert.ToInt32(contApi.GetCookieValue("LastValidLanguageID"));
}
}
if (ContentLanguage == EkConstants.CONTENT_LANGUAGES_UNDEFINED)
{
contApi.ContentLanguage = EkConstants.ALL_CONTENT_LANGUAGES;
}
else
{
contApi.ContentLanguage = ContentLanguage;
}
object[] acMetaInfo = new object[4];
string MetaSelect;
string MetaSeparator;
string MetaTextString = "";
int ValidCounter = 0;
int i = 0;
bool hasMeta = false;
if (Page.Request.Form["frm_validcounter"] != "")
{
ValidCounter = System.Convert.ToInt32(Page.Request.Form["frm_validcounter"]);
hasMeta = true;
}
else
{
ValidCounter = 1;
}
string TaxonomyTreeIdList = "";
TaxonomyTreeIdList = Page.Request.Form[taxonomyselectedtree.UniqueID];
if ((!string.IsNullOrEmpty(TaxonomyTreeIdList)) && TaxonomyTreeIdList.Trim().EndsWith(","))
{
ltrTaxonomyTreeIdList.Text = TaxonomyTreeIdList.Substring(0, TaxonomyTreeIdList.Length - 1);
}
contObj = contApi.EkContentRef;
string[] ids;
string contId = "";
ids = m_idString.Split(",".ToCharArray());
htImagesAssets = new System.Collections.Hashtable();
foreach (string tempLoopVar_contId in ids)
{
contId = tempLoopVar_contId;
if (contId != "")
{
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;
//.........这里部分代码省略.........
示例11: CaptureTaxonomy
private string CaptureTaxonomy(long contentId, long folderId)
{
StringBuilder taxonomyOutput = new StringBuilder();
Folder myFolderApi = new Folder();
FolderData myFolderData;
ContentAPI myContentApi = new ContentAPI();
TaxonomyBaseData[] myTaxonomyBaseData;
List<long> myTaxonomyIds = new List<long>();
System.Text.StringBuilder Js;
Js = new System.Text.StringBuilder();
long iTmpCaller = myContentApi.RequestInformationRef.CallerId;
long iTmpuserID = myContentApi.RequestInformationRef.UserId;
int ContentLanguage = EkConstants.CONTENT_LANGUAGES_UNDEFINED;
if (!(Page.Request.QueryString["LangType"] == null))
{
if (Page.Request.QueryString["LangType"] != "")
{
ContentLanguage = Convert.ToInt32(Page.Request.QueryString["LangType"]);
myContentApi.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
}
else
{
if (myContentApi.GetCookieValue("LastValidLanguageID") != "")
{
ContentLanguage = Convert.ToInt32(myContentApi.GetCookieValue("LastValidLanguageID"));
}
}
}
else
{
if (myContentApi.GetCookieValue("LastValidLanguageID") != "")
{
ContentLanguage = Convert.ToInt32(myContentApi.GetCookieValue("LastValidLanguageID"));
}
}
if (ContentLanguage == EkConstants.CONTENT_LANGUAGES_UNDEFINED)
{
myContentApi.ContentLanguage = EkConstants.ALL_CONTENT_LANGUAGES;
}
else
{
myContentApi.ContentLanguage = ContentLanguage;
}
myContentApi.RequestInformationRef.CallerId = Ektron.Cms.Common.EkConstants.InternalAdmin;
myContentApi.RequestInformationRef.UserId = Ektron.Cms.Common.EkConstants.InternalAdmin;
myFolderData = myContentApi.GetFolderById(folderId, true);
myTaxonomyBaseData = myFolderData.FolderTaxonomy;
myContentApi.RequestInformationRef.CallerId = iTmpCaller;
myContentApi.RequestInformationRef.UserId = iTmpuserID;
if (!String.IsNullOrEmpty(Request.QueryString["TaxonomyId"]))
{
jsTaxRedirectID.Text=taxonomyselectedtree.Value = Request.QueryString["TaxonomyId"].ToString();
}
SetTaxonomy(contentId, folderId);
Js.Append("function ValidateTax(){").Append(Environment.NewLine);
if (myTaxonomyBaseData.Length > 0 && (myTaxonomyBaseData != null))
{
if (myFolderData.CategoryRequired == true)
{
Js.Append(" document.getElementById(\"taxonomyselectedtree\").value=\"\";").Append(Environment.NewLine);
Js.Append(" for(var i=0;i<taxonomytreearr.length;i++){").Append(Environment.NewLine);
Js.Append(" if(document.getElementById(\"taxonomyselectedtree\").value==\"\"){").Append(Environment.NewLine);
Js.Append(" document.getElementById(\"taxonomyselectedtree\").value=taxonomytreearr[i];").Append(Environment.NewLine);
Js.Append(" }else{").Append(Environment.NewLine);
Js.Append(" document.getElementById(\"taxonomyselectedtree\").value=document.getElementById(\"taxonomyselectedtree\").value+\",\"+taxonomytreearr[i];").Append(Environment.NewLine);
Js.Append(" }").Append(Environment.NewLine);
Js.Append(" } ").Append(Environment.NewLine);
Js.Append(" if (Trim(document.getElementById(\'taxonomyselectedtree\').value) == \'\') { ").Append(Environment.NewLine);
Js.Append(" alert(\'" + m_refMsg.GetMessage("js tax cat req") + "\'); ").Append(Environment.NewLine);
Js.Append(" return false; ").Append(Environment.NewLine);
Js.Append(" } ").Append(Environment.NewLine);
Js.Append(" return true; }").Append(Environment.NewLine);
}
else
{
Js.Append(" return true;}").Append(Environment.NewLine);
}
ltrTaxJS.Text = Js.ToString();
ltrShowTaxonomy.Text = "<li><a id=\"taxonomyAnchor\" href=\"#\" onclick=\"dmsMetadataShowHideCategory(\'taxonomy\');return false;\" title=\"View Taxonomy\">" + m_refMsg.GetMessage("viewtaxonomytabtitle") + "</a></li>";
string addTaxonomy = "<div id=" + "\"" + "TreeOutput" + "\"" + "></div>";
return addTaxonomy;
}
else
{
Js.Append(" return true;}").Append(Environment.NewLine);
ltrTaxJS.Text = Js.ToString();
string addTaxonomyEmpty = "<div id=\"EmptyTree\"></div>";
return addTaxonomyEmpty;
}
}
示例12: CaptureMetadata
private StringBuilder CaptureMetadata(long contentId, long folderId)
{
StringBuilder metadataOutput = new StringBuilder();
ContentAPI myContentAPI = new ContentAPI();
ContentData myContentEditData = new ContentData();
ContentMetaData[] myContentMetadata;
string myType = "update";
int myCounter = 0;
Ektron.Cms.Site.EkSite myEkSite = new Ektron.Cms.Site.EkSite();
int ContentLanguage = EkConstants.CONTENT_LANGUAGES_UNDEFINED;
if (Page.Request.QueryString["LangType"] != null)
{
if (Page.Request.QueryString["LangType"] != "")
{
ContentLanguage = Convert.ToInt32(Page.Request.QueryString["LangType"]);
myContentAPI.SetCookieValue("LastValidLanguageID", ContentLanguage.ToString());
}
else
{
if (myContentAPI.GetCookieValue("LastValidLanguageID") != "")
{
ContentLanguage = Convert.ToInt32(myContentAPI.GetCookieValue("LastValidLanguageID"));
}
}
}
else
{
if (myContentAPI.GetCookieValue("LastValidLanguageID") != "")
{
ContentLanguage = Convert.ToInt32(myContentAPI.GetCookieValue("LastValidLanguageID"));
}
}
if (ContentLanguage == EkConstants.CONTENT_LANGUAGES_UNDEFINED)
{
myContentAPI.ContentLanguage = EkConstants.ALL_CONTENT_LANGUAGES;
}
else
{
myContentAPI.ContentLanguage = ContentLanguage;
}
if (contentId != -1)
{
myEkSite = myContentAPI.EkSiteRef;
myContentEditData = myContentAPI.GetContentById(contentId, 0);
myContentMetadata = myContentEditData.MetaData;
if (myContentMetadata.Length > 0)
{
metadataOutput = Ektron.Cms.CustomFields.WriteFilteredMetadataForEdit(myContentMetadata, false, myType, folderId, ref myCounter, myEkSite.GetPermissions(folderId, 0, "folder"));
if (metadataOutput.Length > 0)
{
ltrShowMetadata.Text = "<li><a id=\"metadataAnchor\" href=\"#\" onclick=\"dmsMetadataShowHideCategory(\'metadata\');return false;\" title=\"View Metadata\" class=\"selected\">" + myContentAPI.EkMsgRef.GetMessage("metadata text") + "</a></li>";
}
}
}
return metadataOutput;
}
示例13: Page_Load
private void Page_Load(System.Object sender, System.EventArgs e)
{
bool bAddingNew = false;
string tempStr;
string referrerStr;
try
{
//INITIALIZE THE VARIABLES
if (Request.Browser.Type.IndexOf("IE") != -1)
{
IsBrowserIE = true;
}
jsIsMac.Text = "false";
if (Request.Browser.Platform.IndexOf("Win") == -1)
{
IsMac = true;
}
// Ensure that this is not a browser refresh (Mac-Safari bug causes
// the editor to load after publishing, if the browser is refreshing):
if (IsMac && !IsBrowserIE)
{
referrerStr = Request.Url.LocalPath;
if (referrerStr != null)
{
tempStr = referrerStr.Substring(referrerStr.LastIndexOf("/"));
if (tempStr == "/workarea.aspx")
{
tempStr = referrerStr.Replace(tempStr, "/dashboard.aspx");
Response.Redirect(tempStr, false);
return;
}
}
}
if (m_SelectedEditControl != "ContentDesigner")
{
m_ctlContentPane.Controls.Remove(m_ctlContentDesigner);
m_ctlSummaryStandard.Controls.Remove(m_ctlSummaryDesigner);
m_ctlSummaryRedirect.Controls.Remove(m_ctlFormResponseRedirect);
m_ctlSummaryTransfer.Controls.Remove(m_ctlFormResponseTransfer);
}
Response.Expires = -1;
Response.AddHeader("Pragma", "no-cache");
Response.AddHeader("cache-control", "no-store");
//THE NEXT THREE LINES MUST BE REMOVED BEFORE THE RELEASE
if (Request.ServerVariables["Query_String"] == "")
{
return;
}
if (IsMac)
{
jsIsMac.Text = "true";
}
// Note: To fix a problem with the Ephox Editors on the
// Mac-running-Safari (assumed if "IsMac and not IsBrowserIE")
// we need to use different styles for the DIV-tags holding
// the editors, etc., otherwise they frequently draw themselves
// when they should remain hidden. These values cause problems
// with the PC/Win/IE combination, (the summary editor fails to
// provide a client area for the user to view/edit) so they cannot
// cannot be used everywhere, hence our use of alternate style classes:
// Pass class names to javascript:
jsSelectedDivStyleClass.Text = m_sSelectedDivStyleClass;
jsUnSelectedDivStyleClass.Text = m_sUnSelectedDivStyleClass;
m_refContApi = new ContentAPI();
m_refSiteApi = new SiteAPI();
m_refContent = m_refContApi.EkContentRef;
m_refSite = m_refContApi.EkSiteRef;
m_refTask = m_refContApi.EkTaskRef;
CurrentUserID = m_refContApi.UserId;
AppImgPath = m_refContApi.AppImgPath;
SitePath = m_refContApi.SitePath;
Appname = m_refContApi.AppName;
AppeWebPath = m_refContApi.ApplicationPath + m_refContApi.AppeWebPath;
AppPath = m_refContApi.AppPath;
EnableMultilingual = m_refContApi.EnableMultilingual;
StyleSheetJS.Text = m_refStyle.GetClientScript();
EnhancedMetadataScript.Text = CustomFields.GetEnhancedMetadataScript();
EnhancedMetadataArea.Text = CustomFields.GetEnhancedMetadataArea();
lbl_GenericTitleLabel.Text = m_refMsg.GetMessage("generic title label");
if (!(Request.QueryString["id"] == null))
{
m_intItemId = Convert.ToInt64(Request.QueryString["id"]);
m_intTaxFolderId = m_intItemId;
}
if (!(Request.QueryString["LangType"] == null))
{
if (Request.QueryString["LangType"] != "")
{
m_intContentLanguage = Convert.ToInt32(Request.QueryString["LangType"]);
m_refContApi.SetCookieValue("LastValidLanguageID", m_intContentLanguage.ToString());
}
else
//.........这里部分代码省略.........