Sharepoint Enterprise 2013 provider

This commit is contained in:
robvde 2015-04-05 07:48:45 +08:00
parent bfa2d0cd08
commit 919900b8a1
27 changed files with 4056 additions and 45 deletions

View file

@ -9462,3 +9462,33 @@ END
GO
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

View file

@ -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

View file

@ -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";

View file

@ -39,7 +39,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Bin\</OutputPath>
<OutputPath>..\WebsitePanel.EnterpriseServer\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@ -49,7 +49,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>none</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\Bin\</OutputPath>
<OutputPath>..\WebsitePanel.EnterpriseServer\bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>

View file

@ -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;

View file

@ -58,18 +58,18 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint
/// <param name="startRow">Row index to start from.</param>
/// <param name="maximumRows">Maximum number of rows to retrieve.</param>
/// <returns>Site collections that match.</returns>
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<SharePointSiteCollection> items = PackageController.CreateServiceItemsList(result, 1).ConvertAll<SharePointSiteCollection>(delegate(ServiceProviderItem item) { return (SharePointSiteCollection)item; });
@ -149,9 +149,8 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint
/// </summary>
/// <param name="packageId">Package that owns site collections.</param>
/// <param name="recursive">A value which shows whether nested spaces must be searched as well.</param>
/// <param name="groupName">Resource group name.</param>
/// <returns>List of found site collections.</returns>
public static List<SharePointSiteCollection> GetSiteCollections(int packageId, bool recursive, string groupName)
public static List<SharePointSiteCollection> GetSiteCollections(int packageId, bool recursive)
{
if (IsDemoMode)
{
@ -184,7 +183,7 @@ namespace WebsitePanel.EnterpriseServer.Code.SharePoint
}
List<ServiceProviderItem> items = PackageController.GetPackageItemsByType(packageId, groupName, typeof(SharePointSiteCollection), recursive);
List<ServiceProviderItem> items = PackageController.GetPackageItemsByType(packageId, typeof(SharePointSiteCollection), recursive);
return items.ConvertAll<SharePointSiteCollection>(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.
/// </summary>
/// <param name="item">Site collection description.</param>
/// <param name="groupName">Resource group name.</param>
/// <returns>Created site collection id within metabase.</returns>
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;
}
}
}

View file

@ -17,7 +17,7 @@
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\..\Bin\</OutputPath>
<OutputPath>..\WebsitePanel.EnterpriseServer\bin\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@ -26,7 +26,7 @@
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>..\..\Bin\</OutputPath>
<OutputPath>..\WebsitePanel.EnterpriseServer\bin\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
@ -163,6 +163,7 @@
<Compile Include="Scheduling\SchedulerController.cs" />
<Compile Include="Scheduling\SchedulerJob.cs" />
<Compile Include="Servers\ServerController.cs" />
<Compile Include="SharePoint\HostedSharePointServerEntController.cs" />
<Compile Include="SharePoint\HostedSharePointServerController.cs" />
<Compile Include="SharePoint\SharePointServerController.cs" />
<Compile Include="StatisticsServers\StatisticsServerController.cs" />

View file

@ -68,16 +68,19 @@
<Reference Include="System.EnterpriseServices" />
<Reference Include="System.Web.Mobile" />
<Reference Include="System.Xml.Linq" />
<Reference Include="WebsitePanel.EnterpriseServer.Base">
<Reference Include="WebsitePanel.EnterpriseServer.Base, Version=2.1.0.1, Culture=neutral, PublicKeyToken=da8782a6fc4d0081, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Bin\WebsitePanel.EnterpriseServer.Base.dll</HintPath>
</Reference>
<Reference Include="WebsitePanel.EnterpriseServer.Code">
<Reference Include="WebsitePanel.EnterpriseServer.Code, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Bin\WebsitePanel.EnterpriseServer.Code.dll</HintPath>
</Reference>
<Reference Include="WebsitePanel.Providers.Base">
<Reference Include="WebsitePanel.Providers.Base, Version=2.1.0.1, Culture=neutral, PublicKeyToken=da8782a6fc4d0081, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Bin\WebsitePanel.Providers.Base.dll</HintPath>
</Reference>
<Reference Include="WebsitePanel.Server.Client, Version=1.2.2.0, Culture=neutral, PublicKeyToken=da8782a6fc4d0081, processorArchitecture=MSIL">
<Reference Include="WebsitePanel.Server.Client, Version=2.1.0.1, Culture=neutral, PublicKeyToken=da8782a6fc4d0081, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\Bin\WebsitePanel.Server.Client.dll</HintPath>
</Reference>
@ -120,6 +123,7 @@
<Content Include="bin\WebsitePanel.Whois.pdb" />
<Content Include="bin\WhoisClient.dll" />
<Content Include="esEnterpriseStorage.asmx" />
<Content Include="esHostedSharePointServersEnt.asmx" />
<Content Include="esRemoteDesktopServices.asmx" />
<Content Include="esHeliconZoo.asmx" />
<Content Include="esLync.asmx" />
@ -164,6 +168,10 @@
<DependentUpon>esEnterpriseStorage.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="esHostedSharePointServersEnt.asmx.cs">
<DependentUpon>esHostedSharePointServersEnt.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="esRemoteDesktopServices.asmx.cs">
<DependentUpon>esRemoteDesktopServices.asmx</DependentUpon>
<SubType>Component</SubType>

View file

@ -59,10 +59,10 @@ namespace WebsitePanel.EnterpriseServer
/// <returns>Site collections in raw format.</returns>
[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);
}
/// <summary>
@ -83,9 +83,9 @@ namespace WebsitePanel.EnterpriseServer
/// <param name="groupName">Resource group name.</param>
/// <returns>List of found site collections.</returns>
[WebMethod]
public List<SharePointSiteCollection> GetSiteCollections(int packageId, bool recursive, string groupName)
public List<SharePointSiteCollection> 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
/// <param name="groupName">Resource group name.</param>
/// <returns>Created site collection id within metabase.</returns>
[WebMethod]
public int AddSiteCollection(SharePointSiteCollection item, string groupName)
public int AddSiteCollection(SharePointSiteCollection item)
{
return HostedSharePointServerController.AddSiteCollection(item, groupName);
return HostedSharePointServerController.AddSiteCollection(item);
}
/// <summary>

View file

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

View file

