Skip to content
David Kittell
David Kittell

Application & System: Development / Integration / Orchestration

  • Services
    • Application Development
    • Online Application Integration
  • Code
  • Online Tools
  • Tech Support
David Kittell

Application & System: Development / Integration / Orchestration

Ektron – Find DMS Content File

Posted on November 11, 2013October 26, 2015 By David Kittell

Sometimes you’re asked where a DMS file exists on the server and have to track it down, this query should help.

Caveat: It helps to know where your root/main asset directory is on your server.

SELECT content_id AS "Content: Content ID"
	,content_title AS "Content: Content Title"
	,(storage + '.' + RIGHT(NAME, Len(NAME) - Charindex('.', NAME))) AS "AssetDataTable: Storage"
	,pubFolderPath AS "AssetDataTable: Folder"
FROM content
INNER JOIN AssetDataTable ON id = asset_id
WHERE content_id = 87341
SELECT c.content_id AS "Content: Content ID"
	,c.private
	,c.searchable
	,c.content_title AS "Content: Content Title"
	,(storage + '.' + RIGHT(NAME, Len(NAME) - Charindex('.', NAME))) AS "AssetDataTable: Storage"
	,adt.version
	,adt.[dateModified]
	,cft.[folderpath]
FROM content c
INNER JOIN AssetDataTable adt ON id = asset_id
INNER JOIN content_folder_tbl cft ON c.folder_id = cft.folder_id
WHERE cft.[folderpath] LIKE '%<folder name>%'
ORDER BY cft.[folderpath]
	,c.content_title
SET NOCOUNT ON

DECLARE @Domain VARCHAR(50)

SET @Domain = '/'

SELECT c.content_id AS "Content: Content ID"
	,c.content_title AS "Content: Content Title"
	--  ,(storage + '.' + RIGHT(NAME, Len(NAME) - Charindex('.', NAME))) AS "AssetDataTable: Storage"
	,[handle] AS [DMS File Name]
	,CASE
		WHEN uam.[urlaliasnm] IS NULL
			THEN 'No Alias'
		ELSE (@Domain + uam.[urlaliasnm])
		END AS Alias
	,[mimeType]
	,CASE content_type
		WHEN - 1
			THEN CAST(content_type AS VARCHAR(5)) + ' - AllTypes'
		WHEN 1
			THEN CAST(content_type AS VARCHAR(5)) + ' - Content'
		WHEN 2
			THEN CAST(content_type AS VARCHAR(5)) + ' - Forms'
		WHEN 3
			THEN CAST(content_type AS VARCHAR(5)) + ' - Archive Content'
		WHEN 4
			THEN CAST(content_type AS VARCHAR(5)) + ' - Archive Forms'
		WHEN 7
			THEN CAST(content_type AS VARCHAR(5)) + ' - Library Item'
		WHEN 8
			THEN CAST(content_type AS VARCHAR(5)) + ' - Assets'
		WHEN 9
			THEN CAST(content_type AS VARCHAR(5)) + ' - Archive Assets'
		WHEN 12
			THEN CAST(content_type AS VARCHAR(5)) + ' - Archive Media'
		WHEN 99
			THEN CAST(content_type AS VARCHAR(5)) + ' - Non Library Content'
		WHEN 101
			THEN CAST(content_type AS VARCHAR(5)) + ' - Assets - MSWord'
		WHEN 102
			THEN CAST(content_type AS VARCHAR(5)) + ' - Assets - PDF'
		WHEN 103
			THEN CAST(content_type AS VARCHAR(5)) + ' - Assets - PDF'
		WHEN 1102
			THEN CAST(content_type AS VARCHAR(5)) + ' - Assets - PDF'
		WHEN 104
			THEN CAST(content_type AS VARCHAR(5)) + ' - Multimedia'
		WHEN 106
			THEN CAST(content_type AS VARCHAR(5)) + ' - Assets - Image'
		WHEN 1111
			THEN CAST(content_type AS VARCHAR(5)) + ' - Discussion Topic'
		WHEN 3333
			THEN CAST(content_type AS VARCHAR(5)) + ' - Catalog Entry'
		ELSE CAST(content_type AS VARCHAR(5))
		END AS 'Content Type'
	,adt.version
	--c.[content_status]
	,CASE
		WHEN c.[content_status] = 'A'
			THEN 'Approved'
		WHEN c.[content_status] = 'O'
			THEN 'Checked Out'
		WHEN c.[content_status] = 'I'
			THEN 'Checked In'
		WHEN c.[content_status] = 'S'
			THEN 'Submitted for Approval'
		WHEN c.[content_status] = 'M'
			THEN 'Marked for Deletion'
		WHEN c.[content_status] = 'P'
			THEN 'Pending Go Live Date'
		WHEN c.[content_status] = 'T'
			THEN 'Awaiting Completion of Associated Tasks'
		WHEN c.[content_status] = 'D'
			THEN 'Pending Deletion'
		END AS ContentStatus
	,c.[date_created]
	,adt.[dateModified]
	,cft.[folderpath]
	--,c.private
	,CASE c.[private]
		WHEN 1
			THEN 'Yes'
		WHEN 0
			THEN 'No'
		END AS [Private]
	--,c.searchable
	,CASE c.[searchable]
		WHEN 1
			THEN 'Yes'
		WHEN 0
			THEN 'No'
		END AS Searchable
