From 6489ebb2a455c0a44688427085a826f4cbd7a51b Mon Sep 17 00:00:00 2001 From: Virtuworks Date: Thu, 2 Apr 2015 18:51:05 -0400 Subject: [PATCH 01/41] Added tag build-2.1.0.639 for changeset 673ab8323371 From fce7f6792af5eef609d5d27c46b2c00a85a225bd Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 3 Apr 2015 03:44:00 -0700 Subject: [PATCH 02/41] RDS Powershell disabled by GPO --- .../RdsServerSettings.cs | 3 + .../Windows2012.cs | 46 +++++++- .../SettingsRdsPolicy.ascx.resx | 3 + .../RDSEditUserExperience.ascx.resx | 3 + .../RDS/RDSEditUserExperience.ascx | 14 +++ .../RDS/RDSEditUserExperience.ascx.cs | 103 ++++++------------ .../RDSEditUserExperience.ascx.designer.cs | 36 ++++++ .../WebsitePanel/SettingsRdsPolicy.ascx | 14 +++ .../WebsitePanel/SettingsRdsPolicy.ascx.cs | 9 ++ .../SettingsRdsPolicy.ascx.designer.cs | 36 ++++++ 10 files changed, 195 insertions(+), 72 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServerSettings.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServerSettings.cs index beddb245..ad175a46 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServerSettings.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/RemoteDesktopServices/RdsServerSettings.cs @@ -45,6 +45,9 @@ namespace WebsitePanel.EnterpriseServer.Base.RDS public const string RDS_CONTROL_WITHOUT_PERMISSION = "RDSControlWithoutPermission"; public const string RDS_CONTROL_WITHOUT_PERMISSION_ADMINISTRATORS = "RDSControlWithoutPermissionAdministrators"; public const string RDS_CONTROL_WITHOUT_PERMISSION_Users = "RDSControlWithoutPermissionUsers"; + public const string DISABLE_CMD = "DisableCMD"; + public const string DISABLE_CMD_ADMINISTRATORS = "DisableCMDAdministrators"; + public const string DISABLE_CMD_USERS = "DisableCMDUsers"; public string SettingsName { get; set; } public int ServerId { get; set; } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 1f3b46ce..3fc744bf 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -95,6 +95,11 @@ namespace WebsitePanel.Providers.RemoteDesktopServices private const string HideCDriveGpoValueName = "NoDrives"; private const string RDSSessionGpoKey = @"HKCU\Software\Policies\Microsoft\Windows NT\Terminal Services"; private const string RDSSessionGpoValueName = "Shadow"; + private const string DisableCmdGpoKey = @"HKCU\Software\Policies\Microsoft\Windows\System"; + private const string DisableCmdGpoValueName = "DisableCMD"; + private const string DisallowRunParentKey = @"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer"; + private const string DisallowRunKey = @"HKCU\Software\Microsoft\Windows\CurrentVersion\Policies\Explorer\DisallowRun"; + private const string DisallowRunValueName = "DisallowRun"; #endregion @@ -1136,7 +1141,13 @@ namespace WebsitePanel.Providers.RemoteDesktopServices RemoveRegistryValue(runspace, RemoveRestartGpoKey, administratorsGpo); RemoveRegistryValue(runspace, RemoveRestartGpoKey, usersGpo); RemoveRegistryValue(runspace, DisableTaskManagerGpoKey, administratorsGpo); - RemoveRegistryValue(runspace, DisableTaskManagerGpoKey, usersGpo); + RemoveRegistryValue(runspace, DisableTaskManagerGpoKey, usersGpo); + RemoveRegistryValue(runspace, DisableCmdGpoKey, usersGpo); + RemoveRegistryValue(runspace, DisableCmdGpoKey, administratorsGpo); + RemoveRegistryValue(runspace, DisallowRunKey, usersGpo); + RemoveRegistryValue(runspace, DisallowRunParentKey, usersGpo); + RemoveRegistryValue(runspace, DisallowRunKey, administratorsGpo); + RemoveRegistryValue(runspace, DisallowRunParentKey, administratorsGpo); var setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.SCREEN_SAVER_DISABLED)); SetRegistryValue(setting, runspace, ScreenSaverGpoKey, administratorsGpo, usersGpo, ScreenSaverValueName, "0", "string"); @@ -1153,6 +1164,9 @@ namespace WebsitePanel.Providers.RemoteDesktopServices setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.HIDE_C_DRIVE)); SetRegistryValue(setting, runspace, HideCDriveGpoKey, administratorsGpo, usersGpo, HideCDriveGpoValueName, "4", "DWord"); + setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.DISABLE_CMD)); + SetRegistryValue(setting, runspace, DisableCmdGpoKey, administratorsGpo, usersGpo, DisableCmdGpoValueName, "1", "DWord"); + setting = serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.LOCK_SCREEN_TIMEOUT)); double result; @@ -1162,6 +1176,7 @@ namespace WebsitePanel.Providers.RemoteDesktopServices } SetRdsSessionHostPermissions(runspace, serverSettings, usersGpo, administratorsGpo); + SetPowershellPermissions(runspace, serverSettings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.REMOVE_POWERSHELL_COMMAND)), usersGpo, administratorsGpo); } finally { @@ -1169,6 +1184,24 @@ namespace WebsitePanel.Providers.RemoteDesktopServices } } + private void SetPowershellPermissions(Runspace runspace, RdsServerSetting setting, string usersGpo, string administratorsGpo) + { + if (setting != null) + { + SetRegistryValue(setting, runspace, DisallowRunParentKey, administratorsGpo, usersGpo, DisallowRunValueName, "1", "Dword"); + + if (setting.ApplyAdministrators) + { + SetRegistryValue(runspace, DisallowRunKey, administratorsGpo, "powershell.exe", "string"); + } + + if (setting.ApplyUsers) + { + SetRegistryValue(runspace, DisallowRunKey, usersGpo, "powershell.exe", "string"); + } + } + } + private void SetRdsSessionHostPermissions(Runspace runspace, RdsServerSettings settings, string usersGpo, string administratorsGpo) { var viewSetting = settings.Settings.FirstOrDefault(s => s.PropertyName.Equals(RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION)); @@ -1233,6 +1266,17 @@ namespace WebsitePanel.Providers.RemoteDesktopServices } } + private void SetRegistryValue(Runspace runspace, string key, string gpoName, string value, string type) + { + Command cmd = new Command("Set-GPRegistryValue"); + cmd.Parameters.Add("Name", gpoName); + cmd.Parameters.Add("Key", string.Format("\"{0}\"", key)); + cmd.Parameters.Add("Value", value); + cmd.Parameters.Add("Type", type); + + Collection result = ExecuteRemoteShellCommand(runspace, PrimaryDomainController, cmd); + } + private void SetRegistryValue(Runspace runspace, string key, string gpoName, string value, string valueName, string type) { Command cmd = new Command("Set-GPRegistryValue"); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsRdsPolicy.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsRdsPolicy.ascx.resx index 837eae3e..4e783a67 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsRdsPolicy.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/SettingsRdsPolicy.ascx.resx @@ -129,6 +129,9 @@ Control RDS Session without Users's Permission + + Disable Command Prompt + Drive Space Threshold diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditUserExperience.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditUserExperience.ascx.resx index a6355f92..1ba5fff1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditUserExperience.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/App_LocalResources/RDSEditUserExperience.ascx.resx @@ -129,6 +129,9 @@ Control RDS Session without Users's Permission + + Disable Command Prompt + Drive Space Threshold diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx index 44b5384b..c7cf7553 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx @@ -190,6 +190,20 @@
+ + + + + + + +
+ + + +
+
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs index 6fc1f396..e413b313 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs @@ -53,77 +53,16 @@ namespace WebsitePanel.Portal.RDS cbTimeoutUsers.Checked = setting.ApplyUsers; } - setting = GetServerSetting(settings, RdsServerSettings.REMOVE_RUN_COMMAND); - - if (setting != null) - { - cbRunCommandAdministrators.Checked = setting.ApplyAdministrators; - cbRunCommandUsers.Checked = setting.ApplyUsers; - } - - setting = GetServerSetting(settings, RdsServerSettings.REMOVE_POWERSHELL_COMMAND); - - if (setting != null) - { - cbPowershellAdministrators.Checked = setting.ApplyAdministrators; - cbPowershellUsers.Checked = setting.ApplyUsers; - } - - setting = GetServerSetting(settings, RdsServerSettings.HIDE_C_DRIVE); - - if (setting != null) - { - cbHideCDriveAdministrators.Checked = setting.ApplyAdministrators; - cbHideCDriveUsers.Checked = setting.ApplyUsers; - } - - setting = GetServerSetting(settings, RdsServerSettings.REMOVE_SHUTDOWN_RESTART); - - if (setting != null) - { - cbShutdownAdministrators.Checked = setting.ApplyAdministrators; - cbShutdownUsers.Checked = setting.ApplyUsers; - } - - setting = GetServerSetting(settings, RdsServerSettings.DISABLE_TASK_MANAGER); - - if (setting != null) - { - cbTaskManagerAdministrators.Checked = setting.ApplyAdministrators; - cbTaskManagerUsers.Checked = setting.ApplyUsers; - } - - setting = GetServerSetting(settings, RdsServerSettings.CHANGE_DESKTOP_DISABLED); - - if (setting != null) - { - cbDesktopAdministrators.Checked = setting.ApplyAdministrators; - cbDesktopUsers.Checked = setting.ApplyUsers; - } - - setting = GetServerSetting(settings, RdsServerSettings.SCREEN_SAVER_DISABLED); - - if (setting != null) - { - cbScreenSaverAdministrators.Checked = setting.ApplyAdministrators; - cbViewSessionUsers.Checked = setting.ApplyUsers; - } - - setting = GetServerSetting(settings, RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION); - - if (setting != null) - { - cbViewSessionAdministrators.Checked = setting.ApplyAdministrators; - cbScreenSaverUsers.Checked = setting.ApplyUsers; - } - - setting = GetServerSetting(settings, RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION); - - if (setting != null) - { - cbControlSessionAdministrators.Checked = setting.ApplyAdministrators; - cbControlSessionUsers.Checked = setting.ApplyUsers; - } + SetCheckboxes(settings, RdsServerSettings.REMOVE_RUN_COMMAND, cbRunCommandAdministrators, cbRunCommandUsers); + SetCheckboxes(settings, RdsServerSettings.REMOVE_POWERSHELL_COMMAND, cbPowershellAdministrators, cbPowershellUsers); + SetCheckboxes(settings, RdsServerSettings.HIDE_C_DRIVE, cbHideCDriveAdministrators, cbHideCDriveUsers); + SetCheckboxes(settings, RdsServerSettings.REMOVE_SHUTDOWN_RESTART, cbShutdownAdministrators, cbShutdownUsers); + SetCheckboxes(settings, RdsServerSettings.DISABLE_TASK_MANAGER, cbTaskManagerAdministrators, cbTaskManagerUsers); + SetCheckboxes(settings, RdsServerSettings.CHANGE_DESKTOP_DISABLED, cbDesktopAdministrators, cbDesktopUsers); + SetCheckboxes(settings, RdsServerSettings.SCREEN_SAVER_DISABLED, cbScreenSaverAdministrators, cbScreenSaverUsers); + SetCheckboxes(settings, RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION, cbViewSessionAdministrators, cbViewSessionUsers); + SetCheckboxes(settings, RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION, cbControlSessionAdministrators, cbControlSessionUsers); + SetCheckboxes(settings, RdsServerSettings.DISABLE_CMD, cbDisableCmdAdministrators, cbDisableCmdUsers); setting = GetServerSetting(settings, RdsServerSettings.DRIVE_SPACE_THRESHOLD); @@ -133,6 +72,17 @@ namespace WebsitePanel.Portal.RDS } } + private void SetCheckboxes(RdsServerSettings settings, string settingName, CheckBox cbAdministrators, CheckBox cbUsers) + { + var setting = GetServerSetting(settings, settingName); + + if (setting != null) + { + cbAdministrators.Checked = setting.ApplyAdministrators; + cbUsers.Checked = setting.ApplyUsers; + } + } + private RdsServerSetting GetServerSetting(RdsServerSettings settings, string propertyName) { return settings.Settings.FirstOrDefault(s => s.PropertyName.Equals(propertyName)); @@ -230,6 +180,14 @@ namespace WebsitePanel.Portal.RDS ApplyUsers = cbControlSessionUsers.Checked }); + settings.Settings.Add(new RdsServerSetting + { + PropertyName = RdsServerSettings.DISABLE_CMD, + PropertyValue = "", + ApplyAdministrators = cbDisableCmdAdministrators.Checked, + ApplyUsers = cbDisableCmdUsers.Checked + }); + return settings; } @@ -265,6 +223,9 @@ namespace WebsitePanel.Portal.RDS cbControlSessionAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_ADMINISTRATORS]); cbControlSessionUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_Users]); + cbDisableCmdAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.DISABLE_CMD_ADMINISTRATORS]); + cbDisableCmdUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.DISABLE_CMD_USERS]); + ddTreshold.SelectedValue = settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE]; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.designer.cs index 953e340e..b12d745a 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.designer.cs @@ -462,6 +462,42 @@ namespace WebsitePanel.Portal.RDS { /// protected global::System.Web.UI.WebControls.CheckBox cbControlSessionAdministrators; + /// + /// secDisableCmd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDisableCmd; + + /// + /// disableCmdPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel disableCmdPanel; + + /// + /// cbDisableCmdUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbDisableCmdUsers; + + /// + /// cbDisableCmdAdministrators control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbDisableCmdAdministrators; + /// /// buttonPanel control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx index 4d22c2e1..1f3300e5 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx @@ -166,4 +166,18 @@
+ + + + + + + + +
+ + + +
+
\ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.cs index ed9bab8c..3e28ef23 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.cs @@ -49,6 +49,9 @@ namespace WebsitePanel.Portal cbControlSessionAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_ADMINISTRATORS]); cbControlSessionUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_Users]); + cbDisableCmdAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.DISABLE_CMD_ADMINISTRATORS]); + cbDisableCmdUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.DISABLE_CMD_USERS]); + ddTreshold.SelectedValue = settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE]; } @@ -72,6 +75,12 @@ namespace WebsitePanel.Portal settings[RdsServerSettings.SCREEN_SAVER_DISABLED_ADMINISTRATORS] = cbScreenSaverAdministrators.Checked.ToString(); settings[RdsServerSettings.SCREEN_SAVER_DISABLED_USERS] = cbScreenSaverUsers.Checked.ToString(); settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE] = ddTreshold.SelectedValue; + settings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_ADMINISTRATORS] = cbViewSessionAdministrators.Checked.ToString(); + settings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_Users] = cbViewSessionUsers.Checked.ToString(); + settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_ADMINISTRATORS] = cbControlSessionAdministrators.Checked.ToString(); + settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_Users] = cbControlSessionUsers.Checked.ToString(); + settings[RdsServerSettings.DISABLE_CMD_ADMINISTRATORS] = cbDisableCmdAdministrators.Checked.ToString(); + settings[RdsServerSettings.DISABLE_CMD_USERS] = cbDisableCmdUsers.Checked.ToString(); } } } \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.designer.cs index 2b120670..9ecc5ff4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/SettingsRdsPolicy.ascx.designer.cs @@ -407,5 +407,41 @@ namespace WebsitePanel.Portal { /// To modify move field declaration from designer file to code-behind file. /// protected global::System.Web.UI.WebControls.CheckBox cbControlSessionAdministrators; + + /// + /// secDisableCmd control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.CollapsiblePanel secDisableCmd; + + /// + /// disableCmdPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel disableCmdPanel; + + /// + /// cbDisableCmdUsers control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbDisableCmdUsers; + + /// + /// cbDisableCmdAdministrators control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.CheckBox cbDisableCmdAdministrators; } } From ac46bfbff981074762d19ecb25d55768218382e9 Mon Sep 17 00:00:00 2001 From: vfedosevich Date: Fri, 3 Apr 2015 07:54:19 -0700 Subject: [PATCH 03/41] RDS GPO fixes --- .../RemoteDesktopServicesController.cs | 71 +++++++++++++------ .../Windows2012.cs | 2 + .../RDS/RDSEditUserExperience.ascx.cs | 44 +----------- .../RDS/UserControls/RDSCollectionTabs.ascx | 4 +- .../UserControls/RDSCollectionTabs.ascx.cs | 4 +- 5 files changed, 60 insertions(+), 65 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs index 9595fbab..4d7fd9ff 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/RemoteDesktopServices/RemoteDesktopServicesController.cs @@ -408,24 +408,7 @@ namespace WebsitePanel.EnterpriseServer var rds = GetRemoteDesktopServices(GetRdsServiceId(collection.ItemId)); Organization org = OrganizationController.GetOrganization(collection.ItemId); rds.ApplyGPO(org.OrganizationId, collection.Name, settings); - - XmlDocument doc = new XmlDocument(); - XmlElement nodeProps = doc.CreateElement("properties"); - - if (settings != null) - { - foreach (var setting in settings.Settings) - { - XmlElement nodeProp = doc.CreateElement("property"); - nodeProp.SetAttribute("name", setting.PropertyName); - nodeProp.SetAttribute("value", setting.PropertyValue); - nodeProp.SetAttribute("applyUsers", setting.ApplyUsers ? "1" : "0"); - nodeProp.SetAttribute("applyAdministrators", setting.ApplyAdministrators ? "1" : "0"); - nodeProps.AppendChild(nodeProp); - } - } - - string xml = nodeProps.OuterXml; + string xml = GetSettingsXml(settings); DataProvider.UpdateRdsServerSettings(serverId, settingsName, xml); @@ -792,8 +775,11 @@ namespace WebsitePanel.EnterpriseServer }; rds.CreateCollection(org.OrganizationId, collection); - rds.ApplyGPO(org.OrganizationId, collection.Name, GetDefaultGpoSettings()); - collection.Id = DataProvider.AddRDSCollection(itemId, collection.Name, collection.Description, collection.DisplayName); + var defaultGpoSettings = GetDefaultGpoSettings(); + rds.ApplyGPO(org.OrganizationId, collection.Name, defaultGpoSettings); + collection.Id = DataProvider.AddRDSCollection(itemId, collection.Name, collection.Description, collection.DisplayName); + string xml = GetSettingsXml(defaultGpoSettings); + DataProvider.UpdateRdsServerSettings(collection.Id, string.Format("Collection-{0}-Settings", collection.Id), xml); collection.Settings.RdsCollectionId = collection.Id; int settingsId = DataProvider.AddRdsCollectionSettings(collection.Settings); @@ -2142,7 +2128,52 @@ namespace WebsitePanel.EnterpriseServer ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.SCREEN_SAVER_DISABLED_USERS]) }); + settings.Settings.Add(new RdsServerSetting + { + PropertyName = RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION, + PropertyValue = "", + ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_ADMINISTRATORS]), + ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_Users]) + }); + + settings.Settings.Add(new RdsServerSetting + { + PropertyName = RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION, + PropertyValue = "", + ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_ADMINISTRATORS]), + ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_Users]) + }); + + settings.Settings.Add(new RdsServerSetting + { + PropertyName = RdsServerSettings.DISABLE_CMD, + PropertyValue = "", + ApplyAdministrators = Convert.ToBoolean(defaultSettings[RdsServerSettings.DISABLE_CMD_ADMINISTRATORS]), + ApplyUsers = Convert.ToBoolean(defaultSettings[RdsServerSettings.DISABLE_CMD_USERS]) + }); + return settings; } + + private static string GetSettingsXml(RdsServerSettings settings) + { + XmlDocument doc = new XmlDocument(); + XmlElement nodeProps = doc.CreateElement("properties"); + + if (settings != null) + { + foreach (var setting in settings.Settings) + { + XmlElement nodeProp = doc.CreateElement("property"); + nodeProp.SetAttribute("name", setting.PropertyName); + nodeProp.SetAttribute("value", setting.PropertyValue); + nodeProp.SetAttribute("applyUsers", setting.ApplyUsers ? "1" : "0"); + nodeProp.SetAttribute("applyAdministrators", setting.ApplyAdministrators ? "1" : "0"); + nodeProps.AppendChild(nodeProp); + } + } + + return nodeProps.OuterXml; + } } } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs index 3fc744bf..95bfca5d 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.TerminalServices.Windows2012/Windows2012.cs @@ -1135,6 +1135,8 @@ namespace WebsitePanel.Providers.RemoteDesktopServices { runspace = OpenRunspace(); + CreatePolicy(runspace, organizationId, string.Format("{0}-administrators", collectionName), new DirectoryEntry(GetGroupPath(organizationId, collectionName, GetLocalAdminsGroupName(collectionName))), collectionName); + CreatePolicy(runspace, organizationId, string.Format("{0}-users", collectionName), new DirectoryEntry(GetUsersGroupPath(organizationId, collectionName)), collectionName); CreateHelpDeskPolicy(runspace, new DirectoryEntry(GetHelpDeskGroupPath(RDSHelpDeskGroup)), organizationId, collectionName); RemoveRegistryValue(runspace, ScreenSaverGpoKey, administratorsGpo); RemoveRegistryValue(runspace, ScreenSaverGpoKey, usersGpo); diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs index e413b313..19e11012 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/RDSEditUserExperience.ascx.cs @@ -33,8 +33,8 @@ namespace WebsitePanel.Portal.RDS if (serverSettings == null || !serverSettings.Settings.Any()) { - var defaultSettings = ES.Services.Users.GetUserSettings(PanelSecurity.LoggedUserId, UserSettings.RDS_POLICY); - BindDefaultSettings(defaultSettings); + ddTimeout.SelectedValue = ""; + ddTreshold.SelectedValue = ""; } else { @@ -189,45 +189,7 @@ namespace WebsitePanel.Portal.RDS }); return settings; - } - - private void BindDefaultSettings(UserSettings settings) - { - ddTimeout.SelectedValue = settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_VALUE]; - cbTimeoutAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_ADMINISTRATORS]); - cbTimeoutUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.LOCK_SCREEN_TIMEOUT_USERS]); - - cbRunCommandAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.REMOVE_RUN_COMMAND_ADMINISTRATORS]); - cbRunCommandUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.REMOVE_RUN_COMMAND_USERS]); - - cbPowershellAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.REMOVE_POWERSHELL_COMMAND_ADMINISTRATORS]); - cbPowershellUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.REMOVE_POWERSHELL_COMMAND_USERS]); - - cbHideCDriveAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.HIDE_C_DRIVE_ADMINISTRATORS]); - cbHideCDriveUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.HIDE_C_DRIVE_USERS]); - - cbShutdownAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.REMOVE_SHUTDOWN_RESTART_ADMINISTRATORS]); - cbShutdownUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.REMOVE_SHUTDOWN_RESTART_USERS]); - - cbTaskManagerAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.DISABLE_TASK_MANAGER_ADMINISTRATORS]); - cbTaskManagerUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.DISABLE_TASK_MANAGER_USERS]); - - cbDesktopAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.CHANGE_DESKTOP_DISABLED_ADMINISTRATORS]); - cbDesktopUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.CHANGE_DESKTOP_DISABLED_USERS]); - - cbScreenSaverAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.SCREEN_SAVER_DISABLED_ADMINISTRATORS]); - cbScreenSaverUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.SCREEN_SAVER_DISABLED_USERS]); - - cbViewSessionAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_ADMINISTRATORS]); - cbViewSessionUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_VIEW_WITHOUT_PERMISSION_Users]); - cbControlSessionAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_ADMINISTRATORS]); - cbControlSessionUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.RDS_CONTROL_WITHOUT_PERMISSION_Users]); - - cbDisableCmdAdministrators.Checked = Convert.ToBoolean(settings[RdsServerSettings.DISABLE_CMD_ADMINISTRATORS]); - cbDisableCmdUsers.Checked = Convert.ToBoolean(settings[RdsServerSettings.DISABLE_CMD_USERS]); - - ddTreshold.SelectedValue = settings[RdsServerSettings.DRIVE_SPACE_THRESHOLD_VALUE]; - } + } private bool SaveServerSettings() { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx index 35aa06a7..9f434613 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx @@ -5,13 +5,13 @@ - + <%# Eval("Name") %> - + <%# Eval("Name") %> diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs index 57e12294..cb563662 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/RDS/UserControls/RDSCollectionTabs.ascx.cs @@ -22,11 +22,11 @@ namespace WebsitePanel.Portal.RDS.UserControls List tabsList = new List(); tabsList.Add(CreateTab("rds_edit_collection", "Tab.RdsServers")); tabsList.Add(CreateTab("rds_edit_collection_settings", "Tab.Settings")); + tabsList.Add(CreateTab("rds_collection_user_experience", "Tab.UserExperience")); tabsList.Add(CreateTab("rds_collection_edit_apps", "Tab.RdsApplications")); tabsList.Add(CreateTab("rds_collection_edit_users", "Tab.RdsUsers")); tabsList.Add(CreateTab("rds_collection_user_sessions", "Tab.UserSessions")); - tabsList.Add(CreateTab("rds_collection_local_admins", "Tab.LocalAdmins")); - tabsList.Add(CreateTab("rds_collection_user_experience", "Tab.UserExperience")); + tabsList.Add(CreateTab("rds_collection_local_admins", "Tab.LocalAdmins")); tabsList.Add(CreateTab("rds_setup_letter", "Tab.RdsSetupLetter")); int idx = 0; From 919900b8a14a5e8b5023231bf298363d04b4e2a6 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 5 Apr 2015 07:48:45 +0800 Subject: [PATCH 04/41] Sharepoint Enterprise 2013 provider --- WebsitePanel/Database/update_db.sql | 32 +- .../Packages/Quotas.cs | 3 + .../Servers/ResourceGroups.cs | 1 + .../WebsitePanel.EnterpriseServer.Base.csproj | 4 +- .../HostedSolution/OrganizationController.cs | 31 + .../HostedSharePointServerController.cs | 35 +- .../HostedSharePointServerEntController.cs | 1020 +++++++++++++++++ .../WebsitePanel.EnterpriseServer.Code.csproj | 5 +- .../WebsitePanel.EnterpriseServer.csproj | 16 +- .../esHostedSharePointServers.asmx.cs | 14 +- .../esHostedSharePointServersEnt.asmx | 1 + .../esHostedSharePointServersEnt.asmx.cs | 237 ++++ .../HostedSolution/Organization.cs | 16 + .../HostedSolution/OrganizationStatistics.cs | 15 + .../SharePoint/IHostedSharePointServerEnt.cs | 120 ++ .../WebsitePanel.Providers.Base.csproj | 1 + .../HostedSharePointServer2013Ent.cs | 352 ++++++ .../HostedSharePointServer2013EntImpl.cs | 851 ++++++++++++++ .../Properties/AssemblyInfo.cs | 36 + ...rs.HostedSolution.SharePoint2013Ent.csproj | 75 ++ .../HostedSharePointServerEntProxy.cs | 928 +++++++++++++++ .../WebsitePanel.Server.Client.csproj | 1 + WebsitePanel/Sources/WebsitePanel.Server.sln | 14 +- .../HostedSharePointServerEnt.asmx | 1 + .../HostedSharePointServerEnt.asmx.cs | 274 +++++ .../WebsitePanel.Server.csproj | 7 + .../Sources/generate_server_proxies.bat | 11 +- 27 files changed, 4056 insertions(+), 45 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.Base/SharePoint/IHostedSharePointServerEnt.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/HostedSharePointServer2013Ent.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/HostedSharePointServer2013EntImpl.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/Properties/AssemblyInfo.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent.csproj create mode 100644 WebsitePanel/Sources/WebsitePanel.Server.Client/HostedSharePointServerEntProxy.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.Server/HostedSharePointServerEnt.asmx create mode 100644 WebsitePanel/Sources/WebsitePanel.Server/HostedSharePointServerEnt.asmx.cs diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 228701b7..9470c435 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -9461,4 +9461,34 @@ END GO -UPDATE [dbo].[Quotas] SET GroupID = 45 WHERE QuotaName = 'EnterpriseStorage.DriveMaps' \ No newline at end of file +UPDATE [dbo].[Quotas] SET GroupID = 45 WHERE QuotaName = 'EnterpriseStorage.DriveMaps' + + +UPDATE [dbo].[ResourceGroups] SET GroupName = 'Sharepoint Enterprise Server' WHERE GroupName = 'Sharepoint Server' +GO + +IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Hosted SharePoint Enterprise 2013') +BEGIN +DECLARE @provider_id AS INT +DECLARE @group_id AS INT +SELECT @group_id = GroupId FROM [dbo].[ResourceGroups] WHERE GroupName = 'Sharepoint Enterprise Server' +SELECT TOP 1 @provider_id = ProviderId + 1 From [dbo].[Providers] ORDER BY ProviderID DESC +INSERT [dbo].[Providers] ([ProviderID], [GroupID], [ProviderName], [DisplayName], [ProviderType], [EditorControl], [DisableAutoDiscovery]) +VALUES (@provider_id, @group_id, N'HostedSharePoint2013Ent', N'Hosted SharePoint Enterprise 2013', N'WebsitePanel.Providers.HostedSolution.HostedSharePointServer2013Ent, WebsitePanel.Providers.HostedSolution.SharePoint2013Ent', N'HostedSharePoint30', NULL) +END +GO + +UPDATE Providers SET ProviderType = N'WebsitePanel.Providers.HostedSolution.HostedSharePointServer2013Ent, WebsitePanel.Providers.HostedSolution.SharePoint2013Ent' WHERE ProviderID = 1301 +GO + +UPDATE [dbo].[Quotas] SET QuotaName = 'HostedSharePointEnterprise.Sites' WHERE QuotaId = 550 +GO + +UPDATE [dbo].[Quotas] SET QuotaName = 'HostedSharePointEnterprise.MaxStorage' WHERE QuotaId = 551 +GO + +UPDATE [dbo].[Quotas] SET QuotaName = 'HostedSharePointEnterprise.UseSharedSSL' WHERE QuotaId = 552 +GO + +UPDATE [dbo].[ServiceItemTypes] SET DisplayName = 'SharePointEnterpriseSiteCollection' WHERE DisplayName = 'SharePointSiteCollection' +GO \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs index 47155cb1..ed021ce8 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Packages/Quotas.cs @@ -154,6 +154,9 @@ order by rg.groupOrder public const string HOSTED_SHAREPOINT_SITES = "HostedSharePoint.Sites"; // Hosted SharePoint Sites public const string HOSTED_SHAREPOINT_STORAGE_SIZE = "HostedSharePoint.MaxStorage"; // Hosted SharePoint storage size; public const string HOSTED_SHAREPOINT_USESHAREDSSL = "HostedSharePoint.UseSharedSSL"; // Hosted SharePoint Use Shared SSL Root + public const string HOSTED_SHAREPOINT_ENTERPRISE_SITES = "HostedSharePointEnterprise.Sites"; // Hosted SharePoint Sites + public const string HOSTED_SHAREPOINT_ENTERPRISE_STORAGE_SIZE = "HostedSharePointEnterprise.MaxStorage"; // Hosted SharePoint storage size; + public const string HOSTED_SHAREPOINT_ENTERPRISE_USESHAREDSSL = "HostedSharePointEnterprise.UseSharedSSL"; // Hosted SharePoint Use Shared SSL Root public const string DNS_EDITOR = "DNS.Editor"; // DNS Editor public const string DNS_ZONES = "DNS.Zones"; // DNS Editor public const string DNS_PRIMARY_ZONES = "DNS.PrimaryZones"; // DNS Editor diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs index 0e412bfb..f610eec3 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/Servers/ResourceGroups.cs @@ -45,6 +45,7 @@ namespace WebsitePanel.EnterpriseServer public const string Statistics = "Statistics"; public const string SharePoint = "SharePoint"; public const string SharepointFoundationServer = "Sharepoint Foundation Server"; + public const string SharepointEnterpriseServer = "Sharepoint Enterprise Server"; public const string SharepointServer = "Sharepoint Server"; public const string Exchange = "Exchange"; public const string HostedOrganizations = "Hosted Organizations"; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj index 9f9c3763..ba6f30a1 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Base/WebsitePanel.EnterpriseServer.Base.csproj @@ -39,7 +39,7 @@ true full false - ..\..\Bin\ + ..\WebsitePanel.EnterpriseServer\bin\ DEBUG;TRACE prompt 4 @@ -49,7 +49,7 @@ none true - ..\..\Bin\ + ..\WebsitePanel.EnterpriseServer\bin\ TRACE prompt 4 diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index 57d9ea5f..c56aa486 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -381,6 +381,13 @@ namespace WebsitePanel.EnterpriseServer if (cntx.Quotas[Quotas.HOSTED_SHAREPOINT_STORAGE_SIZE] != null) org.WarningSharePointStorage = cntx.Quotas[Quotas.HOSTED_SHAREPOINT_STORAGE_SIZE].QuotaAllocatedValue; + if (cntx.Quotas[Quotas.HOSTED_SHAREPOINT_ENTERPRISE_STORAGE_SIZE] != null) + org.MaxSharePointEnterpriseStorage = cntx.Quotas[Quotas.HOSTED_SHAREPOINT_ENTERPRISE_STORAGE_SIZE].QuotaAllocatedValue; + + + if (cntx.Quotas[Quotas.HOSTED_SHAREPOINT_ENTERPRISE_STORAGE_SIZE] != null) + org.WarningSharePointEnterpriseStorage = cntx.Quotas[Quotas.HOSTED_SHAREPOINT_ENTERPRISE_STORAGE_SIZE].QuotaAllocatedValue; + //add organization to package items itemId = AddOrganizationToPackageItems(org, serviceId, packageId, organizationName, organizationId, domainName); @@ -668,6 +675,16 @@ namespace WebsitePanel.EnterpriseServer TaskManager.WriteError(ex); } + try + { + HostedSharePointServerEntController.DeleteSiteCollections(itemId); + } + catch (Exception ex) + { + successful = false; + TaskManager.WriteError(ex); + } + if (org.IsOCSOrganization) { DeleteOCSUsers(itemId, ref successful); @@ -937,7 +954,9 @@ namespace WebsitePanel.EnterpriseServer stats.CreatedUsers = 5; stats.AllocatedUsers = 10; stats.CreatedSharePointSiteCollections = 1; + stats.CreatedSharePointEnterpriseSiteCollections = 1; stats.AllocatedSharePointSiteCollections = 5; + stats.AllocatedSharePointEnterpriseSiteCollections = 5; return stats; } #endregion @@ -969,6 +988,13 @@ namespace WebsitePanel.EnterpriseServer stats.CreatedSharePointSiteCollections = sharePointStats.TotalRowCount; } + if (cntxTmp.Groups.ContainsKey(ResourceGroups.SharepointEnterpriseServer)) + { + SharePointSiteCollectionListPaged sharePointStats = HostedSharePointServerEntController.GetSiteCollectionsPaged(org.PackageId, org.Id, string.Empty, string.Empty, string.Empty, 0, 0); + stats.CreatedSharePointEnterpriseSiteCollections = sharePointStats.TotalRowCount; + } + + if (cntxTmp.Groups.ContainsKey(ResourceGroups.HostedCRM)) { stats.CreatedCRMUsers = CRMController.GetCRMUsersCount(org.Id, string.Empty, string.Empty, CRMUserLycenseTypes.FULL).Value; @@ -1117,6 +1143,11 @@ namespace WebsitePanel.EnterpriseServer stats.AllocatedSharePointSiteCollections = cntx.Quotas[Quotas.HOSTED_SHAREPOINT_SITES].QuotaAllocatedValue; } + if (cntx.Groups.ContainsKey(ResourceGroups.SharepointEnterpriseServer)) + { + stats.AllocatedSharePointEnterpriseSiteCollections = cntx.Quotas[Quotas.HOSTED_SHAREPOINT_ENTERPRISE_SITES].QuotaAllocatedValue; + } + if (cntx.Groups.ContainsKey(ResourceGroups.HostedCRM)) { stats.AllocatedCRMUsers = cntx.Quotas[Quotas.CRM_USERS].QuotaAllocatedValue; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerController.cs index 3915a855..a03a95ca 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerController.cs @@ -58,18 +58,18 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint /// Row index to start from. /// Maximum number of rows to retrieve. /// Site collections that match. - public static SharePointSiteCollectionListPaged GetSiteCollectionsPaged(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, string groupName = null) + public static SharePointSiteCollectionListPaged GetSiteCollectionsPaged(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { if (IsDemoMode) { SharePointSiteCollectionListPaged demoResult = new SharePointSiteCollectionListPaged(); - demoResult.SiteCollections = GetSiteCollections(1, false, null); + demoResult.SiteCollections = GetSiteCollections(1, false); demoResult.TotalRowCount = demoResult.SiteCollections.Count; return demoResult; } SharePointSiteCollectionListPaged paged = new SharePointSiteCollectionListPaged(); - DataSet result = PackageController.GetRawPackageItemsPaged(packageId, groupName, typeof(SharePointSiteCollection), + DataSet result = PackageController.GetRawPackageItemsPaged(packageId, typeof(SharePointSiteCollection), true, filterColumn, filterValue, sortColumn, startRow, Int32.MaxValue); List items = PackageController.CreateServiceItemsList(result, 1).ConvertAll(delegate(ServiceProviderItem item) { return (SharePointSiteCollection)item; }); @@ -149,9 +149,8 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint /// /// Package that owns site collections. /// A value which shows whether nested spaces must be searched as well. - /// Resource group name. /// List of found site collections. - public static List GetSiteCollections(int packageId, bool recursive, string groupName) + public static List GetSiteCollections(int packageId, bool recursive) { if (IsDemoMode) { @@ -184,7 +183,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint } - List items = PackageController.GetPackageItemsByType(packageId, groupName, typeof(SharePointSiteCollection), recursive); + List items = PackageController.GetPackageItemsByType(packageId, typeof(SharePointSiteCollection), recursive); return items.ConvertAll(delegate(ServiceProviderItem item) { return (SharePointSiteCollection)item; }); } @@ -197,7 +196,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint { if (IsDemoMode) { - return GetSiteCollections(1, false, null)[itemId - 1]; + return GetSiteCollections(1, false)[itemId - 1]; } SharePointSiteCollection item = PackageController.GetPackageItem(itemId) as SharePointSiteCollection; @@ -208,9 +207,8 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint /// Adds SharePoint site collection. /// /// Site collection description. - /// Resource group name. /// Created site collection id within metabase. - public static int AddSiteCollection(SharePointSiteCollection item, string groupName) + public static int AddSiteCollection(SharePointSiteCollection item) { // Check account. @@ -238,7 +236,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint } // Check if stats resource is available - int serviceId = PackageController.GetPackageServiceId(item.PackageId, groupName); + int serviceId = PackageController.GetPackageServiceId(item.PackageId, ResourceGroups.SharepointFoundationServer); if (serviceId == 0) { @@ -276,7 +274,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint item.Name = String.Format("{0}://{1}", rootWebApplicationUri.Scheme, hostNameBase + "-" + counter.ToString() + "." + sslRoot); siteName = String.Format("{0}", hostNameBase + "-" + counter.ToString() + "." + sslRoot); - while (CheckServiceItemExists(item.Name, item.PackageId)) + while ( DataProvider. CheckServiceItemExists( serviceId, item. Name, "WebsitePanel.Providers.SharePoint.SharePointSiteCollection, WebsitePanel.Providers.Base")) { counter++; item.Name = String.Format("{0}://{1}", rootWebApplicationUri.Scheme, hostNameBase + "-" + counter.ToString() + "." + sslRoot); @@ -306,7 +304,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint // Check package item with given name already exists. - if (PackageController.GetPackageItemByName(item.PackageId, groupName, item.Name, typeof(SharePointSiteCollection)) != null) + if (PackageController.GetPackageItemByName(item.PackageId, item.Name, typeof(SharePointSiteCollection)) != null) { return BusinessErrorCodes.ERROR_SHAREPOINT_PACKAGE_ITEM_EXISTS; } @@ -1016,16 +1014,5 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint } } - private static bool CheckServiceItemExists(string name, int packageId) - { - bool exists = PackageController.GetPackageItemByName(packageId, ResourceGroups.SharepointFoundationServer, name, typeof(SharePointSiteCollection)) != null; - - if (!exists) - { - exists = PackageController.GetPackageItemByName(packageId, ResourceGroups.SharepointServer, name, typeof(SharePointSiteCollection)) != null; - } - - return exists; - } - } + } } diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs new file mode 100644 index 00000000..87c147e1 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs @@ -0,0 +1,1020 @@ +// Copyright (c) 2015, 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.Collections.Specialized; +using System.Data; +using System.IO; +using System.Xml; +using System.Xml.Serialization; +using WebsitePanel.Providers; +using WebsitePanel.Providers.DNS; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.SharePoint; + +namespace WebsitePanel.EnterpriseServer.Code.SharePoint +{ + /// + /// Exposes handful API on hosted SharePoint site collections management. + /// + public class HostedSharePointServerEntController : IImportController, IBackupController + { + private const int FILE_BUFFER_LENGTH = 5000000; // ~5MB + + /// + /// Gets site collections in raw form. + /// + /// Package to which desired site collections belong. + /// Organization to which desired site collections belong. + /// Filter column name. + /// Filter value. + /// Sort column name. + /// Row index to start from. + /// Maximum number of rows to retrieve. + /// Site collections that match. + public static SharePointSiteCollectionListPaged GetSiteCollectionsPaged(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, string groupName = null) + { + if (IsDemoMode) + { + SharePointSiteCollectionListPaged demoResult = new SharePointSiteCollectionListPaged(); + demoResult.SiteCollections = GetSiteCollections(1, false); + demoResult.TotalRowCount = demoResult.SiteCollections.Count; + return demoResult; + } + + SharePointSiteCollectionListPaged paged = new SharePointSiteCollectionListPaged(); + DataSet result = PackageController.GetRawPackageItemsPaged(packageId, typeof(SharePointSiteCollection), + true, filterColumn, filterValue, sortColumn, startRow, Int32.MaxValue); + List items = PackageController.CreateServiceItemsList(result, 1).ConvertAll(delegate(ServiceProviderItem item) { return (SharePointSiteCollection)item; }); + + if (organizationId > 0) + { + items = items.FindAll(delegate(SharePointSiteCollection siteCollection) { return siteCollection.OrganizationId == organizationId; }); + } + paged.TotalRowCount = items.Count; + + if (items.Count > maximumRows) + { + items.RemoveRange(maximumRows, items.Count - maximumRows); + } + + paged.SiteCollections = items; + + return paged; + } + + public static List GetSiteCollections(int organizationId) + { + Organization org = OrganizationController.GetOrganization(organizationId); + + List items = PackageController.GetPackageItemsByType(org.PackageId, typeof(SharePointSiteCollection), false); + items.ConvertAll(delegate(ServiceProviderItem item) { return (SharePointSiteCollection)item; }); + List ret = new List(); + foreach (ServiceProviderItem item in items) + { + SharePointSiteCollection siteCollection = item as SharePointSiteCollection; + if (siteCollection != null && siteCollection.OrganizationId == organizationId) + { + ret.Add(siteCollection); + } + } + + return ret; + } + + /// + /// Gets list of supported languages by this installation of SharePoint. + /// + /// List of supported languages + public static int[] GetSupportedLanguages(int packageId) + { + if (IsDemoMode) + { + return new int[] { 1033 }; + } + + // Log operation. + TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "GET_LANGUAGES"); + + int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointFoundationServer); + if (serviceId == 0) + { + return new int[] { }; + } + + try + { + // Create site collection on server. + HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(serviceId); + return hostedSharePointServer.Enterprise_GetSupportedLanguages(); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + /// + /// Gets list of SharePoint site collections that belong to the package. + /// + /// Package that owns site collections. + /// A value which shows whether nested spaces must be searched as well. + /// Resource group name. + /// List of found site collections. + public static List GetSiteCollections(int packageId, bool recursive) + { + if (IsDemoMode) + { + List demoResult = new List(); + SharePointSiteCollection siteCollection1 = new SharePointSiteCollection(); + siteCollection1.Id = 1; + siteCollection1.OrganizationId = 1; + siteCollection1.LocaleId = 1033; + siteCollection1.Name = "http://john.fabrikam.com"; + siteCollection1.OwnerEmail = "john@fabrikam.com"; + siteCollection1.OwnerLogin = "john@fabrikam.com"; + siteCollection1.OwnerName = "John Smith"; + siteCollection1.PhysicalAddress = "http://john.fabrikam.com"; + siteCollection1.Title = "John Smith's Team Site"; + siteCollection1.Url = "http://john.fabrikam.com"; + demoResult.Add(siteCollection1); + SharePointSiteCollection siteCollection2 = new SharePointSiteCollection(); + siteCollection2.Id = 2; + siteCollection1.OrganizationId = 1; + siteCollection2.LocaleId = 1033; + siteCollection2.Name = "http://mark.contoso.com"; + siteCollection2.OwnerEmail = "mark@contoso.com"; + siteCollection2.OwnerLogin = "mark@contoso.com"; + siteCollection2.OwnerName = "Mark Jonsons"; + siteCollection2.PhysicalAddress = "http://mark.contoso.com"; + siteCollection2.Title = "Mark Jonsons' Blog"; + siteCollection2.Url = "http://mark.contoso.com"; + demoResult.Add(siteCollection2); + return demoResult; + } + + + List items = PackageController.GetPackageItemsByType(packageId, typeof(SharePointSiteCollection), recursive); + return items.ConvertAll(delegate(ServiceProviderItem item) { return (SharePointSiteCollection)item; }); + } + + /// + /// Gets SharePoint site collection with given id. + /// + /// Site collection id within metabase. + /// Site collection or null in case no such item exist. + public static SharePointSiteCollection GetSiteCollection(int itemId) + { + if (IsDemoMode) + { + return GetSiteCollections(1, false)[itemId - 1]; + } + + SharePointSiteCollection item = PackageController.GetPackageItem(itemId) as SharePointSiteCollection; + return item; + } + + /// + /// Adds SharePoint site collection. + /// + /// Site collection description. + /// Resource group name. + /// Created site collection id within metabase. + public static int AddSiteCollection(SharePointSiteCollection item) + { + + // Check account. + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) + { + return accountCheck; + } + + // Check package. + int packageCheck = SecurityContext.CheckPackage(item.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) + { + return packageCheck; + } + + // Check quota. + OrganizationStatistics orgStats = OrganizationController.GetOrganizationStatistics(item.OrganizationId); + //QuotaValueInfo quota = PackageController.GetPackageQuota(item.PackageId, Quotas.HOSTED_SHAREPOINT_SITES); + + if (orgStats.AllocatedSharePointEnterpriseSiteCollections > -1 + && orgStats.CreatedSharePointEnterpriseSiteCollections >= orgStats.AllocatedSharePointEnterpriseSiteCollections) + { + return BusinessErrorCodes.ERROR_SHAREPOINT_RESOURCE_QUOTA_LIMIT; + } + + // Check if stats resource is available + int serviceId = PackageController.GetPackageServiceId(item.PackageId, ResourceGroups.SharepointEnterpriseServer); + + if (serviceId == 0) + { + return BusinessErrorCodes.ERROR_SHAREPOINT_RESOURCE_UNAVAILABLE; + } + + StringDictionary hostedSharePointSettings = ServerController.GetServiceSettings(serviceId); + QuotaValueInfo quota = PackageController.GetPackageQuota(item.PackageId, Quotas.HOSTED_SHAREPOINT_ENTERPRISE_USESHAREDSSL); + Uri rootWebApplicationUri = new Uri(hostedSharePointSettings["RootWebApplicationUri"]); + Organization org = OrganizationController.GetOrganization(item.OrganizationId); + string siteName = item.Name; + + if (quota.QuotaAllocatedValue == 1) + { + string sslRoot = hostedSharePointSettings["SharedSSLRoot"]; + + + string defaultDomain = org.DefaultDomain; + string hostNameBase = string.Empty; + + string[] tmp = defaultDomain.Split('.'); + if (tmp.Length == 2) + { + hostNameBase = tmp[0]; + } + else + { + if (tmp.Length > 2) + { + hostNameBase = tmp[0] + tmp[1]; + } + } + + int counter = 0; + item.Name = String.Format("{0}://{1}", rootWebApplicationUri.Scheme, hostNameBase + "-" + counter.ToString() + "." + sslRoot); + siteName = String.Format("{0}", hostNameBase + "-" + counter.ToString() + "." + sslRoot); + + while (DataProvider.CheckServiceItemExists(serviceId, item.Name, "WebsitePanel. Providers. SharePoint. SharePointSiteCollection, WebsitePanel. Providers. Base")) + { + counter++; + item.Name = String.Format("{0}://{1}", rootWebApplicationUri.Scheme, hostNameBase + "-" + counter.ToString() + "." + sslRoot); + siteName = String.Format("{0}", hostNameBase + "-" + counter.ToString() + "." + sslRoot); + } + } + else + item.Name = String.Format("{0}://{1}", rootWebApplicationUri.Scheme, item.Name); + + if (rootWebApplicationUri.Port > 0 && rootWebApplicationUri.Port != 80 && rootWebApplicationUri.Port != 443) + { + item.PhysicalAddress = String.Format("{0}:{1}", item.Name, rootWebApplicationUri.Port); + } + else + { + item.PhysicalAddress = item.Name; + } + + if (Utils.ParseBool(hostedSharePointSettings["LocalHostFile"], false)) + { + item.RootWebApplicationInteralIpAddress = hostedSharePointSettings["RootWebApplicationInteralIpAddress"]; + item.RootWebApplicationFQDN = item.Name.Replace(rootWebApplicationUri.Scheme + "://", ""); + } + + item.MaxSiteStorage = RecalculateMaxSize(org.MaxSharePointEnterpriseStorage, (int)item.MaxSiteStorage); + item.WarningStorage = item.MaxSiteStorage == -1 ? -1 : Math.Min((int)item.WarningStorage, item.MaxSiteStorage); + + + // Check package item with given name already exists. + if (PackageController.GetPackageItemByName(item.PackageId, item.Name, typeof(SharePointSiteCollection)) != null) + { + return BusinessErrorCodes.ERROR_SHAREPOINT_PACKAGE_ITEM_EXISTS; + } + + // Log operation. + TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "ADD_SITE_COLLECTION", item.Name); + + try + { + // Create site collection on server. + HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(serviceId); + + hostedSharePointServer.Enterprise_CreateSiteCollection(item); + + // Make record in metabase. + item.ServiceId = serviceId; + int itemId = PackageController.AddPackageItem(item); + + hostedSharePointServer.Enterprise_SetPeoplePickerOu(item.Name, org.DistinguishedName); + + int dnsServiceId = PackageController.GetPackageServiceId(item.PackageId, ResourceGroups.Dns); + if (dnsServiceId > 0) + { + string[] tmpStr = siteName.Split('.'); + string hostName = tmpStr[0]; + string domainName = siteName.Substring(hostName.Length + 1, siteName.Length - (hostName.Length + 1)); + + List dnsRecords = ServerController.GetDnsRecordsByService(serviceId); + List resourceRecords = DnsServerController.BuildDnsResourceRecords(dnsRecords, hostName, domainName, ""); + DNSServer dns = new DNSServer(); + + ServiceProviderProxy.Init(dns, dnsServiceId); + // add new resource records + dns.AddZoneRecords(domainName, resourceRecords.ToArray()); + } + + TaskManager.ItemId = itemId; + + return itemId; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + /// + /// Deletes SharePoint site collection with given id. + /// + /// Site collection id within metabase. + /// ? + public static int DeleteSiteCollection(int itemId) + { + // Check account. + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) + { + return accountCheck; + } + + // Load original meta item + SharePointSiteCollection origItem = (SharePointSiteCollection)PackageController.GetPackageItem(itemId); + if (origItem == null) + { + return BusinessErrorCodes.ERROR_SHAREPOINT_PACKAGE_ITEM_NOT_FOUND; + } + + // Get service settings. + StringDictionary hostedSharePointSettings = ServerController.GetServiceSettings(origItem.ServiceId); + Uri rootWebApplicationUri = new Uri(hostedSharePointSettings["RootWebApplicationUri"]); + string siteName = origItem.Name.Replace(String.Format("{0}://", rootWebApplicationUri.Scheme), String.Empty); + + // Log operation. + TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "DELETE_SITE", origItem.Name, itemId); + + try + { + // Delete site collection on server. + HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(origItem.ServiceId); + hostedSharePointServer.Enterprise_DeleteSiteCollection(origItem); + // Delete record in metabase. + PackageController.DeletePackageItem(origItem.Id); + + int dnsServiceId = PackageController.GetPackageServiceId(origItem.PackageId, ResourceGroups.Dns); + if (dnsServiceId > 0) + { + string[] tmpStr = siteName.Split('.'); + string hostName = tmpStr[0]; + string domainName = siteName.Substring(hostName.Length + 1, siteName.Length - (hostName.Length + 1)); + + List dnsRecords = ServerController.GetDnsRecordsByService(origItem.ServiceId); + List resourceRecords = DnsServerController.BuildDnsResourceRecords(dnsRecords, hostName, domainName, ""); + DNSServer dns = new DNSServer(); + + ServiceProviderProxy.Init(dns, dnsServiceId); + // add new resource records + dns.DeleteZoneRecords(domainName, resourceRecords.ToArray()); + } + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + /// + /// Deletes SharePoint site collections which belong to organization. + /// + /// Site collection id within metabase. + public static void DeleteSiteCollections(int organizationId) + { + Organization org = OrganizationController.GetOrganization(organizationId); + SharePointSiteCollectionListPaged existentSiteCollections = GetSiteCollectionsPaged(org.PackageId, org.Id, String.Empty, String.Empty, String.Empty, 0, Int32.MaxValue); + foreach (SharePointSiteCollection existentSiteCollection in existentSiteCollections.SiteCollections) + { + DeleteSiteCollection(existentSiteCollection.Id); + } + } + + /// + /// Backups SharePoint site collection. + /// + /// Site collection id within metabase. + /// Backed up site collection file name. + /// A value which shows whether back up must be archived. + /// A value which shows whether created back up must be downloaded. + /// Local folder to store downloaded backup. + /// Created backup file name. + public static string BackupSiteCollection(int itemId, string fileName, bool zipBackup, bool download, string folderName) + { + // Check account. + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) + { + return null; + } + + // Load original meta item + SharePointSiteCollection origItem = (SharePointSiteCollection)PackageController.GetPackageItem(itemId); + if (origItem == null) + { + return null; + } + + // Log operation. + TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "BACKUP_SITE_COLLECTION", origItem.Name, itemId); + + try + { + // Create site collection on server. + HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(origItem.ServiceId); + string backFile = hostedSharePointServer.Enterprise_BackupSiteCollection(origItem.Name, fileName, zipBackup); + + if (!download) + { + // Copy backup files to space folder. + string relFolderName = FilesController.CorrectRelativePath(folderName); + if (!relFolderName.EndsWith("\\")) + { + relFolderName = relFolderName + "\\"; + } + + // Create backup folder if not exists + if (!FilesController.DirectoryExists(origItem.PackageId, relFolderName)) + { + FilesController.CreateFolder(origItem.PackageId, relFolderName); + } + + string packageFile = relFolderName + Path.GetFileName(backFile); + + // Delete destination file if exists + if (FilesController.FileExists(origItem.PackageId, packageFile)) + { + FilesController.DeleteFiles(origItem.PackageId, new string[] { packageFile }); + } + + byte[] buffer = null; + + int offset = 0; + do + { + // Read remote content. + buffer = hostedSharePointServer.Enterprise_GetTempFileBinaryChunk(backFile, offset, FILE_BUFFER_LENGTH); + + // Write remote content. + FilesController.AppendFileBinaryChunk(origItem.PackageId, packageFile, buffer); + + offset += FILE_BUFFER_LENGTH; + } + while (buffer.Length == FILE_BUFFER_LENGTH); + } + + return backFile; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + /// + /// Restores SharePoint site collection. + /// + /// Site collection id within metabase. + /// + /// + /// + public static int RestoreSiteCollection(int itemId, string uploadedFile, string packageFile) + { + // Check account. + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) + { + return accountCheck; + } + + // Load original meta item. + SharePointSiteCollection origItem = (SharePointSiteCollection)PackageController.GetPackageItem(itemId); + if (origItem == null) + { + return BusinessErrorCodes.ERROR_SHAREPOINT_PACKAGE_ITEM_NOT_FOUND; + } + + // Check package. + int packageCheck = SecurityContext.CheckPackage(origItem.PackageId, DemandPackage.IsActive); + if (packageCheck < 0) + { + return packageCheck; + } + + // Log operation. + TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "BACKUP_SITE_COLLECTION", origItem.Name, itemId); + + try + { + // Create site collection on server. + HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(origItem.ServiceId); + + string backupFile = null; + if (!String.IsNullOrEmpty(packageFile)) + { + // Copy package files to the remote SharePoint Server. + string path = null; + byte[] buffer = null; + + int offset = 0; + do + { + // Read package file. + buffer = FilesController.GetFileBinaryChunk(origItem.PackageId, packageFile, offset, FILE_BUFFER_LENGTH); + + // Write remote backup file + string tempPath = hostedSharePointServer.Enterprise_AppendTempFileBinaryChunk(Path.GetFileName(packageFile), path, buffer); + if (path == null) + { + path = tempPath; + backupFile = path; + } + + offset += FILE_BUFFER_LENGTH; + } + while (buffer.Length == FILE_BUFFER_LENGTH); + } + else if (!String.IsNullOrEmpty(uploadedFile)) + { + // Upladed files. + backupFile = uploadedFile; + } + + // Restore. + if (!String.IsNullOrEmpty(backupFile)) + { + hostedSharePointServer.Enterprise_RestoreSiteCollection(origItem, backupFile); + } + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + /// + /// Gets binary data chunk of specified size from specified offset. + /// + /// Item id to obtain realted service id. + /// Path to file to get bunary data chunk from. + /// Offset from which to start data reading. + /// Binary data chunk length. + /// Binary data chunk read from file. + public static byte[] GetBackupBinaryChunk(int itemId, string path, int offset, int length) + { + // Load original meta item. + SharePointSiteCollection item = (SharePointSiteCollection)PackageController.GetPackageItem(itemId); + if (item == null) + { + return null; + } + + HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(item.ServiceId); + return hostedSharePointServer.Enterprise_GetTempFileBinaryChunk(path, offset, length); + } + + /// + /// Appends supplied binary data chunk to file. + /// + /// Item id to obtain realted service id. + /// Non existent file name to append to. + /// Full path to existent file to append to. + /// Binary data chunk to append to. + /// Path to file that was appended with chunk. + public static string AppendBackupBinaryChunk(int itemId, string fileName, string path, byte[] chunk) + { + // Load original meta item. + SharePointSiteCollection item = (SharePointSiteCollection)PackageController.GetPackageItem(itemId); + if (item == null) + { + return null; + } + + HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(item.ServiceId); + return hostedSharePointServer.Enterprise_AppendTempFileBinaryChunk(fileName, path, chunk); + } + + /// + /// Initializes a new hosted SharePoint server proxy. + /// + /// Hosted SharePoint service id. + /// Hosted SharePoint server proxy. + private static HostedSharePointServerEnt GetHostedSharePointServer(int serviceId) + { + + HostedSharePointServerEnt sps = new HostedSharePointServerEnt(); + ServiceProviderProxy.Init(sps, serviceId); + return sps; + } + + /// + /// Gets list of importable items. + /// + /// Package that owns importable items. + /// Item type id. + /// Item type. + /// Item resource group. + /// List of importable item names. + public List GetImportableItems(int packageId, int itemTypeId, Type itemType, ResourceGroupInfo group) + { + List items = new List(); + + // Get service id + int serviceId = PackageController.GetPackageServiceId(packageId, group.GroupName); + if (serviceId == 0) + { + return items; + } + + HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(serviceId); + if (itemType == typeof(SharePointSiteCollection)) + { + foreach (SharePointSiteCollection siteCollection in hostedSharePointServer.Enterprise_GetSiteCollections()) + { + items.Add(siteCollection.Url); + } + } + + return items; + } + + /// + /// Imports selected item into metabase. + /// + /// Package to which items must be imported. + /// Item type id. + /// Item type. + /// Item resource group. + /// Item name to import. + public void ImportItem(int packageId, int itemTypeId, Type itemType, ResourceGroupInfo group, string itemName) + { + // Get service id + int serviceId = PackageController.GetPackageServiceId(packageId, group.GroupName); + if (serviceId == 0) + { + return; + } + + HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(serviceId); + if (itemType == typeof(SharePointSiteCollection)) + { + SharePointSiteCollection siteCollection = hostedSharePointServer.Enterprise_GetSiteCollection(itemName); + PackageController.AddPackageItem(siteCollection); + } + } + + /// + /// Backups service item by serializing it into supplied writer. + /// + /// Temporary directory path. + /// Xml wirter used to store backuped service provider items. + /// Service provider item to be backed up.. + /// Service provider resource group. + /// Resulting code. + public int BackupItem(string tempFolder, XmlWriter writer, ServiceProviderItem item, ResourceGroupInfo group) + { + SharePointSiteCollection siteCollection = item as SharePointSiteCollection; + if (siteCollection != null) + { + HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(siteCollection.ServiceId); + SharePointSiteCollection loadedSiteCollection = hostedSharePointServer.Enterprise_GetSiteCollection(siteCollection.Url); + // Update item + siteCollection.Url = loadedSiteCollection.Url; + siteCollection.OwnerLogin = loadedSiteCollection.OwnerLogin; + siteCollection.OwnerName = loadedSiteCollection.OwnerName; + siteCollection.OwnerEmail = loadedSiteCollection.OwnerEmail; + siteCollection.LocaleId = loadedSiteCollection.LocaleId; + siteCollection.Title = loadedSiteCollection.Title; + siteCollection.Description = loadedSiteCollection.Description; + // Serialize it. + XmlSerializer serializer = new XmlSerializer(typeof(SharePointSiteCollection)); + serializer.Serialize(writer, siteCollection); + + } + return 0; + } + + /// + /// Restore backed up previously service provider item. + /// + /// Temporary directory path. + /// Serialized service provider item. + /// Service provider item id. + /// Service provider item type. + /// Service provider item name. + /// Service provider item package. + /// Service provider item service id. + /// Service provider item resource group. + /// Resulting code. + public int RestoreItem(string tempFolder, XmlNode itemNode, int itemId, Type itemType, string itemName, int packageId, int serviceId, ResourceGroupInfo group) + { + if (itemType == typeof(SharePointSiteCollection)) + { + HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(serviceId); + // Deserialize item. + XmlSerializer serializer = new XmlSerializer(typeof(SharePointSiteCollection)); + SharePointSiteCollection siteCollection = (SharePointSiteCollection)serializer.Deserialize(new XmlNodeReader(itemNode.SelectSingleNode("SharePointSiteCollection"))); + siteCollection.PackageId = packageId; + siteCollection.ServiceId = serviceId; + + // Create site collection if needed. + if (hostedSharePointServer.Enterprise_GetSiteCollection(siteCollection.Url) == null) + { + hostedSharePointServer.Enterprise_CreateSiteCollection(siteCollection); + } + + // Add metabase record if needed. + SharePointSiteCollection metaSiteCollection = (SharePointSiteCollection)PackageController.GetPackageItemByName(packageId, itemName, typeof(SharePointSiteCollection)); + if (metaSiteCollection == null) + { + PackageController.AddPackageItem(siteCollection); + } + } + + return 0; + } + + + private static int GetHostedSharePointServiceId(int packageId) + { + return PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointFoundationServer); + } + + private static List GetOrganizationSharePointSiteCollections(int orgId) + { + Organization org = OrganizationController.GetOrganization(orgId); + + SharePointSiteCollectionListPaged siteCollections = GetSiteCollectionsPaged(org.PackageId, org.Id, String.Empty, String.Empty, String.Empty, 0, Int32.MaxValue); + return siteCollections.SiteCollections; + } + + private static int RecalculateStorageMaxSize(int size, int packageId) + { + PackageContext cntx = PackageController.GetPackageContext(packageId); + QuotaValueInfo quota = cntx.Quotas[Quotas.HOSTED_SHAREPOINT_ENTERPRISE_STORAGE_SIZE]; + + if (quota.QuotaAllocatedValue == -1) + { + if (size == -1)//Unlimited + return -1; + else + return size; + } + else + { + if (size == -1) + return quota.QuotaAllocatedValue; + + return Math.Min(size, quota.QuotaAllocatedValue); + } + } + + private static int RecalculateMaxSize(int parentSize, int realSize) + { + if (parentSize == -1) + { + if (realSize == -1 || realSize == 0) + return -1; + else + return realSize; + } + + + if (realSize == -1 || realSize == 0) + return parentSize; + + return Math.Min(parentSize, realSize); + + } + + + public static int SetStorageSettings(int itemId, int maxStorage, int warningStorage, bool applyToSiteCollections) + { + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) return accountCheck; + + // place log record + TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "SET_ORG_LIMITS", itemId); + + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + return 0; + + // set limits + int realMaxSizeValue = RecalculateStorageMaxSize(maxStorage, org.PackageId); + + org.MaxSharePointEnterpriseStorage = realMaxSizeValue; + + org.WarningSharePointEnterpriseStorage = realMaxSizeValue == -1 ? -1 : Math.Min(warningStorage, realMaxSizeValue); + + // save organization + UpdateOrganization(org); + + if (applyToSiteCollections) + { + int serviceId = GetHostedSharePointServiceId(org.PackageId); + + HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(serviceId); + + List currentOrgSiteCollection = + GetOrganizationSharePointSiteCollections(org.Id); + + + foreach (SharePointSiteCollection siteCollection in currentOrgSiteCollection) + { + try + { + SharePointSiteCollection sc = GetSiteCollection(siteCollection.Id); + sc.MaxSiteStorage = realMaxSizeValue; + sc.WarningStorage = realMaxSizeValue == -1 ? -1 : warningStorage; + PackageController.UpdatePackageItem(sc); + + hostedSharePointServer.Enterprise_UpdateQuotas(siteCollection.PhysicalAddress, realMaxSizeValue, + warningStorage); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + } + } + + return 0; + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + + public static SharePointSiteDiskSpace[] CalculateSharePointSitesDiskSpace(int itemId, out int errorCode) + { + SharePointSiteDiskSpace[] retDiskSpace = null; + errorCode = 0; + // check account + int accountCheck = SecurityContext.CheckAccount(DemandAccount.NotDemo | DemandAccount.IsActive); + if (accountCheck < 0) + { + errorCode = accountCheck; + return null; + } + + // place log record + TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "CALCULATE_DISK_SPACE", itemId); + + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + return null; + + int serviceId = GetHostedSharePointServiceId(org.PackageId); + + HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(serviceId); + + List currentOrgSiteCollection = + GetOrganizationSharePointSiteCollections(org.Id); + + List urls = new List(); + foreach (SharePointSiteCollection siteCollection in currentOrgSiteCollection) + { + urls.Add(siteCollection.PhysicalAddress); + } + if (urls.Count > 0) + retDiskSpace = hostedSharePointServer.Enterprise_CalculateSiteCollectionsDiskSpace(urls.ToArray()); + else + { + retDiskSpace = new SharePointSiteDiskSpace[1]; + retDiskSpace[0] = new SharePointSiteDiskSpace(); + retDiskSpace[0].DiskSpace = 0; + retDiskSpace[0].Url = string.Empty; + } + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + return retDiskSpace; + } + + private static void UpdateOrganization(Organization organization) + { + PackageController.UpdatePackageItem(organization); + } + + + public static void UpdateQuota(int itemId, int siteCollectionId, int maxStorage, int warningStorage) + { + TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "UPDATE_QUOTA"); + try + { + Organization org = (Organization)PackageController.GetPackageItem(itemId); + if (org == null) + return; + + int serviceId = GetHostedSharePointServiceId(org.PackageId); + + HostedSharePointServerEnt hostedSharePointServer = GetHostedSharePointServer(serviceId); + + SharePointSiteCollection sc = GetSiteCollection(siteCollectionId); + + int maxSize = RecalculateMaxSize(org.MaxSharePointEnterpriseStorage, maxStorage); + int warningSize = warningStorage; + + + sc.MaxSiteStorage = maxSize; + sc.WarningStorage = maxSize == -1 ? -1 : Math.Min(warningSize, maxSize); + PackageController.UpdatePackageItem(sc); + + hostedSharePointServer.Enterprise_UpdateQuotas(sc.PhysicalAddress, maxSize, + warningStorage); + } + catch (Exception ex) + { + throw TaskManager.WriteError(ex); + } + finally + { + TaskManager.CompleteTask(); + } + } + /// + /// Gets a value if caller is in demo mode. + /// + private static bool IsDemoMode + { + get + { + return (SecurityContext.CheckAccount(DemandAccount.NotDemo) < 0); + } + } + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj index 58c17bbf..19107f3d 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/WebsitePanel.EnterpriseServer.Code.csproj @@ -17,7 +17,7 @@ true full false - ..\..\Bin\ + ..\WebsitePanel.EnterpriseServer\bin\ DEBUG;TRACE prompt 4 @@ -26,7 +26,7 @@ pdbonly true - ..\..\Bin\ + ..\WebsitePanel.EnterpriseServer\bin\ TRACE prompt 4 @@ -163,6 +163,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj index c18d5220..6e3e5f97 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/WebsitePanel.EnterpriseServer.csproj @@ -68,16 +68,19 @@ - + + False ..\..\Bin\WebsitePanel.EnterpriseServer.Base.dll - + + False ..\..\Bin\WebsitePanel.EnterpriseServer.Code.dll - + + False ..\..\Bin\WebsitePanel.Providers.Base.dll - + False ..\..\Bin\WebsitePanel.Server.Client.dll @@ -120,6 +123,7 @@ + @@ -164,6 +168,10 @@ esEnterpriseStorage.asmx Component + + esHostedSharePointServersEnt.asmx + Component + esRemoteDesktopServices.asmx Component diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServers.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServers.asmx.cs index c99bee6a..2468333c 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServers.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServers.asmx.cs @@ -59,10 +59,10 @@ namespace WebsitePanel.EnterpriseServer /// Site collections in raw format. [WebMethod] public SharePointSiteCollectionListPaged GetSiteCollectionsPaged(int packageId, int organizationId, - string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, string groupName) + string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { return HostedSharePointServerController.GetSiteCollectionsPaged(packageId, organizationId, filterColumn, filterValue, - sortColumn, startRow, maximumRows, groupName); + sortColumn, startRow, maximumRows); } /// @@ -83,9 +83,9 @@ namespace WebsitePanel.EnterpriseServer /// Resource group name. /// List of found site collections. [WebMethod] - public List GetSiteCollections(int packageId, bool recursive, string groupName) + public List GetSiteCollections(int packageId, bool recursive) { - return HostedSharePointServerController.GetSiteCollections(packageId, recursive, groupName); + return HostedSharePointServerController.GetSiteCollections(packageId, recursive); } [WebMethod] @@ -116,7 +116,7 @@ namespace WebsitePanel.EnterpriseServer public SharePointSiteCollection GetSiteCollectionByDomain(int organizationId, string domain) { DomainInfo domainInfo = ServerController.GetDomain(domain); - SharePointSiteCollectionListPaged existentSiteCollections = this.GetSiteCollectionsPaged(domainInfo.PackageId, organizationId, "ItemName", String.Format("%{0}", domain), String.Empty, 0, Int32.MaxValue, null); + SharePointSiteCollectionListPaged existentSiteCollections = this.GetSiteCollectionsPaged(domainInfo.PackageId, organizationId, "ItemName", String.Format("%{0}", domain), String.Empty, 0, Int32.MaxValue); foreach (SharePointSiteCollection existentSiteCollection in existentSiteCollections.SiteCollections) { Uri existentSiteCollectionUri = new Uri(existentSiteCollection.Name); @@ -136,9 +136,9 @@ namespace WebsitePanel.EnterpriseServer /// Resource group name. /// Created site collection id within metabase. [WebMethod] - public int AddSiteCollection(SharePointSiteCollection item, string groupName) + public int AddSiteCollection(SharePointSiteCollection item) { - return HostedSharePointServerController.AddSiteCollection(item, groupName); + return HostedSharePointServerController.AddSiteCollection(item); } /// diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx new file mode 100644 index 00000000..394c337c --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="esHostedSharePointServersEnt.asmx.cs" Class="WebsitePanel.EnterpriseServer.esHostedSharePointServers" %> diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx.cs new file mode 100644 index 00000000..e5b51f35 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx.cs @@ -0,0 +1,237 @@ +// Copyright (c) 2015, 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.ComponentModel; +using System.Web.Services; +using WebsitePanel.EnterpriseServer.Code.SharePoint; +using WebsitePanel.Providers.SharePoint; +using Microsoft.Web.Services3; + +namespace WebsitePanel.EnterpriseServer +{ + /// + /// Summary description for esHostedSharePointServers + /// + [WebService(Namespace = "http://smbsaas/websitepanel/enterpriseserver")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [Policy("ServerPolicy")] + [ToolboxItem(false)] + public class esHostedSharePointServersEnt : WebService + { + /// + /// Gets site collections in raw form. + /// + /// Package to which desired site collections belong. + /// Organization to which desired site collections belong. + /// Filter column name. + /// Filter value. + /// Sort column name. + /// Row index to start from. + /// Maximum number of rows to retrieve. + /// Resource group name. + /// Site collections in raw format. + [WebMethod] + public SharePointSiteCollectionListPaged GetSiteCollectionsPaged(int packageId, int organizationId, + string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) + { + return HostedSharePointServerEntController.GetSiteCollectionsPaged(packageId, organizationId, filterColumn, filterValue, + sortColumn, startRow, maximumRows); + } + + /// + /// Gets list of supported languages by this installation of SharePoint. + /// + /// List of supported languages + [WebMethod] + public int[] GetSupportedLanguages(int packageId) + { + return HostedSharePointServerEntController.GetSupportedLanguages(packageId); + } + + /// + /// Gets list of SharePoint site collections that belong to the package. + /// + /// Package that owns site collections. + /// A value which shows whether nested spaces must be searched as well. + /// Resource group name. + /// List of found site collections. + [WebMethod] + public List GetSiteCollections(int packageId, bool recursive) + { + return HostedSharePointServerEntController.GetSiteCollections(packageId, recursive); + } + + [WebMethod] + public int SetStorageSettings(int itemId, int maxStorage, int warningStorage, bool applyToSiteCollections) + { + return HostedSharePointServerEntController.SetStorageSettings(itemId, maxStorage, warningStorage, applyToSiteCollections ); + } + + /// + /// Gets SharePoint site collection with given id. + /// + /// Site collection id within metabase. + /// Site collection. + [WebMethod] + public SharePointSiteCollection GetSiteCollection(int itemId) + { + return HostedSharePointServerEntController.GetSiteCollection(itemId); + } + + /// + /// Gets SharePoint site collection from package under organization with given domain. + /// + /// Package id. + /// Organization id. + /// Domain name. + /// SharePoint site collection or null. + [WebMethod] + public SharePointSiteCollection GetSiteCollectionByDomain(int organizationId, string domain) + { + DomainInfo domainInfo = ServerController.GetDomain(domain); + SharePointSiteCollectionListPaged existentSiteCollections = this.GetSiteCollectionsPaged(domainInfo.PackageId, organizationId, "ItemName", String.Format("%{0}", domain), String.Empty, 0, Int32.MaxValue); + foreach (SharePointSiteCollection existentSiteCollection in existentSiteCollections.SiteCollections) + { + Uri existentSiteCollectionUri = new Uri(existentSiteCollection.Name); + if (existentSiteCollection.Name == String.Format("{0}://{1}", existentSiteCollectionUri.Scheme, domain)) + { + return existentSiteCollection; + } + } + + return null; + } + + /// + /// Adds SharePoint site collection. + /// + /// Site collection description. + /// Resource group name. + /// Created site collection id within metabase. + [WebMethod] + public int AddSiteCollection(SharePointSiteCollection item) + { + return HostedSharePointServerEntController.AddSiteCollection(item); + } + + /// + /// Deletes SharePoint site collection with given id. + /// + /// Site collection id within metabase. + /// ? + [WebMethod] + public int DeleteSiteCollection(int itemId) + { + return HostedSharePointServerEntController.DeleteSiteCollection(itemId); + } + + /// + /// Deletes SharePoint site collections which belong to organization. + /// + /// Site collection id within metabase. + /// ? + [WebMethod] + public int DeleteSiteCollections(int organizationId) + { + HostedSharePointServerEntController.DeleteSiteCollections(organizationId); + return 0; + } + + + /// + /// Backups SharePoint site collection. + /// + /// Site collection id within metabase. + /// Backed up site collection file name. + /// A value which shows whether back up must be archived. + /// A value which shows whether created back up must be downloaded. + /// Local folder to store downloaded backup. + /// Created backup file name. + [WebMethod] + public string BackupSiteCollection(int itemId, string fileName, bool zipBackup, bool download, string folderName) + { + return HostedSharePointServerEntController.BackupSiteCollection(itemId, fileName, zipBackup, download, folderName); + } + + /// + /// Restores SharePoint site collection. + /// + /// Site collection id within metabase. + /// + /// + /// + [WebMethod] + public int RestoreSiteCollection(int itemId, string uploadedFile, string packageFile) + { + return HostedSharePointServerEntController.RestoreSiteCollection(itemId, uploadedFile, packageFile); + } + + /// + /// Gets binary data chunk of specified size from specified offset. + /// + /// Item id to obtain realted service id. + /// Path to file to get bunary data chunk from. + /// Offset from which to start data reading. + /// Binary data chunk length. + /// Binary data chunk read from file. + [WebMethod] + public byte[] GetBackupBinaryChunk(int itemId, string path, int offset, int length) + { + return HostedSharePointServerEntController.GetBackupBinaryChunk(itemId, path, offset, length); + } + + /// + /// Appends supplied binary data chunk to file. + /// + /// Item id to obtain realted service id. + /// Non existent file name to append to. + /// Full path to existent file to append to. + /// Binary data chunk to append to. + /// Path to file that was appended with chunk. + [WebMethod] + public string AppendBackupBinaryChunk(int itemId, string fileName, string path, byte[] chunk) + { + return HostedSharePointServerEntController.AppendBackupBinaryChunk(itemId, fileName, path, chunk); + } + + [WebMethod] + public SharePointSiteDiskSpace[] CalculateSharePointSitesDiskSpace(int itemId, out int errorCode) + { + return HostedSharePointServerEntController.CalculateSharePointSitesDiskSpace(itemId, out errorCode); + } + + + [WebMethod] + public void UpdateQuota(int itemId, int siteCollectionId, int maxSize, int warningSize) + { + HostedSharePointServerEntController.UpdateQuota(itemId, siteCollectionId, maxSize, warningSize); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/Organization.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/Organization.cs index 69b3f2c7..f88314b1 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/Organization.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/Organization.cs @@ -61,6 +61,9 @@ namespace WebsitePanel.Providers.HostedSolution private int maxSharePointStorage; private int warningSharePointStorage; + private int maxSharePointEnterpriseStorage; + private int warningSharePointEnterpriseStorage; + #endregion [Persistent] @@ -80,6 +83,19 @@ namespace WebsitePanel.Providers.HostedSolution set { warningSharePointStorage = value; } } + public int MaxSharePointEnterpriseStorage + { + get { return maxSharePointEnterpriseStorage; } + set { maxSharePointEnterpriseStorage = value; } + } + + [Persistent] + public int WarningSharePointEnterpriseStorage + { + get { return warningSharePointEnterpriseStorage; } + set { warningSharePointEnterpriseStorage = value; } + } + [Persistent] public string CrmUrl { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs index 56923206..eddf97ed 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatistics.cs @@ -61,6 +61,9 @@ namespace WebsitePanel.Providers.HostedSolution private int allocatedSharePointSiteCollections; private int createdSharePointSiteCollections; + private int allocatedSharePointEnterpriseSiteCollections; + private int createdSharePointEnterpriseSiteCollections; + private int createdCRMUsers; private int allocatedCRMUsers; @@ -288,6 +291,18 @@ namespace WebsitePanel.Providers.HostedSolution set { createdSharePointSiteCollections = value; } } + public int AllocatedSharePointEnterpriseSiteCollections + { + get { return allocatedSharePointEnterpriseSiteCollections; } + set { allocatedSharePointEnterpriseSiteCollections = value; } + } + + public int CreatedSharePointEnterpriseSiteCollections + { + get { return createdSharePointEnterpriseSiteCollections; } + set { createdSharePointEnterpriseSiteCollections = value; } + } + public int CreatedBlackBerryUsers { get; set; } public int AllocatedBlackBerryUsers { get; set; } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/SharePoint/IHostedSharePointServerEnt.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/SharePoint/IHostedSharePointServerEnt.cs new file mode 100644 index 00000000..4bc6f8ee --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/SharePoint/IHostedSharePointServerEnt.cs @@ -0,0 +1,120 @@ +// Copyright (c) 2015, 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; + +namespace WebsitePanel.Providers.SharePoint +{ + /// + /// Exposes functionality for share point server provider hosted in conjunction with organization management provider and + /// exchange server. + /// + public interface IHostedSharePointServerEnt + { + /// + /// When implemented gets root web application uri. + /// + Uri Enterprise_RootWebApplicationUri + { + get; + } + + /// + /// When implemented gets list of supported languages by this installation of SharePoint. + /// + /// List of supported languages + int[] Enterprise_GetSupportedLanguages(); + + /// + /// When implemented gets list of SharePoint collections within root web application. + /// + /// List of SharePoint collections within root web application. + SharePointSiteCollection[] Enterprise_GetSiteCollections(); + + /// + /// When implemented gets SharePoint collection within root web application with given name. + /// + /// Url that uniquely identifies site collection to be loaded. + /// SharePoint collection within root web application with given name. + SharePointSiteCollection Enterprise_GetSiteCollection(string url); + + /// + /// When implemented creates site collection within predefined root web application. + /// + /// Information about site coolection to be created. + void Enterprise_CreateSiteCollection(SharePointSiteCollection siteCollection); + + /// + /// When implemented deletes site collection under given url. + /// + /// Url that uniquely identifies site collection to be deleted. + void Enterprise_DeleteSiteCollection(SharePointSiteCollection siteCollection); + + /// + /// When implemeneted backups site collection under give url. + /// + /// Url that uniquely identifies site collection to be deleted. + /// Resulting backup file name. + /// A value which shows whether created backup must be archived. + /// Created backup full path. + string Enterprise_BackupSiteCollection(string url, string filename, bool zip); + + /// + /// When implemented restores site collection under given url from backup. + /// + /// Site collection to be restored. + /// Backup file name to restore from. + void Enterprise_RestoreSiteCollection(SharePointSiteCollection siteCollection, string filename); + + /// + /// When implemented gets binary data chunk of specified size from specified offset. + /// + /// Path to file to get bunary data chunk from. + /// Offset from which to start data reading. + /// Binary data chunk length. + /// Binary data chunk read from file. + byte[] Enterprise_GetTempFileBinaryChunk(string path, int offset, int length); + + /// + /// When implemented appends supplied binary data chunk to file. + /// + /// Non existent file name to append to. + /// Full path to existent file to append to. + /// Binary data chunk to append to. + /// Path to file that was appended with chunk. + string Enterprise_AppendTempFileBinaryChunk(string fileName, string path, byte[] chunk); + + void Enterprise_UpdateQuotas(string url, long maxStorage, long warningStorage); + + SharePointSiteDiskSpace[] Enterprise_CalculateSiteCollectionsDiskSpace(string[] urls); + + long Enterprise_GetSiteCollectionSize(string url); + + void Enterprise_SetPeoplePickerOu(string site, string ou); + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index e72359e6..2dec0c17 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -280,6 +280,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/HostedSharePointServer2013Ent.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/HostedSharePointServer2013Ent.cs new file mode 100644 index 00000000..d9e93497 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/HostedSharePointServer2013Ent.cs @@ -0,0 +1,352 @@ +// Copyright (c) 2015, 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.IO; +using System.Text.RegularExpressions; +using System.Xml; +using Microsoft.Win32; +using WebsitePanel.Providers.SharePoint; +using WebsitePanel.Providers.Utils; +using WebsitePanel.Server.Utils; + +namespace WebsitePanel.Providers.HostedSolution +{ + /// + /// Provides hosted SharePoint server functionality implementation. + /// + public class HostedSharePointServer2013Ent : HostingServiceProviderBase, IHostedSharePointServerEnt + { + #region Delegate + + private delegate TReturn SharePointAction(HostedSharePointServer2013EntImpl impl); + + #endregion + + #region Fields + + protected string LanguagePacksPath; + protected string Wss3Registry32Key; + protected string Wss3RegistryKey; + + #endregion + + #region Properties + + public string BackupTemporaryFolder + { + get { return ProviderSettings["BackupTemporaryFolder"]; } + } + + public Uri Enterprise_RootWebApplicationUri + { + get { return new Uri(ProviderSettings["RootWebApplicationUri"]); } + } + + #endregion + + #region Constructor + + public HostedSharePointServer2013Ent() + { + Wss3RegistryKey = @"SOFTWARE\Microsoft\Shared Tools\Web Server Extensions\15.0"; + Wss3Registry32Key = @"SOFTWARE\Wow6432Node\Microsoft\Shared Tools\Web Server Extensions\15.0"; + LanguagePacksPath = @"%commonprogramfiles%\microsoft shared\Web Server Extensions\15\HCCab\"; + } + + #endregion + + #region Methods + + /// Gets list of supported languages by this installation of SharePoint. + /// List of supported languages + public int[] Enterprise_GetSupportedLanguages() + { + var impl = new HostedSharePointServer2013EntImpl(); + return impl.GetSupportedLanguages(Enterprise_RootWebApplicationUri); + } + + /// Gets list of SharePoint collections within root web application. + /// List of SharePoint collections within root web application. + public SharePointSiteCollection[] Enterprise_GetSiteCollections() + { + return ExecuteSharePointAction(impl => impl.GetSiteCollections(Enterprise_RootWebApplicationUri)); + } + + /// Gets SharePoint collection within root web application with given name. + /// Url that uniquely identifies site collection to be loaded. + /// SharePoint collection within root web application with given name. + public SharePointSiteCollection Enterprise_GetSiteCollection(string url) + { + return ExecuteSharePointAction(impl => impl.GetSiteCollection(Enterprise_RootWebApplicationUri, url)); + } + + /// Creates site collection within predefined root web application. + /// Information about site coolection to be created. + public void Enterprise_CreateSiteCollection(SharePointSiteCollection siteCollection) + { + ExecuteSharePointAction(delegate(HostedSharePointServer2013EntImpl impl) + { + impl.CreateSiteCollection(Enterprise_RootWebApplicationUri, siteCollection); + return null; + }); + } + + /// Deletes site collection under given url. + /// The site collection to be deleted. + public void Enterprise_DeleteSiteCollection(SharePointSiteCollection siteCollection) + { + ExecuteSharePointAction(delegate(HostedSharePointServer2013EntImpl impl) + { + impl.DeleteSiteCollection(Enterprise_RootWebApplicationUri, siteCollection); + return null; + }); + } + + /// Backups site collection under give url. + /// Url that uniquely identifies site collection to be deleted. + /// Resulting backup file name. + /// A value which shows whether created backup must be archived. + /// Created backup full path. + public string Enterprise_BackupSiteCollection(string url, string filename, bool zip) + { + return ExecuteSharePointAction(impl => impl.BackupSiteCollection(Enterprise_RootWebApplicationUri, url, filename, zip, BackupTemporaryFolder)); + } + + /// Restores site collection under given url from backup. + /// Site collection to be restored. + /// Backup file name to restore from. + public void Enterprise_RestoreSiteCollection(SharePointSiteCollection siteCollection, string filename) + { + ExecuteSharePointAction(delegate(HostedSharePointServer2013EntImpl impl) + { + impl.RestoreSiteCollection(Enterprise_RootWebApplicationUri, siteCollection, filename); + return null; + }); + } + + /// Gets binary data chunk of specified size from specified offset. + /// Path to file to get bunary data chunk from. + /// Offset from which to start data reading. + /// Binary data chunk length. + /// Binary data chunk read from file. + public virtual byte[] Enterprise_GetTempFileBinaryChunk(string path, int offset, int length) + { + byte[] buffer = FileUtils.GetFileBinaryChunk(path, offset, length); + + if (buffer.Length < length) + { + FileUtils.DeleteFile(path); + } + + return buffer; + } + + /// Appends supplied binary data chunk to file. + /// Non existent file name to append to. + /// Full path to existent file to append to. + /// Binary data chunk to append to. + /// Path to file that was appended with chunk. + public virtual string Enterprise_AppendTempFileBinaryChunk(string fileName, string path, byte[] chunk) + { + if (path == null) + { + path = Path.Combine(Path.GetTempPath(), fileName); + if (FileUtils.FileExists(path)) + { + FileUtils.DeleteFile(path); + } + } + + FileUtils.AppendFileBinaryContent(path, chunk); + + return path; + } + + public void Enterprise_UpdateQuotas(string url, long maxStorage, long warningStorage) + { + ExecuteSharePointAction(delegate(HostedSharePointServer2013EntImpl impl) + { + impl.UpdateQuotas(Enterprise_RootWebApplicationUri, url, maxStorage, warningStorage); + return null; + }); + } + + public SharePointSiteDiskSpace[] Enterprise_CalculateSiteCollectionsDiskSpace(string[] urls) + { + return ExecuteSharePointAction(impl => impl.CalculateSiteCollectionDiskSpace(Enterprise_RootWebApplicationUri, urls)); + } + + public long Enterprise_GetSiteCollectionSize(string url) + { + return ExecuteSharePointAction(impl => impl.GetSiteCollectionSize(Enterprise_RootWebApplicationUri, url)); + } + + public void Enterprise_SetPeoplePickerOu(string site, string ou) + { + ExecuteSharePointAction(delegate(HostedSharePointServer2013EntImpl impl) + { + impl.SetPeoplePickerOu(site, ou); + return null; + }); + } + + + public override bool IsInstalled() + { + return IsSharePointInstalled(); + } + + /// Deletes service items that represent SharePoint site collection. + /// Items to be deleted. + public override void DeleteServiceItems(ServiceProviderItem[] items) + { + foreach (ServiceProviderItem item in items) + { + var sharePointSiteCollection = item as SharePointSiteCollection; + + if (sharePointSiteCollection != null) + { + try + { + Enterprise_DeleteSiteCollection(sharePointSiteCollection); + } + catch (Exception ex) + { + Log.WriteError(String.Format("Error deleting '{0}' {1}", item.Name, item.GetType().Name), ex); + } + } + } + } + + /// Calculates diskspace used by supplied service items. + /// Service items to get diskspace usage for. + /// Calculated disk space usage statistics. + public override ServiceProviderItemDiskSpace[] GetServiceItemsDiskSpace(ServiceProviderItem[] items) + { + var itemsDiskspace = new List(); + + foreach (ServiceProviderItem item in items) + { + if (item is SharePointSiteCollection) + { + try + { + Log.WriteStart(String.Format("Calculating '{0}' site logs size", item.Name)); + + SharePointSiteCollection site = Enterprise_GetSiteCollection(item.Name); + var diskspace = new ServiceProviderItemDiskSpace { ItemId = item.Id, DiskSpace = site.Diskspace }; + itemsDiskspace.Add(diskspace); + + Log.WriteEnd(String.Format("Calculating '{0}' site logs size", item.Name)); + } + catch (Exception ex) + { + Log.WriteError(ex); + } + } + } + + return itemsDiskspace.ToArray(); + } + + /// Checks whether SharePoint 2013 is installed. + /// true - if it is installed; false - otherwise. + private bool IsSharePointInstalled() + { + RegistryKey spKey = Registry.LocalMachine.OpenSubKey(Wss3RegistryKey); + RegistryKey spKey32 = Registry.LocalMachine.OpenSubKey(Wss3Registry32Key); + + if (spKey == null && spKey32 == null) + { + return false; + } + + var spVal = (string)spKey.GetValue("SharePoint"); + + return (String.Compare(spVal, "installed", true) == 0); + } + + /// Executes supplied action within separate application domain. + /// Action to be executed. + /// Any object that results from action execution or null if nothing is supposed to be returned. + /// Is thrown in case supplied action is null. + private static TReturn ExecuteSharePointAction(SharePointAction action) + { + if (action == null) + { + throw new ArgumentNullException("action"); + } + + AppDomain domain = null; + + try + { + Type type = typeof(HostedSharePointServer2013EntImpl); + var info = new AppDomainSetup { ApplicationBase = Path.GetDirectoryName(AppDomain.CurrentDomain.BaseDirectory), PrivateBinPath = GetPrivateBinPath() }; + domain = AppDomain.CreateDomain("WSS30", null, info); + var impl = (HostedSharePointServer2013EntImpl)domain.CreateInstanceAndUnwrap(type.Assembly.FullName, type.FullName); + + return action(impl); + } + finally + { + if (domain != null) + { + AppDomain.Unload(domain); + } + } + + throw new ArgumentNullException("action"); + } + + /// Getting PrivatePath from web.config. + /// The PrivateBinPath. + private static string GetPrivateBinPath() + { + var lines = new List { "bin", "bin/debug" }; + string path = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "web.config"); + + if (File.Exists(path)) + { + using (var reader = new StreamReader(path)) + { + string content = reader.ReadToEnd(); + var pattern = new Regex(@"(?<=probing .*?privatePath\s*=\s*"")[^""]+(?="".*?>)"); + Match match = pattern.Match(content); + lines.AddRange(match.Value.Split(';')); + } + } + + return string.Join(Path.PathSeparator.ToString(), lines.ToArray()); + } + + #endregion + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/HostedSharePointServer2013EntImpl.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/HostedSharePointServer2013EntImpl.cs new file mode 100644 index 00000000..ce92d7b2 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/HostedSharePointServer2013EntImpl.cs @@ -0,0 +1,851 @@ +// Copyright (c) 2015, 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.Collections.ObjectModel; +using System.IO; +using System.Linq; +using System.Management.Automation; +using System.Management.Automation.Runspaces; +using System.Security.Principal; +using Microsoft.SharePoint; +using Microsoft.SharePoint.Administration; +using WebsitePanel.Providers.SharePoint; +using WebsitePanel.Providers.Utils; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class HostedSharePointServer2013EntImpl : MarshalByRefObject + { + #region Fields + + private static RunspaceConfiguration runspaceConfiguration; + + #endregion + + #region Properties + + private string SharepointSnapInName + { + get { return "Microsoft.SharePoint.Powershell"; } + } + + #endregion + + #region Methods + + /// Gets list of SharePoint collections within root web application. + /// The root web application Uri. + /// List of SharePoint collections within root web application. + public SharePointSiteCollection[] GetSiteCollections(Uri rootWebApplicationUri) + { + return GetSPSiteCollections(rootWebApplicationUri).Select(pair => NewSiteCollection(pair.Value)).ToArray(); + } + + /// Gets list of supported languages by this installation of SharePoint. + /// The root web application Uri. + /// List of supported languages + public int[] GetSupportedLanguages(Uri rootWebApplicationUri) + { + var languages = new List(); + + try + { + WindowsImpersonationContext wic = WindowsIdentity.GetCurrent().Impersonate(); + + try + { + languages.AddRange(from SPLanguage lang in SPRegionalSettings.GlobalInstalledLanguages select lang.LCID); + } + finally + { + wic.Undo(); + } + } + catch (Exception ex) + { + throw new InvalidOperationException("Failed to create site collection.", ex); + } + + return languages.ToArray(); + } + + /// Gets site collection size in bytes. + /// The root web application uri. + /// The site collection url. + /// Size in bytes. + public long GetSiteCollectionSize(Uri rootWebApplicationUri, string url) + { + Dictionary sizes = GetSitesCollectionSize(rootWebApplicationUri, new[] {url}); + + if (sizes.Count() == 1) + { + return sizes.First().Value; + } + + throw new ApplicationException(string.Format("SiteCollection {0} does not exist", url)); + } + + /// Gets sites disk space. + /// The root web application uri. + /// The sites urls. + /// The disk space. + public SharePointSiteDiskSpace[] CalculateSiteCollectionDiskSpace(Uri rootWebApplicationUri, string[] urls) + { + return GetSitesCollectionSize(rootWebApplicationUri, urls).Select(pair => new SharePointSiteDiskSpace {Url = pair.Key, DiskSpace = (long) Math.Round(pair.Value/1024.0/1024.0)}).ToArray(); + } + + /// Calculates size of the required seti collections. + /// The root web application uri. + /// The sites urls. + /// Calculated sizes. + private Dictionary GetSitesCollectionSize(Uri rootWebApplicationUri, IEnumerable urls) + { + Runspace runspace = null; + var result = new Dictionary(); + + try + { + runspace = OpenRunspace(); + + foreach (string url in urls) + { + string siteCollectionUrl = String.Format("{0}:{1}", url, rootWebApplicationUri.Port); + var scripts = new List {string.Format("$site=Get-SPSite -Identity \"{0}\"", siteCollectionUrl), "$site.RecalculateStorageUsed()", "$site.Usage.Storage"}; + Collection scriptResult = ExecuteShellCommand(runspace, scripts); + + if (scriptResult != null && scriptResult.Any()) + { + result.Add(url, Convert.ToInt64(scriptResult.First().BaseObject)); + } + } + } + finally + { + CloseRunspace(runspace); + } + + return result; + } + + /// Sets people picker OU. + /// The site. + /// OU. + public void SetPeoplePickerOu(string site, string ou) + { + HostedSolutionLog.LogStart("SetPeoplePickerOu"); + HostedSolutionLog.LogInfo(" Site: {0}", site); + HostedSolutionLog.LogInfo(" OU: {0}", ou); + + Runspace runspace = null; + + try + { + runspace = OpenRunspace(); + var cmd = new Command("Set-SPSite"); + cmd.Parameters.Add("Identity", site); + cmd.Parameters.Add("UserAccountDirectoryPath", ou); + ExecuteShellCommand(runspace, cmd); + } + finally + { + CloseRunspace(runspace); + } + + HostedSolutionLog.LogEnd("SetPeoplePickerOu"); + } + + /// Gets SharePoint collection within root web application with given name. + /// Root web application uri. + /// Url that uniquely identifies site collection to be loaded. + /// SharePoint collection within root web application with given name. + public SharePointSiteCollection GetSiteCollection(Uri rootWebApplicationUri, string url) + { + return NewSiteCollection(GetSPSiteCollection(rootWebApplicationUri, url)); + } + + /// Deletes quota. + /// The quota name. + private static void DeleteQuotaTemplate(string name) + { + SPFarm farm = SPFarm.Local; + + var webService = farm.Services.GetValue(""); + SPQuotaTemplateCollection quotaColl = webService.QuotaTemplates; + quotaColl.Delete(name); + } + + /// Updates site collection quota. + /// The root uri. + /// The site collection url. + /// The max storage. + /// The warning storage value. + public void UpdateQuotas(Uri root, string url, long maxStorage, long warningStorage) + { + if (maxStorage != -1) + { + maxStorage = maxStorage*1024*1024; + } + else + { + maxStorage = 0; + } + + if (warningStorage != -1 && maxStorage != -1) + { + warningStorage = Math.Min(warningStorage, maxStorage)*1024*1024; + } + else + { + warningStorage = 0; + } + + Runspace runspace = null; + + try + { + runspace = OpenRunspace(); + GrantAccess(runspace, root); + string siteCollectionUrl = String.Format("{0}:{1}", url, root.Port); + var command = new Command("Set-SPSite"); + command.Parameters.Add("Identity", siteCollectionUrl); + command.Parameters.Add("MaxSize", maxStorage); + command.Parameters.Add("WarningSize", warningStorage); + ExecuteShellCommand(runspace, command); + } + finally + { + CloseRunspace(runspace); + } + } + + /// Grants acces to current user. + /// The runspace. + /// The root web application uri. + private void GrantAccess(Runspace runspace, Uri rootWebApplicationUri) + { + ExecuteShellCommand(runspace, new List {string.Format("$webApp=Get-SPWebApplication {0}", rootWebApplicationUri.AbsoluteUri), string.Format("$webApp.GrantAccessToProcessIdentity(\"{0}\")", WindowsIdentity.GetCurrent().Name)}); + } + + /// Deletes site collection. + /// The runspace. + /// The site collection url. + /// True - if active directory accounts should be deleted. + private void DeleteSiteCollection(Runspace runspace, string url, bool deleteADAccounts) + { + var command = new Command("Remove-SPSite"); + command.Parameters.Add("Identity", url); + command.Parameters.Add("DeleteADAccounts", deleteADAccounts); + ExecuteShellCommand(runspace, command); + } + + /// Creates site collection within predefined root web application. + /// Root web application uri. + /// Information about site coolection to be created. + /// Is thrown in case requested operation fails for any reason. + public void CreateSiteCollection(Uri rootWebApplicationUri, SharePointSiteCollection siteCollection) + { + HostedSolutionLog.LogStart("CreateSiteCollection"); + WindowsImpersonationContext wic = null; + Runspace runspace = null; + + try + { + wic = WindowsIdentity.GetCurrent().Impersonate(); + runspace = OpenRunspace(); + CreateCollection(runspace, rootWebApplicationUri, siteCollection); + } + finally + { + CloseRunspace(runspace); + HostedSolutionLog.LogEnd("CreateSiteCollection"); + + if (wic != null) + { + wic.Undo(); + } + } + } + + /// Creates site collection within predefined root web application. + /// The runspace. + /// Root web application uri. + /// Information about site coolection to be created. + /// Is thrown in case requested operation fails for any reason. + private void CreateCollection(Runspace runspace, Uri rootWebApplicationUri, SharePointSiteCollection siteCollection) + { + string siteCollectionUrl = String.Format("{0}:{1}", siteCollection.Url, rootWebApplicationUri.Port); + HostedSolutionLog.DebugInfo("siteCollectionUrl: {0}", siteCollectionUrl); + + try + { + SPWebApplication rootWebApplication = SPWebApplication.Lookup(rootWebApplicationUri); + rootWebApplication.Sites.Add(siteCollectionUrl, siteCollection.Title, siteCollection.Description, (uint) siteCollection.LocaleId, String.Empty, siteCollection.OwnerLogin, siteCollection.OwnerName, siteCollection.OwnerEmail, null, null, null, true); + rootWebApplication.Update(); + } + catch (Exception) + { + DeleteSiteCollection(runspace, siteCollectionUrl, true); + throw; + } + + try + { + GrantAccess(runspace, rootWebApplicationUri); + var command = new Command("Set-SPSite"); + command.Parameters.Add("Identity", siteCollectionUrl); + + if (siteCollection.MaxSiteStorage != -1) + { + command.Parameters.Add("MaxSize", siteCollection.MaxSiteStorage*1024*1024); + } + + if (siteCollection.WarningStorage != -1 && siteCollection.MaxSiteStorage != -1) + { + command.Parameters.Add("WarningSize", Math.Min(siteCollection.WarningStorage, siteCollection.MaxSiteStorage)*1024*1024); + } + + ExecuteShellCommand(runspace, command); + } + catch (Exception) + { + DeleteQuotaTemplate(siteCollection.Title); + DeleteSiteCollection(runspace, siteCollectionUrl, true); + throw; + } + + AddHostsRecord(siteCollection); + } + + /// Deletes site collection under given url. + /// Root web application uri. + /// The site collection to be deleted. + /// Is thrown in case requested operation fails for any reason. + public void DeleteSiteCollection(Uri rootWebApplicationUri, SharePointSiteCollection siteCollection) + { + HostedSolutionLog.LogStart("DeleteSiteCollection"); + Runspace runspace = null; + + try + { + string siteCollectionUrl = String.Format("{0}:{1}", siteCollection.Url, rootWebApplicationUri.Port); + HostedSolutionLog.DebugInfo("siteCollectionUrl: {0}", siteCollectionUrl); + runspace = OpenRunspace(); + DeleteSiteCollection(runspace, siteCollectionUrl, false); + RemoveHostsRecord(siteCollection); + } + catch (Exception ex) + { + throw new InvalidOperationException("Failed to delete site collection.", ex); + } + finally + { + CloseRunspace(runspace); + HostedSolutionLog.LogEnd("DeleteSiteCollection"); + } + } + + /// Backups site collection under give url. + /// Root web application uri. + /// Url that uniquely identifies site collection to be deleted. + /// Resulting backup file name. + /// A value which shows whether created backup must be archived. + /// Custom temp path for backup + /// Full path to created backup. + /// Is thrown in case requested operation fails for any reason. + public string BackupSiteCollection(Uri rootWebApplicationUri, string url, string filename, bool zip, string tempPath) + { + try + { + string siteCollectionUrl = String.Format("{0}:{1}", url, rootWebApplicationUri.Port); + HostedSolutionLog.LogStart("BackupSiteCollection"); + HostedSolutionLog.DebugInfo("siteCollectionUrl: {0}", siteCollectionUrl); + + if (String.IsNullOrEmpty(tempPath)) + { + tempPath = Path.GetTempPath(); + } + + string backupFileName = Path.Combine(tempPath, (zip ? StringUtils.CleanIdentifier(siteCollectionUrl) + ".bsh" : StringUtils.CleanIdentifier(filename))); + HostedSolutionLog.DebugInfo("backupFilePath: {0}", backupFileName); + Runspace runspace = null; + + try + { + runspace = OpenRunspace(); + var command = new Command("Backup-SPSite"); + command.Parameters.Add("Identity", siteCollectionUrl); + command.Parameters.Add("Path", backupFileName); + ExecuteShellCommand(runspace, command); + + if (zip) + { + string zipFile = Path.Combine(tempPath, filename); + string zipRoot = Path.GetDirectoryName(backupFileName); + + FileUtils.ZipFiles(zipFile, zipRoot, new[] {Path.GetFileName(backupFileName)}); + FileUtils.DeleteFile(backupFileName); + + backupFileName = zipFile; + } + + return backupFileName; + } + finally + { + CloseRunspace(runspace); + HostedSolutionLog.LogEnd("BackupSiteCollection"); + } + } + catch (Exception ex) + { + throw new InvalidOperationException("Failed to backup site collection.", ex); + } + } + + /// Restores site collection under given url from backup. + /// Root web application uri. + /// Site collection to be restored. + /// Backup file name to restore from. + /// Is thrown in case requested operation fails for any reason. + public void RestoreSiteCollection(Uri rootWebApplicationUri, SharePointSiteCollection siteCollection, string filename) + { + string url = siteCollection.Url; + + try + { + string siteCollectionUrl = String.Format("{0}:{1}", url, rootWebApplicationUri.Port); + HostedSolutionLog.LogStart("RestoreSiteCollection"); + HostedSolutionLog.DebugInfo("siteCollectionUrl: {0}", siteCollectionUrl); + + HostedSolutionLog.DebugInfo("backupFilePath: {0}", filename); + Runspace runspace = null; + + try + { + string tempPath = Path.GetTempPath(); + string expandedFile = filename; + + if (Path.GetExtension(filename).ToLower() == ".zip") + { + expandedFile = FileUtils.UnzipFiles(filename, tempPath)[0]; + + // Delete zip archive. + FileUtils.DeleteFile(filename); + } + + runspace = OpenRunspace(); + DeleteSiteCollection(runspace, siteCollectionUrl, false); + var command = new Command("Restore-SPSite"); + command.Parameters.Add("Identity", siteCollectionUrl); + command.Parameters.Add("Path", filename); + ExecuteShellCommand(runspace, command); + + command = new Command("Set-SPSite"); + command.Parameters.Add("Identity", siteCollectionUrl); + command.Parameters.Add("OwnerAlias", siteCollection.OwnerLogin); + ExecuteShellCommand(runspace, command); + + command = new Command("Set-SPUser"); + command.Parameters.Add("Identity", siteCollection.OwnerLogin); + command.Parameters.Add("Email", siteCollection.OwnerEmail); + command.Parameters.Add("DisplayName", siteCollection.Name); + ExecuteShellCommand(runspace, command); + + FileUtils.DeleteFile(expandedFile); + } + finally + { + CloseRunspace(runspace); + HostedSolutionLog.LogEnd("RestoreSiteCollection"); + } + } + catch (Exception ex) + { + throw new InvalidOperationException("Failed to restore site collection.", ex); + } + } + + /// Creates new site collection with information from administration object. + /// Administration object. + private static SharePointSiteCollection NewSiteCollection(SPSite site) + { + var siteUri = new Uri(site.Url); + string url = (siteUri.Port > 0) ? site.Url.Replace(String.Format(":{0}", siteUri.Port), String.Empty) : site.Url; + + return new SharePointSiteCollection {Url = url, OwnerLogin = site.Owner.LoginName, OwnerName = site.Owner.Name, OwnerEmail = site.Owner.Email, LocaleId = site.RootWeb.Locale.LCID, Title = site.RootWeb.Title, Description = site.RootWeb.Description, Bandwidth = site.Usage.Bandwidth, Diskspace = site.Usage.Storage, MaxSiteStorage = site.Quota.StorageMaximumLevel, WarningStorage = site.Quota.StorageWarningLevel}; + } + + /// Gets SharePoint sites collection. + /// The root web application uri. + /// The SharePoint sites. + private Dictionary GetSPSiteCollections(Uri rootWebApplicationUri) + { + Runspace runspace = null; + var collections = new Dictionary(); + + try + { + runspace = OpenRunspace(); + var cmd = new Command("Get-SPSite"); + cmd.Parameters.Add("WebApplication", rootWebApplicationUri.AbsoluteUri); + Collection result = ExecuteShellCommand(runspace, cmd); + + if (result != null) + { + foreach (PSObject psObject in result) + { + var spSite = psObject.BaseObject as SPSite; + + if (spSite != null) + { + collections.Add(spSite.Url, spSite); + } + } + } + } + finally + { + CloseRunspace(runspace); + } + + return collections; + } + + /// Gets SharePoint site collection. + /// The root web application uri. + /// The required site url. + /// The SharePoint sites. + private SPSite GetSPSiteCollection(Uri rootWebApplicationUri, string url) + { + Runspace runspace = null; + + try + { + string siteCollectionUrl = String.Format("{0}:{1}", url, rootWebApplicationUri.Port); + runspace = OpenRunspace(); + var cmd = new Command("Get-SPSite"); + cmd.Parameters.Add("Identity", siteCollectionUrl); + Collection result = ExecuteShellCommand(runspace, cmd); + + if (result != null && result.Count() == 1) + { + var spSite = result.First().BaseObject as SPSite; + + if (spSite == null) + { + throw new ApplicationException(string.Format("SiteCollection {0} does not exist", url)); + } + + return result.First().BaseObject as SPSite; + } + else + { + throw new ApplicationException(string.Format("SiteCollection {0} does not exist", url)); + } + } + catch (Exception ex) + { + HostedSolutionLog.LogError(ex); + throw; + } + finally + { + CloseRunspace(runspace); + } + } + + /// Opens PowerShell runspace. + /// The runspace. + private Runspace OpenRunspace() + { + HostedSolutionLog.LogStart("OpenRunspace"); + + if (runspaceConfiguration == null) + { + runspaceConfiguration = RunspaceConfiguration.Create(); + PSSnapInException exception; + runspaceConfiguration.AddPSSnapIn(SharepointSnapInName, out exception); + HostedSolutionLog.LogInfo("Sharepoint snapin loaded"); + + if (exception != null) + { + HostedSolutionLog.LogWarning("SnapIn error", exception); + } + } + + Runspace runspace = RunspaceFactory.CreateRunspace(runspaceConfiguration); + runspace.Open(); + runspace.SessionStateProxy.SetVariable("ConfirmPreference", "none"); + HostedSolutionLog.LogEnd("OpenRunspace"); + + return runspace; + } + + /// Closes runspace. + /// The runspace. + private void CloseRunspace(Runspace runspace) + { + try + { + if (runspace != null && runspace.RunspaceStateInfo.State == RunspaceState.Opened) + { + runspace.Close(); + } + } + catch (Exception ex) + { + HostedSolutionLog.LogError("Runspace error", ex); + } + } + + /// Executes shell command. + /// The runspace. + /// The command to be executed. + /// PSobjecs collection. + private Collection ExecuteShellCommand(Runspace runspace, object cmd) + { + object[] errors; + var command = cmd as Command; + + if (command != null) + { + return ExecuteShellCommand(runspace, command, out errors); + } + + return ExecuteShellCommand(runspace, cmd as List, out errors); + } + + /// Executes shell command. + /// The runspace. + /// The command to be executed. + /// The errors. + /// PSobjecs collection. + private Collection ExecuteShellCommand(Runspace runspace, Command cmd, out object[] errors) + { + HostedSolutionLog.LogStart("ExecuteShellCommand"); + var errorList = new List(); + Collection results; + + using (Pipeline pipeLine = runspace.CreatePipeline()) + { + pipeLine.Commands.Add(cmd); + results = pipeLine.Invoke(); + + if (pipeLine.Error != null && pipeLine.Error.Count > 0) + { + foreach (object item in pipeLine.Error.ReadToEnd()) + { + errorList.Add(item); + string errorMessage = string.Format("Invoke error: {0}", item); + HostedSolutionLog.LogWarning(errorMessage); + } + } + } + + errors = errorList.ToArray(); + HostedSolutionLog.LogEnd("ExecuteShellCommand"); + + return results; + } + + /// Executes shell command. + /// The runspace. + /// The scripts to be executed. + /// The errors. + /// PSobjecs collection. + private Collection ExecuteShellCommand(Runspace runspace, List scripts, out object[] errors) + { + HostedSolutionLog.LogStart("ExecuteShellCommand"); + var errorList = new List(); + Collection results; + + using (Pipeline pipeLine = runspace.CreatePipeline()) + { + foreach (string script in scripts) + { + pipeLine.Commands.AddScript(script); + } + + results = pipeLine.Invoke(); + + if (pipeLine.Error != null && pipeLine.Error.Count > 0) + { + foreach (object item in pipeLine.Error.ReadToEnd()) + { + errorList.Add(item); + string errorMessage = string.Format("Invoke error: {0}", item); + HostedSolutionLog.LogWarning(errorMessage); + + throw new ArgumentException(scripts.First()); + } + } + } + + errors = errorList.ToArray(); + HostedSolutionLog.LogEnd("ExecuteShellCommand"); + + return results; + } + + /// Adds record to hosts file. + /// The site collection object. + public void AddHostsRecord(SharePointSiteCollection siteCollection) + { + try + { + if (siteCollection.RootWebApplicationInteralIpAddress != string.Empty) + { + string dirPath = FileUtils.EvaluateSystemVariables(@"%windir%\system32\drivers\etc"); + string path = dirPath + "\\hosts"; + + if (FileUtils.FileExists(path)) + { + string content = FileUtils.GetFileTextContent(path); + content = content.Replace("\r\n", "\n").Replace("\n\r", "\n"); + string[] contentArr = content.Split(new[] {'\n'}); + bool bRecordExist = false; + + foreach (string s in contentArr) + { + if (s != string.Empty) + { + string hostName = string.Empty; + + if (s[0] != '#') + { + bool bSeperator = false; + + foreach (char c in s) + { + if ((c != ' ') & (c != '\t')) + { + if (bSeperator) + { + hostName += c; + } + } + else + { + bSeperator = true; + } + } + + if (hostName.ToLower() == siteCollection.RootWebApplicationFQDN.ToLower()) + { + bRecordExist = true; + break; + } + } + } + } + + if (!bRecordExist) + { + string outPut = contentArr.Where(o => o != string.Empty).Aggregate(string.Empty, (current, o) => current + (o + "\r\n")); + outPut += siteCollection.RootWebApplicationInteralIpAddress + '\t' + siteCollection.RootWebApplicationFQDN + "\r\n"; + FileUtils.UpdateFileTextContent(path, outPut); + } + } + } + } + catch (Exception ex) + { + HostedSolutionLog.LogError(ex); + } + } + + /// Removes record from hosts file. + /// The site collection object. + private void RemoveHostsRecord(SharePointSiteCollection siteCollection) + { + try + { + if (siteCollection.RootWebApplicationInteralIpAddress != string.Empty) + { + string dirPath = FileUtils.EvaluateSystemVariables(@"%windir%\system32\drivers\etc"); + string path = dirPath + "\\hosts"; + + if (FileUtils.FileExists(path)) + { + string content = FileUtils.GetFileTextContent(path); + content = content.Replace("\r\n", "\n").Replace("\n\r", "\n"); + string[] contentArr = content.Split(new[] {'\n'}); + string outPut = string.Empty; + + foreach (string s in contentArr) + { + if (s != string.Empty) + { + string hostName = string.Empty; + + if (s[0] != '#') + { + bool bSeperator = false; + + foreach (char c in s) + { + if ((c != ' ') & (c != '\t')) + { + if (bSeperator) + { + hostName += c; + } + } + else + { + bSeperator = true; + } + } + + if (hostName.ToLower() != siteCollection.RootWebApplicationFQDN.ToLower()) + { + outPut += s + "\r\n"; + } + } + else + { + outPut += s + "\r\n"; + } + } + } + + FileUtils.UpdateFileTextContent(path, outPut); + } + } + } + catch (Exception ex) + { + HostedSolutionLog.LogError(ex); + } + } + + #endregion + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/Properties/AssemblyInfo.cs b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/Properties/AssemblyInfo.cs new file mode 100644 index 00000000..e25dee60 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +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.HostedSolution.SharePoint2013Ent")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("WebsitePanel.Providers.HostedSolution.SharePoint2013Ent")] +[assembly: AssemblyCopyright("Copyright © 2015")] +[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("fd1db47e-461e-41ac-88cf-fb2925f48d52")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent.csproj new file mode 100644 index 00000000..27740b68 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent/WebsitePanel.Providers.HostedSolution.SharePoint2013Ent.csproj @@ -0,0 +1,75 @@ + + + + + Debug + AnyCPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252} + Library + Properties + WebsitePanel.Providers.HostedSolution.SharePoint2013Ent + WebsitePanel.Providers.HostedSolution.SharePoint2013Ent + v4.5 + 512 + + + true + full + false + ..\WebsitePanel.Server\bin\Sharepoint2013Ent\ + DEBUG;TRACE + prompt + 4 + + + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\..\Lib\References\Microsoft\Microsoft.SharePoint.dll + False + + + + + + False + ..\..\..\..\..\Windows\assembly\GAC_MSIL\System.Management.Automation\1.0.0.0__31bf3856ad364e35\System.Management.Automation.dll + + + + + + + + ..\..\Bin\WebsitePanel.Providers.Base.dll + False + + + ..\WebsitePanel.Server\bin\WebsitePanel.Providers.HostedSolution.dll + False + + + ..\WebsitePanel.Server.Utils\bin\Debug\WebsitePanel.Server.Utils.dll + False + + + + + + + + + + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.Server.Client/HostedSharePointServerEntProxy.cs b/WebsitePanel/Sources/WebsitePanel.Server.Client/HostedSharePointServerEntProxy.cs new file mode 100644 index 00000000..bec63849 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/HostedSharePointServerEntProxy.cs @@ -0,0 +1,928 @@ +// Copyright (c) 2015, 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.8657 +// +// 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.3038. +// +namespace WebsitePanel.Providers.HostedSolution { + using System.Xml.Serialization; + using System.Web.Services; + using System.ComponentModel; + using System.Web.Services.Protocols; + using System; + using System.Diagnostics; + using WebsitePanel.Providers.SharePoint; + + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="HostedSharePointServerEntSoap", Namespace="http://smbsaas/websitepanel/server/")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] + public partial class HostedSharePointServerEnt : Microsoft.Web.Services3.WebServicesClientProtocol { + + public ServiceProviderSettingsSoapHeader ServiceProviderSettingsSoapHeaderValue; + + private System.Threading.SendOrPostCallback Enterprise_GetSupportedLanguagesOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_GetSiteCollectionsOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_GetSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_CreateSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_UpdateQuotasOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_CalculateSiteCollectionsDiskSpaceOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_DeleteSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_BackupSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_RestoreSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_GetTempFileBinaryChunkOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_AppendTempFileBinaryChunkOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_GetSiteCollectionSizeOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_SetPeoplePickerOuOperationCompleted; + + /// + public HostedSharePointServerEnt() { + this.Url = "http://localhost:9003/HostedSharePointServerEnt.asmx"; + } + + /// + public event Enterprise_GetSupportedLanguagesCompletedEventHandler Enterprise_GetSupportedLanguagesCompleted; + + /// + public event Enterprise_GetSiteCollectionsCompletedEventHandler Enterprise_GetSiteCollectionsCompleted; + + /// + public event Enterprise_GetSiteCollectionCompletedEventHandler Enterprise_GetSiteCollectionCompleted; + + /// + public event Enterprise_CreateSiteCollectionCompletedEventHandler Enterprise_CreateSiteCollectionCompleted; + + /// + public event Enterprise_UpdateQuotasCompletedEventHandler Enterprise_UpdateQuotasCompleted; + + /// + public event Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventHandler Enterprise_CalculateSiteCollectionsDiskSpaceCompleted; + + /// + public event Enterprise_DeleteSiteCollectionCompletedEventHandler Enterprise_DeleteSiteCollectionCompleted; + + /// + public event Enterprise_BackupSiteCollectionCompletedEventHandler Enterprise_BackupSiteCollectionCompleted; + + /// + public event Enterprise_RestoreSiteCollectionCompletedEventHandler Enterprise_RestoreSiteCollectionCompleted; + + /// + public event Enterprise_GetTempFileBinaryChunkCompletedEventHandler Enterprise_GetTempFileBinaryChunkCompleted; + + /// + public event Enterprise_AppendTempFileBinaryChunkCompletedEventHandler Enterprise_AppendTempFileBinaryChunkCompleted; + + /// + public event Enterprise_GetSiteCollectionSizeCompletedEventHandler Enterprise_GetSiteCollectionSizeCompleted; + + /// + public event Enterprise_SetPeoplePickerOuCompletedEventHandler Enterprise_SetPeoplePickerOuCompleted; + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_GetSupportedLanguages", 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 int[] Enterprise_GetSupportedLanguages() { + object[] results = this.Invoke("Enterprise_GetSupportedLanguages", new object[0]); + return ((int[])(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetSupportedLanguages(System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetSupportedLanguages", new object[0], callback, asyncState); + } + + /// + public int[] EndEnterprise_GetSupportedLanguages(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int[])(results[0])); + } + + /// + public void Enterprise_GetSupportedLanguagesAsync() { + this.Enterprise_GetSupportedLanguagesAsync(null); + } + + /// + public void Enterprise_GetSupportedLanguagesAsync(object userState) { + if ((this.Enterprise_GetSupportedLanguagesOperationCompleted == null)) { + this.Enterprise_GetSupportedLanguagesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetSupportedLanguagesOperationCompleted); + } + this.InvokeAsync("Enterprise_GetSupportedLanguages", new object[0], this.Enterprise_GetSupportedLanguagesOperationCompleted, userState); + } + + private void OnEnterprise_GetSupportedLanguagesOperationCompleted(object arg) { + if ((this.Enterprise_GetSupportedLanguagesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetSupportedLanguagesCompleted(this, new Enterprise_GetSupportedLanguagesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_GetSiteCollections", 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 SharePointSiteCollection[] Enterprise_GetSiteCollections() { + object[] results = this.Invoke("Enterprise_GetSiteCollections", new object[0]); + return ((SharePointSiteCollection[])(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetSiteCollections(System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetSiteCollections", new object[0], callback, asyncState); + } + + /// + public SharePointSiteCollection[] EndEnterprise_GetSiteCollections(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((SharePointSiteCollection[])(results[0])); + } + + /// + public void Enterprise_GetSiteCollectionsAsync() { + this.Enterprise_GetSiteCollectionsAsync(null); + } + + /// + public void Enterprise_GetSiteCollectionsAsync(object userState) { + if ((this.Enterprise_GetSiteCollectionsOperationCompleted == null)) { + this.Enterprise_GetSiteCollectionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetSiteCollectionsOperationCompleted); + } + this.InvokeAsync("Enterprise_GetSiteCollections", new object[0], this.Enterprise_GetSiteCollectionsOperationCompleted, userState); + } + + private void OnEnterprise_GetSiteCollectionsOperationCompleted(object arg) { + if ((this.Enterprise_GetSiteCollectionsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetSiteCollectionsCompleted(this, new Enterprise_GetSiteCollectionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_GetSiteCollection", 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 SharePointSiteCollection Enterprise_GetSiteCollection(string url) { + object[] results = this.Invoke("Enterprise_GetSiteCollection", new object[] { + url}); + return ((SharePointSiteCollection)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetSiteCollection(string url, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetSiteCollection", new object[] { + url}, callback, asyncState); + } + + /// + public SharePointSiteCollection EndEnterprise_GetSiteCollection(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((SharePointSiteCollection)(results[0])); + } + + /// + public void Enterprise_GetSiteCollectionAsync(string url) { + this.Enterprise_GetSiteCollectionAsync(url, null); + } + + /// + public void Enterprise_GetSiteCollectionAsync(string url, object userState) { + if ((this.Enterprise_GetSiteCollectionOperationCompleted == null)) { + this.Enterprise_GetSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_GetSiteCollection", new object[] { + url}, this.Enterprise_GetSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_GetSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_GetSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetSiteCollectionCompleted(this, new Enterprise_GetSiteCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_CreateSiteCollection", 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 Enterprise_CreateSiteCollection(SharePointSiteCollection siteCollection) { + this.Invoke("Enterprise_CreateSiteCollection", new object[] { + siteCollection}); + } + + /// + public System.IAsyncResult BeginEnterprise_CreateSiteCollection(SharePointSiteCollection siteCollection, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_CreateSiteCollection", new object[] { + siteCollection}, callback, asyncState); + } + + /// + public void EndEnterprise_CreateSiteCollection(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void Enterprise_CreateSiteCollectionAsync(SharePointSiteCollection siteCollection) { + this.Enterprise_CreateSiteCollectionAsync(siteCollection, null); + } + + /// + public void Enterprise_CreateSiteCollectionAsync(SharePointSiteCollection siteCollection, object userState) { + if ((this.Enterprise_CreateSiteCollectionOperationCompleted == null)) { + this.Enterprise_CreateSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_CreateSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_CreateSiteCollection", new object[] { + siteCollection}, this.Enterprise_CreateSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_CreateSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_CreateSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_CreateSiteCollectionCompleted(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/Enterprise_UpdateQuotas", 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 Enterprise_UpdateQuotas(string url, long maxSize, long warningSize) { + this.Invoke("Enterprise_UpdateQuotas", new object[] { + url, + maxSize, + warningSize}); + } + + /// + public System.IAsyncResult BeginEnterprise_UpdateQuotas(string url, long maxSize, long warningSize, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_UpdateQuotas", new object[] { + url, + maxSize, + warningSize}, callback, asyncState); + } + + /// + public void EndEnterprise_UpdateQuotas(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void Enterprise_UpdateQuotasAsync(string url, long maxSize, long warningSize) { + this.Enterprise_UpdateQuotasAsync(url, maxSize, warningSize, null); + } + + /// + public void Enterprise_UpdateQuotasAsync(string url, long maxSize, long warningSize, object userState) { + if ((this.Enterprise_UpdateQuotasOperationCompleted == null)) { + this.Enterprise_UpdateQuotasOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_UpdateQuotasOperationCompleted); + } + this.InvokeAsync("Enterprise_UpdateQuotas", new object[] { + url, + maxSize, + warningSize}, this.Enterprise_UpdateQuotasOperationCompleted, userState); + } + + private void OnEnterprise_UpdateQuotasOperationCompleted(object arg) { + if ((this.Enterprise_UpdateQuotasCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_UpdateQuotasCompleted(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/Enterprise_CalculateSiteCollectionsDiskSpace", 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 SharePointSiteDiskSpace[] Enterprise_CalculateSiteCollectionsDiskSpace(string[] urls) { + object[] results = this.Invoke("Enterprise_CalculateSiteCollectionsDiskSpace", new object[] { + urls}); + return ((SharePointSiteDiskSpace[])(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_CalculateSiteCollectionsDiskSpace(string[] urls, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_CalculateSiteCollectionsDiskSpace", new object[] { + urls}, callback, asyncState); + } + + /// + public SharePointSiteDiskSpace[] EndEnterprise_CalculateSiteCollectionsDiskSpace(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((SharePointSiteDiskSpace[])(results[0])); + } + + /// + public void Enterprise_CalculateSiteCollectionsDiskSpaceAsync(string[] urls) { + this.Enterprise_CalculateSiteCollectionsDiskSpaceAsync(urls, null); + } + + /// + public void Enterprise_CalculateSiteCollectionsDiskSpaceAsync(string[] urls, object userState) { + if ((this.Enterprise_CalculateSiteCollectionsDiskSpaceOperationCompleted == null)) { + this.Enterprise_CalculateSiteCollectionsDiskSpaceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_CalculateSiteCollectionsDiskSpaceOperationCompleted); + } + this.InvokeAsync("Enterprise_CalculateSiteCollectionsDiskSpace", new object[] { + urls}, this.Enterprise_CalculateSiteCollectionsDiskSpaceOperationCompleted, userState); + } + + private void OnEnterprise_CalculateSiteCollectionsDiskSpaceOperationCompleted(object arg) { + if ((this.Enterprise_CalculateSiteCollectionsDiskSpaceCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_CalculateSiteCollectionsDiskSpaceCompleted(this, new Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_DeleteSiteCollection", 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 Enterprise_DeleteSiteCollection(SharePointSiteCollection siteCollection) { + this.Invoke("Enterprise_DeleteSiteCollection", new object[] { + siteCollection}); + } + + /// + public System.IAsyncResult BeginEnterprise_DeleteSiteCollection(SharePointSiteCollection siteCollection, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_DeleteSiteCollection", new object[] { + siteCollection}, callback, asyncState); + } + + /// + public void EndEnterprise_DeleteSiteCollection(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void Enterprise_DeleteSiteCollectionAsync(SharePointSiteCollection siteCollection) { + this.Enterprise_DeleteSiteCollectionAsync(siteCollection, null); + } + + /// + public void Enterprise_DeleteSiteCollectionAsync(SharePointSiteCollection siteCollection, object userState) { + if ((this.Enterprise_DeleteSiteCollectionOperationCompleted == null)) { + this.Enterprise_DeleteSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_DeleteSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_DeleteSiteCollection", new object[] { + siteCollection}, this.Enterprise_DeleteSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_DeleteSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_DeleteSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_DeleteSiteCollectionCompleted(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/Enterprise_BackupSiteCollection", 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 Enterprise_BackupSiteCollection(string url, string filename, bool zip) { + object[] results = this.Invoke("Enterprise_BackupSiteCollection", new object[] { + url, + filename, + zip}); + return ((string)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_BackupSiteCollection(string url, string filename, bool zip, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_BackupSiteCollection", new object[] { + url, + filename, + zip}, callback, asyncState); + } + + /// + public string EndEnterprise_BackupSiteCollection(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string)(results[0])); + } + + /// + public void Enterprise_BackupSiteCollectionAsync(string url, string filename, bool zip) { + this.Enterprise_BackupSiteCollectionAsync(url, filename, zip, null); + } + + /// + public void Enterprise_BackupSiteCollectionAsync(string url, string filename, bool zip, object userState) { + if ((this.Enterprise_BackupSiteCollectionOperationCompleted == null)) { + this.Enterprise_BackupSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_BackupSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_BackupSiteCollection", new object[] { + url, + filename, + zip}, this.Enterprise_BackupSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_BackupSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_BackupSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_BackupSiteCollectionCompleted(this, new Enterprise_BackupSiteCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_RestoreSiteCollection", 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 Enterprise_RestoreSiteCollection(SharePointSiteCollection siteCollection, string filename) { + this.Invoke("Enterprise_RestoreSiteCollection", new object[] { + siteCollection, + filename}); + } + + /// + public System.IAsyncResult BeginEnterprise_RestoreSiteCollection(SharePointSiteCollection siteCollection, string filename, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_RestoreSiteCollection", new object[] { + siteCollection, + filename}, callback, asyncState); + } + + /// + public void EndEnterprise_RestoreSiteCollection(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void Enterprise_RestoreSiteCollectionAsync(SharePointSiteCollection siteCollection, string filename) { + this.Enterprise_RestoreSiteCollectionAsync(siteCollection, filename, null); + } + + /// + public void Enterprise_RestoreSiteCollectionAsync(SharePointSiteCollection siteCollection, string filename, object userState) { + if ((this.Enterprise_RestoreSiteCollectionOperationCompleted == null)) { + this.Enterprise_RestoreSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_RestoreSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_RestoreSiteCollection", new object[] { + siteCollection, + filename}, this.Enterprise_RestoreSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_RestoreSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_RestoreSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_RestoreSiteCollectionCompleted(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/Enterprise_GetTempFileBinaryChunk", RequestNamespace="http://smbsaas/websitepanel/server/", ResponseNamespace="http://smbsaas/websitepanel/server/", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] Enterprise_GetTempFileBinaryChunk(string path, int offset, int length) { + object[] results = this.Invoke("Enterprise_GetTempFileBinaryChunk", new object[] { + path, + offset, + length}); + return ((byte[])(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetTempFileBinaryChunk(string path, int offset, int length, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetTempFileBinaryChunk", new object[] { + path, + offset, + length}, callback, asyncState); + } + + /// + public byte[] EndEnterprise_GetTempFileBinaryChunk(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((byte[])(results[0])); + } + + /// + public void Enterprise_GetTempFileBinaryChunkAsync(string path, int offset, int length) { + this.Enterprise_GetTempFileBinaryChunkAsync(path, offset, length, null); + } + + /// + public void Enterprise_GetTempFileBinaryChunkAsync(string path, int offset, int length, object userState) { + if ((this.Enterprise_GetTempFileBinaryChunkOperationCompleted == null)) { + this.Enterprise_GetTempFileBinaryChunkOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetTempFileBinaryChunkOperationCompleted); + } + this.InvokeAsync("Enterprise_GetTempFileBinaryChunk", new object[] { + path, + offset, + length}, this.Enterprise_GetTempFileBinaryChunkOperationCompleted, userState); + } + + private void OnEnterprise_GetTempFileBinaryChunkOperationCompleted(object arg) { + if ((this.Enterprise_GetTempFileBinaryChunkCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetTempFileBinaryChunkCompleted(this, new Enterprise_GetTempFileBinaryChunkCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_AppendTempFileBinaryChunk", 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 Enterprise_AppendTempFileBinaryChunk(string fileName, string path, [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] byte[] chunk) { + object[] results = this.Invoke("Enterprise_AppendTempFileBinaryChunk", new object[] { + fileName, + path, + chunk}); + return ((string)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_AppendTempFileBinaryChunk(string fileName, string path, byte[] chunk, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_AppendTempFileBinaryChunk", new object[] { + fileName, + path, + chunk}, callback, asyncState); + } + + /// + public string EndEnterprise_AppendTempFileBinaryChunk(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string)(results[0])); + } + + /// + public void Enterprise_AppendTempFileBinaryChunkAsync(string fileName, string path, byte[] chunk) { + this.Enterprise_AppendTempFileBinaryChunkAsync(fileName, path, chunk, null); + } + + /// + public void Enterprise_AppendTempFileBinaryChunkAsync(string fileName, string path, byte[] chunk, object userState) { + if ((this.Enterprise_AppendTempFileBinaryChunkOperationCompleted == null)) { + this.Enterprise_AppendTempFileBinaryChunkOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_AppendTempFileBinaryChunkOperationCompleted); + } + this.InvokeAsync("Enterprise_AppendTempFileBinaryChunk", new object[] { + fileName, + path, + chunk}, this.Enterprise_AppendTempFileBinaryChunkOperationCompleted, userState); + } + + private void OnEnterprise_AppendTempFileBinaryChunkOperationCompleted(object arg) { + if ((this.Enterprise_AppendTempFileBinaryChunkCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_AppendTempFileBinaryChunkCompleted(this, new Enterprise_AppendTempFileBinaryChunkCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_GetSiteCollectionSize", 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 long Enterprise_GetSiteCollectionSize(string url) { + object[] results = this.Invoke("Enterprise_GetSiteCollectionSize", new object[] { + url}); + return ((long)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetSiteCollectionSize(string url, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetSiteCollectionSize", new object[] { + url}, callback, asyncState); + } + + /// + public long EndEnterprise_GetSiteCollectionSize(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((long)(results[0])); + } + + /// + public void Enterprise_GetSiteCollectionSizeAsync(string url) { + this.Enterprise_GetSiteCollectionSizeAsync(url, null); + } + + /// + public void Enterprise_GetSiteCollectionSizeAsync(string url, object userState) { + if ((this.Enterprise_GetSiteCollectionSizeOperationCompleted == null)) { + this.Enterprise_GetSiteCollectionSizeOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetSiteCollectionSizeOperationCompleted); + } + this.InvokeAsync("Enterprise_GetSiteCollectionSize", new object[] { + url}, this.Enterprise_GetSiteCollectionSizeOperationCompleted, userState); + } + + private void OnEnterprise_GetSiteCollectionSizeOperationCompleted(object arg) { + if ((this.Enterprise_GetSiteCollectionSizeCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetSiteCollectionSizeCompleted(this, new Enterprise_GetSiteCollectionSizeCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapHeaderAttribute("ServiceProviderSettingsSoapHeaderValue")] + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/server/Enterprise_SetPeoplePickerOu", 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 Enterprise_SetPeoplePickerOu(string site, string ou) { + this.Invoke("Enterprise_SetPeoplePickerOu", new object[] { + site, + ou}); + } + + /// + public System.IAsyncResult BeginEnterprise_SetPeoplePickerOu(string site, string ou, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_SetPeoplePickerOu", new object[] { + site, + ou}, callback, asyncState); + } + + /// + public void EndEnterprise_SetPeoplePickerOu(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void Enterprise_SetPeoplePickerOuAsync(string site, string ou) { + this.Enterprise_SetPeoplePickerOuAsync(site, ou, null); + } + + /// + public void Enterprise_SetPeoplePickerOuAsync(string site, string ou, object userState) { + if ((this.Enterprise_SetPeoplePickerOuOperationCompleted == null)) { + this.Enterprise_SetPeoplePickerOuOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_SetPeoplePickerOuOperationCompleted); + } + this.InvokeAsync("Enterprise_SetPeoplePickerOu", new object[] { + site, + ou}, this.Enterprise_SetPeoplePickerOuOperationCompleted, userState); + } + + private void OnEnterprise_SetPeoplePickerOuOperationCompleted(object arg) { + if ((this.Enterprise_SetPeoplePickerOuCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_SetPeoplePickerOuCompleted(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.3038")] + public delegate void Enterprise_GetSupportedLanguagesCompletedEventHandler(object sender, Enterprise_GetSupportedLanguagesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetSupportedLanguagesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetSupportedLanguagesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_GetSiteCollectionsCompletedEventHandler(object sender, Enterprise_GetSiteCollectionsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetSiteCollectionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetSiteCollectionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public SharePointSiteCollection[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((SharePointSiteCollection[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_GetSiteCollectionCompletedEventHandler(object sender, Enterprise_GetSiteCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetSiteCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetSiteCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public SharePointSiteCollection Result { + get { + this.RaiseExceptionIfNecessary(); + return ((SharePointSiteCollection)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_CreateSiteCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_UpdateQuotasCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventHandler(object sender, Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public SharePointSiteDiskSpace[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((SharePointSiteDiskSpace[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_DeleteSiteCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_BackupSiteCollectionCompletedEventHandler(object sender, Enterprise_BackupSiteCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_BackupSiteCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_BackupSiteCollectionCompletedEventArgs(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.3038")] + public delegate void Enterprise_RestoreSiteCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_GetTempFileBinaryChunkCompletedEventHandler(object sender, Enterprise_GetTempFileBinaryChunkCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetTempFileBinaryChunkCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetTempFileBinaryChunkCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public byte[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((byte[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_AppendTempFileBinaryChunkCompletedEventHandler(object sender, Enterprise_AppendTempFileBinaryChunkCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_AppendTempFileBinaryChunkCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_AppendTempFileBinaryChunkCompletedEventArgs(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.3038")] + public delegate void Enterprise_GetSiteCollectionSizeCompletedEventHandler(object sender, Enterprise_GetSiteCollectionSizeCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetSiteCollectionSizeCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetSiteCollectionSizeCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public long Result { + get { + this.RaiseExceptionIfNecessary(); + return ((long)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_SetPeoplePickerOuCompletedEventHandler(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 751a8fe5..c68a63eb 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server.Client/WebsitePanel.Server.Client.csproj @@ -82,6 +82,7 @@ + diff --git a/WebsitePanel/Sources/WebsitePanel.Server.sln b/WebsitePanel/Sources/WebsitePanel.Server.sln index c5af78c6..b06fa4e6 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server.sln +++ b/WebsitePanel/Sources/WebsitePanel.Server.sln @@ -1,6 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 12.00 # Visual Studio 2013 -VisualStudioVersion = 12.0.30723.0 +VisualStudioVersion = 12.0.31101.0 MinimumVisualStudioVersion = 10.0.40219.1 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Caching Application Block", "Caching Application Block", "{C8E6F2E4-A5B8-486A-A56E-92D864524682}" ProjectSection(SolutionItems) = preProject @@ -152,6 +152,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Mail EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.Virtualization.HyperV2012R2", "WebsitePanel.Providers.Virtualization.HyperV-2012R2\WebsitePanel.Providers.Virtualization.HyperV2012R2.csproj", "{EE40516B-93DF-4CAB-80C4-64DCE0B751CC}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "WebsitePanel.Providers.HostedSolution.SharePoint2013Ent", "WebsitePanel.Providers.HostedSolution.SharePoint2013Ent\WebsitePanel.Providers.HostedSolution.SharePoint2013Ent.csproj", "{0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -762,6 +764,16 @@ Global {EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU {EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Release|Mixed Platforms.Build.0 = Release|Any CPU {EE40516B-93DF-4CAB-80C4-64DCE0B751CC}.Release|x86.ActiveCfg = Release|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Debug|Any CPU.Build.0 = Debug|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Debug|Mixed Platforms.ActiveCfg = Debug|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Debug|Mixed Platforms.Build.0 = Debug|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Debug|x86.ActiveCfg = Debug|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Release|Any CPU.ActiveCfg = Release|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Release|Any CPU.Build.0 = Release|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Release|Mixed Platforms.ActiveCfg = Release|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Release|Mixed Platforms.Build.0 = Release|Any CPU + {0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}.Release|x86.ActiveCfg = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/WebsitePanel/Sources/WebsitePanel.Server/HostedSharePointServerEnt.asmx b/WebsitePanel/Sources/WebsitePanel.Server/HostedSharePointServerEnt.asmx new file mode 100644 index 00000000..6eb0df72 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server/HostedSharePointServerEnt.asmx @@ -0,0 +1 @@ +<%@ WebService Language="C#" CodeBehind="HostedSharePointServerEnt.asmx.cs" Class="WebsitePanel.Server.HostedSharePointServerEnt" %> diff --git a/WebsitePanel/Sources/WebsitePanel.Server/HostedSharePointServerEnt.asmx.cs b/WebsitePanel/Sources/WebsitePanel.Server/HostedSharePointServerEnt.asmx.cs new file mode 100644 index 00000000..778e17c0 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Server/HostedSharePointServerEnt.asmx.cs @@ -0,0 +1,274 @@ +// Copyright (c) 2015, 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.ComponentModel; +using System.Web.Services; +using System.Web.Services.Protocols; +using WebsitePanel.Providers; +using WebsitePanel.Providers.HostedSolution; +using WebsitePanel.Providers.SharePoint; +using WebsitePanel.Server.Utils; +using Microsoft.Web.Services3; + +namespace WebsitePanel.Server +{ + /// + /// Summary description for HostedSharePointServerEnt + /// + [WebService(Namespace = "http://smbsaas/websitepanel/server/")] + [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)] + [Policy("ServerPolicy")] + [ToolboxItem(false)] + public class HostedSharePointServerEnt : HostingServiceProviderWebService + { + private delegate TReturn Action(); + + /// + /// Gets hosted SharePoint provider instance. + /// + private IHostedSharePointServerEnt HostedSharePointServerEntProvider + { + get { return (IHostedSharePointServerEnt)Provider; } + } + + /// + /// Gets list of supported languages by this installation of SharePoint. + /// + /// List of supported languages + [WebMethod, SoapHeader("settings")] + public int[] Enterprise_GetSupportedLanguages() + { + return ExecuteAction(delegate + { + return HostedSharePointServerEntProvider.Enterprise_GetSupportedLanguages(); + }, "GetSupportedLanguages"); + } + + + /// + /// Gets list of SharePoint collections within root web application. + /// + /// List of SharePoint collections within root web application. + [WebMethod, SoapHeader("settings")] + public SharePointSiteCollection[] Enterprise_GetSiteCollections() + { + return ExecuteAction(delegate + { + return HostedSharePointServerEntProvider.Enterprise_GetSiteCollections(); + }, "GetSiteCollections"); + } + + /// + /// Gets SharePoint collection within root web application with given name. + /// + /// Url that uniquely identifies site collection to be loaded. + /// SharePoint collection within root web application with given name. + [WebMethod, SoapHeader("settings")] + public SharePointSiteCollection Enterprise_GetSiteCollection(string url) + { + return ExecuteAction(delegate + { + return HostedSharePointServerEntProvider.Enterprise_GetSiteCollection(url); + }, "GetSiteCollection"); + } + + /// + /// Creates site collection within predefined root web application. + /// + /// Information about site coolection to be created. + [WebMethod, SoapHeader("settings")] + public void Enterprise_CreateSiteCollection(SharePointSiteCollection siteCollection) + { + siteCollection.OwnerLogin = AttachNetbiosDomainName(siteCollection.OwnerLogin); + ExecuteAction(delegate + { + HostedSharePointServerEntProvider.Enterprise_CreateSiteCollection(siteCollection); + return new object(); + }, "CreateSiteCollection"); + } + + + [WebMethod, SoapHeader("settings")] + public void Enterprise_UpdateQuotas(string url, long maxSize, long warningSize) + { + ExecuteAction(delegate + { + HostedSharePointServerEntProvider.Enterprise_UpdateQuotas(url, maxSize, warningSize); + return new object(); + }, "UpdateQuotas"); + + + + } + + [WebMethod, SoapHeader("settings")] + public SharePointSiteDiskSpace[] Enterprise_CalculateSiteCollectionsDiskSpace(string[] urls) + { + SharePointSiteDiskSpace[] ret = null; + ret = ExecuteAction(delegate + { + return HostedSharePointServerEntProvider.Enterprise_CalculateSiteCollectionsDiskSpace(urls); + }, "CalculateSiteCollectionDiskSpace"); + return ret; + + } + /// + /// Deletes site collection under given url. + /// + /// Url that uniquely identifies site collection to be deleted. + [WebMethod, SoapHeader("settings")] + public void Enterprise_DeleteSiteCollection(SharePointSiteCollection siteCollection) + { + ExecuteAction(delegate + { + HostedSharePointServerEntProvider.Enterprise_DeleteSiteCollection(siteCollection); + return new object(); + }, "DeleteSiteCollection"); + } + /// + /// Backups site collection under give url. + /// + /// Url that uniquely identifies site collection to be deleted. + /// Resulting backup file name. + /// A value which shows whether created backup must be archived. + /// Created backup full path. + [WebMethod, SoapHeader("settings")] + public string Enterprise_BackupSiteCollection(string url, string filename, bool zip) + { + return ExecuteAction(delegate + { + return + HostedSharePointServerEntProvider.Enterprise_BackupSiteCollection(url, filename, zip); + }, "BackupSiteCollection"); + } + + /// + /// Restores site collection under given url from backup. + /// + /// Site collection to be restored. + /// Backup file name to restore from. + [WebMethod, SoapHeader("settings")] + public void Enterprise_RestoreSiteCollection(SharePointSiteCollection siteCollection, string filename) + { + siteCollection.OwnerLogin = AttachNetbiosDomainName(siteCollection.OwnerLogin); + ExecuteAction(delegate + { + HostedSharePointServerEntProvider.Enterprise_RestoreSiteCollection(siteCollection, filename); + return new object(); + }, "RestoreSiteCollection"); + } + + /// + /// Gets binary data chunk of specified size from specified offset. + /// + /// Path to file to get bunary data chunk from. + /// Offset from which to start data reading. + /// Binary data chunk length. + /// Binary data chunk read from file. + [WebMethod, SoapHeader("settings")] + public byte[] Enterprise_GetTempFileBinaryChunk(string path, int offset, int length) + { + return ExecuteAction(delegate + { + return + HostedSharePointServerEntProvider.Enterprise_GetTempFileBinaryChunk(path, offset, length); + }, "GetTempFileBinaryChunk"); + } + + /// + /// Appends supplied binary data chunk to file. + /// + /// Non existent file name to append to. + /// Full path to existent file to append to. + /// Binary data chunk to append to. + /// Path to file that was appended with chunk. + [WebMethod, SoapHeader("settings")] + public virtual string Enterprise_AppendTempFileBinaryChunk(string fileName, string path, byte[] chunk) + { + return ExecuteAction(delegate + { + return + HostedSharePointServerEntProvider.Enterprise_AppendTempFileBinaryChunk(fileName, path, chunk); + }, "AppendTempFileBinaryChunk"); + } + + + [WebMethod, SoapHeader("settings")] + public long Enterprise_GetSiteCollectionSize(string url) + { + return ExecuteAction(delegate + { + return + HostedSharePointServerEntProvider.Enterprise_GetSiteCollectionSize(url); + }, "GetSiteCollectionSize"); + } + + + [WebMethod, SoapHeader("settings")] + public void Enterprise_SetPeoplePickerOu(string site, string ou) + { + HostedSharePointServerEntProvider.Enterprise_SetPeoplePickerOu(site, ou); + } + + + /// + /// Executes supplied action and performs logging. + /// + /// Type of action's return value. + /// Action to be executed. + /// Action name for logging purposes. + /// Action execution result. + private TReturn ExecuteAction(Action action, string actionName) + { + try + { + Log.WriteStart("'{0}' {1}", ProviderSettings.ProviderName, actionName); + TReturn result = action(); + Log.WriteEnd("'{0}' {1}", ProviderSettings.ProviderName, actionName); + return result; + } + catch (Exception ex) + { + Log.WriteError(String.Format("Can't {1} '{0}' provider", ProviderSettings.ProviderName, actionName), ex); + throw; + } + } + + /// + /// Returns fully qualified netbios account name. + /// + /// Account name. + /// Fully qualified netbios account name. + private string AttachNetbiosDomainName(string accountName) + { + string domainNetbiosName = String.Format("{0}\\", ActiveDirectoryUtils.GetNETBIOSDomainName(ServerSettings.ADRootDomain)); + return String.Format("{0}{1}", domainNetbiosName, accountName.Replace(domainNetbiosName, String.Empty)); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj index 8b9f3b8d..2c8eda9a 100644 --- a/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Server/WebsitePanel.Server.csproj @@ -157,6 +157,8 @@ + + @@ -270,6 +272,7 @@ + @@ -319,6 +322,10 @@ EnterpriseStorage.asmx Component + + HostedSharePointServerEnt.asmx + Component + RemoteDesktopServices.asmx Component diff --git a/WebsitePanel/Sources/generate_server_proxies.bat b/WebsitePanel/Sources/generate_server_proxies.bat index 1ed0de0e..cd4f2b8a 100644 --- a/WebsitePanel/Sources/generate_server_proxies.bat +++ b/WebsitePanel/Sources/generate_server_proxies.bat @@ -17,8 +17,8 @@ REM %WSE_CLEAN% .\WebsitePanel.Server.Client\DatabaseServerProxy.cs REM %WSDL% %SERVER_URL%/DNSServer.asmx /out:.\WebsitePanel.Server.Client\DnsServerProxy.cs /namespace:WebsitePanel.Providers.DNS /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\DnsServerProxy.cs -%WSDL% %SERVER_URL%/ExchangeServer.asmx /out:.\WebsitePanel.Server.Client\ExchangeServerProxy.cs /namespace:WebsitePanel.Providers.Exchange /type:webClient /fields -%WSE_CLEAN% .\WebsitePanel.Server.Client\ExchangeServerProxy.cs +REM %WSDL% %SERVER_URL%/ExchangeServer.asmx /out:.\WebsitePanel.Server.Client\ExchangeServerProxy.cs /namespace:WebsitePanel.Providers.Exchange /type:webClient /fields +REM %WSE_CLEAN% .\WebsitePanel.Server.Client\ExchangeServerProxy.cs REM %WSDL% %SERVER_URL%/ExchangeServerHostedEdition.asmx /out:.\WebsitePanel.Server.Client\ExchangeServerHostedEditionProxy.cs /namespace:WebsitePanel.Providers.ExchangeHostedEdition /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\ExchangeServerHostedEditionProxy.cs @@ -26,6 +26,9 @@ REM %WSE_CLEAN% .\WebsitePanel.Server.Client\ExchangeServerHostedEditionProxy.cs REM %WSDL% %SERVER_URL%/HostedSharePointServer.asmx /out:.\WebsitePanel.Server.Client\HostedSharePointServerProxy.cs /namespace:WebsitePanel.Providers.HostedSolution /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\HostedSharePointServerProxy.cs +%WSDL% %SERVER_URL%/HostedSharePointServerEnt.asmx /out:.\WebsitePanel.Server.Client\HostedSharePointServerEntProxy.cs /namespace:WebsitePanel.Providers.HostedSolution /type:webClient /fields +%WSE_CLEAN% .\WebsitePanel.Server.Client\HostedSharePointServerEntProxy.cs + REM %WSDL% %SERVER_URL%/OCSEdgeServer.asmx /out:.\WebsitePanel.Server.Client\OCSEdgeServerProxy.cs /namespace:WebsitePanel.Providers.OCS /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\OCSEdgeServerProxy.cs @@ -35,8 +38,8 @@ REM %WSE_CLEAN% .\WebsitePanel.Server.Client\OCSServerProxy.cs REM %WSDL% %SERVER_URL%/OperatingSystem.asmx /out:.\WebsitePanel.Server.Client\OperatingSystemProxy.cs /namespace:WebsitePanel.Providers.OS /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\OperatingSystemProxy.cs -%WSDL% %SERVER_URL%/Organizations.asmx /out:.\WebsitePanel.Server.Client\OrganizationProxy.cs /namespace:WebsitePanel.Providers.HostedSolution /type:webClient /fields -%WSE_CLEAN% .\WebsitePanel.Server.Client\OrganizationProxy.cs +REM %WSDL% %SERVER_URL%/Organizations.asmx /out:.\WebsitePanel.Server.Client\OrganizationProxy.cs /namespace:WebsitePanel.Providers.HostedSolution /type:webClient /fields +REM %WSE_CLEAN% .\WebsitePanel.Server.Client\OrganizationProxy.cs REM %WSDL% %SERVER_URL%/ServiceProvider.asmx /out:.\WebsitePanel.Server.Client\ServiceProviderProxy.cs /namespace:WebsitePanel.Providers /type:webClient /fields REM %WSE_CLEAN% .\WebsitePanel.Server.Client\ServiceProviderProxy.cs From 820dc84bc2616ef01687d147f3ac064c08839fbb Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 5 Apr 2015 08:03:26 +0800 Subject: [PATCH 05/41] Sharepoint Enterprise Integrated --- WebsitePanel/Sources/generate_es_proxies.bat | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Sources/generate_es_proxies.bat b/WebsitePanel/Sources/generate_es_proxies.bat index 4f45afb7..ebfa40a4 100644 --- a/WebsitePanel/Sources/generate_es_proxies.bat +++ b/WebsitePanel/Sources/generate_es_proxies.bat @@ -47,6 +47,9 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\FilesProxy.cs REM %WSDL% %SERVER_URL%/esHostedSharePointServers.asmx /out:.\WebsitePanel.EnterpriseServer.Client\HostedSharePointServersProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\HostedSharePointServersProxy.cs +REM %WSDL% %SERVER_URL%/esHostedSharePointServersEnt.asmx /out:.\WebsitePanel.EnterpriseServer.Client\HostedSharePointServersEntProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient +REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\HostedSharePointServersEntProxy.cs + REM %WSDL% %SERVER_URL%/esImport.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ImportProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ImportProxy.cs @@ -56,8 +59,8 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OCSProxy.cs REM %WSDL% %SERVER_URL%/esOperatingSystems.asmx /out:.\WebsitePanel.EnterpriseServer.Client\OperatingSystemsProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OperatingSystemsProxy.cs -%WSDL% %SERVER_URL%/esOrganizations.asmx /out:.\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs /namespace:WebsitePanel.EnterpriseServer.HostedSolution /type:webClient -%WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs +REM %WSDL% %SERVER_URL%/esOrganizations.asmx /out:.\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs /namespace:WebsitePanel.EnterpriseServer.HostedSolution /type:webClient +REB %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\OrganizationProxy.cs REM %WSDL% %SERVER_URL%/esPackages.asmx /out:.\WebsitePanel.EnterpriseServer.Client\PackagesProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\PackagesProxy.cs From aa5a0cfc4454164637abeff1511101ce67a04357 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 5 Apr 2015 08:13:57 +0800 Subject: [PATCH 06/41] Sharepoitn 2013 Fix up methods --- .../HostedSharePointServersProxy.cs | 29 +++++++++++++++++ .../esHostedSharePointServersEnt.asmx.cs | 32 +++++++++---------- WebsitePanel/Sources/generate_es_proxies.bat | 4 +-- 3 files changed, 47 insertions(+), 18 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HostedSharePointServersProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HostedSharePointServersProxy.cs index 0a2fb384..63534afd 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HostedSharePointServersProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HostedSharePointServersProxy.cs @@ -1,3 +1,32 @@ +// Copyright (c) 2015, 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. diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx.cs index e5b51f35..3837ca4c 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx.cs @@ -58,7 +58,7 @@ namespace WebsitePanel.EnterpriseServer /// Resource group name. /// Site collections in raw format. [WebMethod] - public SharePointSiteCollectionListPaged GetSiteCollectionsPaged(int packageId, int organizationId, + public SharePointSiteCollectionListPaged Enterprise_GetSiteCollectionsPaged(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { return HostedSharePointServerEntController.GetSiteCollectionsPaged(packageId, organizationId, filterColumn, filterValue, @@ -70,7 +70,7 @@ namespace WebsitePanel.EnterpriseServer /// /// List of supported languages [WebMethod] - public int[] GetSupportedLanguages(int packageId) + public int[] Enterprise_GetSupportedLanguages(int packageId) { return HostedSharePointServerEntController.GetSupportedLanguages(packageId); } @@ -83,13 +83,13 @@ namespace WebsitePanel.EnterpriseServer /// Resource group name. /// List of found site collections. [WebMethod] - public List GetSiteCollections(int packageId, bool recursive) + public List Enterprise_GetSiteCollections(int packageId, bool recursive) { return HostedSharePointServerEntController.GetSiteCollections(packageId, recursive); } [WebMethod] - public int SetStorageSettings(int itemId, int maxStorage, int warningStorage, bool applyToSiteCollections) + public int Enterprise_SetStorageSettings(int itemId, int maxStorage, int warningStorage, bool applyToSiteCollections) { return HostedSharePointServerEntController.SetStorageSettings(itemId, maxStorage, warningStorage, applyToSiteCollections ); } @@ -100,7 +100,7 @@ namespace WebsitePanel.EnterpriseServer /// Site collection id within metabase. /// Site collection. [WebMethod] - public SharePointSiteCollection GetSiteCollection(int itemId) + public SharePointSiteCollection Enterprise_GetSiteCollection(int itemId) { return HostedSharePointServerEntController.GetSiteCollection(itemId); } @@ -113,10 +113,10 @@ namespace WebsitePanel.EnterpriseServer /// Domain name. /// SharePoint site collection or null. [WebMethod] - public SharePointSiteCollection GetSiteCollectionByDomain(int organizationId, string domain) + public SharePointSiteCollection Enterprise_GetSiteCollectionByDomain(int organizationId, string domain) { DomainInfo domainInfo = ServerController.GetDomain(domain); - SharePointSiteCollectionListPaged existentSiteCollections = this.GetSiteCollectionsPaged(domainInfo.PackageId, organizationId, "ItemName", String.Format("%{0}", domain), String.Empty, 0, Int32.MaxValue); + SharePointSiteCollectionListPaged existentSiteCollections = this.Enterprise_GetSiteCollectionsPaged(domainInfo.PackageId, organizationId, "ItemName", String.Format("%{0}", domain), String.Empty, 0, Int32.MaxValue); foreach (SharePointSiteCollection existentSiteCollection in existentSiteCollections.SiteCollections) { Uri existentSiteCollectionUri = new Uri(existentSiteCollection.Name); @@ -136,7 +136,7 @@ namespace WebsitePanel.EnterpriseServer /// Resource group name. /// Created site collection id within metabase. [WebMethod] - public int AddSiteCollection(SharePointSiteCollection item) + public int Enterprise_AddSiteCollection(SharePointSiteCollection item) { return HostedSharePointServerEntController.AddSiteCollection(item); } @@ -147,7 +147,7 @@ namespace WebsitePanel.EnterpriseServer /// Site collection id within metabase. /// ? [WebMethod] - public int DeleteSiteCollection(int itemId) + public int Enterprise_DeleteSiteCollection(int itemId) { return HostedSharePointServerEntController.DeleteSiteCollection(itemId); } @@ -158,7 +158,7 @@ namespace WebsitePanel.EnterpriseServer /// Site collection id within metabase. /// ? [WebMethod] - public int DeleteSiteCollections(int organizationId) + public int Enterprise_DeleteSiteCollections(int organizationId) { HostedSharePointServerEntController.DeleteSiteCollections(organizationId); return 0; @@ -175,7 +175,7 @@ namespace WebsitePanel.EnterpriseServer /// Local folder to store downloaded backup. /// Created backup file name. [WebMethod] - public string BackupSiteCollection(int itemId, string fileName, bool zipBackup, bool download, string folderName) + public string Enterprise_BackupSiteCollection(int itemId, string fileName, bool zipBackup, bool download, string folderName) { return HostedSharePointServerEntController.BackupSiteCollection(itemId, fileName, zipBackup, download, folderName); } @@ -188,7 +188,7 @@ namespace WebsitePanel.EnterpriseServer /// /// [WebMethod] - public int RestoreSiteCollection(int itemId, string uploadedFile, string packageFile) + public int Enterprise_RestoreSiteCollection(int itemId, string uploadedFile, string packageFile) { return HostedSharePointServerEntController.RestoreSiteCollection(itemId, uploadedFile, packageFile); } @@ -202,7 +202,7 @@ namespace WebsitePanel.EnterpriseServer /// Binary data chunk length. /// Binary data chunk read from file. [WebMethod] - public byte[] GetBackupBinaryChunk(int itemId, string path, int offset, int length) + public byte[] Enterprise_GetBackupBinaryChunk(int itemId, string path, int offset, int length) { return HostedSharePointServerEntController.GetBackupBinaryChunk(itemId, path, offset, length); } @@ -216,20 +216,20 @@ namespace WebsitePanel.EnterpriseServer /// Binary data chunk to append to. /// Path to file that was appended with chunk. [WebMethod] - public string AppendBackupBinaryChunk(int itemId, string fileName, string path, byte[] chunk) + public string Enterprise_AppendBackupBinaryChunk(int itemId, string fileName, string path, byte[] chunk) { return HostedSharePointServerEntController.AppendBackupBinaryChunk(itemId, fileName, path, chunk); } [WebMethod] - public SharePointSiteDiskSpace[] CalculateSharePointSitesDiskSpace(int itemId, out int errorCode) + public SharePointSiteDiskSpace[] Enterprise_CalculateSharePointSitesDiskSpace(int itemId, out int errorCode) { return HostedSharePointServerEntController.CalculateSharePointSitesDiskSpace(itemId, out errorCode); } [WebMethod] - public void UpdateQuota(int itemId, int siteCollectionId, int maxSize, int warningSize) + public void Enterprise_UpdateQuota(int itemId, int siteCollectionId, int maxSize, int warningSize) { HostedSharePointServerEntController.UpdateQuota(itemId, siteCollectionId, maxSize, warningSize); } diff --git a/WebsitePanel/Sources/generate_es_proxies.bat b/WebsitePanel/Sources/generate_es_proxies.bat index ebfa40a4..b80218a8 100644 --- a/WebsitePanel/Sources/generate_es_proxies.bat +++ b/WebsitePanel/Sources/generate_es_proxies.bat @@ -35,8 +35,8 @@ REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ecStorefrontProxy.cs REM %WSDL% %SERVER_URL%/ecStorehouse.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ecStorehouseProxy.cs /namespace:WebsitePanel.Ecommerce.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ecStorehouseProxy.cs -%WSDL% %SERVER_URL%/esExchangeServer.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient -%WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs +REM %WSDL% %SERVER_URL%/esExchangeServer.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient +REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ExchangeServerProxy.cs REM %WSDL% %SERVER_URL%/esExchangeHostedEdition.asmx /out:.\WebsitePanel.EnterpriseServer.Client\ExchangeHostedEditionProxy.cs /namespace:WebsitePanel.EnterpriseServer /type:webClient REM %WSE_CLEAN% .\WebsitePanel.EnterpriseServer.Client\ExchangeHostedEditionProxy.cs From a4aa1d419ec72bc64c37956043c9a6584caf23ec Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 5 Apr 2015 08:22:14 +0800 Subject: [PATCH 07/41] Sharepoitn 2013 enterprise fixed up enterprise server --- .../HostedSharePointServersEntProxy.cs | 1218 +++++++++++++++++ ...ebsitePanel.EnterpriseServer.Client.csproj | 1 + .../esHostedSharePointServersEnt.asmx | 2 +- 3 files changed, 1220 insertions(+), 1 deletion(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HostedSharePointServersEntProxy.cs diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HostedSharePointServersEntProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HostedSharePointServersEntProxy.cs new file mode 100644 index 00000000..f49885a5 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HostedSharePointServersEntProxy.cs @@ -0,0 +1,1218 @@ +// Copyright (c) 2015, 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.8009 +// +// 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.3038. +// +namespace WebsitePanel.EnterpriseServer { + using System.Xml.Serialization; + using System.Web.Services; + using System.ComponentModel; + using System.Web.Services.Protocols; + using System; + using System.Diagnostics; + using WebsitePanel.Providers.SharePoint; + using WebsitePanel.Providers; + + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + [System.Web.Services.WebServiceBindingAttribute(Name="esHostedSharePointServersEntSoap", Namespace="http://smbsaas/websitepanel/enterpriseserver")] + [System.Xml.Serialization.XmlIncludeAttribute(typeof(ServiceProviderItem))] + public partial class esHostedSharePointServersEnt : Microsoft.Web.Services3.WebServicesClientProtocol { + + private System.Threading.SendOrPostCallback Enterprise_GetSiteCollectionsPagedOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_GetSupportedLanguagesOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_GetSiteCollectionsOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_SetStorageSettingsOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_GetSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_GetSiteCollectionByDomainOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_AddSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_DeleteSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_DeleteSiteCollectionsOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_BackupSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_RestoreSiteCollectionOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_GetBackupBinaryChunkOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_AppendBackupBinaryChunkOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_CalculateSharePointSitesDiskSpaceOperationCompleted; + + private System.Threading.SendOrPostCallback Enterprise_UpdateQuotaOperationCompleted; + + /// + public esHostedSharePointServersEnt() { + this.Url = "http://localhost:9002/esHostedSharePointServersEnt.asmx"; + } + + /// + public event Enterprise_GetSiteCollectionsPagedCompletedEventHandler Enterprise_GetSiteCollectionsPagedCompleted; + + /// + public event Enterprise_GetSupportedLanguagesCompletedEventHandler Enterprise_GetSupportedLanguagesCompleted; + + /// + public event Enterprise_GetSiteCollectionsCompletedEventHandler Enterprise_GetSiteCollectionsCompleted; + + /// + public event Enterprise_SetStorageSettingsCompletedEventHandler Enterprise_SetStorageSettingsCompleted; + + /// + public event Enterprise_GetSiteCollectionCompletedEventHandler Enterprise_GetSiteCollectionCompleted; + + /// + public event Enterprise_GetSiteCollectionByDomainCompletedEventHandler Enterprise_GetSiteCollectionByDomainCompleted; + + /// + public event Enterprise_AddSiteCollectionCompletedEventHandler Enterprise_AddSiteCollectionCompleted; + + /// + public event Enterprise_DeleteSiteCollectionCompletedEventHandler Enterprise_DeleteSiteCollectionCompleted; + + /// + public event Enterprise_DeleteSiteCollectionsCompletedEventHandler Enterprise_DeleteSiteCollectionsCompleted; + + /// + public event Enterprise_BackupSiteCollectionCompletedEventHandler Enterprise_BackupSiteCollectionCompleted; + + /// + public event Enterprise_RestoreSiteCollectionCompletedEventHandler Enterprise_RestoreSiteCollectionCompleted; + + /// + public event Enterprise_GetBackupBinaryChunkCompletedEventHandler Enterprise_GetBackupBinaryChunkCompleted; + + /// + public event Enterprise_AppendBackupBinaryChunkCompletedEventHandler Enterprise_AppendBackupBinaryChunkCompleted; + + /// + public event Enterprise_CalculateSharePointSitesDiskSpaceCompletedEventHandler Enterprise_CalculateSharePointSitesDiskSpaceCompleted; + + /// + public event Enterprise_UpdateQuotaCompletedEventHandler Enterprise_UpdateQuotaCompleted; + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_GetSiteCollectionsPaged", 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 SharePointSiteCollectionListPaged Enterprise_GetSiteCollectionsPaged(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + object[] results = this.Invoke("Enterprise_GetSiteCollectionsPaged", new object[] { + packageId, + organizationId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}); + return ((SharePointSiteCollectionListPaged)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetSiteCollectionsPaged(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetSiteCollectionsPaged", new object[] { + packageId, + organizationId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, callback, asyncState); + } + + /// + public SharePointSiteCollectionListPaged EndEnterprise_GetSiteCollectionsPaged(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((SharePointSiteCollectionListPaged)(results[0])); + } + + /// + public void Enterprise_GetSiteCollectionsPagedAsync(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + this.Enterprise_GetSiteCollectionsPagedAsync(packageId, organizationId, filterColumn, filterValue, sortColumn, startRow, maximumRows, null); + } + + /// + public void Enterprise_GetSiteCollectionsPagedAsync(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) { + if ((this.Enterprise_GetSiteCollectionsPagedOperationCompleted == null)) { + this.Enterprise_GetSiteCollectionsPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetSiteCollectionsPagedOperationCompleted); + } + this.InvokeAsync("Enterprise_GetSiteCollectionsPaged", new object[] { + packageId, + organizationId, + filterColumn, + filterValue, + sortColumn, + startRow, + maximumRows}, this.Enterprise_GetSiteCollectionsPagedOperationCompleted, userState); + } + + private void OnEnterprise_GetSiteCollectionsPagedOperationCompleted(object arg) { + if ((this.Enterprise_GetSiteCollectionsPagedCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetSiteCollectionsPagedCompleted(this, new Enterprise_GetSiteCollectionsPagedCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_GetSupportedLanguages", 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 int[] Enterprise_GetSupportedLanguages(int packageId) { + object[] results = this.Invoke("Enterprise_GetSupportedLanguages", new object[] { + packageId}); + return ((int[])(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetSupportedLanguages(int packageId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetSupportedLanguages", new object[] { + packageId}, callback, asyncState); + } + + /// + public int[] EndEnterprise_GetSupportedLanguages(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int[])(results[0])); + } + + /// + public void Enterprise_GetSupportedLanguagesAsync(int packageId) { + this.Enterprise_GetSupportedLanguagesAsync(packageId, null); + } + + /// + public void Enterprise_GetSupportedLanguagesAsync(int packageId, object userState) { + if ((this.Enterprise_GetSupportedLanguagesOperationCompleted == null)) { + this.Enterprise_GetSupportedLanguagesOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetSupportedLanguagesOperationCompleted); + } + this.InvokeAsync("Enterprise_GetSupportedLanguages", new object[] { + packageId}, this.Enterprise_GetSupportedLanguagesOperationCompleted, userState); + } + + private void OnEnterprise_GetSupportedLanguagesOperationCompleted(object arg) { + if ((this.Enterprise_GetSupportedLanguagesCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetSupportedLanguagesCompleted(this, new Enterprise_GetSupportedLanguagesCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_GetSiteCollections", 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 SharePointSiteCollection[] Enterprise_GetSiteCollections(int packageId, bool recursive) { + object[] results = this.Invoke("Enterprise_GetSiteCollections", new object[] { + packageId, + recursive}); + return ((SharePointSiteCollection[])(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetSiteCollections(int packageId, bool recursive, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetSiteCollections", new object[] { + packageId, + recursive}, callback, asyncState); + } + + /// + public SharePointSiteCollection[] EndEnterprise_GetSiteCollections(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((SharePointSiteCollection[])(results[0])); + } + + /// + public void Enterprise_GetSiteCollectionsAsync(int packageId, bool recursive) { + this.Enterprise_GetSiteCollectionsAsync(packageId, recursive, null); + } + + /// + public void Enterprise_GetSiteCollectionsAsync(int packageId, bool recursive, object userState) { + if ((this.Enterprise_GetSiteCollectionsOperationCompleted == null)) { + this.Enterprise_GetSiteCollectionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetSiteCollectionsOperationCompleted); + } + this.InvokeAsync("Enterprise_GetSiteCollections", new object[] { + packageId, + recursive}, this.Enterprise_GetSiteCollectionsOperationCompleted, userState); + } + + private void OnEnterprise_GetSiteCollectionsOperationCompleted(object arg) { + if ((this.Enterprise_GetSiteCollectionsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetSiteCollectionsCompleted(this, new Enterprise_GetSiteCollectionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_SetStorageSettings", 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 int Enterprise_SetStorageSettings(int itemId, int maxStorage, int warningStorage, bool applyToSiteCollections) { + object[] results = this.Invoke("Enterprise_SetStorageSettings", new object[] { + itemId, + maxStorage, + warningStorage, + applyToSiteCollections}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_SetStorageSettings(int itemId, int maxStorage, int warningStorage, bool applyToSiteCollections, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_SetStorageSettings", new object[] { + itemId, + maxStorage, + warningStorage, + applyToSiteCollections}, callback, asyncState); + } + + /// + public int EndEnterprise_SetStorageSettings(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void Enterprise_SetStorageSettingsAsync(int itemId, int maxStorage, int warningStorage, bool applyToSiteCollections) { + this.Enterprise_SetStorageSettingsAsync(itemId, maxStorage, warningStorage, applyToSiteCollections, null); + } + + /// + public void Enterprise_SetStorageSettingsAsync(int itemId, int maxStorage, int warningStorage, bool applyToSiteCollections, object userState) { + if ((this.Enterprise_SetStorageSettingsOperationCompleted == null)) { + this.Enterprise_SetStorageSettingsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_SetStorageSettingsOperationCompleted); + } + this.InvokeAsync("Enterprise_SetStorageSettings", new object[] { + itemId, + maxStorage, + warningStorage, + applyToSiteCollections}, this.Enterprise_SetStorageSettingsOperationCompleted, userState); + } + + private void OnEnterprise_SetStorageSettingsOperationCompleted(object arg) { + if ((this.Enterprise_SetStorageSettingsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_SetStorageSettingsCompleted(this, new Enterprise_SetStorageSettingsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_GetSiteCollection", 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 SharePointSiteCollection Enterprise_GetSiteCollection(int itemId) { + object[] results = this.Invoke("Enterprise_GetSiteCollection", new object[] { + itemId}); + return ((SharePointSiteCollection)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetSiteCollection(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetSiteCollection", new object[] { + itemId}, callback, asyncState); + } + + /// + public SharePointSiteCollection EndEnterprise_GetSiteCollection(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((SharePointSiteCollection)(results[0])); + } + + /// + public void Enterprise_GetSiteCollectionAsync(int itemId) { + this.Enterprise_GetSiteCollectionAsync(itemId, null); + } + + /// + public void Enterprise_GetSiteCollectionAsync(int itemId, object userState) { + if ((this.Enterprise_GetSiteCollectionOperationCompleted == null)) { + this.Enterprise_GetSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_GetSiteCollection", new object[] { + itemId}, this.Enterprise_GetSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_GetSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_GetSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetSiteCollectionCompleted(this, new Enterprise_GetSiteCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_GetSiteCollectionByDomain" + + "", 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 SharePointSiteCollection Enterprise_GetSiteCollectionByDomain(int organizationId, string domain) { + object[] results = this.Invoke("Enterprise_GetSiteCollectionByDomain", new object[] { + organizationId, + domain}); + return ((SharePointSiteCollection)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetSiteCollectionByDomain(int organizationId, string domain, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetSiteCollectionByDomain", new object[] { + organizationId, + domain}, callback, asyncState); + } + + /// + public SharePointSiteCollection EndEnterprise_GetSiteCollectionByDomain(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((SharePointSiteCollection)(results[0])); + } + + /// + public void Enterprise_GetSiteCollectionByDomainAsync(int organizationId, string domain) { + this.Enterprise_GetSiteCollectionByDomainAsync(organizationId, domain, null); + } + + /// + public void Enterprise_GetSiteCollectionByDomainAsync(int organizationId, string domain, object userState) { + if ((this.Enterprise_GetSiteCollectionByDomainOperationCompleted == null)) { + this.Enterprise_GetSiteCollectionByDomainOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetSiteCollectionByDomainOperationCompleted); + } + this.InvokeAsync("Enterprise_GetSiteCollectionByDomain", new object[] { + organizationId, + domain}, this.Enterprise_GetSiteCollectionByDomainOperationCompleted, userState); + } + + private void OnEnterprise_GetSiteCollectionByDomainOperationCompleted(object arg) { + if ((this.Enterprise_GetSiteCollectionByDomainCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetSiteCollectionByDomainCompleted(this, new Enterprise_GetSiteCollectionByDomainCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_AddSiteCollection", 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 int Enterprise_AddSiteCollection(SharePointSiteCollection item) { + object[] results = this.Invoke("Enterprise_AddSiteCollection", new object[] { + item}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_AddSiteCollection(SharePointSiteCollection item, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_AddSiteCollection", new object[] { + item}, callback, asyncState); + } + + /// + public int EndEnterprise_AddSiteCollection(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void Enterprise_AddSiteCollectionAsync(SharePointSiteCollection item) { + this.Enterprise_AddSiteCollectionAsync(item, null); + } + + /// + public void Enterprise_AddSiteCollectionAsync(SharePointSiteCollection item, object userState) { + if ((this.Enterprise_AddSiteCollectionOperationCompleted == null)) { + this.Enterprise_AddSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_AddSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_AddSiteCollection", new object[] { + item}, this.Enterprise_AddSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_AddSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_AddSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_AddSiteCollectionCompleted(this, new Enterprise_AddSiteCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_DeleteSiteCollection", 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 int Enterprise_DeleteSiteCollection(int itemId) { + object[] results = this.Invoke("Enterprise_DeleteSiteCollection", new object[] { + itemId}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_DeleteSiteCollection(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_DeleteSiteCollection", new object[] { + itemId}, callback, asyncState); + } + + /// + public int EndEnterprise_DeleteSiteCollection(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void Enterprise_DeleteSiteCollectionAsync(int itemId) { + this.Enterprise_DeleteSiteCollectionAsync(itemId, null); + } + + /// + public void Enterprise_DeleteSiteCollectionAsync(int itemId, object userState) { + if ((this.Enterprise_DeleteSiteCollectionOperationCompleted == null)) { + this.Enterprise_DeleteSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_DeleteSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_DeleteSiteCollection", new object[] { + itemId}, this.Enterprise_DeleteSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_DeleteSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_DeleteSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_DeleteSiteCollectionCompleted(this, new Enterprise_DeleteSiteCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_DeleteSiteCollections", 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 int Enterprise_DeleteSiteCollections(int organizationId) { + object[] results = this.Invoke("Enterprise_DeleteSiteCollections", new object[] { + organizationId}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_DeleteSiteCollections(int organizationId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_DeleteSiteCollections", new object[] { + organizationId}, callback, asyncState); + } + + /// + public int EndEnterprise_DeleteSiteCollections(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void Enterprise_DeleteSiteCollectionsAsync(int organizationId) { + this.Enterprise_DeleteSiteCollectionsAsync(organizationId, null); + } + + /// + public void Enterprise_DeleteSiteCollectionsAsync(int organizationId, object userState) { + if ((this.Enterprise_DeleteSiteCollectionsOperationCompleted == null)) { + this.Enterprise_DeleteSiteCollectionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_DeleteSiteCollectionsOperationCompleted); + } + this.InvokeAsync("Enterprise_DeleteSiteCollections", new object[] { + organizationId}, this.Enterprise_DeleteSiteCollectionsOperationCompleted, userState); + } + + private void OnEnterprise_DeleteSiteCollectionsOperationCompleted(object arg) { + if ((this.Enterprise_DeleteSiteCollectionsCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_DeleteSiteCollectionsCompleted(this, new Enterprise_DeleteSiteCollectionsCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_BackupSiteCollection", 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 Enterprise_BackupSiteCollection(int itemId, string fileName, bool zipBackup, bool download, string folderName) { + object[] results = this.Invoke("Enterprise_BackupSiteCollection", new object[] { + itemId, + fileName, + zipBackup, + download, + folderName}); + return ((string)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_BackupSiteCollection(int itemId, string fileName, bool zipBackup, bool download, string folderName, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_BackupSiteCollection", new object[] { + itemId, + fileName, + zipBackup, + download, + folderName}, callback, asyncState); + } + + /// + public string EndEnterprise_BackupSiteCollection(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string)(results[0])); + } + + /// + public void Enterprise_BackupSiteCollectionAsync(int itemId, string fileName, bool zipBackup, bool download, string folderName) { + this.Enterprise_BackupSiteCollectionAsync(itemId, fileName, zipBackup, download, folderName, null); + } + + /// + public void Enterprise_BackupSiteCollectionAsync(int itemId, string fileName, bool zipBackup, bool download, string folderName, object userState) { + if ((this.Enterprise_BackupSiteCollectionOperationCompleted == null)) { + this.Enterprise_BackupSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_BackupSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_BackupSiteCollection", new object[] { + itemId, + fileName, + zipBackup, + download, + folderName}, this.Enterprise_BackupSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_BackupSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_BackupSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_BackupSiteCollectionCompleted(this, new Enterprise_BackupSiteCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_RestoreSiteCollection", 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 int Enterprise_RestoreSiteCollection(int itemId, string uploadedFile, string packageFile) { + object[] results = this.Invoke("Enterprise_RestoreSiteCollection", new object[] { + itemId, + uploadedFile, + packageFile}); + return ((int)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_RestoreSiteCollection(int itemId, string uploadedFile, string packageFile, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_RestoreSiteCollection", new object[] { + itemId, + uploadedFile, + packageFile}, callback, asyncState); + } + + /// + public int EndEnterprise_RestoreSiteCollection(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((int)(results[0])); + } + + /// + public void Enterprise_RestoreSiteCollectionAsync(int itemId, string uploadedFile, string packageFile) { + this.Enterprise_RestoreSiteCollectionAsync(itemId, uploadedFile, packageFile, null); + } + + /// + public void Enterprise_RestoreSiteCollectionAsync(int itemId, string uploadedFile, string packageFile, object userState) { + if ((this.Enterprise_RestoreSiteCollectionOperationCompleted == null)) { + this.Enterprise_RestoreSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_RestoreSiteCollectionOperationCompleted); + } + this.InvokeAsync("Enterprise_RestoreSiteCollection", new object[] { + itemId, + uploadedFile, + packageFile}, this.Enterprise_RestoreSiteCollectionOperationCompleted, userState); + } + + private void OnEnterprise_RestoreSiteCollectionOperationCompleted(object arg) { + if ((this.Enterprise_RestoreSiteCollectionCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_RestoreSiteCollectionCompleted(this, new Enterprise_RestoreSiteCollectionCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_GetBackupBinaryChunk", RequestNamespace="http://smbsaas/websitepanel/enterpriseserver", ResponseNamespace="http://smbsaas/websitepanel/enterpriseserver", Use=System.Web.Services.Description.SoapBindingUse.Literal, ParameterStyle=System.Web.Services.Protocols.SoapParameterStyle.Wrapped)] + [return: System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] + public byte[] Enterprise_GetBackupBinaryChunk(int itemId, string path, int offset, int length) { + object[] results = this.Invoke("Enterprise_GetBackupBinaryChunk", new object[] { + itemId, + path, + offset, + length}); + return ((byte[])(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_GetBackupBinaryChunk(int itemId, string path, int offset, int length, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_GetBackupBinaryChunk", new object[] { + itemId, + path, + offset, + length}, callback, asyncState); + } + + /// + public byte[] EndEnterprise_GetBackupBinaryChunk(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((byte[])(results[0])); + } + + /// + public void Enterprise_GetBackupBinaryChunkAsync(int itemId, string path, int offset, int length) { + this.Enterprise_GetBackupBinaryChunkAsync(itemId, path, offset, length, null); + } + + /// + public void Enterprise_GetBackupBinaryChunkAsync(int itemId, string path, int offset, int length, object userState) { + if ((this.Enterprise_GetBackupBinaryChunkOperationCompleted == null)) { + this.Enterprise_GetBackupBinaryChunkOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_GetBackupBinaryChunkOperationCompleted); + } + this.InvokeAsync("Enterprise_GetBackupBinaryChunk", new object[] { + itemId, + path, + offset, + length}, this.Enterprise_GetBackupBinaryChunkOperationCompleted, userState); + } + + private void OnEnterprise_GetBackupBinaryChunkOperationCompleted(object arg) { + if ((this.Enterprise_GetBackupBinaryChunkCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_GetBackupBinaryChunkCompleted(this, new Enterprise_GetBackupBinaryChunkCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_AppendBackupBinaryChunk", 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 Enterprise_AppendBackupBinaryChunk(int itemId, string fileName, string path, [System.Xml.Serialization.XmlElementAttribute(DataType="base64Binary")] byte[] chunk) { + object[] results = this.Invoke("Enterprise_AppendBackupBinaryChunk", new object[] { + itemId, + fileName, + path, + chunk}); + return ((string)(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_AppendBackupBinaryChunk(int itemId, string fileName, string path, byte[] chunk, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_AppendBackupBinaryChunk", new object[] { + itemId, + fileName, + path, + chunk}, callback, asyncState); + } + + /// + public string EndEnterprise_AppendBackupBinaryChunk(System.IAsyncResult asyncResult) { + object[] results = this.EndInvoke(asyncResult); + return ((string)(results[0])); + } + + /// + public void Enterprise_AppendBackupBinaryChunkAsync(int itemId, string fileName, string path, byte[] chunk) { + this.Enterprise_AppendBackupBinaryChunkAsync(itemId, fileName, path, chunk, null); + } + + /// + public void Enterprise_AppendBackupBinaryChunkAsync(int itemId, string fileName, string path, byte[] chunk, object userState) { + if ((this.Enterprise_AppendBackupBinaryChunkOperationCompleted == null)) { + this.Enterprise_AppendBackupBinaryChunkOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_AppendBackupBinaryChunkOperationCompleted); + } + this.InvokeAsync("Enterprise_AppendBackupBinaryChunk", new object[] { + itemId, + fileName, + path, + chunk}, this.Enterprise_AppendBackupBinaryChunkOperationCompleted, userState); + } + + private void OnEnterprise_AppendBackupBinaryChunkOperationCompleted(object arg) { + if ((this.Enterprise_AppendBackupBinaryChunkCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_AppendBackupBinaryChunkCompleted(this, new Enterprise_AppendBackupBinaryChunkCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_CalculateSharePointSitesD" + + "iskSpace", 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 SharePointSiteDiskSpace[] Enterprise_CalculateSharePointSitesDiskSpace(int itemId, out int errorCode) { + object[] results = this.Invoke("Enterprise_CalculateSharePointSitesDiskSpace", new object[] { + itemId}); + errorCode = ((int)(results[1])); + return ((SharePointSiteDiskSpace[])(results[0])); + } + + /// + public System.IAsyncResult BeginEnterprise_CalculateSharePointSitesDiskSpace(int itemId, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_CalculateSharePointSitesDiskSpace", new object[] { + itemId}, callback, asyncState); + } + + /// + public SharePointSiteDiskSpace[] EndEnterprise_CalculateSharePointSitesDiskSpace(System.IAsyncResult asyncResult, out int errorCode) { + object[] results = this.EndInvoke(asyncResult); + errorCode = ((int)(results[1])); + return ((SharePointSiteDiskSpace[])(results[0])); + } + + /// + public void Enterprise_CalculateSharePointSitesDiskSpaceAsync(int itemId) { + this.Enterprise_CalculateSharePointSitesDiskSpaceAsync(itemId, null); + } + + /// + public void Enterprise_CalculateSharePointSitesDiskSpaceAsync(int itemId, object userState) { + if ((this.Enterprise_CalculateSharePointSitesDiskSpaceOperationCompleted == null)) { + this.Enterprise_CalculateSharePointSitesDiskSpaceOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_CalculateSharePointSitesDiskSpaceOperationCompleted); + } + this.InvokeAsync("Enterprise_CalculateSharePointSitesDiskSpace", new object[] { + itemId}, this.Enterprise_CalculateSharePointSitesDiskSpaceOperationCompleted, userState); + } + + private void OnEnterprise_CalculateSharePointSitesDiskSpaceOperationCompleted(object arg) { + if ((this.Enterprise_CalculateSharePointSitesDiskSpaceCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_CalculateSharePointSitesDiskSpaceCompleted(this, new Enterprise_CalculateSharePointSitesDiskSpaceCompletedEventArgs(invokeArgs.Results, invokeArgs.Error, invokeArgs.Cancelled, invokeArgs.UserState)); + } + } + + /// + [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/Enterprise_UpdateQuota", 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 Enterprise_UpdateQuota(int itemId, int siteCollectionId, int maxSize, int warningSize) { + this.Invoke("Enterprise_UpdateQuota", new object[] { + itemId, + siteCollectionId, + maxSize, + warningSize}); + } + + /// + public System.IAsyncResult BeginEnterprise_UpdateQuota(int itemId, int siteCollectionId, int maxSize, int warningSize, System.AsyncCallback callback, object asyncState) { + return this.BeginInvoke("Enterprise_UpdateQuota", new object[] { + itemId, + siteCollectionId, + maxSize, + warningSize}, callback, asyncState); + } + + /// + public void EndEnterprise_UpdateQuota(System.IAsyncResult asyncResult) { + this.EndInvoke(asyncResult); + } + + /// + public void Enterprise_UpdateQuotaAsync(int itemId, int siteCollectionId, int maxSize, int warningSize) { + this.Enterprise_UpdateQuotaAsync(itemId, siteCollectionId, maxSize, warningSize, null); + } + + /// + public void Enterprise_UpdateQuotaAsync(int itemId, int siteCollectionId, int maxSize, int warningSize, object userState) { + if ((this.Enterprise_UpdateQuotaOperationCompleted == null)) { + this.Enterprise_UpdateQuotaOperationCompleted = new System.Threading.SendOrPostCallback(this.OnEnterprise_UpdateQuotaOperationCompleted); + } + this.InvokeAsync("Enterprise_UpdateQuota", new object[] { + itemId, + siteCollectionId, + maxSize, + warningSize}, this.Enterprise_UpdateQuotaOperationCompleted, userState); + } + + private void OnEnterprise_UpdateQuotaOperationCompleted(object arg) { + if ((this.Enterprise_UpdateQuotaCompleted != null)) { + System.Web.Services.Protocols.InvokeCompletedEventArgs invokeArgs = ((System.Web.Services.Protocols.InvokeCompletedEventArgs)(arg)); + this.Enterprise_UpdateQuotaCompleted(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.3038")] + public delegate void Enterprise_GetSiteCollectionsPagedCompletedEventHandler(object sender, Enterprise_GetSiteCollectionsPagedCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetSiteCollectionsPagedCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetSiteCollectionsPagedCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public SharePointSiteCollectionListPaged Result { + get { + this.RaiseExceptionIfNecessary(); + return ((SharePointSiteCollectionListPaged)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_GetSupportedLanguagesCompletedEventHandler(object sender, Enterprise_GetSupportedLanguagesCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetSupportedLanguagesCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetSupportedLanguagesCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_GetSiteCollectionsCompletedEventHandler(object sender, Enterprise_GetSiteCollectionsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetSiteCollectionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetSiteCollectionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public SharePointSiteCollection[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((SharePointSiteCollection[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_SetStorageSettingsCompletedEventHandler(object sender, Enterprise_SetStorageSettingsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_SetStorageSettingsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_SetStorageSettingsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_GetSiteCollectionCompletedEventHandler(object sender, Enterprise_GetSiteCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetSiteCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetSiteCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public SharePointSiteCollection Result { + get { + this.RaiseExceptionIfNecessary(); + return ((SharePointSiteCollection)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_GetSiteCollectionByDomainCompletedEventHandler(object sender, Enterprise_GetSiteCollectionByDomainCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetSiteCollectionByDomainCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetSiteCollectionByDomainCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public SharePointSiteCollection Result { + get { + this.RaiseExceptionIfNecessary(); + return ((SharePointSiteCollection)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_AddSiteCollectionCompletedEventHandler(object sender, Enterprise_AddSiteCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_AddSiteCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_AddSiteCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_DeleteSiteCollectionCompletedEventHandler(object sender, Enterprise_DeleteSiteCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_DeleteSiteCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_DeleteSiteCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_DeleteSiteCollectionsCompletedEventHandler(object sender, Enterprise_DeleteSiteCollectionsCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_DeleteSiteCollectionsCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_DeleteSiteCollectionsCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_BackupSiteCollectionCompletedEventHandler(object sender, Enterprise_BackupSiteCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_BackupSiteCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_BackupSiteCollectionCompletedEventArgs(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.3038")] + public delegate void Enterprise_RestoreSiteCollectionCompletedEventHandler(object sender, Enterprise_RestoreSiteCollectionCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_RestoreSiteCollectionCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_RestoreSiteCollectionCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public int Result { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_GetBackupBinaryChunkCompletedEventHandler(object sender, Enterprise_GetBackupBinaryChunkCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_GetBackupBinaryChunkCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_GetBackupBinaryChunkCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public byte[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((byte[])(this.results[0])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_AppendBackupBinaryChunkCompletedEventHandler(object sender, Enterprise_AppendBackupBinaryChunkCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_AppendBackupBinaryChunkCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_AppendBackupBinaryChunkCompletedEventArgs(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.3038")] + public delegate void Enterprise_CalculateSharePointSitesDiskSpaceCompletedEventHandler(object sender, Enterprise_CalculateSharePointSitesDiskSpaceCompletedEventArgs e); + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + [System.Diagnostics.DebuggerStepThroughAttribute()] + [System.ComponentModel.DesignerCategoryAttribute("code")] + public partial class Enterprise_CalculateSharePointSitesDiskSpaceCompletedEventArgs : System.ComponentModel.AsyncCompletedEventArgs { + + private object[] results; + + internal Enterprise_CalculateSharePointSitesDiskSpaceCompletedEventArgs(object[] results, System.Exception exception, bool cancelled, object userState) : + base(exception, cancelled, userState) { + this.results = results; + } + + /// + public SharePointSiteDiskSpace[] Result { + get { + this.RaiseExceptionIfNecessary(); + return ((SharePointSiteDiskSpace[])(this.results[0])); + } + } + + /// + public int errorCode { + get { + this.RaiseExceptionIfNecessary(); + return ((int)(this.results[1])); + } + } + } + + /// + [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] + public delegate void Enterprise_UpdateQuotaCompletedEventHandler(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 481ef66f..0393a436 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/WebsitePanel.EnterpriseServer.Client.csproj @@ -89,6 +89,7 @@ code + diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx index 394c337c..c27229d3 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServersEnt.asmx @@ -1 +1 @@ -<%@ WebService Language="C#" CodeBehind="esHostedSharePointServersEnt.asmx.cs" Class="WebsitePanel.EnterpriseServer.esHostedSharePointServers" %> +<%@ WebService Language="C#" CodeBehind="esHostedSharePointServersEnt.asmx.cs" Class="WebsitePanel.EnterpriseServer.esHostedSharePointServersEnt" %> From fed079a14b0d07ff7d9b9d1bed2d7fa3fd1414e0 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 5 Apr 2015 08:56:18 +0800 Subject: [PATCH 08/41] Sharepoint Enterprise -> remove sharepoint changes applied to portal --- .../HostedSharePointServerEntController.cs | 6 +-- .../HostedSharePointBackupSiteCollection.ascx | 4 +- ...stedSharePointBackupSiteCollection.ascx.cs | 13 ++----- ...PointBackupSiteCollection.ascx.designer.cs | 37 +++++-------------- .../HostedSharePointEditSiteCollection.ascx | 2 + ...HostedSharePointEditSiteCollection.ascx.cs | 7 ---- ...rePointEditSiteCollection.ascx.designer.cs | 37 +++++-------------- ...HostedSharePointRestoreSiteCollection.ascx | 4 ++ ...tedSharePointRestoreSiteCollection.ascx.cs | 7 +--- ...ointRestoreSiteCollection.ascx.designer.cs | 37 +++++-------------- .../HostedSharePointSiteCollections.ascx | 3 +- .../HostedSharePointSiteCollections.ascx.cs | 10 ++--- .../HostedSharePointStorageSettings.ascx | 3 +- ...SharePointStorageSettings.ascx.designer.cs | 37 +++++-------------- .../HostedSharePointStorageUsage.ascx | 2 + ...tedSharePointStorageUsage.ascx.designer.cs | 37 +++++-------------- 16 files changed, 69 insertions(+), 177 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs index 87c147e1..f24b4c44 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs @@ -58,7 +58,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint /// Row index to start from. /// Maximum number of rows to retrieve. /// Site collections that match. - public static SharePointSiteCollectionListPaged GetSiteCollectionsPaged(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, string groupName = null) + public static SharePointSiteCollectionListPaged GetSiteCollectionsPaged(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { if (IsDemoMode) { @@ -122,7 +122,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint // Log operation. TaskManager.StartTask("HOSTED_SHAREPOINT_ENTERPRISE", "GET_LANGUAGES"); - int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointFoundationServer); + int serviceId = PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointEnterpriseServer); if (serviceId == 0) { return new int[] { }; @@ -149,7 +149,6 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint /// /// Package that owns site collections. /// A value which shows whether nested spaces must be searched as well. - /// Resource group name. /// List of found site collections. public static List GetSiteCollections(int packageId, bool recursive) { @@ -208,7 +207,6 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint /// Adds SharePoint site collection. /// /// Site collection description. - /// Resource group name. /// Created site collection id within metabase. public static int AddSiteCollection(SharePointSiteCollection item) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx index 932d7aa8..7cc9c611 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx @@ -3,7 +3,8 @@ <%@ Register Src="UserControls/FileLookup.ascx" TagName="FileLookup" TagPrefix="uc1" %> <%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> - + +<%@ Register Src="ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> <%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> @@ -13,6 +14,7 @@
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.cs index 4171ea68..5e1afb37 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.cs @@ -61,11 +61,6 @@ namespace WebsitePanel.Portal } } - public static string GroupName - { - get { return HttpContext.Current.Request["GroupName"]; } - } - protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) @@ -165,10 +160,10 @@ namespace WebsitePanel.Portal RedirectBack(); } - private void RedirectBack() - { - HttpContext.Current.Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_edit_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName)); - } + private void RedirectBack() + { + HttpContext.Current.Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_edit_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString())); + } protected void chkZipBackup_CheckedChanged(object sender, EventArgs e) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.designer.cs index fd9c426c..7e8df4e9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, 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. @@ -49,6 +21,15 @@ namespace WebsitePanel.Portal { /// protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + /// /// Image1 control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx index d80139d7..35773dfe 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx @@ -3,6 +3,7 @@ <%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> <%@ Register Src="UserControls/CollapsiblePanel.ascx" TagName="CollapsiblePanel" TagPrefix="wsp" %> <%@ Register Src="UserControls/PopupHeader.ascx" TagName="PopupHeader" TagPrefix="wsp" %> +<%@ Register Src="ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> <%@ Register Src="UserControls/AllocatePackageIPAddresses.ascx" TagName="SiteUrlBuilder" TagPrefix="wsp" %> <%@ Register Src="ExchangeServer/UserControls/UserSelector.ascx" TagName="UserSelector" TagPrefix="wsp" %> <%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> @@ -14,6 +15,7 @@
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.cs index 89ce616c..0a35bcfc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.cs @@ -420,13 +420,6 @@ namespace WebsitePanel.Portal return true; } - break; - case 552: - if (Convert.ToBoolean(quota.QuotaAllocatedValue)) - { - return true; - } - break; } } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.designer.cs index b82a5dd1..694af254 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, 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. @@ -49,6 +21,15 @@ namespace WebsitePanel.Portal { /// protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + /// /// Image1 control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx index 4b256403..16ea6abd 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx @@ -3,6 +3,9 @@ <%@ Register Src="UserControls/FileLookup.ascx" TagName="FileLookup" TagPrefix="uc1" %> <%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +6 +<%@ Register Src="ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> + <%@ Register Src="UserControls/EnableAsyncTasksSupport.ascx" TagName="EnableAsyncTasksSupport" TagPrefix="wsp" %> @@ -14,6 +17,7 @@
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.cs index 74c9be70..de33f161 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.cs @@ -59,11 +59,6 @@ namespace WebsitePanel.Portal } } - public static string GroupName - { - get { return HttpContext.Current.Request["GroupName"]; } - } - protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) @@ -171,7 +166,7 @@ namespace WebsitePanel.Portal private void RedirectBack() { - Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_edit_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName)); + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_edit_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString())); } protected void radioUpload_CheckedChanged(object sender, EventArgs e) { diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.designer.cs index 061c85f8..7903ac5e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, 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. @@ -49,6 +21,15 @@ namespace WebsitePanel.Portal { /// protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + /// /// Image1 control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx index a1734e43..2e6b6269 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx @@ -76,8 +76,7 @@ function confirmation() - - + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx.cs index 0bd9b7b0..b03fd0f0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointSiteCollections.ascx.cs @@ -44,11 +44,7 @@ namespace WebsitePanel.Portal { public partial class HostedSharePointSiteCollections : WebsitePanelModuleBase { - public static string GroupName - { - get { return HttpContext.Current.Request["GroupName"]; } - } - + protected void Page_Load(object sender, EventArgs e) { this.BindStats(); @@ -67,14 +63,14 @@ namespace WebsitePanel.Portal protected void btnCreateSiteCollection_Click(object sender, EventArgs e) { - Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "sharepoint_edit_sitecollection", "SpaceID=" + PanelSecurity.PackageId.ToString(), "GroupName=" + GroupName)); + Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "sharepoint_edit_sitecollection", "SpaceID=" + PanelSecurity.PackageId.ToString())); } public string GetSiteCollectionEditUrl(string siteCollectionId) { return EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_edit_sitecollection", "SiteCollectionID=" + siteCollectionId, - "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName); + "ItemID=" + PanelRequest.ItemID.ToString()); } protected void odsSharePointSiteCollectionPaged_Selected(object sender, ObjectDataSourceStatusEventArgs e) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx index 6329dc5b..5fb250d7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx @@ -6,7 +6,7 @@ <%@ Register Src="ExchangeServer/UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> <%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> - +<%@ Register Src="ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %> <%@ Register src="UserControls/QuotaEditor.ascx" tagname="QuotaEditor" tagprefix="uc1" %> @@ -14,6 +14,7 @@
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx.designer.cs index 8cc0e3cc..b004706e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, 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. @@ -40,6 +12,15 @@ namespace WebsitePanel.Portal { public partial class HostedSharePointStorageSettings { + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + /// /// Image1 control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx index 54db370b..9308c5b0 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx @@ -6,10 +6,12 @@ <%@ Register Src="ExchangeServer/UserControls/SizeBox.ascx" TagName="SizeBox" TagPrefix="wsp" %> <%@ Register Src="UserControls/SimpleMessageBox.ascx" TagName="SimpleMessageBox" TagPrefix="wsp" %> +<%@ Register Src="ExchangeServer/UserControls/Menu.ascx" TagName="Menu" TagPrefix="wsp" %>
+
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx.designer.cs index 43f100c7..b6916e27 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx.designer.cs @@ -1,31 +1,3 @@ -// Copyright (c) 2015, 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. @@ -40,6 +12,15 @@ namespace WebsitePanel.Portal { public partial class HostedSharePointStorageUsage { + /// + /// menu control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; + /// /// Image1 control. /// From 42b4d8730157a7824d73b4c1640e6775d113be23 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 5 Apr 2015 11:30:57 +0800 Subject: [PATCH 09/41] Fix up sharepoint 2013 mess --- WebsitePanel/Database/update_db.sql | 7 +- .../HostedSharePointServersProxy.cs | 61 ++++++++--------- .../HostedSolution/OrganizationController.cs | 7 ++ .../HostedSolution/ReportController.cs | 66 +++++++++++++++++++ .../CalculatePackagesDiskspaceTask.cs | 14 ++++ .../HostedSharePointServerEntController.cs | 2 +- .../esHostedSharePointServers.asmx.cs | 3 - .../WebsitePanel_SharedResources.ascx.resx | 7 +- .../OrganizationMenu.ascx.resx | 4 +- .../UserOrganization.ascx.resx | 4 +- .../HostedSharePointSiteCollectionsHelper.cs | 16 +---- .../App_LocalResources/Menu.ascx.resx | 4 +- .../ExchangeServer/UserControls/Menu.ascx.cs | 4 +- .../HostedSharePointBackupSiteCollection.ascx | 1 - ...PointBackupSiteCollection.ascx.designer.cs | 9 --- .../HostedSharePointEditSiteCollection.ascx | 1 - ...HostedSharePointEditSiteCollection.ascx.cs | 30 ++------- ...rePointEditSiteCollection.ascx.designer.cs | 9 --- ...HostedSharePointRestoreSiteCollection.ascx | 1 - ...ointRestoreSiteCollection.ascx.designer.cs | 9 --- .../HostedSharePointStorageSettings.ascx | 1 - ...SharePointStorageSettings.ascx.designer.cs | 9 --- .../HostedSharePointStorageUsage.ascx | 1 - ...tedSharePointStorageUsage.ascx.designer.cs | 9 --- .../WebsitePanel/ServersEditService.ascx.cs | 2 +- .../UserControls/OrganizationMenuControl.cs | 4 +- 26 files changed, 141 insertions(+), 144 deletions(-) diff --git a/WebsitePanel/Database/update_db.sql b/WebsitePanel/Database/update_db.sql index 9470c435..68a99329 100644 --- a/WebsitePanel/Database/update_db.sql +++ b/WebsitePanel/Database/update_db.sql @@ -9462,11 +9462,15 @@ END GO UPDATE [dbo].[Quotas] SET GroupID = 45 WHERE QuotaName = 'EnterpriseStorage.DriveMaps' +GO UPDATE [dbo].[ResourceGroups] SET GroupName = 'Sharepoint Enterprise Server' WHERE GroupName = 'Sharepoint Server' GO +UPDATE [dbo].[ResourceGroups] SET GroupController = 'WebsitePanel.EnterpriseServer.HostedSharePointServerEntController' WHERE GroupName = 'Sharepoint Enterprise Server' +GO + IF NOT EXISTS (SELECT * FROM [dbo].[Providers] WHERE [DisplayName] = 'Hosted SharePoint Enterprise 2013') BEGIN DECLARE @provider_id AS INT @@ -9478,9 +9482,6 @@ VALUES (@provider_id, @group_id, N'HostedSharePoint2013Ent', N'Hosted SharePoint END GO -UPDATE Providers SET ProviderType = N'WebsitePanel.Providers.HostedSolution.HostedSharePointServer2013Ent, WebsitePanel.Providers.HostedSolution.SharePoint2013Ent' WHERE ProviderID = 1301 -GO - UPDATE [dbo].[Quotas] SET QuotaName = 'HostedSharePointEnterprise.Sites' WHERE QuotaId = 550 GO diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HostedSharePointServersProxy.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HostedSharePointServersProxy.cs index 63534afd..ccff6073 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HostedSharePointServersProxy.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Client/HostedSharePointServersProxy.cs @@ -26,11 +26,10 @@ // (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.7905 +// Runtime Version:2.0.50727.8009 // // Changes to this file may cause incorrect behavior and will be lost if // the code is regenerated. @@ -51,6 +50,7 @@ namespace WebsitePanel.EnterpriseServer { using WebsitePanel.Providers; + /// [System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")] [System.Diagnostics.DebuggerStepThroughAttribute()] @@ -141,7 +141,7 @@ namespace WebsitePanel.EnterpriseServer { /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetSiteCollectionsPaged", 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 SharePointSiteCollectionListPaged GetSiteCollectionsPaged(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, string groupName) { + public SharePointSiteCollectionListPaged GetSiteCollectionsPaged(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { object[] results = this.Invoke("GetSiteCollectionsPaged", new object[] { packageId, organizationId, @@ -149,13 +149,12 @@ namespace WebsitePanel.EnterpriseServer { filterValue, sortColumn, startRow, - maximumRows, - groupName}); + maximumRows}); return ((SharePointSiteCollectionListPaged)(results[0])); } /// - public System.IAsyncResult BeginGetSiteCollectionsPaged(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, string groupName, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetSiteCollectionsPaged(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetSiteCollectionsPaged", new object[] { packageId, organizationId, @@ -163,8 +162,7 @@ namespace WebsitePanel.EnterpriseServer { filterValue, sortColumn, startRow, - maximumRows, - groupName}, callback, asyncState); + maximumRows}, callback, asyncState); } /// @@ -174,12 +172,12 @@ namespace WebsitePanel.EnterpriseServer { } /// - public void GetSiteCollectionsPagedAsync(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, string groupName) { - this.GetSiteCollectionsPagedAsync(packageId, organizationId, filterColumn, filterValue, sortColumn, startRow, maximumRows, groupName, null); + public void GetSiteCollectionsPagedAsync(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows) { + this.GetSiteCollectionsPagedAsync(packageId, organizationId, filterColumn, filterValue, sortColumn, startRow, maximumRows, null); } /// - public void GetSiteCollectionsPagedAsync(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, string groupName, object userState) { + public void GetSiteCollectionsPagedAsync(int packageId, int organizationId, string filterColumn, string filterValue, string sortColumn, int startRow, int maximumRows, object userState) { if ((this.GetSiteCollectionsPagedOperationCompleted == null)) { this.GetSiteCollectionsPagedOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSiteCollectionsPagedOperationCompleted); } @@ -190,8 +188,7 @@ namespace WebsitePanel.EnterpriseServer { filterValue, sortColumn, startRow, - maximumRows, - groupName}, this.GetSiteCollectionsPagedOperationCompleted, userState); + maximumRows}, this.GetSiteCollectionsPagedOperationCompleted, userState); } private void OnGetSiteCollectionsPagedOperationCompleted(object arg) { @@ -244,20 +241,18 @@ namespace WebsitePanel.EnterpriseServer { /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/GetSiteCollections", 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 SharePointSiteCollection[] GetSiteCollections(int packageId, bool recursive, string groupName) { + public SharePointSiteCollection[] GetSiteCollections(int packageId, bool recursive) { object[] results = this.Invoke("GetSiteCollections", new object[] { packageId, - recursive, - groupName}); + recursive}); return ((SharePointSiteCollection[])(results[0])); } /// - public System.IAsyncResult BeginGetSiteCollections(int packageId, bool recursive, string groupName, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginGetSiteCollections(int packageId, bool recursive, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("GetSiteCollections", new object[] { packageId, - recursive, - groupName}, callback, asyncState); + recursive}, callback, asyncState); } /// @@ -267,19 +262,18 @@ namespace WebsitePanel.EnterpriseServer { } /// - public void GetSiteCollectionsAsync(int packageId, bool recursive, string groupName) { - this.GetSiteCollectionsAsync(packageId, recursive, groupName, null); + public void GetSiteCollectionsAsync(int packageId, bool recursive) { + this.GetSiteCollectionsAsync(packageId, recursive, null); } /// - public void GetSiteCollectionsAsync(int packageId, bool recursive, string groupName, object userState) { + public void GetSiteCollectionsAsync(int packageId, bool recursive, object userState) { if ((this.GetSiteCollectionsOperationCompleted == null)) { this.GetSiteCollectionsOperationCompleted = new System.Threading.SendOrPostCallback(this.OnGetSiteCollectionsOperationCompleted); } this.InvokeAsync("GetSiteCollections", new object[] { packageId, - recursive, - groupName}, this.GetSiteCollectionsOperationCompleted, userState); + recursive}, this.GetSiteCollectionsOperationCompleted, userState); } private void OnGetSiteCollectionsOperationCompleted(object arg) { @@ -426,18 +420,16 @@ namespace WebsitePanel.EnterpriseServer { /// [System.Web.Services.Protocols.SoapDocumentMethodAttribute("http://smbsaas/websitepanel/enterpriseserver/AddSiteCollection", 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 int AddSiteCollection(SharePointSiteCollection item, string groupName) { + public int AddSiteCollection(SharePointSiteCollection item) { object[] results = this.Invoke("AddSiteCollection", new object[] { - item, - groupName}); + item}); return ((int)(results[0])); } /// - public System.IAsyncResult BeginAddSiteCollection(SharePointSiteCollection item, string groupName, System.AsyncCallback callback, object asyncState) { + public System.IAsyncResult BeginAddSiteCollection(SharePointSiteCollection item, System.AsyncCallback callback, object asyncState) { return this.BeginInvoke("AddSiteCollection", new object[] { - item, - groupName}, callback, asyncState); + item}, callback, asyncState); } /// @@ -447,18 +439,17 @@ namespace WebsitePanel.EnterpriseServer { } /// - public void AddSiteCollectionAsync(SharePointSiteCollection item, string groupName) { - this.AddSiteCollectionAsync(item, groupName, null); + public void AddSiteCollectionAsync(SharePointSiteCollection item) { + this.AddSiteCollectionAsync(item, null); } /// - public void AddSiteCollectionAsync(SharePointSiteCollection item, string groupName, object userState) { + public void AddSiteCollectionAsync(SharePointSiteCollection item, object userState) { if ((this.AddSiteCollectionOperationCompleted == null)) { this.AddSiteCollectionOperationCompleted = new System.Threading.SendOrPostCallback(this.OnAddSiteCollectionOperationCompleted); } this.InvokeAsync("AddSiteCollection", new object[] { - item, - groupName}, this.AddSiteCollectionOperationCompleted, userState); + item}, this.AddSiteCollectionOperationCompleted, userState); } private void OnAddSiteCollectionOperationCompleted(object arg) { diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs index c56aa486..8b536f54 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/OrganizationController.cs @@ -1074,8 +1074,15 @@ namespace WebsitePanel.EnterpriseServer { SharePointSiteCollectionListPaged sharePointStats = HostedSharePointServerController.GetSiteCollectionsPaged(org.PackageId, o.Id, string.Empty, string.Empty, string.Empty, 0, 0); stats.CreatedSharePointSiteCollections += sharePointStats.TotalRowCount; + } + + if (cntxTmp.Groups.ContainsKey(ResourceGroups.SharepointEnterpriseServer)) + { + SharePointSiteCollectionListPaged sharePointStats = HostedSharePointServerController.GetSiteCollectionsPaged(org.PackageId, o.Id, string.Empty, string.Empty, string.Empty, 0, 0); + stats.CreatedSharePointEnterpriseSiteCollections += sharePointStats.TotalRowCount; } + if (cntxTmp.Groups.ContainsKey(ResourceGroups.HostedCRM)) { stats.CreatedCRMUsers += CRMController.GetCRMUsersCount(o.Id, string.Empty, string.Empty, CRMUserLycenseTypes.FULL ).Value; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/ReportController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/ReportController.cs index 82589f64..b6c63d98 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/ReportController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/ReportController.cs @@ -158,6 +158,18 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution return PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointFoundationServer); } + + private static HostedSharePointServerEnt GetHostedSharePointServerEnt(int serviceId) + { + HostedSharePointServerEnt sps = new HostedSharePointServerEnt(); + ServiceProviderProxy.Init(sps, serviceId); + return sps; + } + + private static int GetHostedSharePointEntServiceId(int packageId) + { + return PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointEnterpriseServer); + } private static void PopulateBaseItem(BaseStatistics stats, Organization org, string topReseller) { @@ -394,6 +406,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution string.Format("Could not get sharepoint server. PackageId: {0}", org.PackageId), ex); } + foreach (SharePointSiteCollection siteCollection in siteCollections) { try @@ -419,6 +432,59 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } + private static void PopulateSharePointEntItem(Organization org, EnterpriseSolutionStatisticsReport report, string topReseller) + { + List siteCollections; + + try + { + siteCollections = HostedSharePointServerEntController.GetSiteCollections(org.Id); + } + catch (Exception ex) + { + throw new ApplicationException(string.Format("Could not get site collections. OrgId: {0}", org.Id), ex); + } + + if (siteCollections == null || siteCollections.Count == 0) + return; + + + HostedSharePointServerEnt srvEnt; + try + { + int serviceId = GetHostedSharePointEntServiceId(org.PackageId); + srvEnt = GetHostedSharePointServerEnt(serviceId); + } + catch (Exception ex) + { + throw new ApplicationException( + string.Format("Could not get sharepoint enterprise server. PackageId: {0}", org.PackageId), ex); + } + + foreach (SharePointSiteCollection siteCollection in siteCollections) + { + try + { + SharePointStatistics stats = new SharePointStatistics(); + PopulateBaseItem(stats, org, topReseller); + + stats.SiteCollectionUrl = siteCollection.PhysicalAddress; + stats.SiteCollectionOwner = siteCollection.OwnerName; + stats.SiteCollectionQuota = siteCollection.MaxSiteStorage; + + stats.SiteCollectionCreated = siteCollection.CreatedDate; + + stats.SiteCollectionSize = srvEnt.Enterprise_GetSiteCollectionSize(siteCollection.PhysicalAddress); + + report.SharePointReport.Items.Add(stats); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + } + } + private static void PopulateExchangeReportItems(Organization org, EnterpriseSolutionStatisticsReport report, string topReseller) { TaskManager.Write("Exchange Report Items " + org.Name); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/CalculatePackagesDiskspaceTask.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/CalculatePackagesDiskspaceTask.cs index 272c6e8a..9d6302fb 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/CalculatePackagesDiskspaceTask.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SchedulerTasks/CalculatePackagesDiskspaceTask.cs @@ -179,6 +179,20 @@ namespace WebsitePanel.EnterpriseServer } } } + + if (cntx.Groups.ContainsKey(ResourceGroups.SharepointEnterpriseServer)) + { + SharePointSiteDiskSpace[] sharePointSiteDiskSpaces = + HostedSharePointServerEntController.CalculateSharePointSitesDiskSpace(org.Id, out res); + if (res == 0) + { + foreach (SharePointSiteDiskSpace currecnt in sharePointSiteDiskSpaces) + { + size += currecnt.DiskSpace; + } + } + } + ServiceProviderItemDiskSpace tmp = new ServiceProviderItemDiskSpace(); tmp.ItemId = item.Id; tmp.DiskSpace = size; diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs index f24b4c44..cbe0867a 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs @@ -791,7 +791,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint private static int GetHostedSharePointServiceId(int packageId) { - return PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointFoundationServer); + return PackageController.GetPackageServiceId(packageId, ResourceGroups.SharepointEnterpriseServer); } private static List GetOrganizationSharePointSiteCollections(int orgId) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServers.asmx.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServers.asmx.cs index 2468333c..4aa4946f 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServers.asmx.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer/esHostedSharePointServers.asmx.cs @@ -55,7 +55,6 @@ namespace WebsitePanel.EnterpriseServer /// Sort column name. /// Row index to start from. /// Maximum number of rows to retrieve. - /// Resource group name. /// Site collections in raw format. [WebMethod] public SharePointSiteCollectionListPaged GetSiteCollectionsPaged(int packageId, int organizationId, @@ -80,7 +79,6 @@ namespace WebsitePanel.EnterpriseServer /// /// Package that owns site collections. /// A value which shows whether nested spaces must be searched as well. - /// Resource group name. /// List of found site collections. [WebMethod] public List GetSiteCollections(int packageId, bool recursive) @@ -133,7 +131,6 @@ namespace WebsitePanel.EnterpriseServer /// Adds SharePoint site collection. /// /// Site collection description. - /// Resource group name. /// Created site collection id within metabase. [WebMethod] public int AddSiteCollection(SharePointSiteCollection item) 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 937e6e43..d403de41 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_GlobalResources/WebsitePanel_SharedResources.ascx.resx @@ -3371,14 +3371,11 @@ Deleted Users Backup Storage Space per Organization, Mb - - Hosted SharePoint - SharePoint Foundation Server - - SharePoint Server + + SharePoint Enterprise Server Office Communications Server diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/OrganizationMenu.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/OrganizationMenu.ascx.resx index f6644414..11849f1e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/OrganizationMenu.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/OrganizationMenu.ascx.resx @@ -204,8 +204,8 @@ SharePoint Foundation - - SharePoint Server + + SharePoint Enterprise Server Site Collections diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserOrganization.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserOrganization.ascx.resx index 135dc55a..c9e880a7 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserOrganization.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/UserOrganization.ascx.resx @@ -237,8 +237,8 @@ Hosted Organization - SharePoint Foundation Server - - Hosted Organization - SharePoint Server + + Hosted Organization - SharePoint Enterprise Server Sharepoint Sites diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/HostedSharePointSiteCollectionsHelper.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/HostedSharePointSiteCollectionsHelper.cs index 50a0078e..6f0dd712 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/HostedSharePointSiteCollectionsHelper.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/HostedSharePointSiteCollectionsHelper.cs @@ -37,7 +37,6 @@ using System.Web.UI.WebControls.WebParts; using System.Web.UI.HtmlControls; using WebsitePanel.Providers.SharePoint; using System.Collections.Generic; -using WebsitePanel.EnterpriseServer; namespace WebsitePanel.Portal { @@ -45,28 +44,19 @@ namespace WebsitePanel.Portal { SharePointSiteCollectionListPaged result; - public int GetSharePointSiteCollectionPagedCount(int packageId, int organizationId, string groupName, string filterColumn, string filterValue) + public int GetSharePointSiteCollectionPagedCount(int packageId, int organizationId, string filterColumn, string filterValue) { return result.TotalRowCount; } - public List GetSharePointSiteCollectionPaged(int packageId, int organizationId, string groupName, string filterColumn, string filterValue, int maximumRows, int startRowIndex, string sortColumn) + public List GetSharePointSiteCollectionPaged(int packageId, int organizationId, string filterColumn, string filterValue, int maximumRows, int startRowIndex, string sortColumn) { if (!String.IsNullOrEmpty(filterValue)) { filterValue = filterValue + "%"; } - if (ResourceGroups.SharepointFoundationServer.Replace(" ", "").Equals(groupName)) - { - groupName = ResourceGroups.SharepointFoundationServer; - } - else if (ResourceGroups.SharepointServer.Replace(" ", "").Equals(groupName)) - { - groupName = ResourceGroups.SharepointServer; - } - - result = ES.Services.HostedSharePointServers.GetSiteCollectionsPaged(packageId, organizationId, filterColumn, filterValue, sortColumn, startRowIndex, maximumRows, groupName); + result = ES.Services.HostedSharePointServers.GetSiteCollectionsPaged(packageId, organizationId, filterColumn, filterValue, sortColumn, startRowIndex, maximumRows); return result.SiteCollections; } diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx index 6563c74a..cd6d756e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/App_LocalResources/Menu.ascx.resx @@ -168,8 +168,8 @@ SharePoint Foundation - - SharePoint Server + + SharePoint Enterprise OCS diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs index 45d1f8c5..25ae4d73 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/UserControls/Menu.ascx.cs @@ -319,9 +319,9 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls PrepareSharePointMenu(cntx, groups, imagePath, GetLocalizedString("Text.SharePointFoundationServerGroup")); } - if (cntx.Groups.ContainsKey(ResourceGroups.SharepointServer)) + if (cntx.Groups.ContainsKey(ResourceGroups.SharepointEnterpriseServer)) { - PrepareSharePointMenu(cntx, groups, imagePath, GetLocalizedString("Text.SharePointServerGroup")); + PrepareSharePointMenu(cntx, groups, imagePath, GetLocalizedString("Text.SharePointEnterpriseServerGroup")); } //CRM Menu diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx index 7cc9c611..6ee199ec 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx @@ -14,7 +14,6 @@
-
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.designer.cs index 7e8df4e9..6bd4aa9e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointBackupSiteCollection.ascx.designer.cs @@ -21,15 +21,6 @@ namespace WebsitePanel.Portal { /// protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; - /// - /// menu control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; - /// /// Image1 control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx index 35773dfe..5a219436 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx @@ -15,7 +15,6 @@
-
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.cs index 0a35bcfc..1c150ca9 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.cs @@ -44,11 +44,6 @@ namespace WebsitePanel.Portal { SharePointSiteCollection item = null; - public static string GroupName - { - get { return HttpContext.Current.Request["GroupName"]; } - } - private int OrganizationId { get @@ -230,7 +225,7 @@ namespace WebsitePanel.Portal /// Reserved disk space vallue. private int GetReservedDiskStorageSpace() { - var existingCollections = ES.Services.HostedSharePointServers.GetSiteCollections(PanelSecurity.PackageId, false, GroupName); + var existingCollections = ES.Services.HostedSharePointServers.GetSiteCollections(PanelSecurity.PackageId, false); return (int)existingCollections.Sum(siteCollection => siteCollection.MaxSiteStorage); } @@ -257,20 +252,9 @@ namespace WebsitePanel.Portal { item = new SharePointSiteCollection(); - string groupName = GroupName; - - if (ResourceGroups.SharepointFoundationServer.Replace(" ", "").Equals(groupName)) - { - groupName = ResourceGroups.SharepointFoundationServer; - } - else if (ResourceGroups.SharepointServer.Replace(" ", "").Equals(groupName)) - { - groupName = ResourceGroups.SharepointServer; - } - - if (!UseSharedSLL(PanelSecurity.PackageId)) + if (!UseSharedSLL(PanelSecurity.PackageId)) { - SharePointSiteCollectionListPaged existentSiteCollections = ES.Services.HostedSharePointServers.GetSiteCollectionsPaged(PanelSecurity.PackageId, this.OrganizationId, "ItemName", String.Format("%{0}", this.domain.DomainName), String.Empty, 0, Int32.MaxValue, groupName); + SharePointSiteCollectionListPaged existentSiteCollections = ES.Services.HostedSharePointServers.GetSiteCollectionsPaged(PanelSecurity.PackageId, this.OrganizationId, "ItemName", String.Format("%{0}", this.domain.DomainName), String.Empty, 0, Int32.MaxValue); foreach (SharePointSiteCollection existentSiteCollection in existentSiteCollections.SiteCollections) { Uri existentSiteCollectionUri = new Uri(existentSiteCollection.Name); @@ -303,7 +287,7 @@ namespace WebsitePanel.Portal item.MaxSiteStorage = maxStorage.QuotaValue; item.WarningStorage = warningStorage.QuotaValue; - int result = ES.Services.HostedSharePointServers.AddSiteCollection(item, groupName); + int result = ES.Services.HostedSharePointServers.AddSiteCollection(item); if (result < 0) { localMessageBox.ShowResultMessage(result); @@ -390,19 +374,19 @@ namespace WebsitePanel.Portal protected void btnBackup_Click(object sender, EventArgs e) { - Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_backup_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName)); + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_backup_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString())); } protected void btnRestore_Click(object sender, EventArgs e) { - Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_restore_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName)); + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_restore_sitecollection", "SiteCollectionID=" + this.SiteCollectionId, "ItemID=" + PanelRequest.ItemID.ToString())); } private void RedirectToSiteCollectionsList() { - Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_sitecollections", "ItemID=" + PanelRequest.ItemID.ToString(), "GroupName=" + GroupName)); + Response.Redirect(EditUrl("SpaceID", PanelSecurity.PackageId.ToString(), "sharepoint_sitecollections", "ItemID=" + PanelRequest.ItemID.ToString())); } private bool UseSharedSLL(int packageID) diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.designer.cs index 694af254..6801e4b1 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEditSiteCollection.ascx.designer.cs @@ -21,15 +21,6 @@ namespace WebsitePanel.Portal { /// protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; - /// - /// menu control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; - /// /// Image1 control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx index 16ea6abd..5f3f1771 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx @@ -17,7 +17,6 @@
-
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.designer.cs index 7903ac5e..c59bec70 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointRestoreSiteCollection.ascx.designer.cs @@ -21,15 +21,6 @@ namespace WebsitePanel.Portal { /// protected global::WebsitePanel.Portal.EnableAsyncTasksSupport asyncTasks; - /// - /// menu control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; - /// /// Image1 control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx index 5fb250d7..f11df6ad 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx @@ -14,7 +14,6 @@
-
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx.designer.cs index b004706e..04b5be91 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageSettings.ascx.designer.cs @@ -12,15 +12,6 @@ namespace WebsitePanel.Portal { public partial class HostedSharePointStorageSettings { - /// - /// menu control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; - /// /// Image1 control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx index 9308c5b0..317c2138 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx @@ -11,7 +11,6 @@
-
diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx.designer.cs index b6916e27..4c003393 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointStorageUsage.ascx.designer.cs @@ -12,15 +12,6 @@ namespace WebsitePanel.Portal { public partial class HostedSharePointStorageUsage { - /// - /// menu control. - /// - /// - /// Auto-generated field. - /// To modify move field declaration from designer file to code-behind file. - /// - protected global::WebsitePanel.Portal.ExchangeServer.UserControls.Menu menu; - /// /// Image1 control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditService.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditService.ascx.cs index 3ed913ac..224ce9e4 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditService.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ServersEditService.ascx.cs @@ -161,7 +161,7 @@ namespace WebsitePanel.Portal (resourceGroup.GroupName == ResourceGroups.Os)| (resourceGroup.GroupName == ResourceGroups.HostedOrganizations) | (resourceGroup.GroupName == ResourceGroups.SharepointFoundationServer) | - (resourceGroup.GroupName == ResourceGroups.SharepointServer) | + (resourceGroup.GroupName == ResourceGroups.SharepointEnterpriseServer) | (resourceGroup.GroupName == ResourceGroups.Mail)| (resourceGroup.GroupName == ResourceGroups.Lync)| (resourceGroup.GroupName == ResourceGroups.Exchange)| diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/OrganizationMenuControl.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/OrganizationMenuControl.cs index 95925257..ad45d878 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/OrganizationMenuControl.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/UserControls/OrganizationMenuControl.cs @@ -98,8 +98,8 @@ namespace WebsitePanel.Portal.UserControls if (Cntx.Groups.ContainsKey(ResourceGroups.SharepointFoundationServer)) PrepareSharePointMenuRoot(items, GetLocalizedString("Text.SharePointFoundationServerGroup"), ResourceGroups.SharepointFoundationServer.Replace(" ", "")); - if (Cntx.Groups.ContainsKey(ResourceGroups.SharepointServer)) - PrepareSharePointMenuRoot(items, GetLocalizedString("Text.SharePointServerGroup"), ResourceGroups.SharepointServer.Replace(" ", "")); + if (Cntx.Groups.ContainsKey(ResourceGroups.SharepointEnterpriseServer)) + PrepareSharePointMenuRoot(items, GetLocalizedString("Text.SharePointEnterpriseServerGroup"), ResourceGroups.SharepointEnterpriseServer.Replace(" ", "")); //CRM Menu if (Cntx.Groups.ContainsKey(ResourceGroups.HostedCRM2013)) From 7c2a38743c5635917dd1a4193fdc6edbb96584e6 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 5 Apr 2015 11:46:40 +0800 Subject: [PATCH 10/41] Fix the get site collections --- .../SharePoint/HostedSharePointServerController.cs | 2 +- .../SharePoint/HostedSharePointServerEntController.cs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerController.cs index a03a95ca..90d87927 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerController.cs @@ -69,7 +69,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint } SharePointSiteCollectionListPaged paged = new SharePointSiteCollectionListPaged(); - DataSet result = PackageController.GetRawPackageItemsPaged(packageId, typeof(SharePointSiteCollection), + DataSet result = PackageController.GetRawPackageItemsPaged(packageId, "Sharepoint Foundation Server", typeof(SharePointSiteCollection), true, filterColumn, filterValue, sortColumn, startRow, Int32.MaxValue); List items = PackageController.CreateServiceItemsList(result, 1).ConvertAll(delegate(ServiceProviderItem item) { return (SharePointSiteCollection)item; }); diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs index cbe0867a..c57f783e 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/SharePoint/HostedSharePointServerEntController.cs @@ -69,7 +69,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint } SharePointSiteCollectionListPaged paged = new SharePointSiteCollectionListPaged(); - DataSet result = PackageController.GetRawPackageItemsPaged(packageId, typeof(SharePointSiteCollection), + DataSet result = PackageController.GetRawPackageItemsPaged(packageId, , "Sharepoint Enterprise Server", typeof(SharePointSiteCollection), true, filterColumn, filterValue, sortColumn, startRow, Int32.MaxValue); List items = PackageController.CreateServiceItemsList(result, 1).ConvertAll(delegate(ServiceProviderItem item) { return (SharePointSiteCollection)item; }); From 079568a9e0ba966a4eecf5152d649d3387ea7453 Mon Sep 17 00:00:00 2001 From: robvde Date: Sun, 5 Apr 2015 14:18:13 +0800 Subject: [PATCH 11/41] Sharepoint 2013 UI Partial Check in --- .../ESModule_ControlsHierarchy.config | 13 +- .../App_Data/WebsitePanel_Modules.config | 17 + .../App_Data/WebsitePanel_Pages.config | 11 + .../WebsitePanel_Modules.ascx.resx | 15 + ...ntEnterpriseBackupSiteCollection.ascx.resx | 153 ++++++ ...ointEnterpriseEditSiteCollection.ascx.resx | 207 ++++++++ ...tEnterpriseRestoreSiteCollection.ascx.resx | 150 ++++++ ...rePointEnterpriseSiteCollections.ascx.resx | 153 ++++++ ...rePointEnterpriseStorageSettings.ascx.resx | 154 ++++++ ...SharePointEnterpriseStorageUsage.ascx.resx | 150 ++++++ .../WebsitePanel/Code/Framework/ES.cs | 5 + ...arePointEnterpriseSiteCollectionsHelper.cs | 65 +++ .../ExchangeServer/UserControls/Menu.ascx.cs | 16 +- ...rePointEnterpriseBackupSiteCollection.ascx | 80 ++++ ...ointEnterpriseBackupSiteCollection.ascx.cs | 189 ++++++++ ...priseBackupSiteCollection.ascx.designer.cs | 159 +++++++ ...harePointEnterpriseEditSiteCollection.ascx | 209 ++++++++ ...ePointEnterpriseEditSiteCollection.ascx.cs | 450 ++++++++++++++++++ ...erpriseEditSiteCollection.ascx.designer.cs | 447 +++++++++++++++++ ...ePointEnterpriseRestoreSiteCollection.ascx | 101 ++++ ...intEnterpriseRestoreSiteCollection.ascx.cs | 176 +++++++ ...riseRestoreSiteCollection.ascx.designer.cs | 159 +++++++ ...edSharePointEnterpriseSiteCollections.ascx | 92 ++++ ...harePointEnterpriseSiteCollections.ascx.cs | 110 +++++ ...EnterpriseSiteCollections.ascx.designer.cs | 141 ++++++ ...edSharePointEnterpriseStorageSettings.ascx | 62 +++ ...harePointEnterpriseStorageSettings.ascx.cs | 93 ++++ ...EnterpriseStorageSettings.ascx.designer.cs | 114 +++++ ...ostedSharePointEnterpriseStorageUsage.ascx | 57 +++ ...edSharePointEnterpriseStorageUsage.ascx.cs | 94 ++++ ...intEnterpriseStorageUsage.ascx.designer.cs | 114 +++++ .../UserControls/OrganizationMenuControl.cs | 68 ++- .../WebsitePanel.Portal.Modules.csproj | 67 +++ 33 files changed, 4077 insertions(+), 14 deletions(-) create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/HostedSharePointEnterpriseBackupSiteCollection.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/HostedSharePointEnterpriseEditSiteCollection.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/HostedSharePointEnterpriseRestoreSiteCollection.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/HostedSharePointEnterpriseSiteCollections.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/HostedSharePointEnterpriseStorageSettings.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/App_LocalResources/HostedSharePointEnterpriseStorageUsage.ascx.resx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/Code/Helpers/HostedSharePointEnterpriseSiteCollectionsHelper.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseBackupSiteCollection.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseBackupSiteCollection.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseBackupSiteCollection.ascx.designer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseEditSiteCollection.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseEditSiteCollection.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseEditSiteCollection.ascx.designer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseRestoreSiteCollection.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseRestoreSiteCollection.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseRestoreSiteCollection.ascx.designer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseSiteCollections.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseSiteCollections.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseSiteCollections.ascx.designer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseStorageSettings.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseStorageSettings.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseStorageSettings.ascx.designer.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseStorageUsage.ascx create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseStorageUsage.ascx.cs create mode 100644 WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseStorageUsage.ascx.designer.cs diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config index 7ed16940..f97bb492 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/ESModule_ControlsHierarchy.config @@ -98,11 +98,22 @@ - + + + + + + + + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config index ecbdc1f6..1bd0de2e 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Modules.config @@ -252,6 +252,16 @@ + + + + + + + + + + @@ -540,6 +550,13 @@ + + + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Pages.config b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Pages.config index e10593c1..d695ed92 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Pages.config +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/App_Data/WebsitePanel_Pages.config @@ -175,6 +175,17 @@ + +