@ -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>
/// Summary description for esHostedSharePointServers
/// </summary>
[WebService(Namespace = "http://smbsaas/websitepanel/enterpriseserver")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[Policy("ServerPolicy")]
[ToolboxItem(false)]
public class esHostedSharePointServersEnt : WebService
{
/// <summary>
/// Gets site collections in raw form.
/// </summary>
/// <param name="packageId">Package to which desired site collections belong.</param>
/// <param name="organizationId">Organization to which desired site collections belong.</param>
/// <param name="filterColumn">Filter column name.</param>
/// <param name="filterValue">Filter value.</param>
/// <param name="sortColumn">Sort column name.</param>
/// <param name="startRow">Row index to start from.</param>
/// <param name="maximumRows">Maximum number of rows to retrieve.</param>
/// <param name="groupName">Resource group name.</param>
/// <returns>Site collections in raw format.</returns>
[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);
}
/// <summary>
/// Gets list of supported languages by this installation of SharePoint.
/// </summary>
/// <returns>List of supported languages</returns>
[WebMethod]
public int[] GetSupportedLanguages(int packageId)
{
return HostedSharePointServerEntController.GetSupportedLanguages(packageId);
}
/// <summary>
/// Gets list of SharePoint site collections that belong to the package.
/// </summary>
/// <param name="packageId">Package that owns site collections.</param>
/// <param name="recursive">A value which shows whether nested spaces must be searched as well.</param>
/// <param name="groupName">Resource group name.</param>
/// <returns>List of found site collections.</returns>
[WebMethod]
public List<SharePointSiteCollection> 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 );
}
/// <summary>
/// Gets SharePoint site collection with given id.
/// </summary>
/// <param name="itemId">Site collection id within metabase.</param>
/// <returns>Site collection.</returns>
[WebMethod]
public SharePointSiteCollection GetSiteCollection(int itemId)
{
return HostedSharePointServerEntController.GetSiteCollection(itemId);
}
/// <summary>
/// Gets SharePoint site collection from package under organization with given domain.
/// </summary>
/// <param name="packageId">Package id.</param>
/// <param name="organizationId">Organization id.</param>
/// <param name="domain">Domain name.</param>
/// <returns>SharePoint site collection or null.</returns>
[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;
}
/// <summary>
/// Adds SharePoint site collection.
/// </summary>
/// <param name="item">Site collection description.</param>
/// <param name="groupName">Resource group name.</param>
/// <returns>Created site collection id within metabase.</returns>
[WebMethod]
public int AddSiteCollection(SharePointSiteCollection item)
{
return HostedSharePointServerEntController.AddSiteCollection(item);
}
/// <summary>
/// Deletes SharePoint site collection with given id.
/// </summary>
/// <param name="itemId">Site collection id within metabase.</param>
/// <returns>?</returns>
[WebMethod]
public int DeleteSiteCollection(int itemId)
{
return HostedSharePointServerEntController.DeleteSiteCollection(itemId);
}
/// <summary>
/// Deletes SharePoint site collections which belong to organization.
/// </summary>
/// <param name="organizationId">Site collection id within metabase.</param>
/// <returns>?</returns>
[WebMethod]
public int DeleteSiteCollections(int organizationId)
{
HostedSharePointServerEntController.DeleteSiteCollections(organizationId);
return 0;
}
/// <summary>
/// Backups SharePoint site collection.
/// </summary>
/// <param name="itemId">Site collection id within metabase.</param>
/// <param name="fileName">Backed up site collection file name.</param>
/// <param name="zipBackup">A value which shows whether back up must be archived.</param>
/// <param name="download">A value which shows whether created back up must be downloaded.</param>
/// <param name="folderName">Local folder to store downloaded backup.</param>
/// <returns>Created backup file name. </returns>
[WebMethod]
public string BackupSiteCollection(int itemId, string fileName, bool zipBackup, bool download, string folderName)
{
return HostedSharePointServerEntController.BackupSiteCollection(itemId, fileName, zipBackup, download, folderName);
}
/// <summary>
/// Restores SharePoint site collection.
/// </summary>
/// <param name="itemId">Site collection id within metabase.</param>
/// <param name="uploadedFile"></param>
/// <param name="packageFile"></param>
/// <returns></returns>
[WebMethod]
public int RestoreSiteCollection(int itemId, string uploadedFile, string packageFile)
{
return HostedSharePointServerEntController.RestoreSiteCollection(itemId, uploadedFile, packageFile);
}
/// <summary>
/// Gets binary data chunk of specified size from specified offset.
/// </summary>
/// <param name="itemId">Item id to obtain realted service id.</param>
/// <param name="path">Path to file to get bunary data chunk from.</param>
/// <param name="offset">Offset from which to start data reading.</param>
/// <param name="length">Binary data chunk length.</param>
/// <returns>Binary data chunk read from file.</returns>
[WebMethod]
public byte[] GetBackupBinaryChunk(int itemId, string path, int offset, int length)
{
return HostedSharePointServerEntController.GetBackupBinaryChunk(itemId, path, offset, length);
}
/// <summary>
/// Appends supplied binary data chunk to file.
/// </summary>
/// <param name="itemId">Item id to obtain realted service id.</param>
/// <param name="fileName">Non existent file name to append to.</param>
/// <param name="path">Full path to existent file to append to.</param>
/// <param name="chunk">Binary data chunk to append to.</param>
/// <returns>Path to file that was appended with chunk.</returns>
[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);
}
}
}

View file

@ -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
{

View file

@ -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; }

View file

