USP_DATALIST_CMSSECURABLEOBJECT

Returns general info about each CMS securable object

Parameters

Parameter Parameter Type Mode Description
@OBJECTGUID uniqueidentifier IN Object Guid
@RECORDID int IN Record ID
@OBJECTTYPEID int IN Object Type ID

Definition

Copy


CREATE procedure dbo.USP_DATALIST_CMSSECURABLEOBJECT(@OBJECTGUID uniqueidentifier = null, @RECORDID int = null, @OBJECTTYPEID int = null)
as
    set nocount on;
            if @OBJECTGUID = '00000000-0000-0000-0000-000000000000'
                    set @OBJECTGUID = null                           

            if @OBJECTGUID is null and (@RECORDID is null OR @RECORDID <= 0)
                select * from dbo.V_CMSSECURABLEOBJECTS
            else if @OBJECTGUID is not null
                select top 1 * from dbo.V_CMSSECURABLEOBJECTS SO where SO.OBJECTGUID = @OBJECTGUID
            else if @OBJECTTYPEID not in (2,3)
                select top 1 * from dbo.V_CMSSECURABLEOBJECTS SO where SO.RECORDID = @RECORDID and SO.OBJECTTYPEID = @OBJECTTYPEID
            else -- Adding special casing for pages and templates since they share the same ID range and we don't always know if we're

                 --asking about a page or a template

                select top 1 * from dbo.V_CMSSECURABLEOBJECTS SO where SO.RECORDID = @RECORDID and SO.OBJECTTYPEID in (2,3)