<!--#include file="CNCASPPageManager_ResourceCreateAcceptor.inc" -->

<%
' *****************************************************************************
' File:		/NR/System/WBC/Internals/WBCFuncPages/Cross-Browser/
'			ResourceBrowser/Management/ResourceCreate/
'			ResourceCreateAcceptor.asp
'
' Author:	Microsoft Corporation.
' Purpose:	Process the uploading of the resource file.  There will be a file
'			read, then create the resource based on the filename.
'
' Query String Parameters:
'	IDS_QPARAM_GALLERY: Guid of the gallery selected
'
' Form Field Names:
'	IDS_FORM_RESOURCE_DESCRIPTION: Description of the resource
'	IDS_FORM_RESOURCE_DISPLAY_NAME: Display name of resource
'	IDS_FORM_RESOURCE_NAME: The resource file
' ************************************************************************

' ---- Initialize the ASPPageManager
Dim g_pASPPageManager
Set g_pASPPageManager = New CNCASPPageManager_ResourceCreateAcceptor
Call g_pASPPageManager.InitManager()

%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">

<html>
<head>
<meta http-equiv="pragma" content="no-cache">
<meta http-equiv="expires" content="-1">
<meta name="Author" content="Microsoft Corporation.">
<meta name="Description" content="Process the uploaded desktop resource and add it to a	resource gallery">
<meta name="robots" content="NOINDEX,NOFOLLOW">
<meta http-equiv="Content-Type" content="text/html;charset=<%= g_pASPPageManager.Charset %>">
<title><%= IDS_UI_BROWSER_TITLE %></title>
<% Call EmbedWBCHeadSection %>

</head>

<body>