@ -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
{
/// <summary>
/// Exposes functionality for share point server provider hosted in conjunction with organization management provider and
/// exchange server.
/// </summary>
public interface IHostedSharePointServerEnt
{
/// <summary>
/// When implemented gets root web application uri.
/// </summary>
Uri Enterprise_RootWebApplicationUri
{
get;
}
/// <summary>
/// When implemented gets list of supported languages by this installation of SharePoint.
/// </summary>
/// <returns>List of supported languages</returns>
int[] Enterprise_GetSupportedLanguages();
/// <summary>
/// When implemented gets list of SharePoint collections within root web application.
/// </summary>
/// <returns>List of SharePoint collections within root web application.</returns>
SharePointSiteCollection[] Enterprise_GetSiteCollections();
/// <summary>
/// When implemented gets SharePoint collection within root web application with given name.
/// </summary>
/// <param name="url">Url that uniquely identifies site collection to be loaded.</param>
/// <returns>SharePoint collection within root web application with given name.</returns>
SharePointSiteCollection Enterprise_GetSiteCollection(string url);
/// <summary>
/// When implemented creates site collection within predefined root web application.
/// </summary>
/// <param name="siteCollection">Information about site coolection to be created.</param>
void Enterprise_CreateSiteCollection(SharePointSiteCollection siteCollection);
/// <summary>
/// When implemented deletes site collection under given url.
/// </summary>
/// <param name="url">Url that uniquely identifies site collection to be deleted.</param>
void Enterprise_DeleteSiteCollection(SharePointSiteCollection siteCollection);
/// <summary>
/// When implemeneted backups site collection under give url.
/// </summary>
/// <param name="url">Url that uniquely identifies site collection to be deleted.</param>
/// <param name="filename">Resulting backup file name.</param>
/// <param name="zip">A value which shows whether created backup must be archived.</param>
/// <returns>Created backup full path.</returns>
string Enterprise_BackupSiteCollection(string url, string filename, bool zip);
/// <summary>
/// When implemented restores site collection under given url from backup.
/// </summary>
/// <param name="siteCollection">Site collection to be restored.</param>
/// <param name="filename">Backup file name to restore from.</param>
void Enterprise_RestoreSiteCollection(SharePointSiteCollection siteCollection, string filename);
/// <summary>
/// When implemented gets binary data chunk of specified size from specified offset.
/// </summary>
/// <param name="path">Path to file to get bunary data chunk from.</param>
/// <param name="offset">Offset from which to start data reading.</param>
/// <param name="length">Binary data chunk length.</param>
/// <returns>Binary data chunk read from file.</returns>
byte[] Enterprise_GetTempFileBinaryChunk(string path, int offset, int length);
/// <summary>
/// When implemented appends supplied binary data chunk to file.
/// </summary>
/// <param name="fileName">Non existent file name to append to.</param>
/// <param name="path">Full path to existent file to append to.</param>
/// <param name="chunk">Binary data chunk to append to.</param>
/// <returns>Path to file that was appended with chunk.</returns>
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);
}
}

View file

@ -280,6 +280,7 @@
<Compile Include="ResultObjects\ValueResultObject.cs" />
<Compile Include="ResultObjects\VirtualMachineResult.cs" />
<Compile Include="ResultObjects\WebAppGallery.cs" />
<Compile Include="SharePoint\IHostedSharePointServerEnt.cs" />
<Compile Include="SharePoint\IHostedSharePointServer.cs" />
<Compile Include="SharePoint\ISharePointServer.cs" />
<Compile Include="SharePoint\SharePointSite.cs" />

View file

@ -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
{
/// <summary>
/// Provides hosted SharePoint server functionality implementation.
/// </summary>
public class HostedSharePointServer2013Ent : HostingServiceProviderBase, IHostedSharePointServerEnt
{
#region Delegate
private delegate TReturn SharePointAction<TReturn>(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
/// <summary>Gets list of supported languages by this installation of SharePoint.</summary>
/// <returns>List of supported languages</returns>
public int[] Enterprise_GetSupportedLanguages()
{
var impl = new HostedSharePointServer2013EntImpl();
return impl.GetSupportedLanguages(Enterprise_RootWebApplicationUri);
}
/// <summary>Gets list of SharePoint collections within root web application.</summary>
/// <returns>List of SharePoint collections within root web application.</returns>
public SharePointSiteCollection[] Enterprise_GetSiteCollections()
{
return ExecuteSharePointAction(impl => impl.GetSiteCollections(Enterprise_RootWebApplicationUri));
}
/// <summary>Gets SharePoint collection within root web application with given name.</summary>
/// <param name="url">Url that uniquely identifies site collection to be loaded.</param>
/// <returns>SharePoint collection within root web application with given name.</returns>
public SharePointSiteCollection Enterprise_GetSiteCollection(string url)
{
return ExecuteSharePointAction(impl => impl.GetSiteCollection(Enterprise_RootWebApplicationUri, url));
}
/// <summary>Creates site collection within predefined root web application.</summary>
/// <param name="siteCollection">Information about site coolection to be created.</param>
public void Enterprise_CreateSiteCollection(SharePointSiteCollection siteCollection)
{
ExecuteSharePointAction<object>(delegate(HostedSharePointServer2013EntImpl impl)
{
impl.CreateSiteCollection(Enterprise_RootWebApplicationUri, siteCollection);
return null;
});
}
/// <summary>Deletes site collection under given url.</summary>
/// <param name="siteCollection">The site collection to be deleted.</param>
public void Enterprise_DeleteSiteCollection(SharePointSiteCollection siteCollection)
{
ExecuteSharePointAction<object>(delegate(HostedSharePointServer2013EntImpl impl)
{
impl.DeleteSiteCollection(Enterprise_RootWebApplicationUri, siteCollection);
return null;
});
}
/// <summary>Backups site collection under give url.</summary>
/// <param name="url">Url that uniquely identifies site collection to be deleted.</param>
/// <param name="filename">Resulting backup file name.</param>
/// <param name="zip">A value which shows whether created backup must be archived.</param>
/// <returns>Created backup full path.</returns>
public string Enterprise_BackupSiteCollection(string url, string filename, bool zip)
{
return ExecuteSharePointAction(impl => impl.BackupSiteCollection(Enterprise_RootWebApplicationUri, url, filename, zip, BackupTemporaryFolder));
}
/// <summary>Restores site collection under given url from backup.</summary>
/// <param name="siteCollection">Site collection to be restored.</param>
/// <param name="filename">Backup file name to restore from.</param>
public void Enterprise_RestoreSiteCollection(SharePointSiteCollection siteCollection, string filename)
{
ExecuteSharePointAction<object>(delegate(HostedSharePointServer2013EntImpl impl)
{
impl.RestoreSiteCollection(Enterprise_RootWebApplicationUri, siteCollection, filename);
return null;
});
}
/// <summary>Gets binary data chunk of specified size from specified offset.</summary>
/// <param name="path">Path to file to get bunary data chunk from.</param>
/// <param name="offset">Offset from which to start data reading.</param>
/// <param name="length">Binary data chunk length.</param>
/// <returns>Binary data chunk read from file.</returns>
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;
}
/// <summary>Appends supplied binary data chunk to file.</summary>
/// <param name="fileName">Non existent file name to append to.</param>
/// <param name="path">Full path to existent file to append to.</param>
/// <param name="chunk">Binary data chunk to append to.</param>
/// <returns>Path to file that was appended with chunk.</returns>
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<object>(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<object>(delegate(HostedSharePointServer2013EntImpl impl)
{
impl.SetPeoplePickerOu(site, ou);
return null;
});
}
public override bool IsInstalled()
{
return IsSharePointInstalled();
}
/// <summary>Deletes service items that represent SharePoint site collection.</summary>
/// <param name="items">Items to be deleted.</param>
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);
}
}
}
}
/// <summary>Calculates diskspace used by supplied service items.</summary>
/// <param name="items">Service items to get diskspace usage for.</param>
/// <returns>Calculated disk space usage statistics.</returns>
public override ServiceProviderItemDiskSpace[] GetServiceItemsDiskSpace(ServiceProviderItem[] items)
{
var itemsDiskspace = new List<ServiceProviderItemDiskSpace>();
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();
}
/// <summary>Checks whether SharePoint 2013 is installed.</summary>
/// <returns>true - if it is installed; false - otherwise.</returns>
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);
}
/// <summary>Executes supplied action within separate application domain.</summary>
/// <param name="action">Action to be executed.</param>
/// <returns>Any object that results from action execution or null if nothing is supposed to be returned.</returns>
/// <exception cref="ArgumentNullException">Is thrown in case supplied action is null.</exception>
private static TReturn ExecuteSharePointAction<TReturn>(SharePointAction<TReturn> 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");
}
/// <summary> Getting PrivatePath from web.config. </summary>
/// <returns> The PrivateBinPath.</returns>
private static string GetPrivateBinPath()
{
var lines = new List<string> { "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
}
}

