<%

'*****************************************************************************
' Microsoft Content Management Server
'
' File: SDReportRightsGroupsAndUsersRestoreOptions.INC
'
' Purpose:
'   ASP server-side include file that generates the import options information 
'   section of an import report. This file is included by the main report file.
'
' GLOBAL DEPENDENCIES:
'	pReportXMLTag [in] - the root XML tag of the report XML.
'
'*****************************************************************************


	'*************************************************************************
	' Description:
	'	Examines the option in the report XML concerning the import of user
	'	rights groups. This method will examine the various low-level values
	'	in the XML and convert them to human-readable strings for the report.
	'
	' Returns:
	'	String indicating selected option for importing user rights groups
	'*************************************************************************
	function getUserRightsGroupOption
	
		dim bImportUserRightsGroups
		bImportUserRightsGroups = CBool( pReportXMLTag.ImportOptions.Security.RightsGroups.Import )
		
		dim bImportUsers
		bImportUsers = CBool( pReportXMLTag.ImportOptions.Security.RightsGroups.Users )
		
		dim strOption
		' default to do not import, overwrite otherwise
		strOption = "Do not import any User Rights Groups"
		
		if bImportUserRightsGroups then
			strOption = "Import User Rights Groups"
		end if
		
		if bImportUsers then
			strOption = strOption & " <I>and</I> Users"
		end if
	
		getUserRightsGroupOption = strOption
		
	end function


	'*************************************************************************
	' Description:
	'	Examines the option in the report XML concerning the import of users. 
	'	This method will examine the various low-level values the XML and 
	'   convert them to human-readable strings for the report.
	'
	' Returns:
	'	String indicating selected option for importing users
	'*************************************************************************
	function getUserOption
	
		dim strUserOption
		strUserOption = pReportXMLTag.ImportOptions.Security.RightsGroups.Specifier
		
		if strUserOption = "None" then
			strUserOption = "N/A"

		elseif strUserOption = "WithoutUsers" then
			strUserOption = "Do not import users"
			
		elseif strUserOption = "ROPUsers" then
			strUserOption = "Use only the package user lists"
		
		elseif strUserOption = "CombineUsers" then
			strUserOption = "Use package and destination user lists, combining them for replaced Rights Groups"

		elseif strUserOption = "CombineUsers" then
			strUserOption = "Use package and destination user lists, combining them for replaced Rights Groups"
					
		else
			call Err.Raise( nERROR_INVALID_USER_OPTION, "ImportReportOptions", strERROR_INVALID_USER_OPTION )
			
		end if

		getuserOption = strUserOption
		
	end function

	'*************************************************************************
	' Description:
	'	Examines the option in the report XML concerning the CreatedBy attribute of
	'	imported objects. This method will examine the various low-level values
	'	in the XML and convert them to human-readable strings for the report.
	'
	' Returns:
	'	String indicating selected owner for imported objects
	'*************************************************************************
	function getCreatedByOption
		
		dim strCreatedByOption
		
		strCreatedByOption = pReportXMLTag.ImportOptions.Security.CreatedBy.Specifier
		
		if strCreatedByOption = "UsePackage" then
			strCreatedByOption = "Use Created By in package"
		else
			strCreatedByOption = "Set to current user"
		end if				
	
		getCreatedByOption = strCreatedByOption
		
	end function
	
	'*************************************************************************
	' Description:
	'	Examines the option in the report XML concerning the CreatedBy attribute of
	'	imported objects. This method will examine the various low-level values
	'	in the XML and convert them to human-readable strings for the report.
	'
	' Returns:
	'	String indicating selected owner for imported objects
	'*************************************************************************
	function getRemoveUsersBeforeImportOption
		
		dim strRemoveUsersBeforeImportOption
		dim strOption
		
		strOption = pReportXMLTag.ImportOptions.Security.RightsGroups.RemoveUsersBeforeImport
		
		if strOption = "-1" then
			strRemoveUsersBeforeImportOption = "Remove users from the existing Rights Groups before import"
		else
			strRemoveUsersBeforeImportOption = "Do not remove users from the existing Rights Groups"
		end if				
	
		getRemoveUsersBeforeImportOption = strRemoveUsersBeforeImportOption
		
	end function	
%>
     
     
       
<H4 Class="Heading4">Rights Groups</H4>

<BLOCKQUOTE style="MARGIN-RIGHT: 0px">

	<P>
	
	<TABLE CLASS="OptionsTable">
	  
	  <TR>
	    <TD CLASS="OptionsTableData" >Select how Rights Groups are imported:</TD>
	    <TD> <%= getUserRightsGroupOption %></TD>
	  </TR>
	  
	  <TR VALIGN="TOP">
	    <TD>When how Users are imported:</TD>
	    <TD> <%= getUserOption %> </TD>
	  </TR>
	
	  <TR VALIGN="TOP">
	    <TD>Existing Rights Group membership:</TD>
	    <TD> <%= getRemoveUsersBeforeImportOption %> </TD>
	  </TR>
	  	
	  <TR>
	    <TD>Set Created By on imported objects to:</TD>
	    <TD> <%= getCreatedByOption %> </TD>
	  </TR>
  
	</TABLE>
	
	</P>
  
</BLOCKQUOTE>
 
