本文整理汇总了C#中ContentAPI.GetMetaDataTypes方法的典型用法代码示例。如果您正苦于以下问题:C# ContentAPI.GetMetaDataTypes方法的具体用法?C# ContentAPI.GetMetaDataTypes怎么用?C# ContentAPI.GetMetaDataTypes使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ContentAPI
的用法示例。
在下文中一共展示了ContentAPI.GetMetaDataTypes方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Display_EditLibraryItem
//.........这里部分代码省略.........
if (_Type == "quicklinks")
{
dr[3] = "<input type=\"hidden\" size=\"9\" maxlength=\"19\" name=\"frm_content_id\" value=\"" + library_data.ContentId + "\"/>" + library_data.ContentId;
}
else
{
dr[2] += "<input type=\"hidden\" name=\"frm_content_id\" value=\"\"/>";
}
dr[2] += "<input type=hidden name=frm_libtype id=frm_libtype value=\"" + _Type + "\"/>";
dt.Rows.Add(dr);
}
DataView dv = new DataView(dt);
EditLibraryItemGrid.DataSource = dv;
EditLibraryItemGrid.DataBind();
m_libraryToolBar = (librarytoolbar)(LoadControl("controls/library/librarytoolbar.ascx"));
ToolBarHolder.Controls.Add(m_libraryToolBar);
m_libraryToolBar.AppImgPath = _AppImgPath;
m_libraryToolBar.PageAction = _PageAction;
m_libraryToolBar.FolderInfo = folder_data;
m_libraryToolBar.SecurityInfo = security_data;
m_libraryToolBar.FolderId = _FolderId;
m_libraryToolBar.LibType = _Type;
m_libraryToolBar.ContentLanguage = _ContentLanguage;
m_libraryToolBar.LibraryInfo = library_data;
if (_Type != "quicklinks" && _Type != "forms")
{
editTabs.Visible = true;
dvSummary.Attributes.Add("class", _SelectedDivStyleClass);
bool bManagedAsset = false;
ContentData content_data = null;
ContentAPI m_refcontentapi = new ContentAPI();
CustomFields cFieldsO = new CustomFields();
ContentMetaData[] meta_data;
if (_ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
{
m_refcontentapi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
}
else
{
m_refcontentapi.ContentLanguage = _ContentLanguage;
}
if (library_data.ContentId != 0)
{
content_data = m_refcontentapi.GetContentById(library_data.ContentId, 0);
}
if (!(content_data == null))
{
meta_data = content_data.MetaData;
_ContentTeaser = content_data.Teaser;
if (content_data.Type != Ektron.Cms.Common.EkConstants.CMSContentType_Library)
{
bManagedAsset = true;
}
}
else
{
meta_data = m_refcontentapi.GetMetaDataTypes("id");
}
// Setting the titles for tabs
EditdvSummaryTxt.Text = _MessageHelper.GetMessage("Summary text");
EditdvMetadataTxt.Text = _MessageHelper.GetMessage("metadata text");
EditdvCategoryTxt.Text = _MessageHelper.GetMessage("viewtaxonomytabtitle");
RenderSummaryEditor();
//Populating the category
string Action = "Edit";
PopulateCategory(Action);
if (meta_data != null)
{
if (meta_data.Length > 0)
{
if (!bManagedAsset)
{
if (m_refcontentapi.ContentLanguage != Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
{
int v = 0;
ShowMeta.Text = CustomFields.WriteFilteredMetadataForEdit(meta_data, true, "update", _FolderId, ref v, null).ToString();
ShowTagEditArea(m_refcontentapi, library_data);
}
else
{
string strLink;
strLink = "<a href=\"library.aspx?LangType=" + meta_data[0].Language.ToString() + "&action=" + _PageAction + "&id=" + _Id + "&parent_id=" + _FolderId + "\">";
ShowMeta.Text = "<span style=\"COLOR: red\">*Note - Related metadata/tags will be displayed only if a specific language was selected. You may either go back to the page and select a language, or click " + strLink + "here</a> to view the metadata with the language selected automatically.</span>";
}
}
}
}
}
}
示例2: Display_ViewLibraryItem
//.........这里部分代码省略.........
if (_Type != "quicklinks" && _Type != "forms")
{
bool bManagedAsset = false;
ContentAPI m_refcontentapi = new ContentAPI();
CustomFields cFieldsO = new CustomFields();
ContentMetaData[] meta_data;
if (_ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
{
m_refcontentapi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
}
else
{
m_refcontentapi.ContentLanguage = _ContentLanguage;
}
if (library_data.ContentId != 0)
{
content_data = m_refcontentapi.GetContentById(library_data.ContentId, 0);
}
if (!(content_data == null))
{
meta_data = content_data.MetaData;
_ContentTeaser = content_data.Teaser;
_ContentTeaser = _ContentTeaser.Replace("<p> </p>", string.Empty);
if (content_data.Type != Ektron.Cms.Common.EkConstants.CMSContentType_Library)
{
bManagedAsset = true;
}
}
else
{
meta_data = m_refcontentapi.GetMetaDataTypes("id");
}
// Add the Teaser-Data for this Library item:
dr = dt.NewRow();
dr[0] = _MessageHelper.GetMessage("description label");
dr[1] = _ContentTeaser;
dt.Rows.Add(dr);
if (meta_data != null)
{
if (meta_data.Length > 0)
{
if (!bManagedAsset)
{
//ViewLibraryMeta.Text = cFieldsO.WriteMetadataForView(meta_data).ToString
if (m_refcontentapi.ContentLanguage != Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES)
{
ViewLibraryMeta.Text = CustomFields.WriteFilteredMetadataForView(meta_data, _FolderId, true).ToString();
// display tag info for this library item
System.Text.StringBuilder taghtml = new System.Text.StringBuilder();
taghtml.Append("<fieldset style=\"margin:10px\">");
taghtml.Append("<legend>" + _MessageHelper.GetMessage("lbl personal tags") + "</legend>");
taghtml.Append("<div style=\"height: 80px; overflow: auto;\" >");
if (library_data.Id > 0)
{
LocalizationAPI localizationApi = new LocalizationAPI();
TagData[] tdaUser;
tdaUser = (new Ektron.Cms.Community.TagsAPI()).GetTagsForObject(library_data.Id, EkEnumeration.CMSObjectTypes.Library, m_refcontentapi.ContentLanguage);
if (tdaUser != null && tdaUser.Length > 0)
{
示例3: Display_AddLibraryItem
//.........这里部分代码省略.........
else
{
OverwriteSubPanel0.Visible = true;
if (_Type == "hyperlinks")
{
tr2_td2_ali_controls.Text = "<input type=\"text\" size=\"50\" maxlength=\"255\" name=\"frm_filename\" value=\"http://\" onkeypress=\"javascript:return CheckKeyValue(event,\'34\');\"/>";
frm_filename.Visible = false;
}
else if (_Type == "quicklinks")
{
tr2_td2_ali_controls.Text = "<span style=\"white-space:nowrap;\">" + _SitePath + "<input type=\"text\" size=\"" + (50 - Strings.Len(_SitePath)) + "\" maxlength=\"255\" name=\"frm_filename\" value=\"\" onkeypress=\"javascript:return CheckKeyValue(event,\'34\');\"/></span>";
frm_filename.Visible = false;
}
AddItemFocus.Text = "document.forms[0].frm_title.focus();";
}
if (_Type != "quicklinks" && _Type != "forms")
{
addTabs.Visible = false;
editTabs.Visible = true;
dvSummary.Attributes.Add("class", _SelectedDivStyleClass);
CustomFields cFieldsO = new CustomFields();
ContentMetaData[] meta_data = null;
ContentAPI m_refcontentapi = new ContentAPI();
ContentData content_data = new ContentData();
bool bManagedAsset = false;
string ty = "";
if (_ContentLanguage == Ektron.Cms.Common.EkConstants.CONTENT_LANGUAGES_UNDEFINED)
{
m_refcontentapi.ContentLanguage = Ektron.Cms.Common.EkConstants.ALL_CONTENT_LANGUAGES;
}
else
{
m_refcontentapi.ContentLanguage = _ContentLanguage;
}
if (_Operation == "overwrite")
{
Action = "Edit";
ty = "update";
if (library_data.ContentId != 0)
{
content_data = m_refcontentapi.GetContentById(library_data.ContentId, 0);
if (!(content_data == null))
{
meta_data = content_data.MetaData;
_ContentTeaser = content_data.Teaser;
if (content_data.Type != Ektron.Cms.Common.EkConstants.CMSContentType_Library)
{
bManagedAsset = true;
}
}
else
{
meta_data = m_refcontentapi.GetMetaDataTypes("id");
}
}
}
else
{
if (_PageAction == "addlibraryitem")
{
ty = "add";
}
meta_data = m_refcontentapi.GetMetaDataTypes("id");
}
RenderSummaryEditor();
// Setting the titles for tabs
AdddvSummaryTxt.Text = _MessageHelper.GetMessage("Summary text");
AdddvMetadataTxt.Text = _MessageHelper.GetMessage("metadata text");
AdddvCategoryTxt.Text = _MessageHelper.GetMessage("viewtaxonomytabtitle");
EditdvSummaryTxt.Text = _MessageHelper.GetMessage("Summary text");
EditdvMetadataTxt.Text = _MessageHelper.GetMessage("metadata text");
EditdvCategoryTxt.Text = _MessageHelper.GetMessage("viewtaxonomytabtitle");
//Populating the category Tab
PopulateCategory(Action);
if (meta_data != null)
{
if (meta_data.Length > 0)
{
if (!bManagedAsset)// bManagedAsset)
{
int c = 0;
ShowMeta.Text = CustomFields.WriteFilteredMetadataForEdit(meta_data, true, ty, _FolderId, ref c, null).ToString();
ShowTagEditArea(m_refcontentapi, library_data);
}
}
}
}
}
示例4: Page_Load
protected void Page_Load(object sender, EventArgs e)
{
refContentAPI = new ContentAPI();
refEkContent = refContentAPI.EkContentRef;
refEkSite = refContentAPI.EkSiteRef;
ContentMetaData[] metaData = null;
Ektron.Cms.ContentData originalContent = null;
ltrEnhancedMetadataArea.Text = CustomFields.GetEnhancedMetadataArea();
if (ContentID != 0)
{
originalContent = refContentAPI.GetContentById(this.ContentID, ResultType);
if (resultType == ContentAPI.ContentResultType.Staged && originalContent == null)
{
originalContent = refContentAPI.GetContentById(this.ContentID, ContentAPI.ContentResultType.Published);
}
if (originalContent.FolderId == FolderID)
{
metaData = originalContent.MetaData;
}
}
if(metaData == null){
metaData = refContentAPI.GetMetaDataTypes("id");
}
int validCounter = 0;
if (originalContent != null || ContentID == 0)
{
foreach (ContentMetaData cMeta in metaData)
{
if (cMeta.Type.ToString() == "ImageSelector")
{
cMeta.Text = cMeta.Text.Replace(SitePath + "assets/", "");
cMeta.Text = System.Text.RegularExpressions.Regex.Replace(cMeta.Text, "\\?.*", "");
}
}
StringBuilder sbMetadata = Ektron.Cms.CustomFields.WriteFilteredMetadataForEdit(
metaData,
false,
MetaUpdateString,
this.FolderID,
ref validCounter,
refEkSite.GetPermissions(this.FolderID, 0, "folder"));
if (!String.IsNullOrEmpty(sbMetadata.ToString()))
{
ltrMetadataHTML.Text = sbMetadata.ToString();
if (sbMetadata.ToString().Contains("<span style=\"color:red\">"))
MetadataRequired = metadataRequired = true;
}
else
{
ltrMetadataHTML.Text = "<span>"+siteAPI.EkMsgRef.GetMessage("lbl no metadata associated")+"</span>";
}
}
Ektron.Cms.API.JS.RegisterJSInclude(this, refContentAPI.AppPath + "java/jfunct.js", "CommunityJFunctJS");
Ektron.Cms.API.JS.RegisterJSInclude(this, refContentAPI.AppPath + "java/metadata_selectlist.js", "CommunityMetadataSelectListJS");
Ektron.Cms.API.JS.RegisterJSInclude(this, refContentAPI.AppPath + "java/searchfuncsupport.js", "CommunitySearchFuncSupportJS");
Ektron.Cms.API.JS.RegisterJSInclude(this, refContentAPI.AppPath + "java/internCalendarDisplayFuncs.js", "CommunityInternCalendarDisplayFuncsJS");
Ektron.Cms.API.JS.RegisterJSInclude(this, refContentAPI.AppPath + "java/metadata_associations.js", "CommunityMetadataAssociationsJS");
Ektron.Cms.API.JS.RegisterJSInclude(this, refContentAPI.AppPath + "java/optiontransfer.js", "CommunityOptionTransferJS");
Ektron.Cms.API.JS.RegisterJSBlock(this, "window.ek_ma_ForceNewWindow = " + ForceNewWindow.ToString().ToLower(), "ek_ma_ForceNewWindow");
}