<!--#include virtual="/NR/System/WBC/Internals/Main/WBCApp.inc"-->
<!--#include virtual="/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/PageOperation/AuthoringMode/InternalProgrammingConstants.inc"-->
<!--#include virtual="/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/PageOperation/AuthoringMode/EntryProgrammingConstants.inc"-->
<!--#include virtual="/NR/System/WBC/Customizable/WBCFuncPagesConfig/UIStringConstants/PageOperationUIStrings.inc"-->
<!--#include file="NewPageSaveDlgHelper.inc"-->

<!--#include virtual="/NR/System/WBC/Internals/Integration/InternalHooks/WBCFuncPagesHooks/NewPageSaveDlgHooks.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/PageOperation/PageSave
'			CNCASPPageManager_NewPageSaveDlg.inc
' Version: 	Microsoft Content Management Server
' Author:	Microsoft Corporation.
' Purpose:	Encapsulate the ASP logic associated with NewPageSaveDlg.asp
'
' Implements the INCASPPageManager interface:
'	- Sub InitManager()
'	- Public Property CurrentNode()
'	- Public Property ErrorString()
'	- Public Property Charset()
'	- Public Property PostingCanSetName()
'	- Public Property IsConnectedPage()
'	- Public Property Get SourceNode()
'	- Public Property ContinueAuthoring()
'	- Public Property CodePage
'	- Public Property DefaultName
'	- Public Property DefaultDisplayName
'
' ********************************************************************

Class CNCASPPageManager_NewPageSaveDlg

	' -- the current node that is possibly virtual
	Private m_pCurrentNode

	' -- objects needed in the ASP page
	Private m_strError

	' -- used for showing multilanguage
	Private m_strCharset

	' -- used for indicating user has rights to set a page name
	Private m_bPostingCanSetName

	' -- Is this page a connected page?
	'    Used by the title in the NewPageSave.asp
	Private m_bIsConnectedPage

	' -- Continue authoring, passed to Javascript
	Private m_bContinueAuthoring

	' -- m_pSourceNode is the connected page original node
	Private m_pSourceNode

	' -- m_lCodePage is the code page
	Private m_lCodePage

	' -- m_strDefaultName is the default name for new pages
	Private m_strDefaultName

	' -- m_strDefaultDisplayName is the default display name for new pages
	Private m_strDefaultDisplayName


	Public Property Get CurrentNode()
		Set CurrentNode = m_pCurrentNode
	End Property

	Public Property Get ErrorString()
		ErrorString = m_strError
	End Property

	Public Property Get Charset()
		Charset = m_strCharset
	End Property

	Public Property Get CodePage()
		CodePage = m_lCodePage
	End Property

	Public Property Get PostingCanSetName()
		PostingCanSetName = m_bPostingCanSetName
	End Property

	Public Property Get IsConnectedPage()
		IsConnectedPage = m_bIsConnectedPage
	End Property

	Public Property Get SourceNode()
		Set SourceNode = m_pSourceNode
	End Property

	Public Property Get ContinueAuthoring()
		ContinueAuthoring = m_bContinueAuthoring
	End Property

	Public Property Get DefaultName()
		DefaultName = m_strDefaultName
	End Property

	Public Property Let DefaultName( strNewValue )
		m_strDefaultName = strNewValue
	End Property

	Public Property Get DefaultDisplayName()
		DefaultDisplayName = m_strDefaultDisplayName
	End Property

	Public Property Let DefaultDisplayName( strNewValue )
		m_strDefaultDisplayName = strNewValue
	End Property


	' ---- [Private] Class standard initialization routine
	Private Sub Class_Initialize()
		m_strError = IDS_E_NO_ERROR
		m_strCharset = ""
		m_lCodePage = 0
		m_bPostingCanSetName = False
		m_bIsConnectedPage = False
		m_bContinueAuthoring = False
		Set m_pCurrentNode = Nothing
		Set m_pSourceNode = Nothing
	End Sub

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

		Set m_pCurrentNode = AutoSession.This

		If m_pCurrentNode is Nothing Then
			m_strError = IDS_E_PAGE_DOES_NOT_EXIST
		Else
			Call SetupContinueAuthoringIndicator()
			Call SetupConnectedPageInfo()
			Call SetupMLSInfo()
			Call SetupAccessRights()
			Call SetupDefaultNames()

			' -- call Internal Integration hook function
			Call OnInternalAfterInitNewPageSaveDlg( Me )
		End If

	End Sub


	' ---- [Private] Initialize the default name and display name of this page
	Private Sub SetupDefaultNames()

		If m_pCurrentNode.IsConnected Then
			m_strDefaultName = m_pSourceNode.Name
			m_strDefaultDisplayName = m_pSourceNode.DisplayName
		Else
			m_strDefaultName = ""
			m_strDefaultDisplayName = ""
		End If

	End Sub


	' ---- [Private] Initialize the m_Charset of this page
	Private Sub SetupMLSInfo()
		m_strCharset = m_pCurrentNode.Charset
		m_lCodePage = m_pCurrentNode.CodePage
	End Sub


	' ---- [Private] SetupAccessRights will take care of setting up properties
	Private Sub SetupAccessRights()
		m_bPostingCanSetName = Not(m_pCurrentNode.IsConnected)
	End Sub


	' ---- [Private]
	Private Sub SetupConnectedPageInfo()
		Dim strSourceNodeGUID

		If m_pCurrentNode.IsConnected Then
			m_bIsConnectedPage = True
			strSourceNodeGUID = Request.QueryString(IDS_QSTR_NRPOSTINGGUID)

			If strSourceNodeGUID = "" Then
				m_strError = IDS_E_ERR_SOURCE_PAGE_NOT_FOUND
			Else
				Set m_pSourceNode = AutoSession.Searches.GetByGUID(strSourceNodeGUID)
				If m_pSourceNode Is Nothing Then
					m_strError = IDS_E_ERR_SOURCE_PAGE_NOT_FOUND
				End If
			End If

		End If
	End Sub

	' --- [Private]
	Private Sub SetupContinueAuthoringIndicator()
		Dim strContinue

		m_bContinueAuthoring = False
		strContinue = Request.QueryString(IDS_QSTR_PAGEOPERATIONAUTHORING_CONTINUEAUTHORING)
		If strContinue = IDS_PAGEOPERATIONAUTHORING_CONTINUEAUTHORING_TRUE Then
			m_bContinueAuthoring = True
		End If
	End Sub

End Class

%>
