diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 0231b023..046938ea 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -1959,4 +1959,20 @@ GO +-- Enterprise Storage +IF NOT EXISTS (SELECT * FROM [dbo].[ResourceGroups] WHERE [GroupName] = 'EnterpriseStorage') +BEGIN +INSERT [dbo].[ResourceGroups] ([GroupID], [GroupName], [GroupOrder], [GroupController], [ShowGroup]) VALUES (44, N'EnterpriseStorage', 25, N'WebsitePanel.EnterpriseServer.EnterpriseStorageController', 1) +END +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Enterprise Storage Windows 2012') +BEGIN +INSERT [dbo].[Providers] ([ProviderId], [GroupId], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) VALUES(600, 44, N'EnterpriseStorage2012', N'Enterprise Storage Windows 2012', N'WebsitePanel.Providers.EnterpriseStorage.Windows2012, WebsitePanel.Providers.EnterpriseStorage.Windows2012', N'EnterpriseStorage', 1) +END +ELSE +BEGIN +UPDATE [dbo].[Providers] SET [DisableAutoDiscovery] = NULL WHERE [DisplayName] = 'Enterprise Storage Windows 2012' +END +GO diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/EnterpriseStorageProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/EnterpriseStorageProxy.cs index f441a76a..ae0653c8 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/EnterpriseStorageProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/EnterpriseStorageProxy.cs @@ -16,6 +16,7 @@ using WebsitePanel.Providers.Common; using WebsitePanel.Providers.ResultObjects; using WebsitePanel.Providers.OS; + namespace WebsitePanel.EnterpriseServer { using System.Xml.Serialization; using System.Web.Services; @@ -33,6 +34,8 @@ namespace WebsitePanel.EnterpriseServer { [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] public partial class esEnterpriseStorage : Microsoft.Web.Services3.WebServicesClientProtocol { + private System.Threading.SendOrPostCallback CheckFileServicesInstallationOperationCompleted; + private System.Threading.SendOrPostCallback GetEnterpriseFoldersOperationCompleted; private System.Threading.SendOrPostCallback GetEnterpriseFolderOperationCompleted; @@ -48,6 +51,9 @@ namespace WebsitePanel.EnterpriseServer { this.Url = "http://localhost:9002/esEnterpriseStorage.asmx"; } + /// + public event CheckFileServicesInstallationCompletedEventHandler CheckFileServicesInstallationCompleted; + /// public event GetEnterpriseFoldersCompletedEventHandler GetEnterpriseFoldersCompleted; @@ -63,6 +69,47 @@ namespace WebsitePanel.EnterpriseServer { /// public event SetEnterpriseFolderQuotaCompletedEventHandler SetEnterpriseFolderQuotaCompleted; + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/CheckFileServicesInstallation", 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 CheckFileServicesInstallation(int serviceId) { + object[] results = this.Invoke("CheckFileServicesInstallation", new object[] { + serviceId}); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginCheckFileServicesInstallation(int serviceId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CheckFileServicesInstallation", new object[] { + serviceId}, callback, asyncState); + } + + /// + public bool EndCheckFileServicesInstallation(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void CheckFileServicesInstallationAsync(int serviceId) { + this.CheckFileServicesInstallationAsync(serviceId, null); + } + + /// + public void CheckFileServicesInstallationAsync(int serviceId, object userState) { + if ((this.CheckFileServicesInstallationOperationCompleted == null)) { + this.CheckFileServicesInstallationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckFileServicesInstallationOperationCompleted); + } + this.InvokeAsync("CheckFileServicesInstallation", new object[] { + serviceId}, this.CheckFileServicesInstallationOperationCompleted, userState); + } + + private void OnCheckFileServicesInstallationOperationCompleted(object arg) { + if ((this.CheckFileServicesInstallationCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CheckFileServicesInstallationCompleted(this, new CheckFileServicesInstallationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetEnterpriseFolders", 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 SystemFile[] GetEnterpriseFolders(int itemId) { @@ -292,6 +339,32 @@ namespace WebsitePanel.EnterpriseServer { } } + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void CheckFileServicesInstallationCompletedEventHandler(object sender, CheckFileServicesInstallationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CheckFileServicesInstallationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CheckFileServicesInstallationCompletedEventArgs(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.3038")] public delegate void GetEnterpriseFoldersCompletedEventHandler(object sender, GetEnterpriseFoldersCompletedEventArgs e); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/EnterpriseStorage/EnterpriseStorageController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/EnterpriseStorage/EnterpriseStorageController.cs index 81761735..ba585e20 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/EnterpriseStorage/EnterpriseStorageController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/EnterpriseStorage/EnterpriseStorageController.cs @@ -38,6 +38,7 @@ using System.Xml.Serialization; using WebsitePanel.Server; using WebsitePanel.Providers; using WebsitePanel.Providers.OS; +using WebsitePanel.Providers.EnterpriseStorage; using System.Collections; using WebsitePanel.Providers.Common; using WebsitePanel.Providers.ResultObjects; @@ -75,6 +76,14 @@ namespace WebsitePanel.EnterpriseServer #endregion + private static EnterpriseStorage GetEnterpriseStorage(int serviceId) + { + EnterpriseStorage es = new EnterpriseStorage(); + ServiceProviderProxy.Init(es, serviceId); + return es; + } + + private static SystemFile[] GetFoldersInternal(int itemId) { return new SystemFile[1]; @@ -101,5 +110,10 @@ namespace WebsitePanel.EnterpriseServer } + public static bool CheckFileServicesInstallation(int serviceId) + { + EnterpriseStorage es = GetEnterpriseStorage(serviceId); + return es.CheckFileServicesInstallation(); + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esEnterpriseStorage.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esEnterpriseStorage.asmx.cs index ca86b949..aa7f35d5 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esEnterpriseStorage.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esEnterpriseStorage.asmx.cs @@ -54,6 +54,13 @@ namespace WebsitePanel.EnterpriseServer [ToolboxItem(false)] public class esEnterpriseStorage : WebService { + + [WebMethod] + public bool CheckFileServicesInstallation(int serviceId) + { + return EnterpriseStorageController.CheckFileServicesInstallation(serviceId); + } + [WebMethod] public SystemFile[] GetEnterpriseFolders(int itemId) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOperatingSystems.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOperatingSystems.asmx.cs index 807901a9..681795a8 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOperatingSystems.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esOperatingSystems.asmx.cs @@ -94,12 +94,10 @@ namespace WebsitePanel.EnterpriseServer return OperatingSystemController.DeleteOdbcSource(itemId); } - //CO Changes [WebMethod] public bool CheckFileServicesInstallation(int serviceId) { return OperatingSystemController.CheckFileServicesInstallation(serviceId); } - //END } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/EnterpriseStorage/IEnterpriseStorage.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/EnterpriseStorage/IEnterpriseStorage.cs index 24461de5..879d2021 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/EnterpriseStorage/IEnterpriseStorage.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/EnterpriseStorage/IEnterpriseStorage.cs @@ -42,5 +42,6 @@ namespace WebsitePanel.Providers.EnterpriseStorage void CreateFolder(string organizationId, string folder); void DeleteFolder(string organizationId, string folder); void SetFolderQuota(string organizationId, string folder, long quota); + bool CheckFileServicesInstallation(); } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs index b313de15..8ff413f0 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.EnterpriseStorage.Windows2012/Windows2012.cs @@ -9,7 +9,7 @@ using WebsitePanel.Server.Utils; using WebsitePanel.Providers.Utils; using WebsitePanel.Providers.OS; -namespace WebsitePanel.Providers.EnterpriseStorage.Windows2012 +namespace WebsitePanel.Providers.EnterpriseStorage { public class Windows2012 : HostingServiceProviderBase { @@ -66,6 +66,12 @@ namespace WebsitePanel.Providers.EnterpriseStorage.Windows2012 } + + public bool CheckFileServicesInstallation() + { + return WebsitePanel.Server.Utils.OS.CheckFileServicesInstallation(); + } + #endregion #region HostingServiceProvider methods @@ -135,6 +141,7 @@ namespace WebsitePanel.Providers.EnterpriseStorage.Windows2012 } return itemsDiskspace.ToArray(); } + #endregion public override bool IsInstalled() diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs index 001239af..87a560a1 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/EnterpriseStorageProxy.cs @@ -16,7 +16,6 @@ using WebsitePanel.Providers.Common; using WebsitePanel.Providers.ResultObjects; using WebsitePanel.Providers.OS; - namespace WebsitePanel.Providers.EnterpriseStorage { using System.Xml.Serialization; using System.Web.Services; @@ -46,6 +45,8 @@ namespace WebsitePanel.Providers.EnterpriseStorage { private System.Threading.SendOrPostCallback SetFolderQuotaOperationCompleted; + private System.Threading.SendOrPostCallback CheckFileServicesInstallationOperationCompleted; + /// public EnterpriseStorage() { this.Url = "http://localhost:9003/EnterpriseStorage.asmx"; @@ -66,6 +67,9 @@ namespace WebsitePanel.Providers.EnterpriseStorage { /// public event SetFolderQuotaCompletedEventHandler SetFolderQuotaCompleted; + /// + public event CheckFileServicesInstallationCompletedEventHandler CheckFileServicesInstallationCompleted; + /// [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/GetFolders", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] @@ -285,6 +289,45 @@ namespace WebsitePanel.Providers.EnterpriseStorage { } } + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/CheckFileServicesInstallation", 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 CheckFileServicesInstallation() { + object[] results = this.Invoke("CheckFileServicesInstallation", new object[0]); + return ((bool)(results[0])); + } + + /// + public System.IAsyncResult BeginCheckFileServicesInstallation(System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("CheckFileServicesInstallation", new object[0], callback, asyncState); + } + + /// + public bool EndCheckFileServicesInstallation(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((bool)(results[0])); + } + + /// + public void CheckFileServicesInstallationAsync() { + this.CheckFileServicesInstallationAsync(null); + } + + /// + public void CheckFileServicesInstallationAsync(object userState) { + if ((this.CheckFileServicesInstallationOperationCompleted == null)) { + this.CheckFileServicesInstallationOperationCompleted = new System.Threading.SendOrPostCallback(this.OnCheckFileServicesInstallationOperationCompleted); + } + this.InvokeAsync("CheckFileServicesInstallation", new object[0], this.CheckFileServicesInstallationOperationCompleted, userState); + } + + private void OnCheckFileServicesInstallationOperationCompleted(object arg) { + if ((this.CheckFileServicesInstallationCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.CheckFileServicesInstallationCompleted(this, new CheckFileServicesInstallationCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + /// public new void CancelAsync(object userState) { base.CancelAsync(userState); @@ -354,4 +397,30 @@ namespace WebsitePanel.Providers.EnterpriseStorage { /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] public delegate void SetFolderQuotaCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void CheckFileServicesInstallationCompletedEventHandler(object sender, CheckFileServicesInstallationCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class CheckFileServicesInstallationCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal CheckFileServicesInstallationCompletedEventArgs(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])); + } + } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.Server/EnterpriseStorage.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/EnterpriseStorage.asmx.cs index 6d413784..2ebbc72c 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/EnterpriseStorage.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.Server/EnterpriseStorage.asmx.cs @@ -139,6 +139,23 @@ namespace WebsitePanel.Server throw; } } + + [WebMethod, SoapHeader("settings")] + public bool CheckFileServicesInstallation() + { + try + { + Log.WriteStart("'{0}' CheckFileServicesInstallation", ProviderSettings.ProviderName); + return EnterpriseStorageProvider.CheckFileServicesInstallation(); + Log.WriteEnd("'{0}' CheckFileServicesInstallation", ProviderSettings.ProviderName); + } + catch (Exception ex) + { + Log.WriteError(String.Format("'{0}' CheckFileServicesInstallation", ProviderSettings.ProviderName), ex); + throw; + } + } + } } 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 d39706a8..04733282 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/ES.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Framework/ES.cs @@ -218,6 +218,13 @@ namespace WebsitePanel.Portal { get { return GetCachedProxy(); } } + + + public esEnterpriseStorage EnterpriseStorage + { + get { return GetCachedProxy(); } + } + protected ES() { } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx.cs index 84738e50..8024ccf6 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ProviderControls/EnterpriseStorage_Settings.ascx.cs @@ -44,12 +44,11 @@ namespace WebsitePanel.Portal.ProviderControls { protected void Page_Load(object sender, EventArgs e) { - //CO Changes if (!IsPostBack) { try { - chkEnableHardQuota.Enabled = ES.Services.OperatingSystems.CheckFileServicesInstallation(PanelRequest.ServiceId); + chkEnableHardQuota.Enabled = ES.Services.EnterpriseStorage.CheckFileServicesInstallation(PanelRequest.ServiceId); txtLocationDrive.Enabled = chkEnableHardQuota.Enabled; valLocationDrive.Enabled = chkEnableHardQuota.Enabled; if (!chkEnableHardQuota.Enabled) @@ -59,25 +58,20 @@ namespace WebsitePanel.Portal.ProviderControls { } } - //END } public void BindSettings(StringDictionary settings) { txtFolder.Text = settings["UsersHome"]; - //CO Changes txtLocationDrive.Text = settings["LocationDrive"]; chkEnableHardQuota.Checked = settings["EnableHardQuota"] == "true" ? true : false; - //END } public void SaveSettings(StringDictionary settings) { settings["UsersHome"] = txtFolder.Text; - //CO Changes settings["LocationDrive"] = txtLocationDrive.Text; settings["EnableHardQuota"] = chkEnableHardQuota.Checked.ToString().ToLower(); - //END } } } \ No newline at end of file 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 689afdc0..5b17c066 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/WebsitePanel.Portal.Modules.csproj @@ -360,6 +360,13 @@ CRM2011_Settings.ascx + + EnterpriseStorage_Settings.ascx + ASPXCodeBehind + + + EnterpriseStorage_Settings.ascx + HeliconZoo_Settings.ascx ASPXCodeBehind @@ -3941,6 +3948,7 @@ + @@ -5143,6 +5151,7 @@ + Designer