FROM content c
INNER JOIN AssetDataTable adt ON id = asset_id
INNER JOIN content_folder_tbl cft ON c.folder_id = cft.folder_id
LEFT OUTER JOIN [UrlAliasMapping] uam ON uam.TargetID = c.content_id
--WHERE cft.[folderpath] LIKE '%<folder name>%'
--WHERE [mimeType] not like '%pdf%'
ORDER BY mimeType
	,cft.[folderpath]
	,c.content_title
Originally Posted on November 11, 2013
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.

Related

Code Ektron MSSQL MSSQL - Ektron MSSQL - Ektron 8.0.2 SQL

Post navigation

Previous post
Next post

Related Posts

Oracle Clean Date Format

Posted on September 18, 2013October 26, 2015

Sometimes you have to pull a date from Oracle in a cleaner format, this is one way to achieve the format you want. // Convert the Oracle date 19000101 to 01-01-1900 public string OracleCleanDate(string strDate) { if (strDate.Length == 8) { string strYear, strMonth, strDay; strYear = strDate.Substring(0, 4); strMonth…

Read More

Windows OS Version

Posted on December 14, 2013October 26, 2015

Public Function GetOSVersion() As String Dim sOSType As String = "" Select Case Environment.OSVersion.Platform Case PlatformID.Win32S sOSType = "Win 3.1" Case PlatformID.Win32Windows Select Case Environment.OSVersion.Version.Minor Case 0 sOSType = "Win95" Case 10 sOSType = "Win98" Case 90 sOSType = "WinME" Case Else sOSType = "Unknown" End Select Case PlatformID.Win32NT Select…

Read More
Code

Ubuntu – WordPress Install

Posted on September 2, 2015May 31, 2017

These steps are based on Ubuntu 14.10 Server 64-bit but can be applied to virtually any Debian based UNIX distribution. Originally Posted on September 2, 2015Last Updated on May 31, 2017 All information on this site is shared with the intention to help. Before any source code or program is…

Read More

Code

Top Posts & Pages

  • PowerShell - Rename Pictures to Image Taken
  • Front Page
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions

Recent Posts

  • Javascript – Digital Clock with Style
  • BASH – Web Ping Log
  • BASH – Picture / Video File Name Manipulation
  • Mac OSX Terminal – Create SSH Key
  • Bash – Rename Picture

Top Posts

  • PowerShell - Rename Pictures to Image Taken
  • C# - Start/Stop/Restart Services
  • MacPorts / HomeBrew - Rip CD tracks from terminal
  • PowerShell - Show File Extensions
  • SQLite - Auto-Increment / Auto Generate GUID
©2025 David Kittell | WordPress Theme by SuperbThemes