<%
' ********************************************************************
' Copyright (C) 2001 Microsoft Corporation. All rights reserved.
'
'	IMPORTANT.  Please read the legal.txt file, located in the
'	"<CMS Install Directory>\Server\httpexec\WBC\Internals"
'	directory, governing the use of this internal file."
' ********************************************************************

' ********************************************************************
' File:		/NR/System/WBC/Internals/ServerControls/CNCTreeDom_NRResGalleries.inc
' Version: 	Microsoft Content Management Server
' Author:	Microsoft Corporation.
' Purpose:	Responsible for Displaying Content Management Server hierarchy tree
'
' Implements the INCTreeDom Interface:
'	- Function GetRootObject()
'	- Function GetObjectByID( strID )
'	- Function GetObjectID( pObject )
'	- Function GetObjectDisplayName( pObject )
'	- Function ShouldRecurseContainer( pChild )
'	- Function GetChildrenContainerCol( pObject )
'	- Function GetChildrenLeafCol( pObject )
'
' Public Interface of CNCTreeDom_NRChannels
'	- Sub SetRootObject( pObject )
' ********************************************************************


Class CNCTreeDom_NRResGalleries

	Private m_pRootObject

	Public Sub Class_Initialize()
		Set m_pRootObject = AutoSession.RootResourceGallery
	End Sub

	' -------------------------------------------------------------------------
	'
	'	[Public] This sub allows the client of this class to supply a
	'			virtual root object to override the default tree root.
	'
	' -------------------------------------------------------------------------
	Public Sub SetRootObject( pObject )
		Set m_pRootObject = pObject
	End Sub

	' -------------------------------------------------------------------------
	'
	'	INCTreeDom::GetRootObject()
	'	This function is called by the CNCTreeControl to query for the root
	'	object of the tree hierarchy.
	'
	'	@return - the root object of the Tree
	'
	' -------------------------------------------------------------------------
	Public Function GetRootObject()
		Set GetRootObject = m_pRootObject
	End Function

	' -------------------------------------------------------------------------
	'
	'	INCTreeDom::GetObjectByID( strID )
	'	This function is called by the CNCTreeControl to search for an object
	'	given an ID.
	'
	'	@strID [in] - the ID that identifies the object in the hierarchy
	'
	'	@return - the object in the hierarchy identified by the ID
	'
	' -------------------------------------------------------------------------
	Public Function GetObjectByID( strID )
		Set GetObjectByID = AutoSession.Searches.GetByGUID( strID )
	End Function

	' -------------------------------------------------------------------------
	'
	'	INCTreeDom::GetObjectID( pObject )
	'	This function is called by the CNCTreeControl to ask for the ID
	'	of an object
	'
	'	@pObject [in] - the object whose ID is to be returned
	'
	'	@return - the ID of the object
	'
	' -------------------------------------------------------------------------
	Public Function GetObjectID( pObject )
		GetObjectID = pObject.GUID
	End Function

	' -------------------------------------------------------------------------
	'
	'	INCTreeDom::GetObjectDisplayName( pObject )
	'	This function is called by the CNCTreeControl to ask for the display
	'	name of an object
	'
	'	@pObject [in] - the object whose display name is to be returned
	'
	'	@return - the display name of the object
	'
	' -------------------------------------------------------------------------
	Public Function GetObjectDisplayName( pObject )
		GetObjectDisplayName = pObject.Name
	End Function

	' -------------------------------------------------------------------------
	'
	'	INCTreeDom::ShouldRecurseIntoContainer( pParent, pChild )
	'	This function is called by the CNCTreeControl to give this TreeDOM
	'	class a chance to filter out some Containers when rendering the tree.
	'
	'	@pParent [in] - the parent of pChild
	'
	'	@pChild [in] - the child container object which is in question as to
	'				whether the CNCTreeControl should recurse into.
	'
	'	@return - a Boolean which indicates to the CNCTreeControl whether it
	'				should recurse into the child container
	'
	' -------------------------------------------------------------------------
	Public Function ShouldRecurseIntoContainer( pParent, pChild )
		ShouldRecurseIntoContainer = True
	End Function

	' -------------------------------------------------------------------------
	'
	'	INCTreeDom::GetChildrenContainerCol( pObject )
	'	This function is called by the CNCTreeControl to retrieve the container
	'	children collection of a certain object.
	'
	'	@pObject [in] - the container object whose container children
	'				collection is to be returned.
	'
	'	@return - the childern container collection of pObject
	'
	' -------------------------------------------------------------------------
	Public Function GetChildrenContainerCol( pObject )
		Set GetChildrenContainerCol = pObject.ResourceGalleries
	End Function

	' -------------------------------------------------------------------------
	'
	'	INCTreeDom::GetChildrenLeafCol( pObject )
	'	This function is called by the CNCTreeControl to retrieve the leaf
	'	children collection of a certain object.
	'
	'	@pObject [in] - the container object whose container children
	'				collection is to be returned.
	'
	'	@return - the childern container collection of pObject
	'
	' -------------------------------------------------------------------------
	Public Function GetChildrenLeafCol( pObject )
		Set GetChildrenLeafCol = pObject.Resources
	End Function

End Class

%>