<%	If (g_pASPPageManager.Error <> "") Then %>

	<table width="100%" border="0" cellspacing="0" cellpadding="0">

		<!-- Show the Top Title -->
		<tr class="WBC_styclsBackground1">
			<td align=right><img border=0 src="<%=IDS_PATH_IMAGE_LOGO %>"></td>
			<td width=100% valign="middle"  class="WBC_styclsHeaderText">
				<%= IDS_UI_RESOURCE_MANAGER %>
			</td>
			<td><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="<%= C_INT_MAIN_MARGIN %>" height="<%=C_INT_HEADER_HEIGHT%>" border="0"></td>
		</tr>

		<!-- Show the breadcrumb trail -->
		<tr class="WBC_styclsBackground2">
			<td><img src="<%=IDS_TRANSPARENT_GIF%>"
				width="<%= C_INT_MAIN_MARGIN %>" height="<%=C_INT_SUBHEAD_HEIGHT%>" border="0"></td>
			<td class="WBC_styclsSubheadText">
				<a href="<%= g_pASPPageManager.URLBack2ResourceCreateLink %>"><%= IDS_UI_ADD_RESOURCE %></a> >
				<%= IDS_UI_ADD_RESOURCE_FAILURE %>
			</td>
			<td><img src="<%=IDS_TRANSPARENT_GIF%>"
				width="<%= C_INT_MAIN_MARGIN %>" height="<%=C_INT_SUBHEAD_HEIGHT%>" border="0"></td>
		</tr>
		<tr>
			<td><img src="<%=IDS_TRANSPARENT_GIF%>"
				width="15" height="<%= C_INT_MAIN_SPACING %>" border="0"></td>
		</tr>

		<!-- Set the margin width for the rest of the page -->
		<tr>
			<td rowspan="999"><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="<%= C_INT_MAIN_MARGIN %>" height="1" border="0"></td>
			<td><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="100%" height="1" border="0"></td>
			<td rowspan="999"><img src="<%=IDS_TRANSPARENT_GIF%>"
						width="<%= C_INT_MAIN_MARGIN %>" height="1" border="0"></td>
		</tr>

	<%	If (g_pASPPageManager.Error = IDS_ERR_GALLERY_NOT_FOUND) Then %>

		<!-- Display the fact that ResourceGallery Is not found -->
		<tr>
			<td class="WBC_styclsBackground1">
				<table width="100%" border="0" cellspacing="<%= C_INT_THICK_BORDER %>" cellpadding="5">
					<tr class="WBC_styclsBackground2">
						<td>
							<span class="WBC_styclsHeavyTextColor1"><%= IDS_UI_RESOURCE_GALLERY %>:</span>&nbsp;&nbsp;
							<span class="WBC_styclsTextColor1"><%= IDS_UI_GALLERY_NOT_FOUND %></span>
						</td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td colspan=3><img src="<%=IDS_TRANSPARENT_GIF%>"
				width="15" height="<%= C_INT_MAIN_SPACING %>" border="0"></td>
		</tr>

	<%	Else %>

		<!-- Show the Content area -->
		<tr>
			<td valign="top" class="WBC_styclsBackground1">
				<table width="100%" border="0" cellspacing="<%= C_INT_THICK_BORDER %>" cellpadding="5" >
					<tr class="WBC_styclsBackground2">
						<td valign="top" >
							<table width="100%" border="0" cellspacing="0" cellpadding="5" >

							<%	If (g_pASPPageManager.Error = IDS_ERR_INIT_FORMREADER) Then %>

								<!-- Render FileUpload Error Description (Err.Description) -->
								<tr valign="top">
									<td class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERR_INIT_FORMREADER %></td>
									<td class="WBC_styclsTextColor1"><%= Err.Description %>&nbsp;</td>
								</tr>

							<%	ElseIf (g_pASPPageManager.Error = IDS_ERR_FILE_UPLOAD) Then %>

								<!-- Render FileUpload Error Description (Err.Description) -->
								<tr valign="top">
									<td class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERR_FILE_UPLOAD %></td>
									<td class="WBC_styclsTextColor1"><%= Err.Description %>&nbsp;</td>
								</tr>

							<%	ElseIf (g_pASPPageManager.Error = IDS_ERR_RESOURCE_CREATE) Then %>

								<!-- Render Resource.SetContent Error Description -->
								<tr valign="top">
									<td class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERR_RESOURCE_CREATE %></td>
									<td class="WBC_styclsTextColor1"><%= AutoSession.LastError.Description %>&nbsp;</td>
								</tr>

								<!-- Render Resource.SetContent Error Detailed Description -->
								<tr valign="top">
									<td class="WBC_styclsHeavyTextColor1"><%= IDS_UI_DETAILED_ERROR_DESCRIPTION %></td>
									<td class="WBC_styclsTextColor1"><%= AutoSession.LastError.InternalDetails %>&nbsp;</td>
								</tr>

							<%	ElseIf (g_pASPPageManager.Error = IDS_ERR_RESOURCE_SETPROPS) Then %>

								<!-- Render Resource SetProperties Error Description -->
								<tr valign="top">
									<td class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERR_RESOURCE_SETPROPS %></td>
									<td class="WBC_styclsTextColor1"><%= AutoSession.LastError.Description %>&nbsp;</td>
								</tr>

								<!-- Render Resource SetProperties Error Detailed Description -->
								<tr valign="top">
									<td class="WBC_styclsHeavyTextColor1"><%= IDS_UI_DETAILED_ERROR_DESCRIPTION %></td>
									<td class="WBC_styclsTextColor1"><%= AutoSession.LastError.InternalDetails %>&nbsp;</td>
								</tr>

							<%	ElseIf (g_pASPPageManager.Error = IDS_ERR_FILE_CLEANUP) Then %>

								<!-- Render FileUpload Error Description (Err.Description) -->
								<tr valign="top">
									<td class="WBC_styclsHeavyTextColor1"><%= IDS_UI_ERR_FILE_CLEANUP %></td>
									<td class="WBC_styclsTextColor1"><%= Err.Description %>&nbsp;</td>
								</tr>

							<%	End If %>

								<tr>
									<td colspan="2">&nbsp;</td>
								</tr>

							</table>
						</td>
					</tr>
				</table>
			</td>
		</tr>

	<%	End If %>

</table>

<%	Else %>

	<script language="JavaScript" type="text/javascript">
	<!--
		if (!WBC_isOpenerWindowClosed())
		{
			window.opener.WBC_refreshResourcesListWindow();
		}
		window.close();

	// -->
	</script>

<%	End If %>

</body>
</html>