PageRenderTime 132ms CodeModel.GetById 124ms app.highlight 4ms RepoModel.GetById 1ms app.codeStats 0ms

/source/app/NOS.Wiki/AdminProviders.aspx

http://github.com/agross/netopenspace
ASP.NET | 254 lines | 200 code | 31 blank | 23 comment | 2 complexity | 009a59d43338d1bcf04c3324c0832fa3 MD5 | raw file
  1<%@ Page Title="" Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeBehind="AdminProviders.aspx.cs" Inherits="ScrewTurn.Wiki.AdminProviders" culture="auto" meta:resourcekey="PageResource1" uiculture="auto" %>
  2
  3<%@ Register TagPrefix="st" TagName="ProviderSelector" Src="~/ProviderSelector.ascx" %>
  4
  5<asp:Content ID="ctnHead" ContentPlaceHolderID="head" runat="server">
  6</asp:Content>
  7
  8<asp:Content ID="ctnProviders" ContentPlaceHolderID="cphAdmin" runat="server">
  9	<script type="text/javascript">
 10	<!--
 11		function __ShowUploadProgress() {
 12			document.getElementById("UploadProgressSpan").style["display"] = "";
 13			return true;
 14		}
 15		function __HideUploadProgress() {
 16			document.getElementById("UploadProgressSpan").style["display"] = "none";
 17			return true;
 18		}
 19	// -->
 20	</script>
 21
 22	<h2 class="sectiontitle"><asp:Literal ID="lblProviders" runat="server" Text="Providers" EnableViewState="False" meta:resourcekey="lblProvidersResource1" /></h2>
 23
 24	<anthem:Panel ID="pnlList" runat="server" AutoUpdateAfterCallBack="True" meta:resourcekey="pnlListResource1" UpdateAfterCallBack="True">
 25		<asp:Literal ID="lblDisplay" runat="server" Text="Display" EnableViewState="False" meta:resourcekey="lblDisplayResource1" />:
 26		<anthem:RadioButton ID="rdoPages" runat="server" Text="Pages Providers" GroupName="type" Checked="True" AutoCallBack="True" OnCheckedChanged="rdo_CheckedChanged" meta:resourcekey="rdoPagesResource1" />
 27		<anthem:RadioButton ID="rdoUsers" runat="server" Text="Users Providers" GroupName="type" AutoCallBack="True" OnCheckedChanged="rdo_CheckedChanged" meta:resourcekey="rdoUsersResource1" />
 28		<anthem:RadioButton ID="rdoFiles" runat="server" Text="Files Providers" GroupName="type" AutoCallBack="True" OnCheckedChanged="rdo_CheckedChanged" meta:resourcekey="rdoFilesResource1" />
 29		<anthem:RadioButton ID="rdoCache" runat="server" Text="Cache Providers" GroupName="type" AutoCallBack="True" OnCheckedChanged="rdo_CheckedChanged" meta:resourcekey="rdoCacheResource1" />
 30		<anthem:RadioButton ID="rdoFormatter" runat="server" Text="Formatter Providers" GroupName="type" AutoCallBack="True" OnCheckedChanged="rdo_CheckedChanged" meta:resourcekey="rdoFormatterResource1" />
 31		<br />
 32		
 33		<div id="ProvidersListContainerDiv">
 34			<anthem:Repeater ID="rptProviders" runat="server"
 35				OnDataBinding="rptProviders_DataBinding" OnItemCommand="rptProviders_ItemCommand">
 36				<HeaderTemplate>
 37					<table cellpadding="0" cellspacing="0" class="generic">
 38						<thead>
 39						<tr class="tableheader">
 40							<th><asp:Literal ID="lblName" runat="server" EnableViewState="False" meta:resourcekey="lblNameResource1" Text="Name" /></th>
 41							<th><asp:Literal ID="lblVersion" runat="server" EnableViewState="False" meta:resourcekey="lblVersionResource1" Text="Ver." /></th>
 42							<th><asp:Literal ID="lblAuthor" runat="server" EnableViewState="False" meta:resourcekey="lblAuthorResource1" Text="Author" /></th>
 43							<th><asp:Literal ID="lblUpdateStatus" runat="server" EnableViewState="false" meta:resourcekey="lblUpdateStatusResource1" Text="Update Status" /></th>
 44							<th>&nbsp;</th>
 45						</tr>
 46						</thead>
 47						<tbody>
 48				</HeaderTemplate>
 49				<ItemTemplate>
 50					<tr class='tablerow<%# Eval("AdditionalClass") %>'>
 51						<td><%# Eval("Name") %></td>
 52						<td><%# Eval("Version") %></td>
 53						<td><a href='<%# Eval("AuthorUrl") %>' target="_blank"><%# Eval("Author") %></a></td>
 54						<td><%# Eval("UpdateStatus") %></td>
 55						<td><anthem:LinkButton ID="btnSelect" runat="server" CommandArgument='<%# Eval("TypeName") %>' CommandName="Select" meta:resourcekey="btnSelectResource2" Text="Select" /></td>
 56					</tr>
 57				</ItemTemplate>
 58				<AlternatingItemTemplate>
 59					<tr class='tablerowalternate<%# Eval("AdditionalClass") %>'>
 60						<td><%# Eval("Name") %></td>
 61						<td><%# Eval("Version") %></td>
 62						<td><a href='<%# Eval("AuthorUrl") %>' target="_blank"><%# Eval("Author") %></a></td>
 63						<td><%# Eval("UpdateStatus") %></td>
 64						<td><anthem:LinkButton ID="btnSelect" runat="server" Text="Select" CommandName="Select" CommandArgument='<%# Eval("TypeName") %>' meta:resourcekey="btnSelectResource1" /></td>
 65					</tr>
 66				</AlternatingItemTemplate>
 67				<FooterTemplate>
 68					</tbody>
 69					</table>
 70				</FooterTemplate>
 71			</anthem:Repeater>
 72		</div>
 73		
 74		<anthem:Panel ID="pnlProviderDetails" runat="server" AutoUpdateAfterCallBack="True" Visible="False" meta:resourcekey="pnlProviderDetailsResource1">
 75			<div id="EditProviderDiv">
 76				<h3><asp:Literal ID="lblProviderName" runat="server" meta:resourcekey="lblProviderNameResource1" /></h3>
 77				<b><asp:Literal ID="lblProviderDll" runat="server" meta:resourcekey="lblProviderDllResource1" /></b>
 78				<br /><br />
 79				
 80				<asp:Literal ID="lblConfigurationStringTitle" runat="server" Text="Configuration String" EnableViewState="False" meta:resourcekey="lblConfigurationStringTitleResource1" />
 81				&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
 82				<a href="#" onclick="javascript:document.getElementById('ProviderConfigHelpDiv').style['display'] = ''; return false;">
 83				<asp:Literal ID="lblConfigHelp" runat="server" Text="Help" EnableViewState="False" meta:resourcekey="lblConfigHelpResource1" /></a>
 84				<br />
 85				<anthem:TextBox ID="txtConfigurationString" runat="server" TextMode="MultiLine" CssClass="config" meta:resourcekey="txtConfigurationStringResource1" />
 86				<br />
 87				<anthem:Button ID="btnSave" runat="server" Text="Save" ToolTip="Save the Configuration String" OnClick="btnSave_Click" meta:resourcekey="btnSaveResource1" />
 88				<anthem:Button ID="btnDisable" runat="server" Text="Disable" ToolTip="Disable the Provider" OnClick="btnDisable_Click" PreCallBackFunction="RequestConfirm" meta:resourcekey="btnDisableResource1" />
 89				<anthem:Button ID="btnEnable" runat="server" Text="Enable" ToolTip="Enable the Provider" Visible="False" OnClick="btnEnable_Click" PreCallBackFunction="RequestConfirm" meta:resourcekey="btnEnableResource1" />
 90				<anthem:Button ID="btnUnload" runat="server" Text="Unload" ToolTip="Unloads the Provider" OnClick="btnUnload_Click" PreCallBackFunction="RequestConfirm" meta:resourcekey="btnUnloadResource1" />
 91				<anthem:Button ID="btnCancel" runat="server" Text="Cancel" ToolTip="Deselect the Provider" OnClick="btnCancel_Click" meta:resourcekey="btnCancelResource1" />
 92				<br /><br />
 93				<anthem:Label ID="lblCannotDisable" runat="server" CssClass="small" Text="Cannot disable the provider because it is the default provider or,<br />in case of a Pages Provider, it manages the default page of the root namespace"
 94					meta:resourcekey="lblCannotDisableResource1"/><br />
 95				<anthem:Label ID="lblResult" runat="server" meta:resourcekey="lblResultResource1" />
 96				
 97				<div id="ProviderConfigHelpDiv" style="display: none;">
 98					<anthem:Label ID="lblProviderConfigHelp" runat="server" meta:resourcekey="lblProviderConfigHelpResource1" />
 99				</div>
