Helicon Zoo Web Engines

This commit is contained in:
Virtuworks 2013-03-10 10:58:39 -04:00
parent 983d091670
commit 4768b07c92
50 changed files with 4389 additions and 36 deletions

View file

@ -1,4 +1,4 @@
USE [${install.database}]
USE [${install.database}]
GO
-- update database version
@ -44,13 +44,23 @@ INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDe
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[Quotas] WHERE [QuotaName] = 'Exchange2007.RecoverableItemsSpace')
BEGIN
INSERT [dbo].[Quotas] ([QuotaID], [GroupID],[QuotaOrder], [QuotaName], [QuotaDescription], [QuotaTypeID], [ServiceQuota], [ItemTypeID]) VALUES (421, 12, 25,N'Exchange2007.RecoverableItemsSpace',N'Recoverable Items Space',2, 0 , NULL)
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [ProviderName] = 'HeliconZoo')
BEGIN
INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES (135, 42, N'HeliconZoo', N'Web Application Engines', N'WebsitePanel.Providers.Web.HeliconZoo.HeliconZoo, WebsitePanel.Providers.Web.HeliconZoo', N'HeliconZoo', NULL)
END
GO
IF NOT EXISTS (SELECT * FROM [dbo].[ResourceGroups] WHERE [GroupName] = 'HeliconZoo')
BEGIN
INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (42, N'HeliconZoo', 2, N'WebsitePanel.EnterpriseServer.HeliconZooController', 1)
END
GO
IF NOT EXISTS(select 1 from sys.columns COLS INNER JOIN sys.objects OBJS ON OBJS.object_id=COLS.object_id and OBJS.type='U' AND OBJS.name='ExchangeMailboxPlans' AND COLS.name='AllowLitigationHold')
@ -423,4 +433,4 @@ GO
UPDATE Providers SET ProviderType = N'WebsitePanel.Providers.HostedSolution.CRMProvider2011, WebsitePanel.Providers.HostedSolution.CRMProvider2011' WHERE ProviderID = 1201
GO
GO

View file

@ -8,6 +8,6 @@ namespace WebsitePanel.EnterpriseServer.Base.Common
public class WebPlatformInstaller
{
public const string MAIN_FEED_URL = "https://www.microsoft.com/web/webpi/4.2/webproductlist.xml";
public const string ZOO_FEED = "http://www.helicontech.com/zoo/feed/wsp4";
public const string ZOO_FEED = "http://www.helicontech.com/zoo/feed/wsp21";
}
}

View file

@ -226,7 +226,9 @@ order by rg.groupOrder
public const string LYNC_EVNATIONAL = "Lync.EVNational";
public const string LYNC_EVMOBILE = "Lync.EVMobile";
public const string LYNC_EVINTERNATIONAL = "Lync.EVInternational";
public const string LYNC_ENABLEDPLANSEDITING = "Lync.EnablePlansEditing";
public const string LYNC_ENABLEDPLANSEDITING = "Lync.EnablePlansEditing";
public const string HELICON_ZOO = "HeliconZoo.*";
}
}

View file

