USP_DATALIST_EVENTHIERARCHYNAVIGATIONTREE

This datalist is the page navigation tree used by the event page for multi-level events.

Parameters

Parameter Parameter Type Mode Description
@EVENTID uniqueidentifier IN Input parameter indicating the context ID for the data list.
@CURRENTAPPUSERID uniqueidentifier IN Input parameter indicating the ID of the current user.

Definition

Copy


CREATE procedure dbo.USP_DATALIST_EVENTHIERARCHYNAVIGATIONTREE
(
    @EVENTID uniqueidentifier,
    @CURRENTAPPUSERID uniqueidentifier = null
)
as
    set nocount on;

    declare @MAINEVENTID uniqueidentifier;
    select @MAINEVENTID = coalesce(MAINEVENTID,ID) from dbo.EVENT where EVENT.ID = @EVENTID;

    select 
        EVENT.ID [CONTEXTID],
        'AE279924-53DA-4751-8ABB-2DF2C893B560' [PAGEID],
        EVENT.NAME [CAPTION],
        (select * from dbo.UFN_EVENTHIERARCHY_NODES(EVENTHIERARCHY.HIERARCHYPATH, @EVENTID) for xml raw('NODE'), root('NODES'), elements, type) [NODES],
        -- was trying out highlighting the context event: case when EVENT.ID = @EVENTID then 'RES:bullet_diamond' else '' end [IMAGEKEY]

        '' [IMAGEKEY]
    from
        dbo.EVENT
    left outer join
        dbo.EVENTHIERARCHY on EVENTHIERARCHY.ID = EVENT.ID
    where 
        EVENT.ID = @MAINEVENTID