View file

@ -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
/// <summary>Gets list of SharePoint collections within root web application.</summary>
/// <param name="rootWebApplicationUri"> The root web application Uri. </param>
/// <returns>List of SharePoint collections within root web application.</returns>
public SharePointSiteCollection[] GetSiteCollections(Uri rootWebApplicationUri)
{
return GetSPSiteCollections(rootWebApplicationUri).Select(pair => NewSiteCollection(pair.Value)).ToArray();
}
/// <summary>Gets list of supported languages by this installation of SharePoint.</summary>
/// <param name="rootWebApplicationUri"> The root web application Uri. </param>
/// <returns>List of supported languages</returns>
public int[] GetSupportedLanguages(Uri rootWebApplicationUri)
{
var languages = new List<int>();
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();
}
/// <summary>Gets site collection size in bytes.</summary>
/// <param name="rootWebApplicationUri">The root web application uri.</param>
/// <param name="url">The site collection url.</param>
/// <returns>Size in bytes.</returns>
public long GetSiteCollectionSize(Uri rootWebApplicationUri, string url)
{
Dictionary<string, long> sizes = GetSitesCollectionSize(rootWebApplicationUri, new[] {url});
if (sizes.Count() == 1)
{
return sizes.First().Value;
}
throw new ApplicationException(string.Format("SiteCollection {0} does not exist", url));
}
/// <summary>Gets sites disk space.</summary>
/// <param name="rootWebApplicationUri">The root web application uri.</param>
/// <param name="urls">The sites urls.</param>
/// <returns>The disk space.</returns>
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();
}
/// <summary>Calculates size of the required seti collections.</summary>
/// <param name="rootWebApplicationUri">The root web application uri.</param>
/// <param name="urls">The sites urls.</param>
/// <returns>Calculated sizes.</returns>
private Dictionary<string, long> GetSitesCollectionSize(Uri rootWebApplicationUri, IEnumerable<string> urls)
{
Runspace runspace = null;
var result = new Dictionary<string, long>();
try
{
runspace = OpenRunspace();
foreach (string url in urls)
{
string siteCollectionUrl = String.Format("{0}:{1}", url, rootWebApplicationUri.Port);
var scripts = new List<string> {string.Format("$site=Get-SPSite -Identity \"{0}\"", siteCollectionUrl), "$site.RecalculateStorageUsed()", "$site.Usage.Storage"};
Collection<PSObject> scriptResult = ExecuteShellCommand(runspace, scripts);
if (scriptResult != null && scriptResult.Any())
{
result.Add(url, Convert.ToInt64(scriptResult.First().BaseObject));
}
}
}
finally
{
CloseRunspace(runspace);
}
return result;
}
/// <summary>Sets people picker OU.</summary>
/// <param name="site">The site.</param>
/// <param name="ou">OU.</param>
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");
}
/// <summary>Gets SharePoint collection within root web application with given name.</summary>
/// <param name="rootWebApplicationUri">Root web application uri.</param>
/// <param name="url">Url that uniquely identifies site collection to be loaded.</param>
/// <returns>SharePoint collection within root web application with given name.</returns>
public SharePointSiteCollection GetSiteCollection(Uri rootWebApplicationUri, string url)
{
return NewSiteCollection(GetSPSiteCollection(rootWebApplicationUri, url));
}
/// <summary>Deletes quota.</summary>
/// <param name="name">The quota name.</param>
private static void DeleteQuotaTemplate(string name)
{
SPFarm farm = SPFarm.Local;
var webService = farm.Services.GetValue<SPWebService>("");
SPQuotaTemplateCollection quotaColl = webService.QuotaTemplates;
quotaColl.Delete(name);
}
/// <summary>Updates site collection quota.</summary>
/// <param name="root">The root uri.</param>
/// <param name="url">The site collection url.</param>
/// <param name="maxStorage">The max storage.</param>
/// <param name="warningStorage">The warning storage value.</param>
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);
}
}
/// <summary>Grants acces to current user.</summary>
/// <param name="runspace">The runspace.</param>
/// <param name="rootWebApplicationUri">The root web application uri.</param>
private void GrantAccess(Runspace runspace, Uri rootWebApplicationUri)
{
ExecuteShellCommand(runspace, new List<string> {string.Format("$webApp=Get-SPWebApplication {0}", rootWebApplicationUri.AbsoluteUri), string.Format("$webApp.GrantAccessToProcessIdentity(\"{0}\")", WindowsIdentity.GetCurrent().Name)});
}
/// <summary>Deletes site collection.</summary>
/// <param name="runspace">The runspace.</param>
/// <param name="url">The site collection url.</param>
/// <param name="deleteADAccounts">True - if active directory accounts should be deleted.</param>
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);
}
/// <summary> Creates site collection within predefined root web application.</summary>
/// <param name="rootWebApplicationUri">Root web application uri.</param>
/// <param name="siteCollection">Information about site coolection to be created.</param>
/// <exception cref="InvalidOperationException">Is thrown in case requested operation fails for any reason.</exception>
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();
}
}
}
/// <summary> Creates site collection within predefined root web application.</summary>
/// <param name="runspace"> The runspace.</param>
/// <param name="rootWebApplicationUri">Root web application uri.</param>
/// <param name="siteCollection">Information about site coolection to be created.</param>
/// <exception cref="InvalidOperationException">Is thrown in case requested operation fails for any reason.</exception>
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);
}
/// <summary>Deletes site collection under given url.</summary>
/// <param name="rootWebApplicationUri">Root web application uri.</param>
/// <param name="siteCollection">The site collection to be deleted.</param>
/// <exception cref="InvalidOperationException">Is thrown in case requested operation fails for any reason.</exception>
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");
}
}
/// <summary> Backups site collection under give url.</summary>
/// <param name="rootWebApplicationUri">Root web application uri.</param>
/// <param name="url">Url that uniquely identifies site collection to be deleted.</param>
/// <param name="filename">Resulting backup file name.</param>
/// <param name="zip">A value which shows whether created backup must be archived.</param>
/// <param name="tempPath">Custom temp path for backup</param>
/// <returns>Full path to created backup.</returns>
/// <exception cref="InvalidOperationException">Is thrown in case requested operation fails for any reason.</exception>
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);
}
}
/// <summary>Restores site collection under given url from backup.</summary>
/// <param name="rootWebApplicationUri">Root web application uri.</param>
/// <param name="siteCollection">Site collection to be restored.</param>
/// <param name="filename">Backup file name to restore from.</param>
/// <exception cref="InvalidOperationException">Is thrown in case requested operation fails for any reason.</exception>
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);
}
}
/// <summary>Creates new site collection with information from administration object.</summary>
/// <param name="site">Administration object.</param>
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};
}
/// <summary>Gets SharePoint sites collection.</summary>
/// <param name="rootWebApplicationUri">The root web application uri.</param>
/// <returns>The SharePoint sites.</returns>
private Dictionary<string, SPSite> GetSPSiteCollections(Uri rootWebApplicationUri)
{
Runspace runspace = null;
var collections = new Dictionary<string, SPSite>();
try
{
runspace = OpenRunspace();
var cmd = new Command("Get-SPSite");
cmd.Parameters.Add("WebApplication", rootWebApplicationUri.AbsoluteUri);
Collection<PSObject> 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;
}
/// <summary>Gets SharePoint site collection.</summary>
/// <param name="rootWebApplicationUri">The root web application uri.</param>
/// <param name="url">The required site url.</param>
/// <returns>The SharePoint sites.</returns>
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<PSObject> 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);
}
}
/// <summary>Opens PowerShell runspace.</summary>
/// <returns>The runspace.</returns>
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;
}
/// <summary>Closes runspace.</summary>
/// <param name="runspace">The runspace.</param>
private void CloseRunspace(Runspace runspace)
{
try
{
if (runspace != null && runspace.RunspaceStateInfo.State == RunspaceState.Opened)
{
runspace.Close();
}
}
catch (Exception ex)
{
HostedSolutionLog.LogError("Runspace error", ex);
}
}
/// <summary>Executes shell command.</summary>
/// <param name="runspace">The runspace.</param>
/// <param name="cmd">The command to be executed.</param>
/// <returns>PSobjecs collection.</returns>
private Collection<PSObject> 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<string>, out errors);
}
/// <summary>Executes shell command.</summary>
/// <param name="runspace">The runspace.</param>
/// <param name="cmd">The command to be executed.</param>
/// <param name="errors">The errors.</param>
/// <returns>PSobjecs collection.</returns>
private Collection<PSObject> ExecuteShellCommand(Runspace runspace, Command cmd, out object[] errors)
{
HostedSolutionLog.LogStart("ExecuteShellCommand");
var errorList = new List<object>();
Collection<PSObject> 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;
}
/// <summary>Executes shell command.</summary>
/// <param name="runspace">The runspace.</param>
/// <param name="scripts">The scripts to be executed.</param>
/// <param name="errors">The errors.</param>
/// <returns>PSobjecs collection.</returns>
private Collection<PSObject> ExecuteShellCommand(Runspace runspace, List<string> scripts, out object[] errors)
{
HostedSolutionLog.LogStart("ExecuteShellCommand");
var errorList = new List<object>();
Collection<PSObject> 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;
}
/// <summary>Adds record to hosts file.</summary>
/// <param name="siteCollection">The site collection object.</param>
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);
}
}
/// <summary>Removes record from hosts file.</summary>
/// <param name="siteCollection">The site collection object.</param>
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
}
}

