<%
' -----------------------------------------------------------------------------
'
'	This is the hook function being called before before a simple Posting is created  
'	in a Channel.  A boolean return value of False from this function will cause
'	the create operation to be skipped.  The implementation of this Fucntion is totally 
'	up to the site designer.
'
'	@pChannel [in] - the Channel object that is about to be updated.
'
'	@pTemplate [in] - the Template object that the new simple posting will be
'					  used. 
'
'	@return - A boolean value to indicate whether the create operation should
'			  be performed. A False value will result in the operation being
'			  cancelled and return the user to the Authoring Mode screen
'             with the original template info as page contents.
' -----------------------------------------------------------------------------
Function OnInternalBeforeCreatePosting( pChannel, pTemplate )

	' TODO: Custom Script
	
	' Return value determines whether operation should be canceled:
	'	TRUE: go ahead with the operation
	'	FALSE: cancel the operation
	OnInternalBeforeCreatePosting = True
End Function



' -----------------------------------------------------------------------------
'
'	This is the hook function being called after a simple posting has 
'	just been created.   
'
'	@pNewPosting [in] - the new Posting object that has just been created.
'
' -----------------------------------------------------------------------------
Sub OnInternalAfterCreatePosting( pNewPosting )

	' TODO: Custom Script
	
End Sub


' -----------------------------------------------------------------------------
'
'	This is the hook function being called before before a connected Posting is created  
'	in a Channel.  A boolean return value of False from this function will cause
'	the create operation to be skipped.  The implementation of this Function is totally 
'	up to the site designer.
'
'	@pChannel [in] - the Channel object that is about to be updated.
'
'	@pTemplate [in] - the Template object that the new connected posting will be
'					  used. 
'
'	@pExistingPosting [in] - the "original" posting object that is going to be used to 
'                            create a connected page.  This is the original page 
'							 that is going to share the contents with the connected 
'                            posting.
'
'	@return - A boolean value to indicate whether the create operation should
'			  be performed. A False value will result in the operation being
'			  cancelled and return the user to the Authoring Mode screen
'             with the original template info as page contents.
' -----------------------------------------------------------------------------
Function OnInternalBeforeCreateConnectedPosting( pChannel, pTemplate, pExistingPosting )
	
	' TODO: Custom Script
	
	' Return value determines whether operation should be canceled:
	'	TRUE: go ahead with the operation
	'	FALSE: cancel the operation
	OnInternalBeforeCreateConnectedPosting = True
End Function

' -----------------------------------------------------------------------------
'
'	This is the hook function being called after a connected posting has 
'	just been created.   
'
'	@pExistingPosting [in] - the "original" posting object that is going to be used to 
'                            create a connected page.  This is the original page 
'							 that is going to share the contents with the connected 
'                            posting.
'
'	@pNewPosting [in] - the new connected Posting object that has just been created.
'
' -----------------------------------------------------------------------------
Sub OnInternalAfterCreateConnectedPosting( pExistingPosting, pNewPosting )

	' TODO: Custom Script
	
End Sub


' -----------------------------------------------------------------------------
'
'	This is the hook function being called before before a  simple/connected Posting is   
'	updated in a Channel.  A boolean return value of False from this function will cause
'	the update operation to be skipped.  The implementation of this Function is totally 
'	up to the site designer.
'
'	@pPosting [in] - the Posting object that is about to be updated.
'
'	@return - A boolean value to indicate whether the update operation should
'			  be performed. A False value will result in the operation being
'			  cancelled and return the user to the Authoring Mode screen
'             with the original posting info as page contents.
' -----------------------------------------------------------------------------
Function OnInternalBeforeUpdatePosting( pPosting )

	' TODO: Custom Script
	
	' Return value determines whether operation should be canceled:
	'	TRUE: go ahead with the operation
	'	FALSE: cancel the operation
	OnInternalBeforeUpdatePosting = True
End Function



' -----------------------------------------------------------------------------
'
'	This is the hook function being called after a simple/connected posting has 
'	just been updated.   
'
'	@pPosting [in] - the Posting object that has just been updated.
'
' -----------------------------------------------------------------------------
Sub OnInternalAfterUpdatePosting( pPosting )

	' TODO: Custom Script
	If Not GetGlobalFeatureManager.FeatureIsRegistered( _
									IDS_FEATURE_CONNECTOR_FRAMEWORK ) Then
		Exit Sub
	End If


	If Not (g_pNRCSSession.ThisPosting Is Nothing) Then

		Dim pNRCSPosting
		If g_pNRCSSession.ThisPosting.IsSimpleProductPosting Then
			Set pNRCSPosting = g_pNRCSFactory.GetSimpleProductPosting( _
												pPosting, _
												g_pNRCSSession.ThisPosting.Product )
		Else
			Set pNRCSPosting = g_pNRCSFactory.GetPosting( pPosting )
		End If

		Dim pFormReader
		Set pFormReader = GetInitializedFormReaderSafe( False )

		Call ProcessContentProfilePost( pNRCSPosting, pFormReader )

	End If
	
End Sub


' -----------------------------------------------------------------------------
'
'	This is the hook function being called before before a  simple/connected Posting is   
'	deleted in a Channel.  A boolean return value of False from this function will cause
'	the delete operation to be skipped.  The implementation of this Function is totally 
'	up to the site designer.
'
'	@pPosting [in] - the Posting object that is about to be deleted.
'
'	@return - A boolean value to indicate whether the delete operation should
'			  be performed. A False value will result in the operation being
'			  cancelled and return the user to the Edit Mode screen
'             with the original posting info as page contents.
' -----------------------------------------------------------------------------
Function OnInternalBeforeDeletePosting( pPosting )

	' TODO: Custom Script
	
	' Return value determines whether operation should be canceled:
	'	TRUE: go ahead with the operation
	'	FALSE: cancel the operation
	OnInternalBeforeDeletePosting = True
End Function



' -----------------------------------------------------------------------------
'
'	This is the hook function being called after a simple/connected posting has 
'	just been deleted.   
'
'	 WARNING: accessing properties or invoking methods on the pPosting
'			object which has been deleted at this point may cause
'			errors or unexpected results.
'
'	@pChannel [in] - the Channel object that has owns the deleted posting
'
'	@pPosting [in] - the Posting object that has just been deleted.
'
' -----------------------------------------------------------------------------
Sub OnInternalAfterDeletePosting( pChannel, pPosting )

	' TODO: Custom Script
	If Not GetGlobalFeatureManager.FeatureIsRegistered( _
									IDS_FEATURE_CONNECTOR_FRAMEWORK ) Then
		Exit Sub
	End If

	Dim pNRCSPosting
	Set pNRCSPosting = g_pNRCSFactory.GetPosting( pPosting )

	If Not (pNRCSPosting Is Nothing) Then

		Call pNRCSPosting.Delete

	End If
	
End Sub

%>