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 Alias With Folder Name

Posted on February 25, 2014October 26, 2015 By David Kittell

With assistance from my Ektron Content Folder Names script this script will display all aliases with the folder that the content belongs to.

This is not an ideal process as you can have many folders in Ektron but this can help.

SET NOCOUNT ON

DECLARE @Domain VARCHAR(50)

SET @Domain = '/'

SELECT c.[content_id]
	,c.[content_title]
	,c.[content_html]
	,
	--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]
	,
	--c.[content_type],
	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'
		WHEN 102
			THEN CAST(content_type AS VARCHAR(5)) + ' - Assets'
		WHEN 103
			THEN CAST(content_type AS VARCHAR(5)) + ' - Assets'
		WHEN 106
			THEN CAST(content_type AS VARCHAR(5)) + ' - PNG Assets'
		WHEN 104
			THEN CAST(content_type AS VARCHAR(5)) + ' - Multimedia'
		WHEN 1102
			THEN CAST(content_type AS VARCHAR(5)) + ' - Archived PDF Assets'
		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'
	,
	--c.[approval_method],
	--c.[searchable],
	CASE c.[searchable]
		WHEN 1
			THEN 'Yes'
		WHEN 0
			THEN 'No'
		END AS Searchable
	,CASE
		WHEN uam.[urlaliasnm] IS NULL
			THEN 'No Alias'
		ELSE (@Domain + uam.[urlaliasnm])
		END AS Alias
	,
	--(@Domain + uam.[urlaliasnm]) AS AliasURL,
	--(@Domain + uam.[urltargetnm]) AS ActualURL,
	--c.folder_id,
	--cft.[folder_name],
	cft.FolderPath
--cft.FolderIdPath
FROM [content] c
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 c.[content_type] in (101,102,103,104)
ORDER BY cft.FolderPath
	,c.content_id
SET NOCOUNT ON

DECLARE @Domain VARCHAR(50)

SET @Domain = '/'

SELECT AliasName
	,(@Domain + alias_pagename) AS AliasURL
	,(@Domain + alias_logical) AS ActualURL
	,uat.content_id
	,cft.[folder_name] AS Folder_1_Name
	,(
		SELECT folder_name
		FROM [content_folder_tbl] cft1
		WHERE cft1.folder_id = cft.parent_id
		) AS Folder_2_Name
	,(
		SELECT folder_name
		FROM [content_folder_tbl] cft2
		WHERE cft2.folder_id = (
				SELECT cft1.parent_id
				FROM [content_folder_tbl] cft1
				WHERE cft1.folder_id = cft.parent_id
				)
		) AS Folder_3_Name
FROM url_alias_tbl uat
LEFT OUTER JOIN UrlAliasManual_Tbl ON UrlAliasManual_Tbl.aliasid = uat.alias_id
INNER JOIN [content] c ON uat.content_id = c.content_id
INNER JOIN [content_folder_tbl] cft ON c.folder_id = cft.folder_id
ORDER BY folder_name
	,AliasName
Originally Posted on February 25, 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.

Related

Code Ektron MSSQL - Ektron MSSQL - Ektron 8.0.2 MSSQL - Ektron 8.7 SQL

Post navigation

Previous post
Next post

Related Posts

Get Windows Shortcut (.lnk) Details

Posted on March 17, 2016

The below will help you get the full path of a Windows shortcut (.lnk) in your program. The below examples specifically create a command-line executable file but you could use the function in your program just as well. View the full code in GitHub at https://github.com/dkittell/lnk-parser using System; using System.Collections.Generic;…

Read More

PowerShell – Azure – Get VM Image List

Posted on April 6, 2016April 7, 2016

When installing a new VM in Azure it’s helpful to know your options Get-AzureVMImage | Select OS, label ( Get-AzureVMImage | where-object { $_.Label -like "Barracuda*" } ) | Fl OS, publishername, Location, logicalsizeinGB, Label, ImageFamily, ImageName ( Get-AzureVMImage | where-object { $_.Label -like "CentOS*" } ) | Fl OS,…

Read More

PHP Facebook WebCal Parse

Posted on March 18, 2015

I have seen various ways to parse webcal (ical, ics) files in PHP but they tend to get a little more complicated than they need to in some cases or simply do not work. <?phpPHP $icalURL = '<facebook URL>'; echo '<p>iCal URL:<br/>' . $icalURL . '</p>'; $ical = file_get_contents($icalURL); $sED_Start…

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