View file

@ -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")]

View file

@ -0,0 +1,75 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{0CF0C19E-7BFE-4A61-AF00-7B7CE7264252}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>WebsitePanel.Providers.HostedSolution.SharePoint2013Ent</RootNamespace>
<AssemblyName>WebsitePanel.Providers.HostedSolution.SharePoint2013Ent</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<FileAlignment>512</FileAlignment>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>..\WebsitePanel.Server\bin\Sharepoint2013Ent\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.SharePoint">
<HintPath>..\..\Lib\References\Microsoft\Microsoft.SharePoint.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="System" />
<Reference Include="System.Configuration" />
<Reference Include="System.Core" />
<Reference Include="System.Management.Automation, Version=3.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<SpecificVersion>False</SpecificVersion>
<HintPath>..\..\..\..\..\Windows\assembly\GAC_MSIL\System.Management.Automation\1.0.0.0__31bf3856ad364e35\System.Management.Automation.dll</HintPath>
</Reference>
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data" />
<Reference Include="System.Xml" />
<Reference Include="WebsitePanel.Providers.Base">
<HintPath>..\..\Bin\WebsitePanel.Providers.Base.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="WebsitePanel.Providers.HostedSolution">
<HintPath>..\WebsitePanel.Server\bin\WebsitePanel.Providers.HostedSolution.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="WebsitePanel.Server.Utils">
<HintPath>..\WebsitePanel.Server.Utils\bin\Debug\WebsitePanel.Server.Utils.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="HostedSharePointServer2013Ent.cs" />
<Compile Include="HostedSharePointServer2013EntImpl.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>

