<!--#include virtual="/NR/System/WBC/Internals/Main/WBCApp.inc"-->

<!--#include virtual="/NR/System/WBC/Customizable/WBCFuncPagesConfig/UIStringConstants/PageCreationWizardUIStrings.inc" -->
<!--#include virtual="/NR/System/WBC/Customizable/WBCFuncPagesConfig/MLSDisplayConfig/PageCreationWizardConfig.inc" -->

<!--#include virtual="/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/PageCreationWizard/EntryProgrammingConstants.inc" -->
<!--#include virtual="/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/PageCreationWizard/InternalProgrammingConstants.inc" -->

<!--#include virtual="/NR/System/WBC/Internals/ServerControls/TreeControl/CNCTreeControl.inc"-->
<!--#include virtual="/NR/System/WBC/Internals/ServerControls/TreeControl/CNCTreeDom_NRChannels.inc"-->
<!--#include file="CNCTreeRenderer_ChannelsBrowse.inc" -->

<!-- #include virtual="/NR/System/WBC/Internals/Integration/InternalHooks/URLGenerationHooks/PostingCreationHooks.inc" -->
<!-- #include virtual="/NR/System/WBC/Customizable/Hooks/URLGenerationHooks/PostingCreationHooks.inc" -->

<%
' ********************************************************************
' 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/WBCFuncPages/Cross-Browser/PageCreationWizard/
'			/ChannelsBrowse/CNCASPPageManager_ChannelsBrowse.inc
' Version: 	Microsoft Content Management Server
' Author:	Microsoft Corporation.
' Purpose:	Encapsulate the ASP logic associated with ChannelsBrowse.asp
'
' Implements the INCASPPageManager interface:
'	- Sub InitManager()
'
' Exposes the following properties:
'	- Property TreeControl
'	- Property CurrentPageNode
'	- Property Error
'	- Property ASPUtilsObject
'	- Property CodePage
'	- Property Charset
' ********************************************************************

Class CNCASPPageManager_ChannelsBrowse


	' -- Object needed when "View As Tree"
	Public TreeControl

	' -- The current Posting Node
	Public CurrentPageNode

	' -- Error code
	Public Error

	' -- For MLS display
	Public ASPUtilsObject
	Public Charset
	Public CodePage

	' ---- [Private] Class standard initialization routine
	Private Sub Class_Initialize()
		Set TreeControl= Nothing
		Set CurrentPageNode = Nothing
		Set ASPUtilsObject = Nothing
	End Sub

	' ---- [Public] InitManager will take care of all programming logic in the ASP page
	Public Sub InitManager()

		' -- Setup CurrentObject
		Call SetupCurrentPageNode

		If Error = "" Then
			' -- Set up TreeControl which is used for displaying the Channels hierarchy
			Call SetupTreeControl()

			' -- Setup MLS Info
			Call SetupMLSInfo()
		End If

	End Sub


	' ---- [Private] Set up the page object
	Private Sub SetupCurrentPageNode()
		Dim strPageGuid

		strPageGuid = Request.QueryString(IDS_QSTR_PAGECREATIONWIZARD_CONNECTEDPAGE)
		If strPageGuid = "" Then
			Error = IDS_UI_ERR_PAGE_NOT_FOUND
		Else

			Set CurrentPageNode = AutoSession.Searches.GetByGUID(strPageGuid)
			If (CurrentPageNode is Nothing) Then
				Error = IDS_UI_ERR_PAGE_NOT_FOUND
			End If
		End If
	End Sub



	' ---- [Private] Set up TreeControl for displaying Channels as a Tree
	Private Sub SetupTreeControl()
		Set TreeControl = New CNCTreeControl

		Dim pNCTreeDom, pNCTreeRenderer
		Set pNCTreeDom = New CNCTreeDom_NRChannels
		Set pNCTreeRenderer = New CNCTreeRenderer_ChannelsBrowse
		If Request.QueryString(IDS_QSTR_PAGECREATIONWIZARD_FRESHTREE) = IDS_PAGECREATIONWIZARD_FRESHTREE_TRUE Then
			Call TreeControl.InitTreeControl( "PageCreation", pNCTreeDom, pNCTreeRenderer, True)
		Else
			Call TreeControl.InitTreeControl( "PageCreation", pNCTreeDom, pNCTreeRenderer, False)
		End If

		' During round trip, these QPARAM will be retained when come back from server
		Call TreeControl.PropagateParameter( IDS_QSTR_PAGECREATIONWIZARD_FRESHTREE, IDS_PAGECREATIONWIZARD_FRESHTREE_FALSE )
		Call TreeControl.PropagateParameter( "NRMODE", "Unpublished" )
		Call TreeControl.PropagateParameter(IDS_QSTR_PAGECREATIONWIZARD_TIMESTAMP, CDbl(CDate(now)))

		TreeControl.DisplayLeafs = false
		TreeControl.IndentWidth = 35
		TreeControl.NodeSpacing = 5
		TreeControl.NodePadding = 2
	End Sub


	' ---- [Private] Set up the MLS info this ASP page will be running under
	Private Sub SetupMLSInfo()
		Set ASPUtilsObject = GetInitializedASPUtils()

		' -- call functions in WBC/Customizable/MLSDisplayConfig/PageCreationWizardConfig.inc
		'	 to determine CodePage and Charset setting
		CodePage = GetCodePageForPageCreationWizard( Nothing, CurrentPageNode, ASPUtilsObject )
		Charset = GetCharacterSetForPageCreationWizard( Nothing, CurrentPageNode )
	End Sub


End Class

%>