100			</div>
101		</anthem:Panel>
102		
103		<div id="ProvidersUpdateDiv">
104		
105			<script type="text/javascript">
106			<!--
107				function __ShowUpdateProgress() {
108					if (RequestConfirm()) {
109						document.getElementById("ProvidersUpdateProgress").style["display"] = "";
110						return true;
111					}
112					else return false;
113				}
114
115				function __HideUpdateProgress() {
116					document.getElementById("ProvidersUpdateProgress").style["display"] = "none";
117				}
118			// -->
119			</script>
120			
121			<anthem:Button ID="btnAutoUpdateProviders" runat="server" Text="Auto-update Providers" ToolTip="Automatically update all installed providers, of all types"
122				PreCallBackFunction="__ShowUpdateProgress" PostCallBackFunction="__HideUpdateProgress" OnClick="btnAutoUpdateProviders_Click" meta:resourcekey="btnAutoUpdateProvidersResource1" />
123			<span id="ProvidersUpdateProgress" style="display: none;">
124				<img src="Images/Wait.gif" alt="..." />
125			</span>
126			<anthem:Label ID="lblAutoUpdateResult" runat="server" AutoUpdateAfterCallBack="true" />
127			
128		</div>
129		
130	</anthem:Panel>
131	
132	<anthem:HiddenField ID="txtCurrentProvider" runat="server" AutoUpdateAfterCallBack="True" />
133	
134	<div style="clear: both;"></div>
135	
136	<br />
137	<h2 class="separator"><asp:Literal ID="lblDefaultProvidersTitle" runat="server" Text="Default Providers" EnableViewState="False" meta:resourcekey="lblDefaultProvidersTitleResource1" /></h2>
138				
139	<div class="defaultprov">
140		<asp:Literal ID="lblDefaultProvPages" runat="server" Text="Pages Provider" EnableViewState="False" meta:resourcekey="lblDefaultProvPagesResource1" /><br />
141		<st:ProviderSelector ID="lstPagesProvider" runat="server" ProviderType="Pages" ExcludeReadOnly="true" />
142	</div>
143	<div class="defaultprov">
144		<asp:Literal ID="lblDefaultProvUsers" runat="server" Text="Users Provider" EnableViewState="False" meta:resourcekey="lblDefaultProvUsersResource1" /><br />
145		<st:ProviderSelector ID="lstUsersProvider" runat="server" ProviderType="Users" ExcludeReadOnly="true" />
146	</div>
147	<div class="defaultprov">
148		<asp:Literal ID="lblDefaultProvFiles" runat="server" Text="Files Provider" EnableViewState="False" meta:resourcekey="lblDefaultProvFilesResource1" /><br />
149		<st:ProviderSelector ID="lstFilesProvider" runat="server" ProviderType="Files" ExcludeReadOnly="true" />
150	</div>
151	<div class="defaultprov">
152		<asp:Literal ID="lblDefaultProvCache" runat="server" Text="Cache Provider" EnableViewState="False" meta:resourcekey="lblDefaultProvCacheResource1" /><br />
153		<st:ProviderSelector ID="lstCacheProvider" runat="server" ProviderType="Cache" ExcludeReadOnly="true" />
154	</div>
155	<div class="defaultprovbutton">
156		<anthem:Button ID="btnSaveDefaultProviders" runat="server" Text="Save" OnClick="btnSaveDefaultProviders_Click" meta:resourcekey="btnSaveDefaultProvidersResource1" />
157		<anthem:Label ID="lblDefaultProvidersResult" runat="server" AutoUpdateAfterCallBack="True" meta:resourcekey="lblDefaultProvidersResultResource1" />
158	</div>
159	
160	<div style="clear: both;"></div>
161	
162	<br />
163	<h2 class="separator"><asp:Literal ID="lblUploadProvidersTitle" runat="server" Text="Providers DLLs Management" EnableViewState="False" meta:resourcekey="lblUploadProvidersTitleResource1" /></h2>
164	
165	<h4><asp:Literal ID="lblUploadNewDll" runat="server" Text="Upload new DLL" EnableViewState="False" meta:resourcekey="lblUploadNewDllResource1" /></h4>
166	<anthem:FileUpload ID="upDll" runat="server" AutoUpdateAfterCallBack="True" meta:resourcekey="upDllResource1" />
167	<anthem:Button ID="btnUpload" runat="server" Text="Upload" OnClick="btnUpload_Click" EnabledDuringCallBack="False"
168		PreCallBackFunction="__ShowUploadProgress" PostCallBackFunction="__HideUploadProgress" meta:resourcekey="btnUploadResource1" />
169	<span id="UploadProgressSpan" style="display: none;"><img src="Images/Wait.gif" alt="Uploading..." /></span><br />
170	<anthem:Label ID="lblUploadResult" runat="server" AutoUpdateAfterCallBack="True" meta:resourcekey="lblUploadResultResource1" />
171	
172	<div id="DllsListContainerDiv">
173		<anthem:DropDownList ID="lstDlls" runat="server" AutoCallBack="True" AutoUpdateAfterCallBack="True" OnSelectedIndexChanged="lstDlls_SelectedIndexChanged" meta:resourcekey="lstDllsResource1" />
174		<anthem:Button ID="btnDeleteDll" runat="server" Text="Delete" PreCallBackFunction="RequestConfirm" AutoUpdateAfterCallBack="True" OnClick="btnDeleteDll_Click" Enabled="False" meta:resourcekey="btnDeleteDllResource1" />
175		<br />
176		<anthem:Label ID="lblDllResult" runat="server" AutoUpdateAfterCallBack="True" meta:resourcekey="lblDllResultResource1" />
177	</div>
178	
179	<div id="DllNoticeDiv">
180		<small>
181			<asp:Literal ID="lblUploadInfo" runat="server" EnableViewState="False"
182				Text="<b>Note</b>: removing a DLL won't disable the Providers it contains until the next wiki restart,<br />but uploading a new DLL will automatically load the Providers it contains." 
183				meta:resourcekey="lblUploadInfoResource1" />
184		</small>
185	</div>
186	
187	<div style="clear: both;"></div>
188	
189	<br />
190	<h2 class="separator"><asp:Literal ID="lblDataMigration" runat="server" Text="Data Migration" EnableViewState="False" meta:resourcekey="lblDataMigrationResource1" /></h2>
191	<asp:Literal ID="lblMigrationInfo" runat="server" EnableViewState="False"		
192		Text="<b>Note 1</b>: always perform a full backup of all your data before performing a migration.<br /><b>Note 2</b>: migrations usually take several minutes to complete: during this time, do not perform any other activity in the wiki, and do not close this page.<br /><b>Note 3</b>: the destination provider should be completely empty: if it contains any data, it might cause consistency issues. Refer to the target provider's documentation for details.<br /><b>Timeouts</b>: it is strongly suggested that you increase the executionTimeout parameter in web.config before migrating data." 
193		meta:resourcekey="lblMigrationInfoResource2" />
194	<br /><br />
195	
196	<h4><asp:Literal ID="lblMigratePages" runat="server" Text="Migrate Pages and related data" EnableViewState="False" meta:resourcekey="lblMigratePagesResource1" /></h4>
197	<anthem:DropDownList ID="lstPagesSource" runat="server" AutoCallBack="True" AutoUpdateAfterCallBack="True"
198		OnSelectedIndexChanged="lstPagesSource_SelectedIndexChanged" meta:resourcekey="lstPagesSourceResource1" />
199	<img src="Images/ArrowRight.png" alt="->" />
200	<anthem:DropDownList ID="lstPagesDestination" runat="server" AutoUpdateAfterCallBack="True" meta:resourcekey="lstPagesDestinationResource1"  />
201	<anthem:Button ID="btnMigratePages" runat="server" Text="Migrate" Enabled="False" EnabledDuringCallBack="False" AutoUpdateAfterCallBack="True"
202		PreCallBackFunction="RequestConfirm" OnClick="btnMigratePages_Click" meta:resourcekey="btnMigratePagesResource1" />
203	<anthem:Label ID="lblMigratePagesResult" runat="server" AutoUpdateAfterCallBack="True" meta:resourcekey="lblMigratePagesResultResource1" />
204	<br />
205	<br />
206	
207	<h4><asp:Literal ID="lblMigrateUsers" runat="server" Text="Migrate Users and related data" EnableViewState="False" meta:resourcekey="lblMigrateUsersResource1" /></h4>
208	<anthem:DropDownList ID="lstUsersSource" runat="server" AutoCallBack="True" AutoUpdateAfterCallBack="True"
209		OnSelectedIndexChanged="lstUsersSource_SelectedIndexChanged" meta:resourcekey="lstUsersSourceResource1" />
210	<img src="Images/ArrowRight.png" alt="->" />
211	<anthem:DropDownList ID="lstUsersDestination" runat="server" AutoUpdateAfterCallBack="True" meta:resourcekey="lstUsersDestinationResource1" />
212	<anthem:Button ID="btnMigrateUsers" runat="server" Text="Migrate" Enabled="False" EnabledDuringCallBack="False"
213		AutoUpdateAfterCallBack="True" PreCallBackFunction="RequestConfirm" OnClick="btnMigrateUsers_Click" meta:resourcekey="btnMigrateUsersResource1" />
214	<anthem:Label ID="lblMigrateUsersResult" runat="server" AutoUpdateAfterCallBack="True" meta:resourcekey="lblMigrateUsersResultResource1" />
215	<br />
216	<span class="small">
217		<asp:Literal ID="lblMigrateUsersInfo" runat="server" 
218			Text="<b>Note</b>: migrating user accounts will reset all their passwords (an email notice will be sent to all users)." 
219			EnableViewState="False" meta:resourcekey="lblMigrateUsersInfoResource1" />
220	</span>	
221	<br /><br />
222	
223	<h4><asp:Literal ID="lblMigrateFiles" runat="server" Text="Migrate Files and related data" EnableViewState="False" meta:resourcekey="lblMigrateFilesResource1" /></h4>
224	<anthem:DropDownList ID="lstFilesSource" runat="server" AutoCallBack="True" AutoUpdateAfterCallBack="True"
225		OnSelectedIndexChanged="lstFilesSource_SelectedIndexChanged" meta:resourcekey="lstFilesSourceResource1" />
226	<img src="Images/ArrowRight.png" alt="->" />
227	<anthem:DropDownList ID="lstFilesDestination" runat="server" AutoUpdateAfterCallBack="True" meta:resourcekey="lstFilesDestinationResource1"  />
228	<anthem:Button ID="btnMigrateFiles" runat="server" Text="Migrate" Enabled="False" EnabledDuringCallBack="False"
229		AutoUpdateAfterCallBack="True" PreCallBackFunction="RequestConfirm" OnClick="btnMigrateFiles_Click" meta:resourcekey="btnMigrateFilesResource1" />
230	<anthem:Label ID="lblMigrateFilesResult" runat="server" AutoUpdateAfterCallBack="True" meta:resourcekey="lblMigrateFilesResultResource1" />
231	<br /><br />
232	
233	<h4><asp:Literal ID="lblCopySettings" runat="server" Text="Copy Settings and related data" EnableViewState="False" meta:resourcekey="lblCopySettingsResource1" /></h4>
234	<anthem:Label ID="lblSettingsSource" runat="server" AutoUpdateAfterCallBack="True" meta:resourcekey="lblSettingsSourceResource1"  />
235	<img src="Images/ArrowRight.png" alt="->" />
236	<anthem:DropDownList ID="lstSettingsDestination" runat="server" AutoUpdateAfterCallBack="True" AutoCallBack="True"
237		OnSelectedIndexChanged="lstSettingsDestination_SelectedIndexChanged" meta:resourcekey="lstSettingsDestinationResource1" />
238	<anthem:Button ID="btnCopySettings" runat="server" Text="Copy" Enabled="False" EnabledDuringCallBack="False"
239		AutoUpdateAfterCallBack="True" PreCallBackFunction="RequestConfirm" OnClick="btnCopySettings_Click" meta:resourcekey="btnCopySettingsResource1" />
240	<anthem:Label ID="lblCopySettingsResult" runat="server" AutoUpdateAfterCallBack="True" meta:resourcekey="lblCopySettingsResultResource1" /><br />
241	<span class="small">
242		<asp:Literal ID="lblCopySettingsInfo" runat="server" EnableViewState="False"
243			Text="<b>Note</b>: in order to be detected, the destination Provider must be uploaded using the upload tool.<br />Log and recent changes will not be copied." 
244			meta:resourcekey="lblCopySettingsInfoResource1" />
245	</span>
246	<br /><br />
247	<div id="CopySettingsConfigDiv">
248		<asp:Literal ID="lblCopySettingsDestinationConfig" runat="server" Text="Destination Settings Provider Configuration string (if needed)" EnableViewState="false" /><br />
249		<anthem:TextBox ID="txtSettingsDestinationConfig" runat="server" TextMode="MultiLine" CssClass="config" />
250	</div>
251	
252	<div style="clear: both;"></div>
253	
254</asp:Content>