@ -0,0 +1,519 @@
// 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.5456
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
// This source code was auto-generated by wsdl, Version=2.0.50727.42.
//
using WebsitePanel.Providers.HeliconZoo;
namespace WebsitePanel.EnterpriseServer {
using System.Xml.Serialization;
using System.Web.Services;
using System.ComponentModel;
using System.Web.Services.Protocols;
using System;
using System.Diagnostics;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="esHeliconZooSoap", Namespace="http://smbsaas/websitepanel/enterpriseserver")]
public partial class esHeliconZoo : Microsoft.Web.Services3.WebServicesClientProtocol {
private System.Threading.SendOrPostCallback GetEnginesOperationCompleted;
private System.Threading.SendOrPostCallback SetEnginesOperationCompleted;
private System.Threading.SendOrPostCallback IsEnginesEnabledOperationCompleted;
private System.Threading.SendOrPostCallback SwithEnginesEnabledOperationCompleted;
private System.Threading.SendOrPostCallback GetAllowedHeliconZooQuotasForPackageOperationCompleted;
private System.Threading.SendOrPostCallback GetEnabledEnginesForSiteOperationCompleted;
private System.Threading.SendOrPostCallback SetEnabledEnginesForSiteOperationCompleted;
/// <remarks/>
public esHeliconZoo() {
this.Url = "http://localhost:9005/esHeliconZoo.asmx";
}
/// <remarks/>
public event GetEnginesCompletedEventHandler GetEnginesCompleted;
/// <remarks/>
public event SetEnginesCompletedEventHandler SetEnginesCompleted;
/// <remarks/>
public event IsEnginesEnabledCompletedEventHandler IsEnginesEnabledCompleted;
/// <remarks/>
public event SwithEnginesEnabledCompletedEventHandler SwithEnginesEnabledCompleted;
/// <remarks/>
public event GetAllowedHeliconZooQuotasForPackageCompletedEventHandler GetAllowedHeliconZooQuotasForPackageCompleted;
/// <remarks/>
public event GetEnabledEnginesForSiteCompletedEventHandler GetEnabledEnginesForSiteCompleted;
/// <remarks/>
public event SetEnabledEnginesForSiteCompletedEventHandler SetEnabledEnginesForSiteCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetEngines", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public HeliconZooEngine[] GetEngines(int serviceId) {
object[] results = this.Invoke("GetEngines", new object[] {
serviceId});
return ((HeliconZooEngine[])(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetEngines(int serviceId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetEngines", new object[] {
serviceId}, callback, asyncState);
}
/// <remarks/>
public HeliconZooEngine[] EndGetEngines(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((HeliconZooEngine[])(results[0]));
}
/// <remarks/>
public void GetEnginesAsync(int serviceId) {
this.GetEnginesAsync(serviceId, null);
}
/// <remarks/>
public void GetEnginesAsync(int serviceId, object userState) {
if ((this.GetEnginesOperationCompleted == null)) {
this.GetEnginesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetEnginesOperationCompleted);
}
this.InvokeAsync("GetEngines", new object[] {
serviceId}, this.GetEnginesOperationCompleted, userState);
}
private void OnGetEnginesOperationCompleted(object arg) {
if ((this.GetEnginesCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetEnginesCompleted(this, new GetEnginesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetEngines", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void SetEngines(int serviceId, HeliconZooEngine[] userEngines) {
this.Invoke("SetEngines", new object[] {
serviceId,
userEngines});
}
/// <remarks/>
public System.IAsyncResult BeginSetEngines(int serviceId, HeliconZooEngine[] userEngines, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SetEngines", new object[] {
serviceId,
userEngines}, callback, asyncState);
}
/// <remarks/>
public void EndSetEngines(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void SetEnginesAsync(int serviceId, HeliconZooEngine[] userEngines) {
this.SetEnginesAsync(serviceId, userEngines, null);
}
/// <remarks/>
public void SetEnginesAsync(int serviceId, HeliconZooEngine[] userEngines, object userState) {
if ((this.SetEnginesOperationCompleted == null)) {
this.SetEnginesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetEnginesOperationCompleted);
}
this.InvokeAsync("SetEngines", new object[] {
serviceId,
userEngines}, this.SetEnginesOperationCompleted, userState);
}
private void OnSetEnginesOperationCompleted(object arg) {
if ((this.SetEnginesCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SetEnginesCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/IsEnginesEnabled", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public bool IsEnginesEnabled(int serviceId) {
object[] results = this.Invoke("IsEnginesEnabled", new object[] {
serviceId});
return ((bool)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginIsEnginesEnabled(int serviceId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("IsEnginesEnabled", new object[] {
serviceId}, callback, asyncState);
}
/// <remarks/>
public bool EndIsEnginesEnabled(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((bool)(results[0]));
}
/// <remarks/>
public void IsEnginesEnabledAsync(int serviceId) {
this.IsEnginesEnabledAsync(serviceId, null);
}
/// <remarks/>
public void IsEnginesEnabledAsync(int serviceId, object userState) {
if ((this.IsEnginesEnabledOperationCompleted == null)) {
this.IsEnginesEnabledOperationCompleted = new System.Threading.SendOrPostCallback(this.OnIsEnginesEnabledOperationCompleted);
}
this.InvokeAsync("IsEnginesEnabled", new object[] {
serviceId}, this.IsEnginesEnabledOperationCompleted, userState);
}
private void OnIsEnginesEnabledOperationCompleted(object arg) {
if ((this.IsEnginesEnabledCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.IsEnginesEnabledCompleted(this, new IsEnginesEnabledCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SwithEnginesEnabled", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void SwithEnginesEnabled(int serviceId, bool enabled) {
this.Invoke("SwithEnginesEnabled", new object[] {
serviceId,
enabled});
}
/// <remarks/>
public System.IAsyncResult BeginSwithEnginesEnabled(int serviceId, bool enabled, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SwithEnginesEnabled", new object[] {
serviceId,
enabled}, callback, asyncState);
}
/// <remarks/>
public void EndSwithEnginesEnabled(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void SwithEnginesEnabledAsync(int serviceId, bool enabled) {
this.SwithEnginesEnabledAsync(serviceId, enabled, null);
}
/// <remarks/>
public void SwithEnginesEnabledAsync(int serviceId, bool enabled, object userState) {
if ((this.SwithEnginesEnabledOperationCompleted == null)) {
this.SwithEnginesEnabledOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSwithEnginesEnabledOperationCompleted);
}
this.InvokeAsync("SwithEnginesEnabled", new object[] {
serviceId,
enabled}, this.SwithEnginesEnabledOperationCompleted, userState);
}
private void OnSwithEnginesEnabledOperationCompleted(object arg) {
if ((this.SwithEnginesEnabledCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SwithEnginesEnabledCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetAllowedHeliconZooQuotasForPackage" +
"", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public ShortHeliconZooEngine[] GetAllowedHeliconZooQuotasForPackage(int packageId) {
object[] results = this.Invoke("GetAllowedHeliconZooQuotasForPackage", new object[] {
packageId});
return ((ShortHeliconZooEngine[])(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetAllowedHeliconZooQuotasForPackage(int packageId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetAllowedHeliconZooQuotasForPackage", new object[] {
packageId}, callback, asyncState);
}
/// <remarks/>
public ShortHeliconZooEngine[] EndGetAllowedHeliconZooQuotasForPackage(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((ShortHeliconZooEngine[])(results[0]));
}
/// <remarks/>
public void GetAllowedHeliconZooQuotasForPackageAsync(int packageId) {
this.GetAllowedHeliconZooQuotasForPackageAsync(packageId, null);
}
/// <remarks/>
public void GetAllowedHeliconZooQuotasForPackageAsync(int packageId, object userState) {
if ((this.GetAllowedHeliconZooQuotasForPackageOperationCompleted == null)) {
this.GetAllowedHeliconZooQuotasForPackageOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetAllowedHeliconZooQuotasForPackageOperationCompleted);
}
this.InvokeAsync("GetAllowedHeliconZooQuotasForPackage", new object[] {
packageId}, this.GetAllowedHeliconZooQuotasForPackageOperationCompleted, userState);
}
private void OnGetAllowedHeliconZooQuotasForPackageOperationCompleted(object arg) {
if ((this.GetAllowedHeliconZooQuotasForPackageCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetAllowedHeliconZooQuotasForPackageCompleted(this, new GetAllowedHeliconZooQuotasForPackageCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetEnabledEnginesForSite", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string[] GetEnabledEnginesForSite(string siteId, int packageId) {
object[] results = this.Invoke("GetEnabledEnginesForSite", new object[] {
siteId,
packageId});
return ((string[])(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetEnabledEnginesForSite(string siteId, int packageId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetEnabledEnginesForSite", new object[] {
siteId,
packageId}, callback, asyncState);
}
/// <remarks/>
public string[] EndGetEnabledEnginesForSite(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((string[])(results[0]));
}
/// <remarks/>
public void GetEnabledEnginesForSiteAsync(string siteId, int packageId) {
this.GetEnabledEnginesForSiteAsync(siteId, packageId, null);
}
/// <remarks/>
public void GetEnabledEnginesForSiteAsync(string siteId, int packageId, object userState) {
if ((this.GetEnabledEnginesForSiteOperationCompleted == null)) {
this.GetEnabledEnginesForSiteOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetEnabledEnginesForSiteOperationCompleted);
}
this.InvokeAsync("GetEnabledEnginesForSite", new object[] {
siteId,
packageId}, this.GetEnabledEnginesForSiteOperationCompleted, userState);
}
private void OnGetEnabledEnginesForSiteOperationCompleted(object arg) {
if ((this.GetEnabledEnginesForSiteCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetEnabledEnginesForSiteCompleted(this, new GetEnabledEnginesForSiteCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/SetEnabledEnginesForSite", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void SetEnabledEnginesForSite(string siteId, int packageId, string[] engines) {
this.Invoke("SetEnabledEnginesForSite", new object[] {
siteId,
packageId,
engines});
}
/// <remarks/>
public System.IAsyncResult BeginSetEnabledEnginesForSite(string siteId, int packageId, string[] engines, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SetEnabledEnginesForSite", new object[] {
siteId,
packageId,
engines}, callback, asyncState);
}
/// <remarks/>
public void EndSetEnabledEnginesForSite(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void SetEnabledEnginesForSiteAsync(string siteId, int packageId, string[] engines) {
this.SetEnabledEnginesForSiteAsync(siteId, packageId, engines, null);
}
/// <remarks/>
public void SetEnabledEnginesForSiteAsync(string siteId, int packageId, string[] engines, object userState) {
if ((this.SetEnabledEnginesForSiteOperationCompleted == null)) {
this.SetEnabledEnginesForSiteOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetEnabledEnginesForSiteOperationCompleted);
}
this.InvokeAsync("SetEnabledEnginesForSite", new object[] {
siteId,
packageId,
engines}, this.SetEnabledEnginesForSiteOperationCompleted, userState);
}
private void OnSetEnabledEnginesForSiteOperationCompleted(object arg) {
if ((this.SetEnabledEnginesForSiteCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SetEnabledEnginesForSiteCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetEnginesCompletedEventHandler(object sender, GetEnginesCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetEnginesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetEnginesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public HeliconZooEngine[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((HeliconZooEngine[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void SetEnginesCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void IsEnginesEnabledCompletedEventHandler(object sender, IsEnginesEnabledCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class IsEnginesEnabledCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal IsEnginesEnabledCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public bool Result {
get {
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void SwithEnginesEnabledCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetAllowedHeliconZooQuotasForPackageCompletedEventHandler(object sender, GetAllowedHeliconZooQuotasForPackageCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetAllowedHeliconZooQuotasForPackageCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetAllowedHeliconZooQuotasForPackageCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public ShortHeliconZooEngine[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((ShortHeliconZooEngine[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetEnabledEnginesForSiteCompletedEventHandler(object sender, GetEnabledEnginesForSiteCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetEnabledEnginesForSiteCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetEnabledEnginesForSiteCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public string[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((string[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void SetEnabledEnginesForSiteCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
}

View file

@ -87,6 +87,7 @@
<Compile Include="ExchangeServerProxy.cs">
<SubType>code</SubType>
</Compile>
<Compile Include="HeliconZooProxy.cs" />
<Compile Include="LyncProxy.cs" />
<Compile Include="VirtualizationServerProxyForPrivateCloud.cs" />
<Compile Include="CRMProxy.cs" />

View file

@ -3578,5 +3578,123 @@ namespace WebsitePanel.EnterpriseServer
return -1;
}
#region Helicon Zoo
public static void GetHeliconZooProviderAndGroup(string providerName, out int providerId, out int groupId)
{
IDataReader reader = SqlHelper.ExecuteReader(ConnectionString, CommandType.Text,
@"SELECT TOP 1
ProviderID, GroupID
FROM Providers
WHERE ProviderName = @ProviderName",
new SqlParameter("@ProviderName", providerName));
reader.Read();
providerId = (int) reader["ProviderID"];
groupId = (int) reader["GroupID"];
}
public static IDataReader GetHeliconZooQuotas(int providerId)
{
IDataReader reader = SqlHelper.ExecuteReader(ConnectionString, CommandType.Text,
@"SELECT
Q.QuotaID,
Q.GroupID,
Q.QuotaName,
Q.QuotaDescription,
Q.QuotaTypeID,
Q.ServiceQuota
FROM Providers AS P
INNER JOIN Quotas AS Q ON P.GroupID = Q.GroupID
WHERE P.ProviderID = @ProviderID",
new SqlParameter("@ProviderID", providerId));
return reader;
}
public static void RemoveHeliconZooQuota(int groupId, string engineName)
{
int quotaId;
// find quota id
IDataReader reader = SqlHelper.ExecuteReader(ConnectionString, CommandType.Text,
@"SELECT TOP 1
QuotaID
FROM Quotas
WHERE QuotaName = @QuotaName AND GroupID = @GroupID",
new SqlParameter("@QuotaName", engineName),
new SqlParameter("@GroupID", groupId));
reader.Read();
quotaId = (int)reader["QuotaID"];
// delete references from HostingPlanQuotas
SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.Text,
"DELETE FROM HostingPlanQuotas WHERE QuotaID = @QuotaID",
new SqlParameter("@QuotaID", quotaId)
);
// delete from Quotas
SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.Text,
"DELETE FROM Quotas WHERE QuotaID = @QuotaID",
new SqlParameter("@QuotaID", quotaId)
);
}
public static void AddHeliconZooQuota(int groupId, int quotaId, string engineName, string engineDescription, int quotaOrder)
{
SqlHelper.ExecuteNonQuery(ConnectionString, CommandType.Text,
@"INSERT INTO Quotas (QuotaID, GroupID, QuotaOrder, QuotaName, QuotaDescription, QuotaTypeID, ServiceQuota)
VALUES (@QuotaID, @GroupID, @QuotaOrder, @QuotaName, @QuotaDescription, 1, 0)",
new SqlParameter("@QuotaID", quotaId),
new SqlParameter("@GroupID", groupId),
new SqlParameter("@QuotaOrder", quotaOrder),
new SqlParameter("@QuotaName", engineName),
new SqlParameter("@QuotaDescription", engineDescription)
);
}
public static IDataReader GetEnabledHeliconZooQuotasForPackage(int packageId)
{
int providerId, groupId;
GetHeliconZooProviderAndGroup("HeliconZoo", out providerId, out groupId);
IDataReader reader = SqlHelper.ExecuteReader(ConnectionString, CommandType.Text,
@"SELECT HostingPlanQuotas.QuotaID, Quotas.QuotaName, Quotas.QuotaDescription
FROM HostingPlanQuotas
INNER JOIN Packages ON HostingPlanQuotas.PlanID = Packages.PlanID
INNER JOIN Quotas ON HostingPlanQuotas.QuotaID = Quotas.QuotaID
WHERE
(Packages.PackageID = @PackageID) AND (Quotas.GroupID = @GroupID) AND (HostingPlanQuotas.QuotaValue = 1)",
new SqlParameter("@PackageID", packageId),
new SqlParameter("@GroupID", groupId)
);
return reader;
}
public static int GetServerIdForPackage(int packageId)
{
IDataReader reader = SqlHelper.ExecuteReader(ConnectionString, CommandType.Text,
@"SELECT TOP 1
ServerID
FROM Packages
WHERE PackageID = @PackageID",
new SqlParameter("@PackageID", packageId)
);
if (reader.Read())
{
return (int)reader["ServerID"];
}
return -1;
}
#endregion
}
}

View file

@ -0,0 +1,228 @@
// 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.
using System;
using System.Collections.Generic;
using System.Data;
using System.Web;
using Microsoft.ApplicationBlocks.Data;
using WebsitePanel.Providers.HeliconZoo;
using WebsitePanel.Providers.Web;
using WebsitePanel.Server;
namespace WebsitePanel.EnterpriseServer
{
public class HeliconZooController
{
public const string HeliconZooQuotaPrefix = "HeliconZoo.";
public static HeliconZooEngine[] GetEngines(int serviceId)
{
HeliconZoo zooServer = new HeliconZoo();
ServiceProviderProxy.Init(zooServer, serviceId);
return zooServer.GetEngines();
}
public static void SetEngines(int serviceId, HeliconZooEngine[] userEngines)
{
// update applicationHost.config
HeliconZoo zooServer = new HeliconZoo();
ServiceProviderProxy.Init(zooServer, serviceId);
zooServer.SetEngines(userEngines);
// update Helicon Zoo quotas in Quotas table
UpdateQuotas(serviceId, userEngines);
}
public static bool IsEnginesEnabled(int serviceId)
{
HeliconZoo zooServer = new HeliconZoo();
ServiceProviderProxy.Init(zooServer, serviceId);
return zooServer.IsEnginesEnabled();
}
public static void SwithEnginesEnabled(int serviceId, bool enabled)
{
HeliconZoo zooServer = new HeliconZoo();
ServiceProviderProxy.Init(zooServer, serviceId);
zooServer.SwithEnginesEnabled(enabled);
}
public static ShortHeliconZooEngine[] GetAllowedHeliconZooQuotasForPackage(int packageId)
{
List<ShortHeliconZooEngine> allowedEngines = new List<ShortHeliconZooEngine>();
IDataReader reader = DataProvider.GetEnabledHeliconZooQuotasForPackage(packageId);
while (reader.Read())
{
allowedEngines.Add( new ShortHeliconZooEngine(){
Name = (string)reader["QuotaName"],
DisplayName= (string)reader["QuotaDescription"],
});
}
return allowedEngines.ToArray();
}
public static string[] GetEnabledEnginesForSite(string siteId, int packageId)
{
int serviceId = GetHeliconZooServiceIdByPackageId(packageId);
if (-1 == serviceId)
{
// Helicon Zoo is not enabled for this package
return new string[0];
}
// ask Server to enabled engines for site
HeliconZoo zooServer = new HeliconZoo();
ServiceProviderProxy.Init(zooServer, serviceId);
string[] enabledEngines = zooServer.GetEnabledEnginesForSite(siteId);
return enabledEngines;
}
public static void SetEnabledEnginesForSite(string siteId, int packageId, string[] engines)
{
int serviceId = GetHeliconZooServiceIdByPackageId(packageId);
// tell Server to enable engines for site
HeliconZoo zooServer = new HeliconZoo();
ServiceProviderProxy.Init(zooServer, serviceId);
zooServer.SetEnabledEnginesForSite(siteId, engines);
}
#region private helpers
private static void UpdateQuotas(int serviceId, HeliconZooEngine[] userEngines)
{
List<HeliconZooEngine> updatedEngines = new List<HeliconZooEngine>(userEngines);
int providerId, groupId;
DataProvider.GetHeliconZooProviderAndGroup("HeliconZoo", out providerId, out groupId);
// get existing Helicon Zoo quotas
List<string> existingQuotas = new List<string>();
IDataReader reader = DataProvider.GetHeliconZooQuotas(providerId);
while (reader.Read())
{
string quota = (string) reader["QuotaName"];
if (quota.StartsWith(HeliconZooQuotaPrefix))
{
quota = quota.Substring(HeliconZooQuotaPrefix.Length);
}
existingQuotas.Add(quota);
}
// sort: engine to remove and add
List<string> engineNamesToRemove = new List<string>();
List<HeliconZooEngine> enginesToAdd = new List<HeliconZooEngine>();
// find engine to remove in existing engines
foreach (string existingEngineName in existingQuotas)
{
if (
Array.Find(updatedEngines.ToArray(), engine => engine.name == existingEngineName) == null
&&
!engineNamesToRemove.Contains(existingEngineName)
)
{
engineNamesToRemove.Add(existingEngineName);
}
}
// find engines to add
foreach (HeliconZooEngine engine in updatedEngines)
{
if (!existingQuotas.Contains(engine.name))
{
enginesToAdd.Add(engine);
}
}
// remove engines
foreach (string engineName in engineNamesToRemove)
{
DataProvider.RemoveHeliconZooQuota(groupId, HeliconZooQuotaPrefix+engineName);
}
// add engines
int order = 0;
foreach (HeliconZooEngine engine in enginesToAdd)
{
int quotaId = GenerateIntId(engine);
DataProvider.AddHeliconZooQuota(groupId, quotaId,
HeliconZooQuotaPrefix+engine.name,
engine.displayName,
order++);
}
}
private static int GenerateIntId(HeliconZooEngine engine)
{
return engine.name.GetHashCode();
}
private static int GetHeliconZooServiceIdByPackageId(int packageId)
{
// get server id
int serverId = DataProvider.GetServerIdForPackage(packageId);
if (-1 == serverId)
{
throw new Exception(string.Format("Server not found for package {0}", packageId));
}
// get Helicon Zoo provider
int heliconZooProviderId = -1;
List<ProviderInfo> providers = ServerController.GetProviders();
foreach (ProviderInfo providerInfo in providers)
{
if (string.Equals("HeliconZoo", providerInfo.ProviderName, StringComparison.OrdinalIgnoreCase))
{
heliconZooProviderId = providerInfo.ProviderId;
break;
}
}
if (-1 == heliconZooProviderId)
{
throw new Exception("Helicon Zoo provider not found");
}
// get Helicon Zoo service for site
int serviceId = DataProvider.GetServiceIdByProviderForServer(heliconZooProviderId, serverId);
return serviceId;
}
#endregion
}
}

View file

@ -83,6 +83,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Content Include="esHeliconZoo.asmx" />
<Content Include="esLync.asmx" />
<Content Include="esVirtualizationServerForPrivateCloud.asmx" />
<Content Include="Default.aspx" />
@ -138,6 +139,7 @@
<Compile Include="Code\Common\ServiceUsernameTokenManager.cs" />
<Compile Include="Code\Common\UsernameAssertion.cs" />
<Compile Include="Code\Common\Utils.cs" />
<Compile Include="Code\HeliconZoo\HeliconZooController.cs" />
<Compile Include="Code\HostedSolution\LyncController.cs" />
<Compile Include="Code\HostedSolution\LyncControllerAsync.cs" />
<Compile Include="Code\VirtualizationForPrivateCloud\CreateAsyncVMfromVM.cs" />
@ -245,6 +247,10 @@
<Compile Include="Code\WebServers\WebServerController.cs" />
<Compile Include="Code\Wizards\UserCreationWizard.cs" />
<Compile Include="Code\Wizards\WebApplicationsInstaller.cs" />
<Compile Include="esHeliconZoo.asmx.cs">
<DependentUpon>esHeliconZoo.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="esLync.asmx.cs">
<DependentUpon>esLync.asmx</DependentUpon>
<SubType>Component</SubType>

View file

@ -0,0 +1 @@
<%@ WebService Language="C#" CodeBehind="esHeliconZoo.asmx.cs" Class="WebsitePanel.EnterpriseServer.esHeliconZoo" %>

View file

@ -0,0 +1,101 @@
// 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.
using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Collections.Generic;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
using Microsoft.Web.Services3;
using WebsitePanel.Providers;
using WebsitePanel.Providers.Web;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers.HeliconZoo;
namespace WebsitePanel.EnterpriseServer
{
/// <summary>
/// Summary description for esHeliconZoo
/// </summary>
[WebService(Namespace = "http://smbsaas/websitepanel/enterpriseserver")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[Policy("ServerPolicy")]
[ToolboxItem(false)]
public class esHeliconZoo : System.Web.Services.WebService
{
[WebMethod]
public HeliconZooEngine[] GetEngines(int serviceId)
{
return HeliconZooController.GetEngines(serviceId);
}
[WebMethod]
public void SetEngines(int serviceId, HeliconZooEngine[] userEngines)
{
HeliconZooController.SetEngines(serviceId, userEngines);
}
[WebMethod]
public bool IsEnginesEnabled(int serviceId)
{
return HeliconZooController.IsEnginesEnabled(serviceId);
}
[WebMethod]
public void SwithEnginesEnabled(int serviceId, bool enabled)
{
HeliconZooController.SwithEnginesEnabled(serviceId, enabled);
}
[WebMethod]
public ShortHeliconZooEngine[] GetAllowedHeliconZooQuotasForPackage(int packageId)
{
return HeliconZooController.GetAllowedHeliconZooQuotasForPackage(packageId);
}
[WebMethod]
public string[] GetEnabledEnginesForSite(string siteId, int packageId)
{
return HeliconZooController.GetEnabledEnginesForSite(siteId, packageId);
}
[WebMethod]
public void SetEnabledEnginesForSite(string siteId, int packageId, string[] engines)
{
HeliconZooController.SetEnabledEnginesForSite(siteId, packageId, engines);
}
}
}

View file

@ -33,6 +33,7 @@ using System.Text;
namespace WebsitePanel.Server
{
[Serializable]
public class WPIProduct
{
private string productId;
@ -45,11 +46,13 @@ namespace WebsitePanel.Server
private string downloadedLocation;
private string longDescription;
private bool isInstalled;
private bool isUpgrade;
private int fileSize;
private DateTime published;
private string author;
private string authorUri;
public WPIProduct()
{
}
@ -91,6 +94,12 @@ namespace WebsitePanel.Server
set { this.isInstalled = value; }
}
public bool IsUpgrade
{
get { return this.isUpgrade; }
set { this.isUpgrade = value; }
}
public string Version
{
get { return this.version; }
@ -138,6 +147,11 @@ namespace WebsitePanel.Server
get { return authorUri; }
set { authorUri = value; }
}
public new string ToString()
{
return productId;
}
}
public class WPITab
@ -185,6 +199,8 @@ namespace WebsitePanel.Server
public class WPIKeyword
{
public const string HOSTING_PACKAGE_KEYWORD = "ZooPackage";
private string id;
private string text;

View file

@ -0,0 +1,96 @@
// 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.
using System;
using System.Collections.Generic;
using WebsitePanel.Providers.HostedSolution;
using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers.Web;
using WebsitePanel.Providers.WebAppGallery;
using WebsitePanel.Providers.Common;
namespace WebsitePanel.Providers.HeliconZoo
{
[Serializable]
public class HeliconZooEngine //: ServiceProviderItem
{
public string name { get; set; }
public string displayName { get; set; }
public string fullPath { get; set; }
public string arguments { get; set; }
public string transport { get; set; }
public string protocol { get; set; }
public string host { get; set; }
public long portLower { get; set; }
public long portUpper { get; set; }
public long maxInstances { get; set; }
public long minInstances { get; set; }
public long timeLimit { get; set; }
public long gracefulShutdownTimeout { get; set; }
public long memoryLimit { get; set; }
public HeliconZooEnv[] environmentVariables;
public bool isUserEngine { get; set; }
public bool disabled { get; set; }
}
[Serializable]
public class HeliconZooEnv
{
public string Name { get; set; }
public string Value { get; set; }
}
[Serializable]
public class ShortHeliconZooEngine
{
public string Name { get; set; }
public string DisplayName { get; set; }
public bool Enabled { get; set; }
public string KeywordedName
{
get
{
// python.2.7.wsgi -> python27wsgi
return Name.Replace(".", "");
}
}
}
public interface IHeliconZooServer
{
HeliconZooEngine[] GetEngines();
void SetEngines(HeliconZooEngine[] userEngines);
bool IsEnginesEnabled();
void SwithEnginesEnabled(bool enabled);
string[] GetEnabledEnginesForSite(string siteId);
void SetEnabledEnginesForSite(string siteId, string[] engineNames);
}
}

View file

@ -75,6 +75,7 @@
<Compile Include="Common\ErrorCodes.cs" />
<Compile Include="Common\PasswdHelper.cs" />
<Compile Include="Common\WPIEntries.cs" />
<Compile Include="HeliconZoo\IHeliconZooServer.cs" />
<Compile Include="HostedSolution\BaseReport.cs" />
<Compile Include="HostedSolution\BaseStatistics.cs" />
<Compile Include="HostedSolution\BlackBerryErrorsCodes.cs" />

View file

@ -0,0 +1,553 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Text.RegularExpressions;
using Microsoft.Win32;
using Microsoft.Web.Administration;
using Microsoft.Web.Management.Server;
using WebsitePanel.Providers;
using WebsitePanel.Providers.HeliconZoo;
namespace WebsitePanel.Providers.Web.HeliconZoo
{
public class HeliconZoo : HostingServiceProviderBase, IHeliconZooServer
{
const string ZooInstalledRegistryKey = @"SOFTWARE\Helicon\Zoo";
const string ZooInstalledRegistryKeyWow6432 = @"SOFTWARE\Wow6432Node\Helicon\Zoo";
private const int ZooCompatibleBuild = 52;
public override bool IsInstalled()
{
// always return true;
return true;
/*
RegistryKey HKLM = Registry.LocalMachine;
string fullVersion = string.Empty;
RegistryKey key = HKLM.OpenSubKey(ZooInstalledRegistryKey);
if (key != null)
{
fullVersion = key.GetValue("Version", null) as string;
}
else
{
key = HKLM.OpenSubKey(ZooInstalledRegistryKeyWow6432);
if (key != null)
{
fullVersion = key.GetValue("Version", null) as string;
}
}
if (string.IsNullOrEmpty(fullVersion))
{
return false;
}
Match match = Regex.Match(fullVersion, @"\.(\d+)$");
if (match.Success)
{
int version = int.Parse(match.Groups[1].ToString());
if (version >= ZooCompatibleBuild)
{
return true;
}
}
return false;
*/
}
public HeliconZooEngine[] GetEngines()
{
// Read applicationHost.config
List<HeliconZooEngine> result = new List<HeliconZooEngine>();
using (var srvman = new ServerManager())
{
Configuration appConfig = srvman.GetApplicationHostConfiguration();
ConfigurationSection heliconZooServer = appConfig.GetSection("system.webServer/heliconZooServer");
ConfigurationElement engines = heliconZooServer.GetChildElement("engines");
ConfigurationElementCollection enginesCollection = engines.GetCollection();
//switchboard
ConfigurationElement switchboard = heliconZooServer.GetChildElement("switchboard");
ConfigurationElementCollection switchboardCollection = switchboard.GetCollection();
bool switchboardDisabledDefault = true;
foreach (ConfigurationElement switchboardElement in switchboardCollection)
{
if ((string)switchboardElement.GetAttributeValue("name") == "*")
{
switchboardDisabledDefault = !(bool)switchboardElement.GetAttributeValue("enabled");
break;
}
}
foreach (ConfigurationElement item in enginesCollection)
{
HeliconZooEngine newItem = ConvertElementToHeliconZooEngine(item);
newItem.disabled = switchboardDisabledDefault;
result.Add(newItem);
}
ConfigurationElement userEngines = heliconZooServer.GetChildElement("userEngines");
ConfigurationElementCollection userEnginesCollection = userEngines.GetCollection();
foreach (ConfigurationElement item in userEnginesCollection)
{
HeliconZooEngine newItem = ConvertElementToHeliconZooEngine(item);
//remove if exists
HeliconZooEngine serverItem = Collection_GetHeliconZooEngineByName(result, newItem.name);
if (serverItem != null)
{
result.Remove(serverItem);
}
//override settings
newItem.isUserEngine = true;
newItem.disabled = switchboardDisabledDefault;
result.Add(newItem);
}
foreach (ConfigurationElement switchboardElement in switchboardCollection)
{
HeliconZooEngine item = Collection_GetHeliconZooEngineByName(result, (string)switchboardElement.GetAttributeValue("name"));
if (item != null)
{
item.disabled = !(bool)switchboardElement.GetAttributeValue("enabled");
}
else
{
//default value
//item.disabled = !switchboardEnabledDefaults;
}
}
}
return result.ToArray();
}
HeliconZooEngine Collection_GetHeliconZooEngineByName(List<HeliconZooEngine> collection, string name)
{
foreach (HeliconZooEngine r in collection)
{
if (r.name == name)
{
return r;
}
}
return null;
}
public void SetEngines(HeliconZooEngine[] userEngines)
{
// Write to applicationHost.config
using (var srvman = new ServerManager())
{
Configuration appConfig = srvman.GetApplicationHostConfiguration();
ConfigurationSection heliconZooServer = appConfig.GetSection("system.webServer/heliconZooServer");
ConfigurationElement engines = heliconZooServer.GetChildElement("userEngines");
ConfigurationElementCollection enginesCollection = engines.GetCollection();
enginesCollection.Clear();
ConfigurationElement switchboard = heliconZooServer.GetChildElement("switchboard");
ConfigurationElementCollection switchboardCollection = switchboard.GetCollection();
switchboardCollection.Clear();
//Disable all engines, by default for WSP
/*
ConfigurationElement disableAll = switchboardCollection.CreateElement();
disableAll.SetAttributeValue("name", "*");
disableAll.SetAttributeValue("enabled", "false");
switchboardCollection.Add(disableAll);
*/
foreach(HeliconZooEngine item in userEngines)
{
if (item.isUserEngine)
{
ConfigurationElement engine = enginesCollection.CreateElement();
ConvertHeliconZooEngineToElement(item, engine);
enginesCollection.Add(engine);
}
/*
ConfigurationElement disable = switchboardCollection.CreateElement();
disable.SetAttributeValue("name", item.name );
disable.SetAttributeValue("enabled", item.disabled? "false": "true" );
switchboardCollection.Add(disable);
*/
}
srvman.CommitChanges();
}
}
public bool IsEnginesEnabled()
{
bool isEnginesEnabled = true;
using (var srvman = new ServerManager())
{
Configuration appConfig = srvman.GetApplicationHostConfiguration();
ConfigurationSection heliconZooServer = appConfig.GetSection("system.webServer/heliconZooServer");
//switchboard
ConfigurationElement switchboard = heliconZooServer.GetChildElement("switchboard");
ConfigurationElementCollection switchboardCollection = switchboard.GetCollection();
foreach (ConfigurationElement switchboardElement in switchboardCollection)
{
if ((string) switchboardElement.GetAttributeValue("name") == "*")
{
isEnginesEnabled = (bool) switchboardElement.GetAttributeValue("enabled");
break;
}
}
}
return isEnginesEnabled;
}
public void SwithEnginesEnabled(bool enabled)
{
using (var srvman = new ServerManager())
{
Configuration appConfig = srvman.GetApplicationHostConfiguration();
ConfigurationSection heliconZooServer = appConfig.GetSection("system.webServer/heliconZooServer");
ConfigurationElement switchboard = heliconZooServer.GetChildElement("switchboard");
ConfigurationElementCollection switchboardCollection = switchboard.GetCollection();
bool wildCardFound = false;
foreach (ConfigurationElement switchboardElement in switchboardCollection)
{
if ((string)switchboardElement.GetAttributeValue("name") == "*")
{
switchboardElement.SetAttributeValue("enabled", enabled ? "true" : "false");
wildCardFound = true;
break;
}
}
if (!wildCardFound)
{
ConfigurationElement element = switchboardCollection.CreateElement();
element.SetAttributeValue("name", "*");
element.SetAttributeValue("enabled", enabled ? "true" : "false");
switchboardCollection.Add(element);
}
srvman.CommitChanges();
}
}
public string[] GetEnabledEnginesForSite(string siteId)
{
if (string.IsNullOrEmpty(siteId))
{
return new string[0];
}
List<string> engines = new List<string>();
using (var srvman = new ServerManager())
{
Configuration appConfig = srvman.GetApplicationHostConfiguration();
ConfigurationSection zooServer = appConfig.GetSection("system.webServer/heliconZooServer", siteId);
ConfigurationElement switchboard = zooServer.GetChildElement("switchboard");
ConfigurationElementCollection switchboardCollection = switchboard.GetCollection();
foreach (ConfigurationElement element in switchboardCollection)
{
string enabled = element.GetAttributeValue("enabled").ToString();
if (string.Equals(enabled, "true", StringComparison.OrdinalIgnoreCase))
{
engines.Add(element.GetAttributeValue("name").ToString());
}
}
}
return engines.ToArray();
}
public void SetEnabledEnginesForSite(string siteId, string[] engineNames)
{
if (string.IsNullOrEmpty(siteId))
{
return;
}
using (var srvman = new ServerManager())
{
Configuration appConfig = srvman.GetApplicationHostConfiguration();
ConfigurationSection zooServer = appConfig.GetSection("system.webServer/heliconZooServer", siteId);
ConfigurationElement switchboard = zooServer.GetChildElement("switchboard");
ConfigurationElementCollection switchboardCollection = switchboard.GetCollection();
switchboardCollection.Clear();
ConfigurationElement elementDisableAll = switchboardCollection.CreateElement();
elementDisableAll.SetAttributeValue("name", "*");
elementDisableAll.SetAttributeValue("enabled", "false");
switchboardCollection.Add(elementDisableAll);
foreach (string engineName in engineNames)
{
ConfigurationElement element = switchboardCollection.CreateElement();
element.SetAttributeValue("name", engineName);
element.SetAttributeValue("enabled", "true");
switchboardCollection.Add(element);
}
RegisterZooPhpHandlers(siteId, engineNames, appConfig);
srvman.CommitChanges();
}
}
#region private methods
private void ConvertHeliconZooEngineToElement(HeliconZooEngine item, ConfigurationElement engine)
{
engine.SetAttributeValue("name", item.name);
engine.SetAttributeValue("displayName", item.displayName);
engine.SetAttributeValue("arguments", item.arguments);
engine.SetAttributeValue("fullPath", item.fullPath);
engine.SetAttributeValue("arguments", item.arguments);
engine.SetAttributeValue("transport", item.transport);
engine.SetAttributeValue("protocol", item.protocol);
engine.SetAttributeValue("host", item.host);
engine.SetAttributeValue("portLower", item.portLower);
engine.SetAttributeValue("portUpper", item.portUpper);
engine.SetAttributeValue("maxInstances", item.maxInstances);
engine.SetAttributeValue("minInstances", item.minInstances);
engine.SetAttributeValue("timeLimit", item.timeLimit);
engine.SetAttributeValue("gracefulShutdownTimeout", item.gracefulShutdownTimeout);
engine.SetAttributeValue("memoryLimit", item.memoryLimit);
ConfigurationElementCollection envColl = engine.GetChildElement("environmentVariables").GetCollection();
foreach(HeliconZooEnv env in item.environmentVariables)
{
ConfigurationElement envElement = envColl.CreateElement();
envElement.SetAttributeValue("name", env.Name);
envElement.SetAttributeValue("value", env.Value);
envColl.Add(envElement);
}
}
private HeliconZooEngine ConvertElementToHeliconZooEngine(ConfigurationElement item)
{
HeliconZooEngine result = new HeliconZooEngine();
result.name = (string)item.GetAttributeValue("name");
result.displayName = (string)item.GetAttributeValue("displayName");
result.arguments = (string)item.GetAttributeValue("arguments");
result.fullPath = (string)item.GetAttributeValue("fullPath");
result.arguments = (string)item.GetAttributeValue("arguments");
result.transport = (string)item.GetAttributeValue("transport");
result.protocol = (string)item.GetAttributeValue("protocol");
result.host = (string)item.GetAttributeValue("host");
result.portLower = (long) item.GetAttributeValue("portLower");
result.portUpper = (long) item.GetAttributeValue("portUpper");
result.maxInstances = (long) item.GetAttributeValue("maxInstances");
result.minInstances = (long) item.GetAttributeValue("minInstances");
result.timeLimit = (long) item.GetAttributeValue("timeLimit");
result.gracefulShutdownTimeout = (long) item.GetAttributeValue("gracefulShutdownTimeout");
result.memoryLimit = (long) item.GetAttributeValue("memoryLimit");
List<HeliconZooEnv> envList = new List<HeliconZooEnv>();
ConfigurationElementCollection envColl = item.GetChildElement("environmentVariables").GetCollection();
foreach (ConfigurationElement el in envColl)
{
envList.Add(ConvertElementToHeliconZooEnv(el));
}
result.environmentVariables = envList.ToArray();
// TODO: fix this
result.isUserEngine = false;
// TODO: disabled
return result;
}
private HeliconZooEnv ConvertElementToHeliconZooEnv(ConfigurationElement item)
{
HeliconZooEnv result = new HeliconZooEnv();
result.Name = (string)item.GetAttributeValue("name");
result.Value = (string)item.GetAttributeValue("value");
return result;
}
private static void RegisterZooPhpHandlers(string siteId, string[] engineNames, Configuration appConfig)
{
// set up zoo php handler if php engine was enabled
string enabledPhpEngine = string.Empty;
foreach (string engineName in engineNames)
{
if (engineName.StartsWith("php", StringComparison.OrdinalIgnoreCase))
{
enabledPhpEngine = engineName;
}
}
if (!string.IsNullOrEmpty(enabledPhpEngine))
{
ConfigurationSection handlers = appConfig.GetSection("system.webServer/handlers", siteId);
ConfigurationElementCollection handlerCollection = handlers.GetCollection();
// remove native php handlers
/*
ConfigurationElement removePhp53 = handlerCollection.CreateElement("remove");
removePhp53.SetAttributeValue("name", "PHP53_via_FastCGI");
handlerCollection.Add(removePhp53);
ConfigurationElement removePhp = handlerCollection.CreateElement("remove");
removePhp.SetAttributeValue("name", "PHP_via_FastCGI");
handlerCollection.Add(removePhp);
*/
// search native php handlers
/*
List<ConfigurationElement> elementsToRemove = new List<ConfigurationElement>();
foreach (ConfigurationElement el in handlerCollection)
{
string name = el.GetAttributeValue("name") as string;
if (!string.IsNullOrEmpty(name))
{
if (string.Equals(name, "PHP_via_FastCGI", StringComparison.OrdinalIgnoreCase)
||
string.Equals(name, "PHP53_via_FastCGI", StringComparison.OrdinalIgnoreCase)
)
{
elementsToRemove.Add(el);
}
}
}
foreach (ConfigurationElement element in elementsToRemove)
{
//handlerCollection.Remove(element);
}
*/
// check zoo handlers exists
List<ConfigurationElement> zooPhpHandlersToRemove = new List<ConfigurationElement>();
foreach (ConfigurationElement el in handlerCollection)
{
string name = el.GetAttributeValue("name") as string;
if (!string.IsNullOrEmpty(name))
{
if (name.StartsWith("php.", StringComparison.OrdinalIgnoreCase))
{
string scriptProcessor = el.GetAttributeValue("scriptProcessor") as string;
if (!string.IsNullOrEmpty(scriptProcessor))
{
zooPhpHandlersToRemove.Add(el);
}
}
}
}
// remove existing zoo php handlers
foreach (ConfigurationElement element in zooPhpHandlersToRemove)
{
handlerCollection.Remove(element);
}
// add zoo php handlers
ConfigurationElement zooPhpX86 = handlerCollection.CreateElement();
zooPhpX86.SetAttributeValue("name", "php.pipe#x86");
zooPhpX86.SetAttributeValue("scriptProcessor", enabledPhpEngine);
zooPhpX86.SetAttributeValue("path", "*.php");
zooPhpX86.SetAttributeValue("verb", "*");
zooPhpX86.SetAttributeValue("modules", "HeliconZoo_x86");
zooPhpX86.SetAttributeValue("preCondition", "bitness32");
zooPhpX86.SetAttributeValue("resourceType", "Unspecified");
zooPhpX86.SetAttributeValue("requireAccess", "Script");
handlerCollection.AddAt(0, zooPhpX86);
ConfigurationElement zooPhpX64 = handlerCollection.CreateElement();
zooPhpX64.SetAttributeValue("name", "php.pipe#x64");
zooPhpX64.SetAttributeValue("scriptProcessor", enabledPhpEngine);
zooPhpX64.SetAttributeValue("path", "*.php");
zooPhpX64.SetAttributeValue("verb", "*");
zooPhpX64.SetAttributeValue("modules", "HeliconZoo_x64");
zooPhpX64.SetAttributeValue("preCondition", "bitness64");
zooPhpX64.SetAttributeValue("resourceType", "Unspecified");
zooPhpX64.SetAttributeValue("requireAccess", "Script");
handlerCollection.AddAt(1, zooPhpX64);
// process index.php as default document
ConfigurationSection defaultDocument = appConfig.GetSection("system.webServer/defaultDocument", siteId);
RegisterPhpDefaultDocument(defaultDocument);
}
}
private static void RegisterPhpDefaultDocument(ConfigurationSection defaultDocument)
{
ConfigurationElement defaultFiles = defaultDocument.GetChildElement("files");
ConfigurationElementCollection filesCollection = defaultFiles.GetCollection();
// search index.php in default documents
bool indexPhpPresent = false;
foreach (ConfigurationElement configurationElement in filesCollection)
{
string value = configurationElement.GetAttributeValue("value") as string;
if (!string.IsNullOrEmpty(value))
{
if (string.Equals(value, "index.php", StringComparison.OrdinalIgnoreCase))
{
indexPhpPresent = true;
break;
}
}
}
if (!indexPhpPresent)
{
// add index.php
ConfigurationElement indexPhp = filesCollection.CreateElement();
indexPhp.SetAttributeValue("value", "index.php");
filesCollection.AddAt(0, indexPhp);
}
}
#endregion
}
}

View file

@ -0,0 +1,22 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("WebsitePanel.Providers.Web.HeliconZoo")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyProduct("WebsitePanel.Providers.Web.HeliconZoo")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
// Setting ComVisible to false makes the types in this assembly not visible
// to COM components. If you need to access a type in this assembly from
// COM, set the ComVisible attribute to true on that type.
[assembly: ComVisible(false)]
// The following GUID is for the ID of the typelib if this project is exposed to COM
[assembly: Guid("36ce3717-bdb5-40c3-ba56-c91ab9bf1903")]

View file

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{A1FCFF8F-4977-462B-A81A-EE67B56D52A4}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WebsitePanel.Providers.Web.HeliconZoo</RootNamespace>
<AssemblyName>WebsitePanel.Providers.Web.HeliconZoo</AssemblyName>
<TargetFrameworkVersion>v3.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\WebsitePanel.Server\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\WebsitePanel.Server\bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Web.Administration, Version=7.9.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Administration.dll</HintPath>
</Reference>
<Reference Include="Microsoft.Web.Management, Version=7.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Lib\References\Microsoft\Microsoft.Web.Management.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\VersionInfo.cs">
<Link>VersionInfo.cs</Link>
</Compile>
<Compile Include="HeliconZoo.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\WebsitePanel.Providers.Base\WebsitePanel.Providers.Base.csproj">
<Project>{684C932A-6C75-46AC-A327-F3689D89EB42}</Project>
<Name>WebsitePanel.Providers.Base</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -30,6 +30,7 @@
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Security;
using System.Text;
using Microsoft.Practices.EnterpriseLibrary.Caching;
@ -167,7 +168,7 @@ namespace WebsitePanel.Providers.Web.WPIWebApplicationGallery
foreach (Keyword keyword in wpi.GetKeywords())
{
if (wpi.IsKeywordApplication(keyword))
if (wpi.IsKeywordApplication(keyword) && !wpi.IsHiddenKeyword(keyword))
{
categories.Add(new GalleryCategory
{
@ -395,7 +396,8 @@ namespace WebsitePanel.Providers.Web.WPIWebApplicationGallery
LastUpdated = product.Published,
Published = product.Published,
Link = (null==product.Link) ? "" :product.Link.ToString(),
InstallerFileSize = size
InstallerFileSize = size,
Keywords = product.Keywords.Select(keyword => keyword.Id).ToList()
};
}

View file

@ -0,0 +1,405 @@
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:2.0.50727.5456
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
//
// This source code was auto-generated by wsdl, Version=2.0.50727.42.
//
namespace WebsitePanel.Providers.HeliconZoo {
using System.Xml.Serialization;
using System.Web.Services;
using System.ComponentModel;
using System.Web.Services.Protocols;
using System;
using System.Diagnostics;
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
[System.Web.Services.WebServiceBindingAttribute(Name="HeliconZooSoap", Namespace="http://smbsaas/websitepanel/server/")]
public partial class HeliconZoo : Microsoft.Web.Services3.WebServicesClientProtocol {
public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue;
private System.Threading.SendOrPostCallback GetEnginesOperationCompleted;
private System.Threading.SendOrPostCallback SetEnginesOperationCompleted;
private System.Threading.SendOrPostCallback IsEnginesEnabledOperationCompleted;
private System.Threading.SendOrPostCallback SwithEnginesEnabledOperationCompleted;
private System.Threading.SendOrPostCallback GetEnabledEnginesForSiteOperationCompleted;
private System.Threading.SendOrPostCallback SetEnabledEnginesForSiteOperationCompleted;
/// <remarks/>
public HeliconZoo() {
this.Url = "http://localhost:9003/HeliconZoo.asmx";
}
/// <remarks/>
public event GetEnginesCompletedEventHandler GetEnginesCompleted;
/// <remarks/>
public event SetEnginesCompletedEventHandler SetEnginesCompleted;
/// <remarks/>
public event IsEnginesEnabledCompletedEventHandler IsEnginesEnabledCompleted;
/// <remarks/>
public event SwithEnginesEnabledCompletedEventHandler SwithEnginesEnabledCompleted;
/// <remarks/>
public event GetEnabledEnginesForSiteCompletedEventHandler GetEnabledEnginesForSiteCompleted;
/// <remarks/>
public event SetEnabledEnginesForSiteCompletedEventHandler SetEnabledEnginesForSiteCompleted;
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetEngines", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public HeliconZooEngine[] GetEngines() {
object[] results = this.Invoke("GetEngines", new object[0]);
return ((HeliconZooEngine[])(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetEngines(System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetEngines", new object[0], callback, asyncState);
}
/// <remarks/>
public HeliconZooEngine[] EndGetEngines(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((HeliconZooEngine[])(results[0]));
}
/// <remarks/>
public void GetEnginesAsync() {
this.GetEnginesAsync(null);
}
/// <remarks/>
public void GetEnginesAsync(object userState) {
if ((this.GetEnginesOperationCompleted == null)) {
this.GetEnginesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetEnginesOperationCompleted);
}
this.InvokeAsync("GetEngines", new object[0], this.GetEnginesOperationCompleted, userState);
}
private void OnGetEnginesOperationCompleted(object arg) {
if ((this.GetEnginesCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetEnginesCompleted(this, new GetEnginesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetEngines", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void SetEngines(HeliconZooEngine[] userEngines) {
this.Invoke("SetEngines", new object[] {
userEngines});
}
/// <remarks/>
public System.IAsyncResult BeginSetEngines(HeliconZooEngine[] userEngines, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SetEngines", new object[] {
userEngines}, callback, asyncState);
}
/// <remarks/>
public void EndSetEngines(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void SetEnginesAsync(HeliconZooEngine[] userEngines) {
this.SetEnginesAsync(userEngines, null);
}
/// <remarks/>
public void SetEnginesAsync(HeliconZooEngine[] userEngines, object userState) {
if ((this.SetEnginesOperationCompleted == null)) {
this.SetEnginesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetEnginesOperationCompleted);
}
this.InvokeAsync("SetEngines", new object[] {
userEngines}, this.SetEnginesOperationCompleted, userState);
}
private void OnSetEnginesOperationCompleted(object arg) {
if ((this.SetEnginesCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SetEnginesCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/IsEnginesEnabled", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public bool IsEnginesEnabled() {
object[] results = this.Invoke("IsEnginesEnabled", new object[0]);
return ((bool)(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginIsEnginesEnabled(System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("IsEnginesEnabled", new object[0], callback, asyncState);
}
/// <remarks/>
public bool EndIsEnginesEnabled(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((bool)(results[0]));
}
/// <remarks/>
public void IsEnginesEnabledAsync() {
this.IsEnginesEnabledAsync(null);
}
/// <remarks/>
public void IsEnginesEnabledAsync(object userState) {
if ((this.IsEnginesEnabledOperationCompleted == null)) {
this.IsEnginesEnabledOperationCompleted = new System.Threading.SendOrPostCallback(this.OnIsEnginesEnabledOperationCompleted);
}
this.InvokeAsync("IsEnginesEnabled", new object[0], this.IsEnginesEnabledOperationCompleted, userState);
}
private void OnIsEnginesEnabledOperationCompleted(object arg) {
if ((this.IsEnginesEnabledCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.IsEnginesEnabledCompleted(this, new IsEnginesEnabledCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SwithEnginesEnabled", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void SwithEnginesEnabled(bool enabled) {
this.Invoke("SwithEnginesEnabled", new object[] {
enabled});
}
/// <remarks/>
public System.IAsyncResult BeginSwithEnginesEnabled(bool enabled, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SwithEnginesEnabled", new object[] {
enabled}, callback, asyncState);
}
/// <remarks/>
public void EndSwithEnginesEnabled(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void SwithEnginesEnabledAsync(bool enabled) {
this.SwithEnginesEnabledAsync(enabled, null);
}
/// <remarks/>
public void SwithEnginesEnabledAsync(bool enabled, object userState) {
if ((this.SwithEnginesEnabledOperationCompleted == null)) {
this.SwithEnginesEnabledOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSwithEnginesEnabledOperationCompleted);
}
this.InvokeAsync("SwithEnginesEnabled", new object[] {
enabled}, this.SwithEnginesEnabledOperationCompleted, userState);
}
private void OnSwithEnginesEnabledOperationCompleted(object arg) {
if ((this.SwithEnginesEnabledCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SwithEnginesEnabledCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetEnabledEnginesForSite", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public string[] GetEnabledEnginesForSite(string siteId) {
object[] results = this.Invoke("GetEnabledEnginesForSite", new object[] {
siteId});
return ((string[])(results[0]));
}
/// <remarks/>
public System.IAsyncResult BeginGetEnabledEnginesForSite(string siteId, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("GetEnabledEnginesForSite", new object[] {
siteId}, callback, asyncState);
}
/// <remarks/>
public string[] EndGetEnabledEnginesForSite(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((string[])(results[0]));
}
/// <remarks/>
public void GetEnabledEnginesForSiteAsync(string siteId) {
this.GetEnabledEnginesForSiteAsync(siteId, null);
}
/// <remarks/>
public void GetEnabledEnginesForSiteAsync(string siteId, object userState) {
if ((this.GetEnabledEnginesForSiteOperationCompleted == null)) {
this.GetEnabledEnginesForSiteOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetEnabledEnginesForSiteOperationCompleted);
}
this.InvokeAsync("GetEnabledEnginesForSite", new object[] {
siteId}, this.GetEnabledEnginesForSiteOperationCompleted, userState);
}
private void OnGetEnabledEnginesForSiteOperationCompleted(object arg) {
if ((this.GetEnabledEnginesForSiteCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.GetEnabledEnginesForSiteCompleted(this, new GetEnabledEnginesForSiteCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
[System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")]
[System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/SetEnabledEnginesForSite", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)]
public void SetEnabledEnginesForSite(string siteId, string[] engineNames) {
this.Invoke("SetEnabledEnginesForSite", new object[] {
siteId,
engineNames});
}
/// <remarks/>
public System.IAsyncResult BeginSetEnabledEnginesForSite(string siteId, string[] engineNames, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("SetEnabledEnginesForSite", new object[] {
siteId,
engineNames}, callback, asyncState);
}
/// <remarks/>
public void EndSetEnabledEnginesForSite(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void SetEnabledEnginesForSiteAsync(string siteId, string[] engineNames) {
this.SetEnabledEnginesForSiteAsync(siteId, engineNames, null);
}
/// <remarks/>
public void SetEnabledEnginesForSiteAsync(string siteId, string[] engineNames, object userState) {
if ((this.SetEnabledEnginesForSiteOperationCompleted == null)) {
this.SetEnabledEnginesForSiteOperationCompleted = new System.Threading.SendOrPostCallback(this.OnSetEnabledEnginesForSiteOperationCompleted);
}
this.InvokeAsync("SetEnabledEnginesForSite", new object[] {
siteId,
engineNames}, this.SetEnabledEnginesForSiteOperationCompleted, userState);
}
private void OnSetEnabledEnginesForSiteOperationCompleted(object arg) {
if ((this.SetEnabledEnginesForSiteCompleted != null)) {
System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg));
this.SetEnabledEnginesForSiteCompleted(this, new System.ComponentModel.AsyncCompletedEventArgs(invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetEnginesCompletedEventHandler(object sender, GetEnginesCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetEnginesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetEnginesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public HeliconZooEngine[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((HeliconZooEngine[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void SetEnginesCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void IsEnginesEnabledCompletedEventHandler(object sender, IsEnginesEnabledCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class IsEnginesEnabledCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal IsEnginesEnabledCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public bool Result {
get {
this.RaiseExceptionIfNecessary();
return ((bool)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void SwithEnginesEnabledCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void GetEnabledEnginesForSiteCompletedEventHandler(object sender, GetEnabledEnginesForSiteCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
[System.Diagnostics.DebuggerStepThroughAttribute()]
[System.ComponentModel.DesignerCategoryAttribute("code")]
public partial class GetEnabledEnginesForSiteCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs {
private object[] results;
internal GetEnabledEnginesForSiteCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) :
base(exception, cancelled, userState) {
this.results = results;
}
/// <remarks/>
public string[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((string[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")]
public delegate void SetEnabledEnginesForSiteCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
}

View file

@ -80,6 +80,7 @@
<Compile Include="DnsServerProxy.cs" />
<Compile Include="ExchangeServerProxy.cs" />
<Compile Include="FtpServerProxy.cs" />
<Compile Include="HeliconZooProxy.cs" />
<Compile Include="HostedSharePointServerProxy.cs" />
<Compile Include="LyncServerProxy.cs" />
<Compile Include="OCSEdgeServerProxy.cs" />

View file

@ -110,6 +110,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Mail
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.OS.Windows2012", "WebsitePanel.Providers.OS.Windows2012\WebsitePanel.Providers.OS.Windows2012.csproj", "{27130BBB-76FA-411E-8B4D-51CD4DC821AF}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Web.HeliconZoo", "WebsitePanel.Providers.Web.HeliconZoo\WebsitePanel.Providers.Web.HeliconZoo.csproj", "{A1FCFF8F-4977-462B-A81A-EE67B56D52A4}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Web.IIs80", "WebsitePanel.Providers.Web.IIs80\WebsitePanel.Providers.Web.IIs80.csproj", "{6E348968-461D-45A1-B235-4F552947B9F1}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.FTP.IIs80", "WebsitePanel.Providers.FTP.IIs80\WebsitePanel.Providers.FTP.IIs80.csproj", "{D73CCF4C-9CFF-4D61-9030-34DCAF0C50D6}"
@ -608,6 +610,16 @@ Global
{27130BBB-76FA-411E-8B4D-51CD4DC821AF}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{27130BBB-76FA-411E-8B4D-51CD4DC821AF}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{27130BBB-76FA-411E-8B4D-51CD4DC821AF}.Release|x86.ActiveCfg = Release|Any CPU
{A1FCFF8F-4977-462B-A81A-EE67B56D52A4}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A1FCFF8F-4977-462B-A81A-EE67B56D52A4}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A1FCFF8F-4977-462B-A81A-EE67B56D52A4}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU
{A1FCFF8F-4977-462B-A81A-EE67B56D52A4}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU
{A1FCFF8F-4977-462B-A81A-EE67B56D52A4}.Debug|x86.ActiveCfg = Debug|Any CPU
{A1FCFF8F-4977-462B-A81A-EE67B56D52A4}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A1FCFF8F-4977-462B-A81A-EE67B56D52A4}.Release|Any CPU.Build.0 = Release|Any CPU
{A1FCFF8F-4977-462B-A81A-EE67B56D52A4}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU
{A1FCFF8F-4977-462B-A81A-EE67B56D52A4}.Release|Mixed Platforms.Build.0 = Release|Any CPU
{A1FCFF8F-4977-462B-A81A-EE67B56D52A4}.Release|x86.ActiveCfg = Release|Any CPU
{6E348968-461D-45A1-B235-4F552947B9F1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{6E348968-461D-45A1-B235-4F552947B9F1}.Debug|Any CPU.Build.0 = Debug|Any CPU
{6E348968-461D-45A1-B235-4F552947B9F1}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU

View file

@ -161,18 +161,37 @@ namespace WebsitePanel.Server.Code
return true;
}
public bool IsHiddenKeyword(Keyword keyword)
{
if (keyword.Id.StartsWith("ZooEngine", StringComparison.OrdinalIgnoreCase))
{
return true;
}
return false;
}
#endregion
#region Products
public List<Product> GetProductsToInstall(string FeedLocation, string keywordId)
{
Keyword keyword = null;
List<Product> products = new List<Product>();
if (!string.IsNullOrEmpty(keywordId))
{
keyword = _productManager.GetKeyword(keywordId);
}
List<Product> products = new List<Product>();
// if we do not find keyword object by keyword string
// then return empty list
if (null == keyword && !string.IsNullOrEmpty(keywordId))
{
WriteLog(string.Format("Keyword '{0}' not found, return empty product list", keywordId));
return products;
}
foreach (Product product in _productManager.Products)
{
@ -490,7 +509,12 @@ namespace WebsitePanel.Server.Code
Installer appInstaller = app.GetInstaller(GetLanguage(languageId));
WpiAppInstallLogger logger = new WpiAppInstallLogger();
/*
if (null == _installManager)
{
Debugger.Break();
}
*/
if (null != installStatusUpdatedHandler)
{
@ -847,6 +871,7 @@ namespace WebsitePanel.Server.Code
}
}
#endregion private members
}

View file

@ -0,0 +1 @@
<%@ WebService Language="C#" CodeBehind="HeliconZoo.asmx.cs" Class="WebsitePanel.Server.HeliconZoo" %>

View file

@ -0,0 +1,105 @@
// 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.
using System;
using System.Data;
using System.Web;
using System.Collections;
using System.Collections.Generic;
using System.Web.Services;
using System.Web.Services.Protocols;
using System.ComponentModel;
using Microsoft.Web.Services3;
using WebsitePanel.Providers;
using WebsitePanel.Providers.Web;
using WebsitePanel.Server.Utils;
using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers.WebAppGallery;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.HeliconZoo;
namespace WebsitePanel.Server
{
/// <summary>
/// Summary description for HeliconZoo
/// </summary>
[WebService(Namespace = "http://smbsaas/websitepanel/server/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[Policy("ServerPolicy")]
[ToolboxItem(false)]
public class HeliconZoo : HostingServiceProviderWebService, IHeliconZooServer
{
private IHeliconZooServer ZooProvider
{
get { return (IHeliconZooServer)Provider; }
}
[WebMethod, SoapHeader("settings")]
public HeliconZooEngine[] GetEngines()
{
return ZooProvider.GetEngines();
}
[WebMethod, SoapHeader("settings")]
public void SetEngines(HeliconZooEngine[] userEngines)
{
ZooProvider.SetEngines(userEngines);
}
[WebMethod, SoapHeader("settings")]
public bool IsEnginesEnabled()
{
return ZooProvider.IsEnginesEnabled();
}
[WebMethod, SoapHeader("settings")]
public void SwithEnginesEnabled(bool enabled)
{
ZooProvider.SwithEnginesEnabled(enabled);
}
[WebMethod, SoapHeader("settings")]
public string[] GetEnabledEnginesForSite(string siteId)
{
return ZooProvider.GetEnabledEnginesForSite(siteId);
}
[WebMethod, SoapHeader("settings")]
public void SetEnabledEnginesForSite(string siteId, string[] engineNames)
{
ZooProvider.SetEnabledEnginesForSite(siteId, engineNames);
}
}
}

View file

@ -85,6 +85,7 @@
<Content Include="AutoDiscovery.asmx" />
<Content Include="BlackBerry.asmx" />
<EmbeddedResource Include="Images\logo.png" />
<Content Include="HeliconZoo.asmx" />
<Content Include="LyncServer.asmx" />
<Content Include="OCSEdgeServer.asmx" />
<Content Include="OCSServer.asmx" />
@ -126,6 +127,10 @@
<Compile Include="Code\ServerConfiguration.cs" />
<Compile Include="Code\ServerUsernameTokenManager.cs" />
<Compile Include="Code\UsernameAssertion.cs" />
<Compile Include="HeliconZoo.asmx.cs">
<DependentUpon>HeliconZoo.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="LyncServer.asmx.cs">
<DependentUpon>LyncServer.asmx</DependentUpon>
<SubType>Component</SubType>

View file

@ -49,6 +49,7 @@ using System.Management;
using System.Collections.Specialized;
using Microsoft.Web.PlatformInstaller;
using Microsoft.Web.Services3;
using Microsoft.Win32;
using WebsitePanel.Providers.Utils;
using WebsitePanel.Server.Code;
using WebsitePanel.Server.Utils;
@ -301,7 +302,7 @@ namespace WebsitePanel.Server
private string makeHref(string value)
private string Linkify(string value)
{
if (string.IsNullOrEmpty(value))
return value;
@ -318,7 +319,7 @@ namespace WebsitePanel.Server
WPIProduct p = new WPIProduct();
p.ProductId = product.ProductId;
p.Summary = product.Summary;
p.LongDescription = makeHref(product.LongDescription);
p.LongDescription = Linkify(product.LongDescription);
p.Published = product.Published;
p.Author = product.Author;
p.AuthorUri = (product.AuthorUri != null) ? product.AuthorUri.ToString() : "";
@ -355,6 +356,30 @@ namespace WebsitePanel.Server
return p;
}
private void CheckHostingPackagesUpgrades(IList<WPIProduct> products)
{
foreach (WPIProduct product in products)
{
string installedHostingPackageVersion = GetInstalledHostingPackageVersion(product.ProductId);
if (!string.IsNullOrEmpty(installedHostingPackageVersion) && string.Compare(product.Version, installedHostingPackageVersion, StringComparison.OrdinalIgnoreCase) > 0)
{
product.IsUpgrade = true;
}
}
}
private string GetInstalledHostingPackageVersion(string productId)
{
string installedVersion = Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Helicon\\Zoo", productId+"Version", string.Empty) as string;
if (string.IsNullOrEmpty(installedVersion))
{
installedVersion = Registry.GetValue("HKEY_LOCAL_MACHINE\\SOFTWARE\\Wow6432Node\\Helicon\\Zoo", productId + "Version", string.Empty) as string;
}
return installedVersion;
}
[WebMethod]
public WPIProduct[] GetWPIProducts(string tabId, string keywordId)
{
@ -391,6 +416,13 @@ namespace WebsitePanel.Server
}
}
// check upgrades for Hosting Packages (ZooPackage keyword)
if (WPIKeyword.HOSTING_PACKAGE_KEYWORD == keywordId)
{
CheckHostingPackagesUpgrades(wpiProducts);
}
}
@ -642,6 +674,7 @@ namespace WebsitePanel.Server
wpiServiceExe.StartInfo.WorkingDirectory = workingDirectory;
wpiServiceExe.StartInfo.UseShellExecute = false;
wpiServiceExe.StartInfo.LoadUserProfile = true;
wpiServiceExe.StartInfo.EnvironmentVariables["MySqlPassword"] = "";
//wpiServiceExe.StartInfo.EnvironmentVariables["UserProfile"] = newUserProfile;
//wpiServiceExe.StartInfo.EnvironmentVariables["LocalAppData"] = newLocalAppData;
//wpiServiceExe.StartInfo.EnvironmentVariables["AppData"] = newAppData;

View file

@ -771,4 +771,8 @@
<data name="ModuleTitle.ApplyEnableHardQuotaFeature" xml:space="preserve">
<value>System Hard Quota</value>
</data>
<data name="ModuleTitle.HeliconZoo" xml:space="preserve">
<value>Helicon Zoo</value>
</data>
</root>

View file

@ -3287,6 +3287,9 @@
<data name="ResourceGroup.OCS" xml:space="preserve">
<value>Office Communications Server</value>
</data>
<data name="ResourceGroup.Web Engines" xml:space="preserve">
<value>Web Engines</value>
</data>
<data name="Quota.HostedSharePoint.Sites" xml:space="preserve">
<value>SharePoint Site Collections per Organization</value>
</data>
@ -3299,6 +3302,9 @@
<data name="Quota.HostedCRM.Organization" xml:space="preserve">
<value>CRM Organization</value>
</data>
<data name="ResourceGroup.HeliconZoo" xml:space="preserve">
<value>Web Engines</value>
</data>
<data name="Error.HOSTEDSHAREPOINT_DELETE_SITECOLLECTION" xml:space="preserve">
<value>Error occurred while delete SharePoint site collection.</value>
</data>

View file

@ -321,6 +321,9 @@
<data name="Tab.Htaccess" xml:space="preserve">
<value>.htaccess</value>
</data>
<data name="Tab.HeliconZoo" xml:space="preserve">
<value>Web Engines</value>
</data>
<data name="Tab.VirtualDirs" xml:space="preserve">
<value>Virtual Dirs</value>
</data>

View file

@ -0,0 +1,126 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnInstall.Text" xml:space="preserve">
<value>Install</value>
</data>
<data name="SelectWebEngine.Text" xml:space="preserve">
<value>Select web application engine to set up</value>
</data>
</root>

View file

@ -213,6 +213,11 @@ namespace WebsitePanel.Portal
get { return GetCachedProxy<esExchangeServer>(); }
}
public esHeliconZoo HeliconZoo
{
get { return GetCachedProxy<esHeliconZoo>(); }
}
protected ES()
{
}

View file

@ -146,6 +146,10 @@ namespace WebsitePanel.Portal
if (!cntx.Groups.ContainsKey(groupName))
return false;
// check wildcard quota name
if (!string.IsNullOrEmpty(groupName) && quotaName.Substring(groupName.Length) == ".*")
return true;
// check quota
if (cntx.Quotas.ContainsKey(quotaName))
return !cntx.Quotas[quotaName].QuotaExhausted;

View file

@ -25,7 +25,7 @@
<ItemTemplate>
<div class="Quota">
<div class="Left">
<%# GetSharedLocalizedString("Quota." + (string)Eval("QuotaName"))%>:
<%# GetSharedLocalizedStringNotEmpty((string)Eval("QuotaName"), Eval("QuotaDescription"))%>:
</div>
<div class="Right">
<uc1:QuotaEditor id="quotaEditor" runat="server"

View file

@ -203,5 +203,29 @@ namespace WebsitePanel.Portal
{
return new DataView(dsQuotas.Tables[1], "GroupID=" + groupId.ToString(), "", DataViewRowState.CurrentRows);
}
public string GetSharedLocalizedStringNotEmpty(string resourceKey, object resourceDescription)
{
string result = GetSharedLocalizedString("Quota." + resourceKey);
if (string.IsNullOrEmpty(result))
{
result = resourceKey;
string resourceDescriptionString = resourceDescription as string;
if (!string.IsNullOrEmpty(resourceDescriptionString))
{
result = resourceDescriptionString;
}
else if (result.IndexOf('.') > 0 && result.Substring(result.IndexOf('.')).Length > 1)
{
// drop Quota name prefix
// HeliconZoo.python -> python
result = result.Substring(result.IndexOf('.')+1);
}
}
return result;
}
}
}

View file

@ -1,22 +1,43 @@
// 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.832
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal {
/// <summary>
/// HostingPlansQuotas class.
/// </summary>
/// <remarks>
/// Auto-generated class.
/// </remarks>
public partial class HostingPlansQuotas {
/// <summary>

View file

@ -0,0 +1,101 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 1.3
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">1.3</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1">this is my long string</data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
[base64 mime encoded serialized .NET Framework object]
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
[base64 mime encoded string representing a byte array form of the .NET Framework object]
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>1.3</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -0,0 +1,399 @@
<%@ Control Language="C#" AutoEventWireup="True" CodeBehind="HeliconZoo_Settings.ascx.cs" Inherits="HeliconZoo_Settings" %>
<%@ Register Src="../UserControls/PopupHeader.ascx" TagName="PopupHeader" TagPrefix="wsp" %>
<%@ Import Namespace="WebsitePanel.Portal.ProviderControls" %>
<%@ Import Namespace="WebsitePanel.Server" %>
<style>
p.description {
margin: 4px 0 10px 0;
color: #666;
}
table.EnginesTable th {
vertical-align: top;
text-align: left;
color: #000;
font-weight: normal;
}
span.ValidationMessageBlock {
display: block !important;
}
#EngineEnvs INPUT.NormalTextBox {
font-family: Consolas, Courier New, monospace;
}
.AspNet-GridView td {
padding: 3px 3px 5px 3px;
}
.AspNet-GridView-Alternate {
background-color: #f2f2f2;
}
</style>
<fieldset>
<legend>
<span>Hosting Packages</span>
</legend>
<asp:GridView runat="server" ID="HostingPackagesGrid"
AutoGenerateColumns="False"
EmptyDataText="Hosting Packages not found. Please check Web Platform Installer settings in System settings."
EnableViewState="True"
ShowHeader="False"
OnRowCommand="HostingPackagesGrid_OnRowCommand"
>
<Columns>
<asp:TemplateField ItemStyle-Wrap="false" HeaderText="gvWPILogo" ItemStyle-Width="10%" >
<ItemTemplate>
<asp:Image ID="icoLogo" runat="server" SkinID="Dvd48" src='<%# Eval("Logo") %>' Width="48" Height="48" />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Wrap="true" HeaderText="gvServicesName" ItemStyle-Width="80%">
<ItemTemplate>
<h2 class="ProductTitle Huge"><%# Eval("Title")%></h2>
<p class="ProductSummary"><%# Eval("Summary") %></p>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField ItemStyle-Wrap="false" HeaderText="gvInstall" ItemStyle-Width="10%">
<ItemStyle HorizontalAlign="Left" />
<ItemTemplate>
<asp:Label ID="LabelInstalled" runat="server" Text="installed" Visible='<%# Eval("IsInstalled") %>'></asp:Label>
<asp:Button ID="btnAdd" runat="server"
CssClass='Button1'
Visible = '<%# !(bool)Eval("IsInstalled") %>'
Text = '<%# AddUpgradeRemoveText( (WPIProduct)Container.DataItem ) %>'
CommandArgument='<%# Container.DataItemIndex %>'
CommandName="WpiAdd"
/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
<asp:Panel runat="server" ID="HostingPackagesInstallButtonsPanel">
<div class="FormFooter">
<asp:Button ID="btnInstall" Text="Install" runat="server" onclick="btnInstall_Click" CssClass="Button1" Enabled="False" />
</div>
</asp:Panel>
<asp:Panel runat="server" ID="HostingPackagesErrorsPanel" Visible="False">
<h3 class="Header ErrorText">Unable to load Hosting Package list with exception:</h3>
<asp:Label runat="server" ID="HostingPackagesLoadingError"></asp:Label>
</asp:Panel>
</fieldset>
<fieldset>
<legend>
<span>Helicon Zoo engine quotas settings</span>
</legend>
<div class="FormBody">
<asp:CheckBox runat="server" ID="QuotasEnabled" Text="Enable Quotas"/>
</div>
</fieldset>
<asp:Panel runat="server" ID="EnginesPanel">
<fieldset>
<legend>
<span>Engines management</span>
</legend>
<div class="FormButtonsBar">
<asp:Button runat="server" ID="ButtonAddEngine" CssClass="Button2" Text="Add engine" OnClick="ButtonAddEngine_Click" />
</div>
<asp:UpdatePanel runat="server" ID="EngineForm" Visible="False">
<ContentTemplate>
<fieldset>
<legend>
<asp:Label runat="server" CssClass="NormalBold" Text="Engine settings"></asp:Label>
</legend>
<table width="100%" cellpadding="4" class="EnginesTable">
<tr>
<th width="160px">
<span>Name</span>
</th>
<td class="Normal" valign="top">
<asp:TextBox ID="EngineName" runat="server" CssClass="NormalTextBox" Width="666px"></asp:TextBox>
<asp:RequiredFieldValidator runat="server"
ControlToValidate="EngineName"
ErrorMessage="Engine name can not be empty"
CssClass="ValidationMessageBlock"
EnableViewState="True"
></asp:RequiredFieldValidator>
<p class="description">Id for the engine</p>
</td>
</tr>
<tr>
<th>
<span>Friendly name</span>
</th>
<td class="Normal" valign="top">
<asp:TextBox ID="EngineFriendlyName" runat="server" CssClass="NormalTextBox" Width="666px"></asp:TextBox>
<asp:RequiredFieldValidator runat="server"
ControlToValidate="EngineFriendlyName"
ErrorMessage="Engine friendly name can not be empty"
CssClass="ValidationMessageBlock"
></asp:RequiredFieldValidator>
<p class="description">Frendly engine name</p>
</td>
</tr>
<tr>
<th>
<span>Full path to executable</span>
</th>
<td class="Normal" valign="top">
<asp:TextBox ID="EngineFullPath" runat="server" CssClass="NormalTextBox" Width="666px"></asp:TextBox>
<asp:RequiredFieldValidator runat="server"
ControlToValidate="EngineFullPath"
ErrorMessage="Path to executable can not be empty"
CssClass="ValidationMessageBlock"
></asp:RequiredFieldValidator>
<p class="description">Path to a worker executable file</p>
</td>
</tr>
<tr>
<th>
<span>Executable`s arguments</span>
</th>
<td class="Normal" valign="top">
<asp:TextBox ID="EngineArguments" runat="server" CssClass="NormalTextBox" Width="666px"></asp:TextBox>
<p class="description">Set of arguments to be passed to a worker on a call, can include special environment variables</p>
</td>
</tr>
<tr>
<th>
<span>Transport</span>
</th>
<td class="Normal" valign="top">
<asp:DropDownList runat="server" ID="EngineTransport"></asp:DropDownList>
</td>
</tr>
<tr>
<th>
<span>Protocol</span>
</th>
<td class="Normal" valign="top">
<asp:DropDownList runat="server" ID="EngineProtocol"></asp:DropDownList>
</td>
</tr>
<tr>
<th>
<span>Lower port</span>
</th>
<td class="Normal" valign="top">
<asp:TextBox ID="EnginePortLower" runat="server" CssClass="NormalTextBox" Width="150px"></asp:TextBox>
<asp:RangeValidator runat="server"
ControlToValidate="EnginePortLower"
MinimumValue="1" MaximumValue="65535"
ErrorMessage="Out of range"
CssClass="ValidationMessage"
></asp:RangeValidator>
<p class="description">Specifies lower automatic port range bound for TCP transport, default = 49152</p>
</td>
</tr>
<tr>
<th>
<span>Upper port</span>
</th>
<td class="Normal" valign="top">
<asp:TextBox ID="EnginePortUpper" runat="server" CssClass="NormalTextBox" Width="150px"></asp:TextBox>
<asp:RangeValidator runat="server"
ControlToValidate="EnginePortUpper"
MinimumValue="1" MaximumValue="65535"
ErrorMessage="Out of range"
CssClass="ValidationMessage"
></asp:RangeValidator>
<p class="description">Specifies upper automatic port range bound for TCP transport, default = 65535</p>
</td>
</tr>
<tr>
<th>
<span>Minimum instances</span>
</th>
<td class="Normal" valign="top">
<asp:TextBox ID="EngineMinInstances" runat="server" CssClass="NormalTextBox" Width="150px"></asp:TextBox>
<asp:RegularExpressionValidator runat="server"
ControlToValidate="EngineMinInstances"
ValidationExpression="\d*"
ErrorMessage="Out of range"
CssClass="ValidationMessage"
></asp:RegularExpressionValidator>
<p class="description">Minimum number of worker instances</p>
</td>
</tr>
<tr>
<th>
<span>Maximum instances</span>
</th>
<td class="Normal" valign="top">
<asp:TextBox ID="EngineMaxInstances" runat="server" CssClass="NormalTextBox" Width="150px"></asp:TextBox>
<asp:RegularExpressionValidator runat="server"
ControlToValidate="EngineMaxInstances"
ValidationExpression="\d*"
ErrorMessage="Out of range"
CssClass="ValidationMessage"
></asp:RegularExpressionValidator>
<p class="description">Maximum number of instances of worker processes to start under high load. Default value of 0 means start as many instances as there are cores.</p>
</td>
</tr>
<tr>
<th>
<span>Time limit</span>
</th>
<td class="Normal" valign="top">
<asp:TextBox ID="EngineTimeLimit" runat="server" CssClass="NormalTextBox" Width="150px"></asp:TextBox>
<asp:RegularExpressionValidator runat="server"
ControlToValidate="EngineTimeLimit"
ValidationExpression="\d*"
ErrorMessage="Out of range"
CssClass="ValidationMessage"
></asp:RegularExpressionValidator>
<p class="description">Restart the worker after it has worked for specific amount of time (minutes), default = 0 (infinite)</p>
</td>
</tr>
<tr>
<th>
<span>Graceful Shutdown Timeout</span>
</th>
<td class="Normal" valign="top">
<asp:TextBox ID="EngineGracefulShutdownTimeout" runat="server" CssClass="NormalTextBox" Width="150px"></asp:TextBox>
<asp:RegularExpressionValidator runat="server"
ControlToValidate="EngineGracefulShutdownTimeout"
ValidationExpression="\d*"
ErrorMessage="Out of range"
CssClass="ValidationMessage"
></asp:RegularExpressionValidator>
<p class="description">XXXXXXXXXXXXXXXXXXX</p>
</td>
</tr>
<tr>
<th>
<span>Memory limit</span>
</th>
<td class="Normal" valign="top">
<asp:TextBox ID="EngineMemoryLimit" runat="server" CssClass="NormalTextBox" Width="150px"></asp:TextBox>
<asp:RegularExpressionValidator runat="server"
ControlToValidate="EngineMemoryLimit"
ValidationExpression="\d*"
ErrorMessage="Out of range"
CssClass="ValidationMessage"
></asp:RegularExpressionValidator>
<p class="description">Restart the worker if it has consumed specific amount of memory (megabytes), default = 0 (unlimited)</p>
</td>
</tr>
<tr>
<th>
<span>Environment variables</span>
</th>
<td class="Normal" valign="top">
<table id="EngineEnvs">
<tr>
<th>Key</th>
<th>Value</th>
</tr>
<tr>
<td><asp:TextBox ID="EnvKey1" runat="server" CssClass="NormalTextBox" Width="240px"></asp:TextBox></td>
<td><asp:TextBox ID="EnvValue1" runat="server" CssClass="NormalTextBox" Width="440px"></asp:TextBox></td>
</tr>
<tr>
<td><asp:TextBox ID="EnvKey2" runat="server" CssClass="NormalTextBox" Width="240px"></asp:TextBox></td>
<td><asp:TextBox ID="EnvValue2" runat="server" CssClass="NormalTextBox" Width="440px"></asp:TextBox></td>
</tr>
<tr>
<td><asp:TextBox ID="EnvKey3" runat="server" CssClass="NormalTextBox" Width="240px"></asp:TextBox></td>
<td><asp:TextBox ID="EnvValue3" runat="server" CssClass="NormalTextBox" Width="440px"></asp:TextBox></td>
</tr>
<tr>
<td><asp:TextBox ID="EnvKey4" runat="server" CssClass="NormalTextBox" Width="240px"></asp:TextBox></td>
<td><asp:TextBox ID="EnvValue4" runat="server" CssClass="NormalTextBox" Width="440px"></asp:TextBox></td>
</tr>
<tr>
<td><asp:TextBox ID="EnvKey5" runat="server" CssClass="NormalTextBox" Width="240px"></asp:TextBox></td>
<td><asp:TextBox ID="EnvValue5" runat="server" CssClass="NormalTextBox" Width="440px"></asp:TextBox></td>
</tr>
<tr>
<td><asp:TextBox ID="EnvKey6" runat="server" CssClass="NormalTextBox" Width="240px"></asp:TextBox></td>
<td><asp:TextBox ID="EnvValue6" runat="server" CssClass="NormalTextBox" Width="440px"></asp:TextBox></td>
</tr>
<tr>
<td><asp:TextBox ID="EnvKey7" runat="server" CssClass="NormalTextBox" Width="240px"></asp:TextBox></td>
<td><asp:TextBox ID="EnvValue7" runat="server" CssClass="NormalTextBox" Width="440px"></asp:TextBox></td>
</tr>
<tr>
<td><asp:TextBox ID="EnvKey8" runat="server" CssClass="NormalTextBox" Width="240px"></asp:TextBox></td>
<td><asp:TextBox ID="EnvValue8" runat="server" CssClass="NormalTextBox" Width="440px"></asp:TextBox></td>
</tr>
</table>
</td>
</tr>
</table>
</fieldset>
</ContentTemplate>
</asp:UpdatePanel>
<br/>
<asp:Panel runat="server" ID="EngineFormButtons" Visible="False">
<div class="FormButtonsBar">
<asp:Button runat="server" ID="ButtonSaveEngine" Text="Save" CssClass="Button2" OnClick="ButtonSaveEngine_Click"></asp:Button>
&nbsp;
<asp:Button runat="server" ID="ButtonCancelEngineForm" Text="Cancel" CssClass="Button2" OnClick="ButtonCancelEngineForm_Click"></asp:Button>
</div>
</asp:Panel>
<asp:GridView runat="server" ID="EngineGrid"
AutoGenerateColumns="False"
EmptyDataText="Engines not found. Please reinstall Helicon Zoo."
EnableViewState="True"
ShowHeader="False"
OnRowCommand="EngineGrid_OnRowCommand"
>
<Columns>
<asp:TemplateField runat="server" ItemStyle-Width="75%">
<ItemTemplate>
<span runat="server" class="NormalBold"><%# Eval("displayName")%></span>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField runat="server" ItemStyle-Width="25%">
<ItemTemplate>
<asp:Button ID="ButtonEditEngine" runat="server"
CssClass='Button1'
Text = 'Edit'
CommandArgument='<%# Eval("name") %>'
CommandName="EngineEdit"
/>
<asp:Button ID="ButtonDeleteEngine" runat="server"
CssClass='Button1'
Text="Delete"
CommandArgument='<%# Eval("name") %>'
CommandName="EngineDelete"
Visible='<%# (bool)Eval("isUserEngine") %>'
/>
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
</fieldset>
</asp:Panel>

View file

@ -0,0 +1,426 @@
using System;
using System.Collections;
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Globalization;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.Portal;
using WebsitePanel.Providers.HeliconZoo;
using WebsitePanel.Server;
public partial class HeliconZoo_Settings : WebsitePanelControlBase, IHostingServiceProviderSettings
{
private class EnvBoxPair
{
public TextBox Name;
public TextBox Value;
public EnvBoxPair(TextBox name, TextBox value)
{
Name = name;
Value = value;
}
}
private EnvBoxPair[] _envBoxsPair;
protected void Page_Load(object sender, EventArgs e)
{
_envBoxsPair = new EnvBoxPair[]
{
new EnvBoxPair(EnvKey1, EnvValue1),
new EnvBoxPair(EnvKey2, EnvValue2),
new EnvBoxPair(EnvKey3, EnvValue3),
new EnvBoxPair(EnvKey4, EnvValue4),
new EnvBoxPair(EnvKey5, EnvValue5),
new EnvBoxPair(EnvKey6, EnvValue6),
new EnvBoxPair(EnvKey7, EnvValue7),
new EnvBoxPair(EnvKey8, EnvValue8),
};
if (!IsPostBack)
{
BindHostingPackages();
EngineTransport.Items.Clear();
EngineTransport.Items.AddRange(
new ListItem[]
{
new ListItem("Named pipe", "namedpipe"),
new ListItem("TCP", "tcp"),
}
);
EngineProtocol.Items.Clear();
EngineProtocol.Items.AddRange(
new ListItem[]
{
new ListItem("FastCGI", "fastcgi"),
new ListItem("HTTP", "http"),
}
);
BindEngines();
}
}
private void BindHostingPackages()
{
// TODO: try...catch?
WPIProduct[] products = null;
try
{
products = GetHostingPackages();
}
catch(Exception e)
{
HostingPackagesGrid.Visible = false;
HostingPackagesInstallButtonsPanel.Visible = false;
HostingPackagesErrorsPanel.Visible = true;
if (e.InnerException != null)
{
e = e.InnerException;
}
HostingPackagesLoadingError.Text = e.Message;
}
HostingPackagesGrid.DataSource = products;
HostingPackagesGrid.DataBind();
}
private void BindEngines()
{
// get all engines from IIS
HeliconZooEngine[] engineList = ES.Services.HeliconZoo.GetEngines(PanelRequest.ServiceId);
if (null != engineList && engineList.Length > 0)
{
// convert list to dict
Dictionary<string, HeliconZooEngine> enginesDict = new Dictionary<string, HeliconZooEngine>();
foreach (HeliconZooEngine engine in engineList)
{
enginesDict[engine.name] = engine;
}
// save engines in view state
ViewState["HeliconZooEngines"] = enginesDict;
// bind to grid
EngineGrid.DataSource = engineList;
EngineGrid.DataBind();
// bind 'Enable quotas' checkbox
bool enabled = ES.Services.HeliconZoo.IsEnginesEnabled(PanelRequest.ServiceId);
QuotasEnabled.Checked = !enabled;
}
else
{
EnginesPanel.Visible = false;
}
}
private void RebindEngines()
{
Dictionary<string, HeliconZooEngine> engines = GetEngines();
EngineGrid.DataSource = engines.Values;
EngineGrid.DataBind();
}
public void BindSettings(StringDictionary settings)
{
}
public void SaveSettings(StringDictionary settings)
{
// save engines
ES.Services.HeliconZoo.SetEngines(PanelRequest.ServiceId, new List<HeliconZooEngine>(GetEngines().Values).ToArray());
// save switcher
ES.Services.HeliconZoo.SwithEnginesEnabled(PanelRequest.ServiceId, !QuotasEnabled.Checked);
}
protected void ClearEngineForm()
{
EngineName.Text = string.Empty;
EngineFriendlyName.Text = string.Empty;
EngineFullPath.Text = string.Empty;
EngineArguments.Text = string.Empty;
EngineProtocol.SelectedIndex = 0;
EngineTransport.SelectedIndex = 0;
foreach (EnvBoxPair envBoxPair in _envBoxsPair)
{
envBoxPair.Name.Text = string.Empty;
envBoxPair.Value.Text = string.Empty;
}
}
protected void ShowEngineForm()
{
EngineForm.Visible = true;
EngineFormButtons.Visible = true;
}
protected void HideEngineForm()
{
EngineForm.Visible = false;
EngineFormButtons.Visible = false;
}
protected void ButtonAddEngine_Click(object sender, EventArgs e)
{
ClearEngineForm();
ShowEngineForm();
}
protected void ButtonSaveEngine_Click(object sender, EventArgs e)
{
HeliconZooEngine engine = EngineFromForm();
HeliconZooEngine savedEngine = FindEngineByName(engine.name);
Dictionary<string, HeliconZooEngine> engines = GetEngines();
// new user engine or update existing
engines[engine.name] = engine;
ClearEngineForm();
HideEngineForm();
// rebind grid
RebindEngines();
}
public static long ParseLong(string s, long deflt)
{
long result;
if (!long.TryParse(s, out result))
{
result = deflt;
}
return result;
}
private HeliconZooEngine EngineFromForm()
{
HeliconZooEngine engine = new HeliconZooEngine()
{
name = EngineName.Text.Trim(),
displayName = EngineFriendlyName.Text.Trim(),
arguments = EngineArguments.Text.Trim(),
fullPath = EngineFullPath.Text.Trim(),
transport = EngineTransport.SelectedValue,
protocol = EngineProtocol.SelectedValue,
portLower = ParseLong(EnginePortLower.Text, -1),
portUpper = ParseLong(EnginePortUpper.Text, -1),
minInstances = ParseLong(EngineMinInstances.Text, -1),
maxInstances = ParseLong(EngineMaxInstances.Text, -1),
timeLimit = ParseLong(EngineTimeLimit.Text, -1),
gracefulShutdownTimeout = ParseLong(EngineGracefulShutdownTimeout.Text, -1),
memoryLimit = ParseLong(EngineMemoryLimit.Text, -1),
isUserEngine = true
};
// envs
List<HeliconZooEnv> tempEnvList = new List<HeliconZooEnv>();
for (int i = 0; i < _envBoxsPair.Length; i++)
{
EnvBoxPair pair = _envBoxsPair[i];
if (!string.IsNullOrEmpty(pair.Name.Text.Trim()) && !string.IsNullOrEmpty(pair.Value.Text.Trim()))
{
tempEnvList.Add(new HeliconZooEnv(){Name = pair.Name.Text.Trim(), Value = pair.Value.Text.Trim()});
}
}
engine.environmentVariables = tempEnvList.ToArray();
return engine;
}
protected void ButtonCancelEngineForm_Click(object sender, EventArgs e)
{
ClearEngineForm();
HideEngineForm();
}
protected void EngineGrid_OnRowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "EngineEdit")
{
HeliconZooEngine engine = FindEngineByName((string)e.CommandArgument);
if (null != engine)
{
BindEngineForm(engine);
ShowEngineForm();
}
}
if (e.CommandName == "EngineDisable")
{
HeliconZooEngine engine = FindEngineByName((string)e.CommandArgument);
if (null != engine)
{
engine.disabled = !engine.disabled;
RebindEngines();
}
}
if (e.CommandName == "EngineDelete")
{
HeliconZooEngine engine = FindEngineByName((string)e.CommandArgument);
if (null != engine)
{
Dictionary<string, HeliconZooEngine> engines = GetEngines();
engines.Remove(engine.name);
RebindEngines();
}
}
}
public static string ToStringClearDeafult(long l)
{
if (-1 == l)
{
return string.Empty;
}
return l.ToString(CultureInfo.InvariantCulture);
}
private void BindEngineForm(HeliconZooEngine engine)
{
EngineName.Text = engine.name;
EngineFriendlyName.Text = engine.displayName;
EngineFullPath.Text = engine.fullPath;
EngineArguments.Text = engine.arguments;
EngineTransport.Text = engine.transport.ToLower();
EngineProtocol.Text = engine.protocol.ToLower();
EnginePortLower.Text = ToStringClearDeafult(engine.portLower);
EnginePortUpper.Text = ToStringClearDeafult(engine.portUpper);
EngineMinInstances.Text = ToStringClearDeafult(engine.minInstances);
EngineMaxInstances.Text = ToStringClearDeafult(engine.maxInstances);
EngineTimeLimit.Text = ToStringClearDeafult(engine.timeLimit);
EngineGracefulShutdownTimeout.Text = ToStringClearDeafult(engine.gracefulShutdownTimeout);
EngineMemoryLimit.Text = ToStringClearDeafult(engine.memoryLimit);
for (int i = 0; i < engine.environmentVariables.Length && i < _envBoxsPair.Length; i++)
{
HeliconZooEnv env = engine.environmentVariables[i];
_envBoxsPair[i].Name.Text = env.Name;
_envBoxsPair[i].Value.Text = env.Value;
}
}
private Dictionary<string, HeliconZooEngine> GetEngines()
{
return ViewState["HeliconZooEngines"] as Dictionary<string, HeliconZooEngine>;
}
private HeliconZooEngine FindEngineByName(string engineName)
{
Dictionary<string, HeliconZooEngine> engines = GetEngines();
if (null != engines)
{
if (engines.ContainsKey(engineName))
{
return engines[engineName];
}
}
return null;
}
protected void HostingPackagesGrid_OnRowCommand(object sender, GridViewCommandEventArgs e)
{
ArrayList wpiProductsForInstall = GetProductsToInstallList();
int productIndex = int.Parse((string)e.CommandArgument);
WPIProduct wpiProduct = GetHostingPackages()[productIndex];
if (null != wpiProduct)
{
if (e.CommandName == "WpiAdd")
{
wpiProductsForInstall = GetProductsToInstallList();
wpiProductsForInstall.Add(wpiProduct.ProductId);
SetProductsToInstallList(wpiProductsForInstall);
((Button)e.CommandSource).Text = AddUpgradeRemoveText(wpiProduct); ;
((Button)e.CommandSource).CommandName = "WpiRemove";
}
if (e.CommandName == "WpiRemove")
{
wpiProductsForInstall = GetProductsToInstallList();
wpiProductsForInstall.Remove(wpiProduct.ProductId);
SetProductsToInstallList(wpiProductsForInstall);
((Button)e.CommandSource).Text = AddUpgradeRemoveText(wpiProduct);
((Button)e.CommandSource).CommandName = "WpiAdd";
}
btnInstall.Enabled = wpiProductsForInstall.Count > 0;
}
}
private ArrayList GetProductsToInstallList()
{
if (ViewState["wpiProductsForInstall"] != null)
{
return (ArrayList)ViewState["wpiProductsForInstall"];
}
return new ArrayList();
}
private void SetProductsToInstallList(ArrayList wpiProductsForInstall)
{
ViewState["wpiProductsForInstall"] = wpiProductsForInstall;
}
private WPIProduct[] GetHostingPackages()
{
if (ViewState["HeliconZooHostingPackages"] == null)
{
ViewState["HeliconZooHostingPackages"] = RequestHostingPackages();
}
return (WPIProduct[])ViewState["HeliconZooHostingPackages"];
}
private static WPIProduct[] RequestHostingPackages()
{
return ES.Services.Servers.GetWPIProducts(PanelRequest.ServerId, null, "ZooPackage");
}
protected string AddUpgradeRemoveText(WPIProduct wpiProduct)
{
if (GetProductsToInstallList().Contains(wpiProduct.ProductId))
{
return "- cancel";
}
else
{
return wpiProduct.IsUpgrade ? "+ upgrade" : "+ add";
}
}
protected void btnInstall_Click(object sender, EventArgs e)
{
ArrayList wpiProductsForInstall = GetProductsToInstallList();
List<string> qsParts = new List<string>();
qsParts.Add("pid=Servers");
qsParts.Add("ctl=edit_platforminstaller");
qsParts.Add("mid=" + Request.QueryString["mid"]);
qsParts.Add("ServerID=" + Request.QueryString["ServerID"]);
qsParts.Add("WPIProduct=" + string.Join(",", wpiProductsForInstall.ToArray()));
qsParts.Add("ReturnUrl=" + Server.UrlEncode(Request.RawUrl));
string installUrl = "Default.aspx?" + String.Join("&", qsParts.ToArray());
Response.Redirect(installUrl);
}
}

View file

@ -0,0 +1,419 @@
// 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.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
public partial class HeliconZoo_Settings {
/// <summary>
/// HostingPackagesGrid 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.GridView HostingPackagesGrid;
/// <summary>
/// HostingPackagesInstallButtonsPanel 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.Panel HostingPackagesInstallButtonsPanel;
/// <summary>
/// btnInstall 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.Button btnInstall;
/// <summary>
/// HostingPackagesErrorsPanel 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.Panel HostingPackagesErrorsPanel;
/// <summary>
/// HostingPackagesLoadingError 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 HostingPackagesLoadingError;
/// <summary>
/// QuotasEnabled 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.CheckBox QuotasEnabled;
/// <summary>
/// EnginesPanel 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.Panel EnginesPanel;
/// <summary>
/// ButtonAddEngine 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.Button ButtonAddEngine;
/// <summary>
/// EngineForm control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.UpdatePanel EngineForm;
/// <summary>
/// EngineName 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.TextBox EngineName;
/// <summary>
/// EngineFriendlyName 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.TextBox EngineFriendlyName;
/// <summary>
/// EngineFullPath 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.TextBox EngineFullPath;
/// <summary>
/// EngineArguments 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.TextBox EngineArguments;
/// <summary>
/// EngineTransport 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 EngineTransport;
/// <summary>
/// EngineProtocol 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 EngineProtocol;
/// <summary>
/// EnginePortLower 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.TextBox EnginePortLower;
/// <summary>
/// EnginePortUpper 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.TextBox EnginePortUpper;
/// <summary>
/// EngineMinInstances 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.TextBox EngineMinInstances;
/// <summary>
/// EngineMaxInstances 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.TextBox EngineMaxInstances;
/// <summary>
/// EngineTimeLimit 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.TextBox EngineTimeLimit;
/// <summary>
/// EngineGracefulShutdownTimeout 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.TextBox EngineGracefulShutdownTimeout;
/// <summary>
/// EngineMemoryLimit 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.TextBox EngineMemoryLimit;
/// <summary>
/// EnvKey1 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.TextBox EnvKey1;
/// <summary>
/// EnvValue1 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.TextBox EnvValue1;
/// <summary>
/// EnvKey2 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.TextBox EnvKey2;
/// <summary>
/// EnvValue2 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.TextBox EnvValue2;
/// <summary>
/// EnvKey3 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.TextBox EnvKey3;
/// <summary>
/// EnvValue3 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.TextBox EnvValue3;
/// <summary>
/// EnvKey4 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.TextBox EnvKey4;
/// <summary>
/// EnvValue4 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.TextBox EnvValue4;
/// <summary>
/// EnvKey5 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.TextBox EnvKey5;
/// <summary>
/// EnvValue5 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.TextBox EnvValue5;
/// <summary>
/// EnvKey6 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.TextBox EnvKey6;
/// <summary>
/// EnvValue6 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.TextBox EnvValue6;
/// <summary>
/// EnvKey7 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.TextBox EnvKey7;
/// <summary>
/// EnvValue7 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.TextBox EnvValue7;
/// <summary>
/// EnvKey8 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.TextBox EnvKey8;
/// <summary>
/// EnvValue8 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.TextBox EnvValue8;
/// <summary>
/// EngineFormButtons 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.Panel EngineFormButtons;
/// <summary>
/// ButtonSaveEngine 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.Button ButtonSaveEngine;
/// <summary>
/// ButtonCancelEngineForm 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.Button ButtonCancelEngineForm;
/// <summary>
/// EngineGrid 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.GridView EngineGrid;
}

View file

@ -108,11 +108,11 @@ namespace WebsitePanel.Portal
ShowProgressPanel();
}
string gotoProduct = Request.QueryString["WPIProduct"];
if (!string.IsNullOrEmpty(gotoProduct))
string gotoProducts = Request.QueryString["WPIProduct"];
if (!string.IsNullOrEmpty(gotoProducts))
{
ArrayList wpiProductsForInstall = GetProductsToInstallList();
wpiProductsForInstall.Add(gotoProduct);
wpiProductsForInstall.AddRange(gotoProducts.Split(','));
SetProductsToInstallList(wpiProductsForInstall);
btnInstall_Click(sender, e);
@ -440,6 +440,13 @@ namespace WebsitePanel.Portal
}
ShowLogButton();
// fix btnBackToServer button text
if (null != Request["returnurl"])
{
btnBackToServer.Text = "Ok";
BackToGalleryButton.Visible = false;
}
}
private void ShowLogButton()
@ -523,9 +530,45 @@ namespace WebsitePanel.Portal
}
}
private bool IsLocalUrl(string url)
{
if (string.IsNullOrEmpty(url))
{
return false;
}
Uri absoluteUri;
if (Uri.TryCreate(url, UriKind.Absolute, out absoluteUri))
{
return String.Equals(this.Request.Url.Host, absoluteUri.Host, StringComparison.OrdinalIgnoreCase);
}
else
{
bool isLocal = !url.StartsWith("http:", StringComparison.OrdinalIgnoreCase)
&& !url.StartsWith("https:", StringComparison.OrdinalIgnoreCase)
&& Uri.IsWellFormedUriString(url, UriKind.Relative);
return isLocal;
}
}
protected void btnCancel_Click(object sender, EventArgs e)
{
Response.Redirect(EditUrl("ServerID", PanelRequest.ServerId.ToString(), "edit_server"));
string redirectUrl = "";
if (Request["returnurl"] != null)
{
redirectUrl = HttpUtility.UrlDecode(Request["returnurl"]);
if (!IsLocalUrl(redirectUrl))
{
redirectUrl = "";
}
}
if (string.IsNullOrEmpty(redirectUrl))
{
redirectUrl = EditUrl("ServerID", PanelRequest.ServerId.ToString(), "edit_server");
}
Response.Redirect(redirectUrl);
}
protected void SearchButton_Click(object sender, EventArgs e)

View file

@ -27,7 +27,8 @@
// SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
using System;
using WebsitePanel.Providers.WebAppGallery;
using System.Web;
using WebsitePanel.Providers.WebAppGallery;
using WebsitePanel.Providers.ResultObjects;
namespace WebsitePanel.Portal
@ -121,14 +122,38 @@ namespace WebsitePanel.Portal
if (isSuccess)
{
Response.Redirect(EditUrl("ApplicationID", PanelRequest.ApplicationID, "editParams",
"SpaceID=" + PanelSecurity.PackageId));
// web app downloaded successfully
string url = EditUrl("ApplicationID", PanelRequest.ApplicationID, "editParams",
"SpaceID=" + PanelSecurity.PackageId);
string targetSite = HttpContext.Current.Request["SiteId"];
if (!string.IsNullOrEmpty(targetSite))
{
url += "&SiteId=" + targetSite;
}
string returnUrl = HttpContext.Current.Request["ReturnUrl"];
if (!string.IsNullOrEmpty(returnUrl))
{
url += "&ReturnUrl=" + Server.UrlEncode(returnUrl);
}
Response.Redirect(url);
}
}
protected void btnCancel_Click(object sender, EventArgs e)
{
RedirectSpaceHomePage();
string returnUrl = HttpContext.Current.Request["ReturnUrl"];
if (!string.IsNullOrEmpty(returnUrl))
{
string redirectUrl = HttpUtility.UrlDecode(returnUrl);
Response.Redirect(redirectUrl);
}
else
{
RedirectSpaceHomePage();
}
}
protected void chIgnoreDependencies_CheckedChanged(object sender, EventArgs e)

View file

@ -30,7 +30,8 @@
using System.Collections.Generic;
using System.Globalization;
using System.IO;
using System.Web.UI.WebControls;
using System.Web;
using System.Web.UI.WebControls;
using WebsitePanel.EnterpriseServer;
using WebsitePanel.Providers.Common;
using WebsitePanel.Providers.WebAppGallery;
@ -129,6 +130,24 @@ namespace WebsitePanel.Portal
ddlWebSite.DataBind();
ddlWebSite.Items.Insert(0, new ListItem(GetLocalizedString("Text.SelectWebSite"), ""));
// select site from query string parameter
string targetSite = HttpContext.Current.Request["SiteId"];
if (!string.IsNullOrEmpty(targetSite))
{
foreach (ListItem item in ddlWebSite.Items)
{
if (item.Text == targetSite)
{
item.Selected = true;
ddlWebSite.Enabled = false;
locWebSiteDescription.Visible = false;
break;
}
}
ddlWebSite.SelectedValue = targetSite;
}
// apply policy to virtual dirs
directoryName.SetPackagePolicy(PanelSecurity.PackageId, UserSettings.WEB_POLICY, "VirtDirNamePolicy");
}
@ -612,12 +631,32 @@ namespace WebsitePanel.Portal
protected void btnCancel_Click(object sender, EventArgs e)
{
RedirectSpaceHomePage();
string returnUrl = HttpContext.Current.Request["ReturnUrl"];
if (!string.IsNullOrEmpty(returnUrl))
{
string redirectUrl = HttpUtility.UrlDecode(returnUrl);
Response.Redirect(redirectUrl);
}
else
{
RedirectSpaceHomePage();
}
}
protected void btnOK_Click(object sender, EventArgs e)
{
RedirectSpaceHomePage();
string returnUrl = HttpContext.Current.Request["ReturnUrl"];
if (!string.IsNullOrEmpty(returnUrl))
{
string redirectUrl = HttpUtility.UrlDecode(returnUrl);
Response.Redirect(redirectUrl);
}
else
{
RedirectSpaceHomePage();
}
}
}
}

View file

@ -8,6 +8,7 @@
<%@ Register Src="WebSitesCustomHeadersControl.ascx" TagName="WebSitesCustomHeadersControl" TagPrefix="uc6" %>
<%@ Register Src="WebSitesSecuredFoldersControl.ascx" TagName="WebSitesSecuredFoldersControl" TagPrefix="wsp" %>
<%@ Register Src="WebSitesHeliconApeControl.ascx" TagName="WebSitesHeliconApeControl" TagPrefix="wsp" %>
<%@ Register Src="WebSitesHeliconZooControl.ascx" TagName="WebSitesHeliconZooControl" TagPrefix="wsp" %>
<%@ Register Src="UserControls/PasswordControl.ascx" TagName="PasswordControl" TagPrefix="wsp" %>
<%@ Register Src="UserControls/UsernameControl.ascx" TagName="UsernameControl" TagPrefix="wsp" %>
<%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %>
@ -241,6 +242,9 @@
</asp:View>
<asp:View ID="tabHeliconApe" runat="server">
<wsp:WebSitesHeliconApeControl ID="webSitesHeliconApeControl" runat="server" />
</asp:View>
<asp:View ID="tabHeliconZoo" runat="server">
<wsp:WebSitesHeliconZooControl ID="webSitesHeliconZooControl" runat="server" />
</asp:View>
<asp:View ID="tabFrontPage" runat="server">
<asp:Panel ID="pnlFrontPage" runat="server" Style="padding: 20;">
@ -510,4 +514,4 @@
CssClass="Button1" CausesValidation="false" OnClientClick="return confirm('Delete this web site?');"
OnClick="btnDelete_Click" />
<asp:CheckBox ID="chkDeleteWebsiteDirectory" runat="server" Text="Delete Website Directory?" AutoPostBack="false" meta:resourcekey="chkDeleteWebsiteDirectory" />
</div>
</div>

View file

@ -60,6 +60,7 @@ namespace WebsitePanel.Portal
new Tab { Id = "htaccessfolders", ResourceKey = "Tab.Htaccess", Quota = Quotas.WEB_HTACCESS, ViewId = "tabHeliconApe" },
new Tab { Id = "frontpage", ResourceKey = "Tab.FrontPage", Quota = Quotas.WEB_FRONTPAGE, ViewId = "tabFrontPage" },
new Tab { Id = "extensions", ResourceKey = "Tab.Extensions", ViewId = "tabExtensions" },
new Tab { Id = "HeliconZoo", ResourceKey = "Tab.HeliconZoo", Quota = Quotas.HELICON_ZOO, ResourceGroup = "HeliconZoo", ViewId = "tabHeliconZoo" },
new Tab { Id = "errors", ResourceKey = "Tab.CustomErrors", Quota = Quotas.WEB_ERRORS, ViewId = "tabErrors" },
new Tab { Id = "headers", ResourceKey = "Tab.CustomHeaders", Quota = Quotas.WEB_HEADERS, ViewId = "tabHeaders" },
new Tab { Id = "webpub", ResourceKey = "Tab.WebDeployPublishing", Quota = Quotas.WEB_REMOTEMANAGEMENT, ViewId = "tabWebDeployPublishing" },
@ -106,7 +107,6 @@ namespace WebsitePanel.Portal
private void BindTabs()
{
//
var filteredTabs = TabsList.FilterTabsByHostingPlanQuotas(PackageId).ToList();
// remove "SSL" tab for a site with dynamic IP
@ -114,6 +114,7 @@ namespace WebsitePanel.Portal
if (!IsDedicatedIP && sslTab != null)
filteredTabs.Remove(sslTab);
var selectedValue = dlTabs.SelectedValue;
if (dlTabs.SelectedIndex == -1)
@ -272,6 +273,7 @@ namespace WebsitePanel.Portal
webSitesMimeTypesControl.BindWebItem(site);
webSitesCustomHeadersControl.BindWebItem(site);
webSitesCustomErrorsControl.BindWebItem(site);
webSitesHeliconZooControl.BindWebItem(site);
if (site.IsDedicatedIP)
{
@ -889,6 +891,7 @@ namespace WebsitePanel.Portal
webSitesMimeTypesControl.SaveWebItem(site);
webSitesCustomHeadersControl.SaveWebItem(site);
webSitesCustomErrorsControl.SaveWebItem(site);
webSitesHeliconZooControl.SaveWebItem(site);
// update web site
try

View file

@ -490,6 +490,24 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::WebsitePanel.Portal.WebSitesHeliconApeControl webSitesHeliconApeControl;
/// <summary>
/// tabHeliconZoo 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.View tabHeliconZoo;
/// <summary>
/// webSitesHeliconZooControl control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.WebSitesHeliconZooControl webSitesHeliconZooControl;
/// <summary>
/// tabFrontPage control.
/// </summary>

View file

@ -0,0 +1,79 @@
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebSitesHeliconZooControl.ascx.cs" Inherits="WebsitePanel.Portal.WebSitesHeliconZooControl" %>
<%@ Import Namespace="WebsitePanel.Portal" %>
<%--
<p class="NormalBold">Web engines allowed for this site:</p>
<asp:Panel ID="AllowedEnginesPanel" runat="server">
<asp:DataList ID="AllowedEnginesList" runat="server" RepeatColumns="1">
<ItemTemplate>
<div class="Quota">
<%# Eval("DisplayName") %>
</div>
</ItemTemplate>
</asp:DataList>
</asp:Panel>
<br/>
<p class="NormalBold">Web engines enabled for this site:</p>
<asp:Panel ID="EnabledEnginesPanel" runat="server">
<asp:DataList ID="EnabledEnginesList" runat="server" RepeatColumns="1">
<ItemTemplate>
<div class="Quota">
<%# Container.DataItem.ToString() %>
</div>
</ItemTemplate>
</asp:DataList>
</asp:Panel>
<br
--%>
<p>
<asp:Label runat="server" meta:resourcekey="SelectWebEngine" CssClass="NormalBold"></asp:Label>
</p>
<br />
<asp:GridView id="gvApplications" runat="server" AutoGenerateColumns="False" AllowPaging="true"
ShowHeader="false" CssSelectorClass="LightGridView" EmptyDataText="gvApplications" OnRowCommand="gvApplications_RowCommand"
OnPageIndexChanging="gvApplications_PageIndexChanging">
<Columns>
<asp:TemplateField HeaderText="gvApplicationsApplication">
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
<div style="text-align:center;">
<%-- <asp:hyperlink NavigateUrl='<%# GetWebAppInstallUrl(Eval("Id").ToString()) %>'
runat="server" ID="Hyperlink3" ToolTip='<%# Eval("Title") %>'>
--%>
<asp:Image runat="server" ID="Image1" Width="120" Height="120"
ImageUrl='<%# GetIconUrlOrDefault((string)Eval("IconUrl")) %>'
AlternateText='<%# Eval("Title") %>'>
</asp:Image>
<%-- </asp:hyperlink> --%>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField>
<ItemTemplate>
<div class="MediumBold" style="padding:4px;">
<%-- <asp:hyperlink CssClass="MediumBold" NavigateUrl='<%# GetWebAppInstallUrl(Eval("Id").ToString()) %>'
runat="server" ID="lnkAppDetails" ToolTip='<%# Eval("Title") %>'>
--%>
<span class="MediumBold"><%# Eval("Title")%></span>
<%-- </asp:hyperlink> --%>
</div>
<div class="Normal" style="padding:4px;">
<%# Eval("Summary") %>
</div>
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="gvApplicationsApplication">
<ItemStyle HorizontalAlign="Center" />
<ItemTemplate>
<asp:Button ID="btnInstall" runat="server"
Text='<%# GetLocalizedString("btnInstall.Text") %>' CssClass="Button1"
CommandArgument='<%# Eval("Id") %>'
CommandName="Install" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>

View file

@ -0,0 +1,199 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WebsitePanel.Providers.HeliconZoo;
using WebsitePanel.Providers.ResultObjects;
using WebsitePanel.Providers.Web;
using WebsitePanel.Providers.WebAppGallery;
namespace WebsitePanel.Portal
{
public class ShortHeliconZooEngineComparer:IComparer<ShortHeliconZooEngine>
{
public int Compare(ShortHeliconZooEngine x, ShortHeliconZooEngine y)
{
return string.Compare(x.DisplayName, y.DisplayName, StringComparison.OrdinalIgnoreCase);
}
}
public partial class WebSitesHeliconZooControl : WebsitePanelControlBase
{
protected void Page_Load(object sender, EventArgs e)
{
}
public void BindWebItem(WebSite site)
{
ViewState["WebSiteId"] = site.SiteId;
ViewState["WebSitePackageId"] = site.PackageId;
BindEngines(site);
BindApplications();
}
private void BindEngines(WebSite site)
{
// get allowed engines for current hosting plan
ShortHeliconZooEngine[] allowedEngineArray =
ES.Services.HeliconZoo.GetAllowedHeliconZooQuotasForPackage(site.PackageId);
Array.Sort(allowedEngineArray, new ShortHeliconZooEngineComparer());
// get enabled engines for this site
string[] enabledEngineNames = ES.Services.HeliconZoo.GetEnabledEnginesForSite(site.SiteId, site.PackageId);
ViewState["EnabledEnginesNames"] = enabledEngineNames;
//EnabledEnginesList.DataSource = enabledEngineNames;
//EnabledEnginesList.DataBind();
List<ShortHeliconZooEngine> allowedEngines = new List<ShortHeliconZooEngine>(allowedEngineArray);
foreach (ShortHeliconZooEngine engine in allowedEngines)
{
engine.Name = engine.Name.Replace("HeliconZoo.", "");
engine.Enabled = enabledEngineNames.Contains(engine.Name, StringComparer.OrdinalIgnoreCase);
}
ViewState["AllowedEngines"] = allowedEngines;
//AllowedEnginesList.DataSource = allowedEngines;
//AllowedEnginesList.DataBind();
}
private void BindApplications()
{
WebAppGalleryHelpers helper = new WebAppGalleryHelpers();
GalleryApplicationsResult result = helper.GetGalleryApplications("ZooTemplate", PanelSecurity.PackageId);
List<GalleryApplication> applications = result.Value as List<GalleryApplication>;
List<GalleryApplication> filteredApplications = new List<GalleryApplication>();
List<ShortHeliconZooEngine> allowedEngines = (List<ShortHeliconZooEngine>)ViewState["AllowedEngines"];
if (null != allowedEngines)
{
foreach (GalleryApplication application in applications)
{
foreach (string keyword in application.Keywords)
{
if (keyword.StartsWith("ZooEngine", StringComparison.OrdinalIgnoreCase))
{
string appEngine = keyword.Substring("ZooEngine".Length);
foreach (ShortHeliconZooEngine engine in allowedEngines)
{
if (string.Equals(appEngine, engine.KeywordedName, StringComparison.OrdinalIgnoreCase))
{
filteredApplications.Add(application);
break;
}
}
}
}
}
}
else
{
filteredApplications.AddRange(applications);
}
gvApplications.DataSource = filteredApplications;
gvApplications.DataBind();
}
public void SaveWebItem(WebSite site)
{
UpdatedAllowedEngines();
}
protected void gvApplications_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName == "Install")
{
UpdatedAllowedEngines();
Response.Redirect(GetWebAppInstallUrl(e.CommandArgument.ToString()));
}
}
private void UpdatedAllowedEngines()
{
List<ShortHeliconZooEngine> allowedEngines = (List<ShortHeliconZooEngine>)ViewState["AllowedEngines"];
string[] enabledEngineNames = (string[])ViewState["EnabledEnginesNames"];
// check that all allowed engines are enabled
bool allAllowedAreEnabled = true;
if (allowedEngines.Count != enabledEngineNames.Length)
{
allAllowedAreEnabled = false;
}
else
{
foreach (ShortHeliconZooEngine allowedEngine in allowedEngines)
{
if (!enabledEngineNames.Contains(allowedEngine.Name, StringComparer.OrdinalIgnoreCase))
{
allAllowedAreEnabled = false;
}
}
}
if (!allAllowedAreEnabled)
{
List<string> updateEnabledEngineNames = new List<string>();
// by default allow for site all engines allowed by hosting plan
foreach (ShortHeliconZooEngine heliconZooEngine in allowedEngines)
{
updateEnabledEngineNames.Add(heliconZooEngine.Name);
}
string siteId = ViewState["WebSiteId"] as string;
int packageId = (int) ViewState["WebSitePackageId"];
ES.Services.HeliconZoo.SetEnabledEnginesForSite(siteId, packageId, updateEnabledEngineNames.ToArray());
}
}
protected void gvApplications_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gvApplications.PageIndex = e.NewPageIndex;
// categorized app list
BindApplications();
}
protected string GetIconUrlOrDefault(string url)
{
if (string.IsNullOrEmpty(url))
{
return "/App_Themes/Default/icons/sphere_128.png";
}
return "~/DesktopModules/WebsitePanel/ResizeImage.ashx?width=120&height=120&url=" + Server.UrlEncode(url);
}
protected string GetWebAppInstallUrl(string appId)
{
//http://localhost:9001/Default.aspx?pid=SpaceWebApplicationsGallery&mid=122&ctl=edit&ApplicationID=DotNetNuke&SpaceID=7
List<string> url = new List<string>();
url.Add("pid=SpaceWebApplicationsGallery");
url.Add("mid=122");
url.Add("ctl=edit");
url.Add("SpaceID="+PanelSecurity.PackageId.ToString(CultureInfo.InvariantCulture));
url.Add("ApplicationID=" + appId);
string siteId = ViewState["WebSiteId"] as string;
if (!string.IsNullOrEmpty(siteId))
{
url.Add("SiteId="+siteId);
}
url.Add("ReturnUrl=" + Server.UrlEncode(Request.RawUrl));
return "~/Default.aspx?" + String.Join("&", url.ToArray());
}
}
}

View file

@ -0,0 +1,52 @@
// 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.
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
namespace WebsitePanel.Portal {
public partial class WebSitesHeliconZooControl {
/// <summary>
/// gvApplications 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.GridView gvApplications;
}
}

View file

@ -325,6 +325,13 @@
<Compile Include="ProviderControls\CRM2011_Settings.ascx.designer.cs">
<DependentUpon>CRM2011_Settings.ascx</DependentUpon>
</Compile>
<Compile Include="ProviderControls\HeliconZoo_Settings.ascx.cs">
<DependentUpon>HeliconZoo_Settings.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="ProviderControls\HeliconZoo_Settings.ascx.designer.cs">
<DependentUpon>HeliconZoo_Settings.ascx</DependentUpon>
</Compile>
<Compile Include="ProviderControls\hMailServer5_EditAccount.ascx.cs">
<DependentUpon>hMailServer5_EditAccount.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -3725,6 +3732,13 @@
<Compile Include="WebSitesEditHeliconApeUser.ascx.designer.cs">
<DependentUpon>WebSitesEditHeliconApeUser.ascx</DependentUpon>
</Compile>
<Compile Include="WebSitesHeliconZooControl.ascx.cs">
<DependentUpon>WebSitesHeliconZooControl.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
</Compile>
<Compile Include="WebSitesHeliconZooControl.ascx.designer.cs">
<DependentUpon>WebSitesHeliconZooControl.ascx</DependentUpon>
</Compile>
<Compile Include="WebSitesEditWebFolder.ascx.cs">
<DependentUpon>WebSitesEditWebFolder.ascx</DependentUpon>
<SubType>ASPXCodeBehind</SubType>
@ -3831,6 +3845,7 @@
<Content Include="ExchangeServer\ExchangeAddMailboxPlan.ascx" />
<Content Include="Lync\UserControls\LyncUserSettings.ascx" />
<Content Include="ProviderControls\CRM2011_Settings.ascx" />
<Content Include="ProviderControls\HeliconZoo_Settings.ascx" />
<Content Include="ServersEditWebPlatformInstaller.ascx" />
<Content Include="ExchangeServer\ExchangeMailboxPlans.ascx" />
<Content Include="ExchangeServer\UserControls\AccountsListWithPermissions.ascx" />
@ -3915,6 +3930,7 @@
<Content Include="UserControls\UserDetails.ascx" />
<Content Include="UserControls\UserLookup.ascx" />
<Content Include="UserControls\UsernameControl.ascx" />
<Content Include="WebSitesHeliconZooControl.ascx" />
<Content Include="WebsitesSSL.ascx" />
</ItemGroup>
<ItemGroup>
@ -4985,6 +5001,7 @@
<Content Include="ExchangeServer\UserControls\App_LocalResources\UserTabs.ascx.resx" />
<Content Include="App_LocalResources\SettingsExchangeMailboxPlansPolicy.ascx.resx" />
<Content Include="App_LocalResources\SettingsLyncUserPlansPolicy.ascx.resx" />
<Content Include="ProviderControls\App_LocalResources\HeliconZoo_Settings.ascx.resx" />
<Content Include="ExchangeServer\App_LocalResources\OrganizationDomainNames.ascx.resx">
<SubType>Designer</SubType>
</Content>
@ -4992,6 +5009,7 @@
<SubType>Designer</SubType>
</Content>
<None Include="Resources\Windows2008_Settings.ascx.resx" />
<Content Include="App_LocalResources\WebSitesHeliconZooControl.ascx.resx" />
<EmbeddedResource Include="UserControls\App_LocalResources\EditDomainsList.ascx.resx">
<SubType>Designer</SubType>
</EmbeddedResource>

View file

@ -95,7 +95,8 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\VirtualizationServerProxy
REM %WSDL% %SERVER_URL%/esLync.asmx /out:.\WebsitePanel.EnterpriseServer.Client\LyncProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient
REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\LyncProxy.cs
REM %WSDL% %SERVER_URL%/esHeliconZoo.asmx /out:.\WebsitePanel.EnterpriseServer.Client\HeliconZooProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient
REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\HeliconZooProxy.cs

View file

@ -59,4 +59,5 @@ REM %WSE_CLEAN% .\WebsitePanel.Server.Client\WindowsServerProxy.cs
REM %WSDL% %SERVER_URL%/LyncServer.asmx /out:.\WebsitePanel.Server.Client\LyncServerProxy.cs /namespace:WebsitePanel.Providers.Lync /type:webClient /fields
REM %WSE_CLEAN% .\WebsitePanel.Server.Client\LyncServerProxy.cs
REM %WSDL% %SERVER_URL%/HeliconZoo.asmx /out:.\WebsitePanel.Server.Client\HeliconZooProxy.cs /namespace:WebsitePanel.Providers.HeliconZoo /type:webClient /fields
REM %WSE_CLEAN% .\WebsitePanel.Server.Client\HeliconZooProxy.cs