Ektron – DMS Content List

| |
<%@ Page Title="" Language="C#" CodeFile="DMSFileList.aspx.cs" Inherits="DMSFileList" %>

<!DOCTYPE html>
<html lang="en" xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
	<meta charset="utf-8" />
	<title>DMS File List</title>
</head>
<body>
	<form id="form1" runat="server">
		<asp:Repeater ID="subContentRepeater" runat="server">

			<HeaderTemplate>
				<table style="border: 1px solid #000000;">
					<tr>
						<th>ID</th>
						<th>Type</th>
						<th>QuickLink</th>
						<th>Title</th>
						<th>Summary</th>
					</tr>
			</HeaderTemplate>

			<ItemTemplate>
				<tr>
					<td style="vertical-align: text-top;">
						<%# DataBinder.Eval(Container.DataItem, "Id").ToString() %>
					</td>
					<td style="vertical-align: text-top;">
						<%# DataBinder.Eval(Container.DataItem, "Type").ToString() %> -
						<%# DataBinder.Eval(Container.DataItem, "SubType").ToString() %>
					</td>
					<td style="vertical-align: text-top;">
						<%# DataBinder.Eval(Container.DataItem, "QuickLink").ToString() %>
					</td>
					<td style="vertical-align: text-top;">
						<%# DataBinder.Eval(Container.DataItem, "Title").ToString() %>
					</td>
					<td style="vertical-align: text-top;">

						<%# DataBinder.Eval(Container.DataItem, "Teaser").ToString() %>
					</td>
				</tr>
			</ItemTemplate>

			<AlternatingItemTemplate>
				<tr style="background-color: lightgray;">
					<td style="vertical-align: text-top;">
						<%# DataBinder.Eval(Container.DataItem, "Id").ToString() %>
					</td>
					<td style="vertical-align: text-top;"><%# DataBinder.Eval(Container.DataItem, "Type").ToString() %> -
						<%# DataBinder.Eval(Container.DataItem, "SubType").ToString() %>
					</td>
					<td style="vertical-align: text-top;">
						<%# DataBinder.Eval(Container.DataItem, "QuickLink").ToString() %>
					</td>
					<td style="vertical-align: text-top;">
						<%# DataBinder.Eval(Container.DataItem, "Title").ToString() %>
					</td>
					<td style="vertical-align: text-top;">
						<%# DataBinder.Eval(Container.DataItem, "Teaser").ToString() %>
					</td>
				</tr>
			</AlternatingItemTemplate>

			<FooterTemplate>
				</table>
			</FooterTemplate>
		</asp:Repeater>
	</form>
</body>
</html>

using System;
using System.Web;
using System.Web.UI;
using System.Collections.Generic;
using System.Linq;
using System.Web.UI.WebControls;
using Ektron.Cms;
using Ektron.Cms.Common;
using Ektron.Cms.Content;
using Ektron.Cms.Framework.Content;

public partial class DMSFileList : System.Web.UI.Page
{
	protected void Page_Load(object sender, EventArgs e)
	{
		// Define Folder ID
		long folderID = 2147483941;

		ContentManager contentManager = new ContentManager();
		Ektron.Cms.Content.ContentCriteria criteria = new Ektron.Cms.Content.ContentCriteria();
		criteria.OrderByDirection = Ektron.Cms.Common.EkEnumeration.OrderByDirection.Ascending;
		criteria.ReturnMetadata = true;

		//	Only show content in the specific folder ID
		criteria.AddFilter(ContentProperty.FolderId, CriteriaFilterOperator.EqualTo, folderID);

		// Only Show Published documents
		criteria.AddFilter(ContentProperty.Status, CriteriaFilterOperator.EqualTo, "A");

		// Only show DMS documents
		criteria.AddFilter(ContentProperty.Type, CriteriaFilterOperator.EqualTo, 102);

		criteria.Condition = LogicalOperation.And;

		List<Ektron.Cms.ContentData> contentList = contentManager.GetList(criteria);

		#region Available Values
		/*
		 * Content ID = Id
		 * Folder ID = FolderId
		 * Folder Name = FolderName
		 * Quick Link = QuickLink
		 * Type of content = Type
		 * SubType of content = SubType
		*/
		#endregion Available Values

		subContentRepeater.DataSource = contentList;
		subContentRepeater.DataBind();
	}
}
Originally Posted on October 31, 2014
Last Updated on October 26, 2015
All information on this site is shared with the intention to help. Before any source code or program is ran on a production (non-development) system it is suggested you test it and fully understand what it is doing not just what it appears it is doing. I accept no responsibility for any damage you may do with this code.