This commit is contained in:
Virtuworks 2013-11-08 16:34:31 -05:00
commit 16ec7fc2b6
11 changed files with 254 additions and 46 deletions

View file

@ -156,4 +156,7 @@
<data name="IIS7.Redirect" xml:space="preserve">
<value>Redirect</value>
</data>
<data name="lblErrorMode.Text">
<value xml:space="preserve">Error Mode</value>
</data>
</root>

View file

@ -1,4 +1,19 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebSitesCustomErrorsControl.ascx.cs" Inherits="WebsitePanel.Portal.WebSitesCustomErrorsControl" %>
<div style="padding: 20; margin-bottom: 10px;">
<table cellpadding="4">
<tr id="rowAspNet" runat="server">
<td class="SubHead">
<asp:Label ID="lblErrorMode" runat="server" meta:resourcekey="lblErrorMode"></asp:Label>:
</td>
<td class="Normal">
<asp:DropDownList ID="ddlErrorMode" runat="server" CssClass="NormalTextBox"></asp:DropDownList>
</td>
</tr>
</table>
</div>
<div class="FormButtonsBar">
<asp:Button id="btnAdd" runat="server" meta:resourcekey="btnAddError" Text="Add Custom Error" CssClass="Button3" OnClick="btnAdd_Click" CausesValidation="False"></asp:Button>
</div>

View file

@ -63,16 +63,29 @@ namespace WebsitePanel.Portal
{
IIs7 = item.IIs7;
// bind data
// bind error mode
ddlErrorMode.Items.Add(HttpErrorsMode.DetailedLocalOnly.ToString());
ddlErrorMode.Items.Add(HttpErrorsMode.Custom.ToString());
ddlErrorMode.Items.Add(HttpErrorsMode.Detailed.ToString());
ddlErrorMode.SelectedValue = item.ErrorMode.ToString();
// bind errors list
gvErrorPages.DataSource = item.HttpErrors;
gvErrorPages.DataBind();
}
public void SaveWebItem(WebVirtualDirectory item)
{
item.ErrorMode = GetSelectedErrorMode();
item.HttpErrors = CollectFormData(false).ToArray();
}
private HttpErrorsMode GetSelectedErrorMode()
{
return (HttpErrorsMode)Enum.Parse(typeof (HttpErrorsMode), ddlErrorMode.SelectedValue);
}
public List<HttpError> CollectFormData(bool includeEmpty)
{
List<HttpError> errors = new List<HttpError>();

View file

@ -1,10 +1,37 @@
// Copyright (c) 2012, Outercurve Foundation.
// All rights reserved.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// - Redistributions of source code must retain the above copyright notice, this
// list of conditions and the following disclaimer.
//
// - Redistributions in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// - Neither the name of the Outercurve Foundation nor the names of its
// contributors may be used to endorse or promote products derived from this
// software without specific prior written permission.
//
// THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
// ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
// WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
// DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
// ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
// (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
// LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
// ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.3074
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ -13,6 +40,33 @@ namespace WebsitePanel.Portal {
public partial class WebSitesCustomErrorsControl {
/// <summary>
/// rowAspNet control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.HtmlControls.HtmlTableRow rowAspNet;
/// <summary>
/// lblErrorMode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Label lblErrorMode;
/// <summary>
/// ddlErrorMode control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.DropDownList ddlErrorMode;
/// <summary>
/// btnAdd control.
/// </summary>

View file

@ -58,20 +58,17 @@ namespace WebsitePanel.Portal
Array.Sort(allowedEngineArray, new ShortHeliconZooEngineComparer());
// get enabled engines for this site from applicationHost.config
string[] enabledEngineNames = ES.Services.HeliconZoo.GetEnabledEnginesForSite(site.SiteId, site.PackageId);
ViewState["EnabledEnginesNames"] = enabledEngineNames;
//console allowed in applicationHost.config
ViewState["IsZooWebConsoleEnabled"] = enabledEngineNames.Contains("console", StringComparer.OrdinalIgnoreCase);
List<ShortHeliconZooEngine> allowedEngines = new List<ShortHeliconZooEngine>(allowedEngineArray);
// fix engine name and check is web console enabled
foreach (ShortHeliconZooEngine engine in allowedEngines)
{
engine.Name = engine.Name.Replace("HeliconZoo.", "");
@ -82,7 +79,6 @@ namespace WebsitePanel.Portal
//console allowed in hosting plan
ViewState["IsZooWebConsoleEnabled"] = engine.Enabled;
}
}
ViewState["AllowedEngines"] = allowedEngines;
@ -146,7 +142,11 @@ namespace WebsitePanel.Portal
continue; //skip
}
if (string.Equals(appEngine, engine.KeywordedName, StringComparison.OrdinalIgnoreCase))
if (
string.Equals(appEngine, engine.KeywordedName, StringComparison.OrdinalIgnoreCase)
||
engine.Name == "*"
)
{
filteredApplications.Add(application);