diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 155f5514..f6fc235d 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -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 \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/WebPlatformInstaller.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/WebPlatformInstaller.cs index d7e28612..fbc57ed9 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/WebPlatformInstaller.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Common/WebPlatformInstaller.cs @@ -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"; } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs index 6444c610..0632b962 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs @@ -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.*"; + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HeliconZooProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HeliconZooProxy.cs new file mode 100644 index 00000000..72272bb0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HeliconZooProxy.cs @@ -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. + +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +// +// 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; + + + /// + [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; + + /// + public esHeliconZoo() { + this.Url = "http://localhost:9005/esHeliconZoo.asmx"; + } + + /// + public event GetEnginesCompletedEventHandler GetEnginesCompleted; + + /// + public event SetEnginesCompletedEventHandler SetEnginesCompleted; + + /// + public event IsEnginesEnabledCompletedEventHandler IsEnginesEnabledCompleted; + + /// + public event SwithEnginesEnabledCompletedEventHandler SwithEnginesEnabledCompleted; + + /// + public event GetAllowedHeliconZooQuotasForPackageCompletedEventHandler GetAllowedHeliconZooQuotasForPackageCompleted; + + /// + public event GetEnabledEnginesForSiteCompletedEventHandler GetEnabledEnginesForSiteCompleted; + + /// + public event SetEnabledEnginesForSiteCompletedEventHandler SetEnabledEnginesForSiteCompleted; + + /// + [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])); + } + + /// + public System.IAsyncResult BeginGetEngines(int serviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetEngines", new object[] { + serviceId}, callback, asyncState); + } + + /// + public HeliconZooEngine[] EndGetEngines(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((HeliconZooEngine[])(results[0])); + } + + /// + public void GetEnginesAsync(int serviceId) { + this.GetEnginesAsync(serviceId, null); + } + + /// + 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)); + } + } + + /// + [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}); + } + + /// + public System.IAsyncResult BeginSetEngines(int serviceId, HeliconZooEngine[] userEngines, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetEngines", new object[] { + serviceId, + userEngines}, callback, asyncState); + } + + /// + public void EndSetEngines(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void SetEnginesAsync(int serviceId, HeliconZooEngine[] userEngines) { + this.SetEnginesAsync(serviceId, userEngines, null); + } + + /// + 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)); + } + } + + /// + [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])); + } + + /// + public System.IAsyncResult BeginIsEnginesEnabled(int serviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("IsEnginesEnabled", new object[] { + serviceId}, callback, asyncState); + } + + /// + public bool EndIsEnginesEnabled(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void IsEnginesEnabledAsync(int serviceId) { + this.IsEnginesEnabledAsync(serviceId, null); + } + + /// + 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)); + } + } + + /// + [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}); + } + + /// + public System.IAsyncResult BeginSwithEnginesEnabled(int serviceId, bool enabled, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SwithEnginesEnabled", new object[] { + serviceId, + enabled}, callback, asyncState); + } + + /// + public void EndSwithEnginesEnabled(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void SwithEnginesEnabledAsync(int serviceId, bool enabled) { + this.SwithEnginesEnabledAsync(serviceId, enabled, null); + } + + /// + 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)); + } + } + + /// + [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])); + } + + /// + public System.IAsyncResult BeginGetAllowedHeliconZooQuotasForPackage(int packageId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetAllowedHeliconZooQuotasForPackage", new object[] { + packageId}, callback, asyncState); + } + + /// + public ShortHeliconZooEngine[] EndGetAllowedHeliconZooQuotasForPackage(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((ShortHeliconZooEngine[])(results[0])); + } + + /// + public void GetAllowedHeliconZooQuotasForPackageAsync(int packageId) { + this.GetAllowedHeliconZooQuotasForPackageAsync(packageId, null); + } + + /// + 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)); + } + } + + /// + [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])); + } + + /// + public System.IAsyncResult BeginGetEnabledEnginesForSite(string siteId, int packageId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetEnabledEnginesForSite", new object[] { + siteId, + packageId}, callback, asyncState); + } + + /// + public string[] EndGetEnabledEnginesForSite(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string[])(results[0])); + } + + /// + public void GetEnabledEnginesForSiteAsync(string siteId, int packageId) { + this.GetEnabledEnginesForSiteAsync(siteId, packageId, null); + } + + /// + 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)); + } + } + + /// + [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}); + } + + /// + 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); + } + + /// + public void EndSetEnabledEnginesForSite(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void SetEnabledEnginesForSiteAsync(string siteId, int packageId, string[] engines) { + this.SetEnabledEnginesForSiteAsync(siteId, packageId, engines, null); + } + + /// + 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)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetEnginesCompletedEventHandler(object sender, GetEnginesCompletedEventArgs e); + + /// + [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; + } + + /// + public HeliconZooEngine[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((HeliconZooEngine[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetEnginesCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void IsEnginesEnabledCompletedEventHandler(object sender, IsEnginesEnabledCompletedEventArgs e); + + /// + [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; + } + + /// + public bool Result { + get { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SwithEnginesEnabledCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetAllowedHeliconZooQuotasForPackageCompletedEventHandler(object sender, GetAllowedHeliconZooQuotasForPackageCompletedEventArgs e); + + /// + [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; + } + + /// + public ShortHeliconZooEngine[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((ShortHeliconZooEngine[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetEnabledEnginesForSiteCompletedEventHandler(object sender, GetEnabledEnginesForSiteCompletedEventArgs e); + + /// + [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; + } + + /// + public string[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetEnabledEnginesForSiteCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); +} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj index 1390dff3..d2540553 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj @@ -87,6 +87,7 @@ code + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs index 762d78bf..0aaf98a5 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/Data/DataProvider.cs @@ -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 } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HeliconZoo/HeliconZooController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HeliconZoo/HeliconZooController.cs new file mode 100644 index 00000000..d2f4c5dd --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/Code/HeliconZoo/HeliconZooController.cs @@ -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 allowedEngines = new List(); + + 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 updatedEngines = new List(userEngines); + + int providerId, groupId; + DataProvider.GetHeliconZooProviderAndGroup("HeliconZoo", out providerId, out groupId); + + + // get existing Helicon Zoo quotas + List existingQuotas = new List(); + 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 engineNamesToRemove = new List(); + List enginesToAdd = new List(); + + // 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 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 + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj index 8dba7817..98a5db62 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj @@ -83,6 +83,7 @@ + @@ -138,6 +139,7 @@ + @@ -245,6 +247,10 @@ + + esHeliconZoo.asmx + Component + esLync.asmx Component diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHeliconZoo.asmx b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHeliconZoo.asmx new file mode 100644 index 00000000..c8fcae11 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHeliconZoo.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="esHeliconZoo.asmx.cs" Class="WebsitePanel.EnterpriseServer.esHeliconZoo" %> diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHeliconZoo.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHeliconZoo.asmx.cs new file mode 100644 index 00000000..6d812019 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHeliconZoo.asmx.cs @@ -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 description for esHeliconZoo + /// + [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); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/WPIEntries.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/WPIEntries.cs index a61106c7..dd3c94d3 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/WPIEntries.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/Common/WPIEntries.cs @@ -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; diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HeliconZoo/IHeliconZooServer.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HeliconZoo/IHeliconZooServer.cs new file mode 100644 index 00000000..a20189a9 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HeliconZoo/IHeliconZooServer.cs @@ -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); + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index f65c7c25..51aff26b 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -75,6 +75,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.HeliconZoo/HeliconZoo.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.HeliconZoo/HeliconZoo.cs new file mode 100644 index 00000000..7ebd4b72 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.HeliconZoo/HeliconZoo.cs @@ -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 result = new List(); + + 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 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 engines = new List(); + + 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 envList = new List(); + 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 elementsToRemove = new List(); + 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 zooPhpHandlersToRemove = new List(); + 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 + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.HeliconZoo/Properties/AssemblyInfo.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.HeliconZoo/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..2a5aaabe --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.HeliconZoo/Properties/AssemblyInfo.cs @@ -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")] + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.HeliconZoo/WebsitePanel.Providers.Web.HeliconZoo.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Web.HeliconZoo/WebsitePanel.Providers.Web.HeliconZoo.csproj new file mode 100644 index 00000000..5a620918 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.HeliconZoo/WebsitePanel.Providers.Web.HeliconZoo.csproj @@ -0,0 +1,70 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {A1FCFF8F-4977-462B-A81A-EE67B56D52A4} + Library + Properties + WebsitePanel.Providers.Web.HeliconZoo + WebsitePanel.Providers.Web.HeliconZoo + v3.5 + 512 + + + true + full + false + ..\WebsitePanel.Server\bin\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + ..\WebsitePanel.Server\bin\ + TRACE + prompt + 4 + + + + False + ..\..\Lib\References\Microsoft\Microsoft.Web.Administration.dll + + + False + ..\..\Lib\References\Microsoft\Microsoft.Web.Management.dll + + + + + + + + + + + VersionInfo.cs + + + + + + + {684C932A-6C75-46AC-A327-F3689D89EB42} + WebsitePanel.Providers.Base + + + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WPIWebApplicationGallery/WPIApplicationGallery.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WPIWebApplicationGallery/WPIApplicationGallery.cs index 2b2ba11d..3f99d1a6 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WPIWebApplicationGallery/WPIApplicationGallery.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Web.IIs60/WPIWebApplicationGallery/WPIApplicationGallery.cs @@ -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() }; } diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/HeliconZooProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/HeliconZooProxy.cs new file mode 100644 index 00000000..356be78d --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/HeliconZooProxy.cs @@ -0,0 +1,405 @@ +//------------------------------------------------------------------------------ +// +// 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. +// +//------------------------------------------------------------------------------ + +// +// 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; + + + /// + [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; + + /// + public HeliconZoo() { + this.Url = "http://localhost:9003/HeliconZoo.asmx"; + } + + /// + public event GetEnginesCompletedEventHandler GetEnginesCompleted; + + /// + public event SetEnginesCompletedEventHandler SetEnginesCompleted; + + /// + public event IsEnginesEnabledCompletedEventHandler IsEnginesEnabledCompleted; + + /// + public event SwithEnginesEnabledCompletedEventHandler SwithEnginesEnabledCompleted; + + /// + public event GetEnabledEnginesForSiteCompletedEventHandler GetEnabledEnginesForSiteCompleted; + + /// + public event SetEnabledEnginesForSiteCompletedEventHandler SetEnabledEnginesForSiteCompleted; + + /// + [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])); + } + + /// + public System.IAsyncResult BeginGetEngines(System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetEngines", new object[0], callback, asyncState); + } + + /// + public HeliconZooEngine[] EndGetEngines(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((HeliconZooEngine[])(results[0])); + } + + /// + public void GetEnginesAsync() { + this.GetEnginesAsync(null); + } + + /// + 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)); + } + } + + /// + [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}); + } + + /// + public System.IAsyncResult BeginSetEngines(HeliconZooEngine[] userEngines, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetEngines", new object[] { + userEngines}, callback, asyncState); + } + + /// + public void EndSetEngines(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void SetEnginesAsync(HeliconZooEngine[] userEngines) { + this.SetEnginesAsync(userEngines, null); + } + + /// + 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)); + } + } + + /// + [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])); + } + + /// + public System.IAsyncResult BeginIsEnginesEnabled(System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("IsEnginesEnabled", new object[0], callback, asyncState); + } + + /// + public bool EndIsEnginesEnabled(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void IsEnginesEnabledAsync() { + this.IsEnginesEnabledAsync(null); + } + + /// + 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)); + } + } + + /// + [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}); + } + + /// + public System.IAsyncResult BeginSwithEnginesEnabled(bool enabled, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SwithEnginesEnabled", new object[] { + enabled}, callback, asyncState); + } + + /// + public void EndSwithEnginesEnabled(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void SwithEnginesEnabledAsync(bool enabled) { + this.SwithEnginesEnabledAsync(enabled, null); + } + + /// + 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)); + } + } + + /// + [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])); + } + + /// + public System.IAsyncResult BeginGetEnabledEnginesForSite(string siteId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("GetEnabledEnginesForSite", new object[] { + siteId}, callback, asyncState); + } + + /// + public string[] EndGetEnabledEnginesForSite(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string[])(results[0])); + } + + /// + public void GetEnabledEnginesForSiteAsync(string siteId) { + this.GetEnabledEnginesForSiteAsync(siteId, null); + } + + /// + 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)); + } + } + + /// + [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}); + } + + /// + public System.IAsyncResult BeginSetEnabledEnginesForSite(string siteId, string[] engineNames, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("SetEnabledEnginesForSite", new object[] { + siteId, + engineNames}, callback, asyncState); + } + + /// + public void EndSetEnabledEnginesForSite(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void SetEnabledEnginesForSiteAsync(string siteId, string[] engineNames) { + this.SetEnabledEnginesForSiteAsync(siteId, engineNames, null); + } + + /// + 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)); + } + } + + /// + public new void CancelAsync(object userState) { + base.CancelAsync(userState); + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetEnginesCompletedEventHandler(object sender, GetEnginesCompletedEventArgs e); + + /// + [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; + } + + /// + public HeliconZooEngine[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((HeliconZooEngine[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetEnginesCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void IsEnginesEnabledCompletedEventHandler(object sender, IsEnginesEnabledCompletedEventArgs e); + + /// + [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; + } + + /// + public bool Result { + get { + this.RaiseExceptionIfNecessary(); + return ((bool)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SwithEnginesEnabledCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void GetEnabledEnginesForSiteCompletedEventHandler(object sender, GetEnabledEnginesForSiteCompletedEventArgs e); + + /// + [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; + } + + /// + public string[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((string[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.42")] + public delegate void SetEnabledEnginesForSiteCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); +} diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj index 44b375f0..4412a312 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj @@ -80,6 +80,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Server.sln b/WebsitePanel/Sources/WebsitePanel.Server.sln index e7e517f5..6e34a22d 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.sln +++ b/WebsitePanel/Sources/WebsitePanel.Server.sln @@ -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 diff --git a/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs b/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs index 5ad0f643..c6c4c130 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/Code/WPIHelper.cs @@ -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 GetProductsToInstall(string FeedLocation, string keywordId) { Keyword keyword = null; + List products = new List(); + if (!string.IsNullOrEmpty(keywordId)) { keyword = _productManager.GetKeyword(keywordId); } - List products = new List(); + // 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 } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/HeliconZoo.asmx b/WebsitePanel/Sources/WebsitePanel.Server/HeliconZoo.asmx new file mode 100644 index 00000000..c0e82789 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server/HeliconZoo.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="HeliconZoo.asmx.cs" Class="WebsitePanel.Server.HeliconZoo" %> diff --git a/WebsitePanel/Sources/WebsitePanel.Server/HeliconZoo.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/HeliconZoo.asmx.cs new file mode 100644 index 00000000..24dce0d6 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server/HeliconZoo.asmx.cs @@ -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 description for HeliconZoo + /// + [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); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj index 72c5835a..54e11a29 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj @@ -85,6 +85,7 @@ + @@ -126,6 +127,10 @@ + + HeliconZoo.asmx + Component + LyncServer.asmx Component diff --git a/WebsitePanel/Sources/WebsitePanel.Server/WindowsServer.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/WindowsServer.asmx.cs index c6398bf5..0c79f416 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/WindowsServer.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/WindowsServer.asmx.cs @@ -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 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; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_Modules.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_Modules.ascx.resx index fef0f5c7..0937309d 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_Modules.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_Modules.ascx.resx @@ -771,4 +771,8 @@ System Hard Quota + + + Helicon Zoo + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx index 154ff84e..46bf2425 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -3287,6 +3287,9 @@ Office Communications Server + + Web Engines + SharePoint Site Collections per Organization @@ -3299,6 +3302,9 @@ CRM Organization + + Web Engines + Error occurred while delete SharePoint site collection. diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesEditSite.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesEditSite.ascx.resx index 78df331e..3e8b025e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesEditSite.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesEditSite.ascx.resx @@ -321,6 +321,9 @@ .htaccess + + Web Engines + Virtual Dirs diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesHeliconZooControl.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesHeliconZooControl.ascx.resx new file mode 100644 index 00000000..da362e19 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/WebSitesHeliconZooControl.ascx.resx @@ -0,0 +1,126 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Install + + + Select web application engine to set up + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/ES.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/ES.cs index aae6f6d5..d39706a8 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/ES.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/ES.cs @@ -213,6 +213,11 @@ namespace WebsitePanel.Portal get { return GetCachedProxy(); } } + + public esHeliconZoo HeliconZoo + { + get { return GetCachedProxy(); } + } protected ES() { } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/PackagesHelper.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/PackagesHelper.cs index 9b15dc35..f56ccbe5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/PackagesHelper.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/PackagesHelper.cs @@ -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; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlansQuotas.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlansQuotas.ascx index 2120e248..1c6b4b43 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlansQuotas.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlansQuotas.ascx @@ -25,7 +25,7 @@
- <%# GetSharedLocalizedString("Quota." + (string)Eval("QuotaName"))%>: + <%# GetSharedLocalizedStringNotEmpty((string)Eval("QuotaName"), Eval("QuotaDescription"))%>:
0 && result.Substring(result.IndexOf('.')).Length > 1) + { + // drop Quota name prefix + // HeliconZoo.python -> python + + result = result.Substring(result.IndexOf('.')+1); + } + } + + return result; + } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlansQuotas.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlansQuotas.ascx.designer.cs index 65f90d8c..b01a3ef9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlansQuotas.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostingPlansQuotas.ascx.designer.cs @@ -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. + //------------------------------------------------------------------------------ // // 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. // //------------------------------------------------------------------------------ namespace WebsitePanel.Portal { - /// - /// HostingPlansQuotas class. - /// - /// - /// Auto-generated class. - /// public partial class HostingPlansQuotas { /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/HeliconZoo_Settings.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/HeliconZoo_Settings.ascx.resx new file mode 100644 index 00000000..85c90909 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/App_LocalResources/HeliconZoo_Settings.ascx.resx @@ -0,0 +1,101 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 1.3 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HeliconZoo_Settings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HeliconZoo_Settings.ascx new file mode 100644 index 00000000..273c6ad2 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HeliconZoo_Settings.ascx @@ -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" %> + + + +
+ + Hosting Packages + + + + + + + + + + + +

<%# Eval("Title")%>

+

<%# Eval("Summary") %>

+
+
+ + + + + + + + + +
+
+ + +
+ +
+
+ + +

Unable to load Hosting Package list with exception:

+ +
+ +
+ + +
+ + Helicon Zoo engine quotas settings + +
+ +
+
+ + +
+ + Engines management + + +
+ +
+ + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ Name + + + +

Id for the engine

+
+ Friendly name + + + +

Frendly engine name

+
+ Full path to executable + + + +

Path to a worker executable file

+
+ Executable`s arguments + + +

Set of arguments to be passed to a worker on a call, can include special environment variables

+
+ Transport + + +
+ Protocol + + +
+ Lower port + + + +

Specifies lower automatic port range bound for TCP transport, default = 49152

+
+ Upper port + + + +

Specifies upper automatic port range bound for TCP transport, default = 65535

+
+ Minimum instances + + + +

Minimum number of worker instances

+
+ Maximum instances + + + +

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.

+
+ Time limit + + + +

Restart the worker after it has worked for specific amount of time (minutes), default = 0 (infinite)

+
+ Graceful Shutdown Timeout + + + +

XXXXXXXXXXXXXXXXXXX

+
+ Memory limit + + + +

Restart the worker if it has consumed specific amount of memory (megabytes), default = 0 (unlimited)

+
+ Environment variables + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
KeyValue
+
+
+
+
+ +
+ +
+ +   + +
+
+ + + + + + <%# Eval("displayName")%> + + + + + + + + + + + + + +
+ +
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HeliconZoo_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HeliconZoo_Settings.ascx.cs new file mode 100644 index 00000000..dcafbfe1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HeliconZoo_Settings.ascx.cs @@ -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 enginesDict = new Dictionary(); + 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 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(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 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 tempEnvList = new List(); + 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 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 GetEngines() + { + return ViewState["HeliconZooEngines"] as Dictionary; + } + + private HeliconZooEngine FindEngineByName(string engineName) + { + Dictionary 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 qsParts = new List(); + + 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); + + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HeliconZoo_Settings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HeliconZoo_Settings.ascx.designer.cs new file mode 100644 index 00000000..d2b3dbb0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/HeliconZoo_Settings.ascx.designer.cs @@ -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. + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + + + +public partial class HeliconZoo_Settings { + + /// + /// HostingPackagesGrid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView HostingPackagesGrid; + + /// + /// HostingPackagesInstallButtonsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel HostingPackagesInstallButtonsPanel; + + /// + /// btnInstall control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button btnInstall; + + /// + /// HostingPackagesErrorsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel HostingPackagesErrorsPanel; + + /// + /// HostingPackagesLoadingError control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Label HostingPackagesLoadingError; + + /// + /// QuotasEnabled control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox QuotasEnabled; + + /// + /// EnginesPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel EnginesPanel; + + /// + /// ButtonAddEngine control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button ButtonAddEngine; + + /// + /// EngineForm control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.UpdatePanel EngineForm; + + /// + /// EngineName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EngineName; + + /// + /// EngineFriendlyName control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EngineFriendlyName; + + /// + /// EngineFullPath control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EngineFullPath; + + /// + /// EngineArguments control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EngineArguments; + + /// + /// EngineTransport control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList EngineTransport; + + /// + /// EngineProtocol control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.DropDownList EngineProtocol; + + /// + /// EnginePortLower control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnginePortLower; + + /// + /// EnginePortUpper control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnginePortUpper; + + /// + /// EngineMinInstances control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EngineMinInstances; + + /// + /// EngineMaxInstances control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EngineMaxInstances; + + /// + /// EngineTimeLimit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EngineTimeLimit; + + /// + /// EngineGracefulShutdownTimeout control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EngineGracefulShutdownTimeout; + + /// + /// EngineMemoryLimit control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EngineMemoryLimit; + + /// + /// EnvKey1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvKey1; + + /// + /// EnvValue1 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvValue1; + + /// + /// EnvKey2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvKey2; + + /// + /// EnvValue2 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvValue2; + + /// + /// EnvKey3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvKey3; + + /// + /// EnvValue3 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvValue3; + + /// + /// EnvKey4 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvKey4; + + /// + /// EnvValue4 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvValue4; + + /// + /// EnvKey5 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvKey5; + + /// + /// EnvValue5 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvValue5; + + /// + /// EnvKey6 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvKey6; + + /// + /// EnvValue6 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvValue6; + + /// + /// EnvKey7 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvKey7; + + /// + /// EnvValue7 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvValue7; + + /// + /// EnvKey8 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvKey8; + + /// + /// EnvValue8 control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.TextBox EnvValue8; + + /// + /// EngineFormButtons control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel EngineFormButtons; + + /// + /// ButtonSaveEngine control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button ButtonSaveEngine; + + /// + /// ButtonCancelEngineForm control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Button ButtonCancelEngineForm; + + /// + /// EngineGrid control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView EngineGrid; +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditWebPlatformInstaller.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditWebPlatformInstaller.ascx.cs index 3987a1b5..ede2fe60 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditWebPlatformInstaller.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditWebPlatformInstaller.ascx.cs @@ -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) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx.cs index caa57525..fdd8e555 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryInstall.ascx.cs @@ -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) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryParams.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryParams.ascx.cs index 0222ec36..72976f80 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryParams.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebApplicationGalleryParams.ascx.cs @@ -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(); + } } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx index 0ae495ee..6f6e8bee 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx @@ -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 @@ + + + @@ -510,4 +514,4 @@ CssClass="Button1" CausesValidation="false" OnClientClick="return confirm('Delete this web site?');" OnClick="btnDelete_Click" /> -
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs index 162d35ce..41f60173 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.cs @@ -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 diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.designer.cs index fe3cda42..710488b3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesEditSite.ascx.designer.cs @@ -490,6 +490,24 @@ namespace WebsitePanel.Portal { ///
protected global::WebsitePanel.Portal.WebSitesHeliconApeControl webSitesHeliconApeControl; + /// + /// tabHeliconZoo control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.View tabHeliconZoo; + + /// + /// webSitesHeliconZooControl control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.WebSitesHeliconZooControl webSitesHeliconZooControl; + /// /// tabFrontPage control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesHeliconZooControl.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesHeliconZooControl.ascx new file mode 100644 index 00000000..4757bbcb --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesHeliconZooControl.ascx @@ -0,0 +1,79 @@ +<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="WebSitesHeliconZooControl.ascx.cs" Inherits="WebsitePanel.Portal.WebSitesHeliconZooControl" %> +<%@ Import Namespace="WebsitePanel.Portal" %> + +<%-- +

Web engines allowed for this site:

+ + + +
+ <%# Eval("DisplayName") %> +
+
+
+
+
+ +

Web engines enabled for this site:

+ + + +
+ <%# Container.DataItem.ToString() %> +
+
+
+
+
+ +

+ +

+
+ + + + + + +
+ <%-- + --%> + + + <%-- --%> +
+
+
+ + +
+ <%-- + --%> + <%# Eval("Title")%> + <%-- --%> +
+
+ <%# Eval("Summary") %> +
+
+
+ + + + + + +
+
+ diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesHeliconZooControl.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesHeliconZooControl.ascx.cs new file mode 100644 index 00000000..e12d06f5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesHeliconZooControl.ascx.cs @@ -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 + { + 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 allowedEngines = new List(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 applications = result.Value as List; + List filteredApplications = new List(); + + List allowedEngines = (List)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 allowedEngines = (List)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 updateEnabledEngineNames = new List(); + + // 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 url = new List(); + 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()); + } + } +} \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesHeliconZooControl.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesHeliconZooControl.ascx.designer.cs new file mode 100644 index 00000000..23332593 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebSitesHeliconZooControl.ascx.designer.cs @@ -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. + +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace WebsitePanel.Portal { + + + public partial class WebSitesHeliconZooControl { + + /// + /// gvApplications control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.GridView gvApplications; + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj index 5a320f77..4b983f1f 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -325,6 +325,13 @@ CRM2011_Settings.ascx + + HeliconZoo_Settings.ascx + ASPXCodeBehind + + + HeliconZoo_Settings.ascx + hMailServer5_EditAccount.ascx ASPXCodeBehind @@ -3725,6 +3732,13 @@ WebSitesEditHeliconApeUser.ascx + + WebSitesHeliconZooControl.ascx + ASPXCodeBehind + + + WebSitesHeliconZooControl.ascx + WebSitesEditWebFolder.ascx ASPXCodeBehind @@ -3831,6 +3845,7 @@ + @@ -3915,6 +3930,7 @@ +
@@ -4985,6 +5001,7 @@ + Designer @@ -4992,6 +5009,7 @@ Designer + Designer diff --git a/WebsitePanel/Sources/generate_es_proxies.bat b/WebsitePanel/Sources/generate_es_proxies.bat index 5a4fbd8d..4bde5550 100644 --- a/WebsitePanel/Sources/generate_es_proxies.bat +++ b/WebsitePanel/Sources/generate_es_proxies.bat @@ -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 diff --git a/WebsitePanel/Sources/generate_server_proxies.bat b/WebsitePanel/Sources/generate_server_proxies.bat index 2ef3d080..0256ae16 100644 --- a/WebsitePanel/Sources/generate_server_proxies.bat +++ b/WebsitePanel/Sources/generate_server_proxies.bat @@ -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