View file

@ -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.
//------------------------------------------------------------------------------
// <auto-generated>
// 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.
// </auto-generated>
//------------------------------------------------------------------------------
//
// 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;
/// <remarks/>
[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;
/// <remarks/>
public HostedSharePointServerEnt() {
this.Url = "http://localhost:9003/HostedSharePointServerEnt.asmx";
}
/// <remarks/>
public event Enterprise_GetSupportedLanguagesCompletedEventHandler Enterprise_GetSupportedLanguagesCompleted;
/// <remarks/>
public event Enterprise_GetSiteCollectionsCompletedEventHandler Enterprise_GetSiteCollectionsCompleted;
/// <remarks/>
public event Enterprise_GetSiteCollectionCompletedEventHandler Enterprise_GetSiteCollectionCompleted;
/// <remarks/>
public event Enterprise_CreateSiteCollectionCompletedEventHandler Enterprise_CreateSiteCollectionCompleted;
/// <remarks/>
public event Enterprise_UpdateQuotasCompletedEventHandler Enterprise_UpdateQuotasCompleted;
/// <remarks/>
public event Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventHandler Enterprise_CalculateSiteCollectionsDiskSpaceCompleted;
/// <remarks/>
public event Enterprise_DeleteSiteCollectionCompletedEventHandler Enterprise_DeleteSiteCollectionCompleted;
/// <remarks/>
public event Enterprise_BackupSiteCollectionCompletedEventHandler Enterprise_BackupSiteCollectionCompleted;
/// <remarks/>
public event Enterprise_RestoreSiteCollectionCompletedEventHandler Enterprise_RestoreSiteCollectionCompleted;
/// <remarks/>
public event Enterprise_GetTempFileBinaryChunkCompletedEventHandler Enterprise_GetTempFileBinaryChunkCompleted;
/// <remarks/>
public event Enterprise_AppendTempFileBinaryChunkCompletedEventHandler Enterprise_AppendTempFileBinaryChunkCompleted;
/// <remarks/>
public event Enterprise_GetSiteCollectionSizeCompletedEventHandler Enterprise_GetSiteCollectionSizeCompleted;
/// <remarks/>
public event Enterprise_SetPeoplePickerOuCompletedEventHandler Enterprise_SetPeoplePickerOuCompleted;
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginEnterprise_GetSupportedLanguages(System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("Enterprise_GetSupportedLanguages", new object[0], callback, asyncState);
}
/// <remarks/>
public int[] EndEnterprise_GetSupportedLanguages(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((int[])(results[0]));
}
/// <remarks/>
public void Enterprise_GetSupportedLanguagesAsync() {
this.Enterprise_GetSupportedLanguagesAsync(null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginEnterprise_GetSiteCollections(System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("Enterprise_GetSiteCollections", new object[0], callback, asyncState);
}
/// <remarks/>
public SharePointSiteCollection[] EndEnterprise_GetSiteCollections(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((SharePointSiteCollection[])(results[0]));
}
/// <remarks/>
public void Enterprise_GetSiteCollectionsAsync() {
this.Enterprise_GetSiteCollectionsAsync(null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginEnterprise_GetSiteCollection(string url, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("Enterprise_GetSiteCollection", new object[] {
url}, callback, asyncState);
}
/// <remarks/>
public SharePointSiteCollection EndEnterprise_GetSiteCollection(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((SharePointSiteCollection)(results[0]));
}
/// <remarks/>
public void Enterprise_GetSiteCollectionAsync(string url) {
this.Enterprise_GetSiteCollectionAsync(url, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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});
}
/// <remarks/>
public System.IAsyncResult BeginEnterprise_CreateSiteCollection(SharePointSiteCollection siteCollection, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("Enterprise_CreateSiteCollection", new object[] {
siteCollection}, callback, asyncState);
}
/// <remarks/>
public void EndEnterprise_CreateSiteCollection(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void Enterprise_CreateSiteCollectionAsync(SharePointSiteCollection siteCollection) {
this.Enterprise_CreateSiteCollectionAsync(siteCollection, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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});
}
/// <remarks/>
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);
}
/// <remarks/>
public void EndEnterprise_UpdateQuotas(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void Enterprise_UpdateQuotasAsync(string url, long maxSize, long warningSize) {
this.Enterprise_UpdateQuotasAsync(url, maxSize, warningSize, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginEnterprise_CalculateSiteCollectionsDiskSpace(string[] urls, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("Enterprise_CalculateSiteCollectionsDiskSpace", new object[] {
urls}, callback, asyncState);
}
/// <remarks/>
public SharePointSiteDiskSpace[] EndEnterprise_CalculateSiteCollectionsDiskSpace(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((SharePointSiteDiskSpace[])(results[0]));
}
/// <remarks/>
public void Enterprise_CalculateSiteCollectionsDiskSpaceAsync(string[] urls) {
this.Enterprise_CalculateSiteCollectionsDiskSpaceAsync(urls, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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});
}
/// <remarks/>
public System.IAsyncResult BeginEnterprise_DeleteSiteCollection(SharePointSiteCollection siteCollection, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("Enterprise_DeleteSiteCollection", new object[] {
siteCollection}, callback, asyncState);
}
/// <remarks/>
public void EndEnterprise_DeleteSiteCollection(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void Enterprise_DeleteSiteCollectionAsync(SharePointSiteCollection siteCollection) {
this.Enterprise_DeleteSiteCollectionAsync(siteCollection, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
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);
}
/// <remarks/>
public string EndEnterprise_BackupSiteCollection(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((string)(results[0]));
}
/// <remarks/>
public void Enterprise_BackupSiteCollectionAsync(string url, string filename, bool zip) {
this.Enterprise_BackupSiteCollectionAsync(url, filename, zip, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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});
}
/// <remarks/>
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);
}
/// <remarks/>
public void EndEnterprise_RestoreSiteCollection(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void Enterprise_RestoreSiteCollectionAsync(SharePointSiteCollection siteCollection, string filename) {
this.Enterprise_RestoreSiteCollectionAsync(siteCollection, filename, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
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);
}
/// <remarks/>
public byte[] EndEnterprise_GetTempFileBinaryChunk(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((byte[])(results[0]));
}
/// <remarks/>
public void Enterprise_GetTempFileBinaryChunkAsync(string path, int offset, int length) {
this.Enterprise_GetTempFileBinaryChunkAsync(path, offset, length, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
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);
}
/// <remarks/>
public string EndEnterprise_AppendTempFileBinaryChunk(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((string)(results[0]));
}
/// <remarks/>
public void Enterprise_AppendTempFileBinaryChunkAsync(string fileName, string path, byte[] chunk) {
this.Enterprise_AppendTempFileBinaryChunkAsync(fileName, path, chunk, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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]));
}
/// <remarks/>
public System.IAsyncResult BeginEnterprise_GetSiteCollectionSize(string url, System.AsyncCallback callback, object asyncState) {
return this.BeginInvoke("Enterprise_GetSiteCollectionSize", new object[] {
url}, callback, asyncState);
}
/// <remarks/>
public long EndEnterprise_GetSiteCollectionSize(System.IAsyncResult asyncResult) {
object[] results = this.EndInvoke(asyncResult);
return ((long)(results[0]));
}
/// <remarks/>
public void Enterprise_GetSiteCollectionSizeAsync(string url) {
this.Enterprise_GetSiteCollectionSizeAsync(url, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
[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});
}
/// <remarks/>
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);
}
/// <remarks/>
public void EndEnterprise_SetPeoplePickerOu(System.IAsyncResult asyncResult) {
this.EndInvoke(asyncResult);
}
/// <remarks/>
public void Enterprise_SetPeoplePickerOuAsync(string site, string ou) {
this.Enterprise_SetPeoplePickerOuAsync(site, ou, null);
}
/// <remarks/>
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));
}
}
/// <remarks/>
public new void CancelAsync(object userState) {
base.CancelAsync(userState);
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void Enterprise_GetSupportedLanguagesCompletedEventHandler(object sender, Enterprise_GetSupportedLanguagesCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public int[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((int[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void Enterprise_GetSiteCollectionsCompletedEventHandler(object sender, Enterprise_GetSiteCollectionsCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public SharePointSiteCollection[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((SharePointSiteCollection[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void Enterprise_GetSiteCollectionCompletedEventHandler(object sender, Enterprise_GetSiteCollectionCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public SharePointSiteCollection Result {
get {
this.RaiseExceptionIfNecessary();
return ((SharePointSiteCollection)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void Enterprise_CreateSiteCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void Enterprise_UpdateQuotasCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventHandler(object sender, Enterprise_CalculateSiteCollectionsDiskSpaceCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public SharePointSiteDiskSpace[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((SharePointSiteDiskSpace[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void Enterprise_DeleteSiteCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void Enterprise_BackupSiteCollectionCompletedEventHandler(object sender, Enterprise_BackupSiteCollectionCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public string Result {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void Enterprise_RestoreSiteCollectionCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void Enterprise_GetTempFileBinaryChunkCompletedEventHandler(object sender, Enterprise_GetTempFileBinaryChunkCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public byte[] Result {
get {
this.RaiseExceptionIfNecessary();
return ((byte[])(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void Enterprise_AppendTempFileBinaryChunkCompletedEventHandler(object sender, Enterprise_AppendTempFileBinaryChunkCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public string Result {
get {
this.RaiseExceptionIfNecessary();
return ((string)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void Enterprise_GetSiteCollectionSizeCompletedEventHandler(object sender, Enterprise_GetSiteCollectionSizeCompletedEventArgs e);
/// <remarks/>
[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;
}
/// <remarks/>
public long Result {
get {
this.RaiseExceptionIfNecessary();
return ((long)(this.results[0]));
}
}
}
/// <remarks/>
[System.CodeDom.Compiler.GeneratedCodeAttribute("wsdl", "2.0.50727.3038")]
public delegate void Enterprise_SetPeoplePickerOuCompletedEventHandler(object sender, System.ComponentModel.AsyncCompletedEventArgs e);
}

View file

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

View file

@ -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

View file

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

View file

@ -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>
/// Summary description for HostedSharePointServerEnt
/// </summary>
[WebService(Namespace = "http://smbsaas/websitepanel/server/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
[Policy("ServerPolicy")]
[ToolboxItem(false)]
public class HostedSharePointServerEnt : HostingServiceProviderWebService
{
private delegate TReturn Action<TReturn>();
/// <summary>
/// Gets hosted SharePoint provider instance.
/// </summary>
private IHostedSharePointServerEnt HostedSharePointServerEntProvider
{
get { return (IHostedSharePointServerEnt)Provider; }
}
/// <summary>
/// Gets list of supported languages by this installation of SharePoint.
/// </summary>
/// <returns>List of supported languages</returns>
[WebMethod, SoapHeader("settings")]
public int[] Enterprise_GetSupportedLanguages()
{
return ExecuteAction<int[]>(delegate
{
return HostedSharePointServerEntProvider.Enterprise_GetSupportedLanguages();
}, "GetSupportedLanguages");
}
/// <summary>
/// Gets list of SharePoint collections within root web application.
/// </summary>
/// <returns>List of SharePoint collections within root web application.</returns>
[WebMethod, SoapHeader("settings")]
public SharePointSiteCollection[] Enterprise_GetSiteCollections()
{
return ExecuteAction<SharePointSiteCollection[]>(delegate
{
return HostedSharePointServerEntProvider.Enterprise_GetSiteCollections();
}, "GetSiteCollections");
}
/// <summary>
/// Gets SharePoint collection within root web application with given name.
/// </summary>
/// <param name="url">Url that uniquely identifies site collection to be loaded.</param>
/// <returns>SharePoint collection within root web application with given name.</returns>
[WebMethod, SoapHeader("settings")]
public SharePointSiteCollection Enterprise_GetSiteCollection(string url)
{
return ExecuteAction<SharePointSiteCollection>(delegate
{
return HostedSharePointServerEntProvider.Enterprise_GetSiteCollection(url);
}, "GetSiteCollection");
}
/// <summary>
/// Creates site collection within predefined root web application.
/// </summary>
/// <param name="siteCollection">Information about site coolection to be created.</param>
[WebMethod, SoapHeader("settings")]
public void Enterprise_CreateSiteCollection(SharePointSiteCollection siteCollection)
{
siteCollection.OwnerLogin = AttachNetbiosDomainName(siteCollection.OwnerLogin);
ExecuteAction<object>(delegate
{
HostedSharePointServerEntProvider.Enterprise_CreateSiteCollection(siteCollection);
return new object();
}, "CreateSiteCollection");
}
[WebMethod, SoapHeader("settings")]
public void Enterprise_UpdateQuotas(string url, long maxSize, long warningSize)
{
ExecuteAction<object>(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<SharePointSiteDiskSpace[]>(delegate
{
return HostedSharePointServerEntProvider.Enterprise_CalculateSiteCollectionsDiskSpace(urls);
}, "CalculateSiteCollectionDiskSpace");
return ret;
}
/// <summary>
/// Deletes site collection under given url.
/// </summary>
/// <param name="url">Url that uniquely identifies site collection to be deleted.</param>
[WebMethod, SoapHeader("settings")]
public void Enterprise_DeleteSiteCollection(SharePointSiteCollection siteCollection)
{
ExecuteAction<object>(delegate
{
HostedSharePointServerEntProvider.Enterprise_DeleteSiteCollection(siteCollection);
return new object();
}, "DeleteSiteCollection");
}
/// <summary>
/// Backups site collection under give url.
/// </summary>
/// <param name="url">Url that uniquely identifies site collection to be deleted.</param>
/// <param name="filename">Resulting backup file name.</param>
/// <param name="zip">A value which shows whether created backup must be archived.</param>
/// <returns>Created backup full path.</returns>
[WebMethod, SoapHeader("settings")]
public string Enterprise_BackupSiteCollection(string url, string filename, bool zip)
{
return ExecuteAction<string>(delegate
{
return
HostedSharePointServerEntProvider.Enterprise_BackupSiteCollection(url, filename, zip);
}, "BackupSiteCollection");
}
/// <summary>
/// Restores site collection under given url from backup.
/// </summary>
/// <param name="siteCollection">Site collection to be restored.</param>
/// <param name="filename">Backup file name to restore from.</param>
[WebMethod, SoapHeader("settings")]
public void Enterprise_RestoreSiteCollection(SharePointSiteCollection siteCollection, string filename)
{
siteCollection.OwnerLogin = AttachNetbiosDomainName(siteCollection.OwnerLogin);
ExecuteAction<object>(delegate
{
HostedSharePointServerEntProvider.Enterprise_RestoreSiteCollection(siteCollection, filename);
return new object();
}, "RestoreSiteCollection");
}
/// <summary>
/// Gets binary data chunk of specified size from specified offset.
/// </summary>
/// <param name="path">Path to file to get bunary data chunk from.</param>
/// <param name="offset">Offset from which to start data reading.</param>
/// <param name="length">Binary data chunk length.</param>
/// <returns>Binary data chunk read from file.</returns>
[WebMethod, SoapHeader("settings")]
public byte[] Enterprise_GetTempFileBinaryChunk(string path, int offset, int length)
{
return ExecuteAction<byte[]>(delegate
{
return
HostedSharePointServerEntProvider.Enterprise_GetTempFileBinaryChunk(path, offset, length);
}, "GetTempFileBinaryChunk");
}
/// <summary>
/// Appends supplied binary data chunk to file.
/// </summary>
/// <param name="fileName">Non existent file name to append to.</param>
/// <param name="path">Full path to existent file to append to.</param>
/// <param name="chunk">Binary data chunk to append to.</param>
/// <returns>Path to file that was appended with chunk.</returns>
[WebMethod, SoapHeader("settings")]
public virtual string Enterprise_AppendTempFileBinaryChunk(string fileName, string path, byte[] chunk)
{
return ExecuteAction<string>(delegate
{
return
HostedSharePointServerEntProvider.Enterprise_AppendTempFileBinaryChunk(fileName, path, chunk);
}, "AppendTempFileBinaryChunk");
}
[WebMethod, SoapHeader("settings")]
public long Enterprise_GetSiteCollectionSize(string url)
{
return ExecuteAction<long>(delegate
{
return
HostedSharePointServerEntProvider.Enterprise_GetSiteCollectionSize(url);
}, "GetSiteCollectionSize");
}
[WebMethod, SoapHeader("settings")]
public void Enterprise_SetPeoplePickerOu(string site, string ou)
{
HostedSharePointServerEntProvider.Enterprise_SetPeoplePickerOu(site, ou);
}
/// <summary>
/// Executes supplied action and performs logging.
/// </summary>
/// <typeparam name="TReturn">Type of action's return value.</typeparam>
/// <param name="action">Action to be executed.</param>
/// <param name="actionName">Action name for logging purposes.</param>
/// <returns>Action execution result.</returns>
private TReturn ExecuteAction<TReturn>(Action<TReturn> 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;
}
}
/// <summary>
/// Returns fully qualified netbios account name.
/// </summary>
/// <param name="accountName">Account name.</param>
/// <returns>Fully qualified netbios account name.</returns>
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));
}
}
}

View file

@ -157,6 +157,8 @@
<Content Include="bin\Microsoft.Web.Management.dll" />
<Content Include="bin\Microsoft.Web.PlatformInstaller.dll" />
<Content Include="bin\Microsoft.Web.Services3.dll" />
<Content Include="bin\Sharepoint2013Ent\WebsitePanel.Providers.HostedSolution.SharePoint2013Ent.dll" />
<Content Include="bin\Sharepoint2013Ent\WebsitePanel.Providers.HostedSolution.SharePoint2013Ent.pdb" />
<Content Include="bin\Sharepoint2013\WebsitePanel.Providers.HostedSolution.SharePoint2013.dll" />
<Content Include="bin\Sharepoint2013\WebsitePanel.Providers.HostedSolution.SharePoint2013.pdb" />
<Content Include="bin\WebsitePanel.Providers.Base.dll" />
@ -270,6 +272,7 @@
<Content Include="BlackBerry.asmx" />
<EmbeddedResource Include="Images\logo.png" />
<Content Include="EnterpriseStorage.asmx" />
<Content Include="HostedSharePointServerEnt.asmx" />
<Content Include="RemoteDesktopServices.asmx" />
<Content Include="HeliconZoo.asmx" />
<Content Include="LyncServer.asmx" />
@ -319,6 +322,10 @@
<DependentUpon>EnterpriseStorage.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="HostedSharePointServerEnt.asmx.cs">
<DependentUpon>HostedSharePointServerEnt.asmx</DependentUpon>
<SubType>Component</SubType>
</Compile>
<Compile Include="RemoteDesktopServices.asmx.cs">
<DependentUpon>RemoteDesktopServices.asmx</DependentUpon>
<SubType>Component</SubType>

View file

@ -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