diff --git a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/ReportController.cs b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/ReportController.cs index b6c63d98..166cc63a 100644 --- a/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/ReportController.cs +++ b/WebsitePanel/Sources/WebsitePanel.EnterpriseServer.Code/HostedSolution/ReportController.cs @@ -116,6 +116,21 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } } + if (report.SharePointEnterpriseReport != null) + { + List sharePoints = + report.SharePointEnterpriseReport.Items.FindAll( + delegate(SharePointEnterpriseStatistics stats) { return stats.OrganizationID == org.OrganizationId; }); + + item.TotalSharePointEnterpriseSiteCollections = sharePoints.Count; + foreach (SharePointEnterpriseStatistics current in sharePoints) + { + item.TotalSharePointEnterpriseSiteCollectionsSize += current.SiteCollectionSize; + } + } + + + if (report.CRMReport != null) { List crmOrganizationStatistics = @@ -336,6 +351,21 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } } + if (report.SharePointEnterpriseReport != null) + { + try + { + TaskManager.Write("Populate SharePoint Enterprise item "); + + PopulateSharePointEnterpriseItem(org, report, topReseller); + } + catch (Exception ex) + { + TaskManager.WriteError(ex); + } + } + + if (report.LyncReport != null) { try @@ -432,7 +462,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution } - private static void PopulateSharePointEntItem(Organization org, EnterpriseSolutionStatisticsReport report, string topReseller) + private static void PopulateSharePointEnterpriseItem(Organization org, EnterpriseSolutionStatisticsReport report, string topReseller) { List siteCollections; @@ -465,7 +495,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution { try { - SharePointStatistics stats = new SharePointStatistics(); + SharePointEnterpriseStatistics stats = new SharePointEnterpriseStatistics(); PopulateBaseItem(stats, org, topReseller); stats.SiteCollectionUrl = siteCollection.PhysicalAddress; @@ -476,7 +506,7 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution stats.SiteCollectionSize = srvEnt.Enterprise_GetSiteCollectionSize(siteCollection.PhysicalAddress); - report.SharePointReport.Items.Add(stats); + report.SharePointEnterpriseReport.Items.Add(stats); } catch (Exception ex) { diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/EnterpriseSolutionStatisticsReport.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/EnterpriseSolutionStatisticsReport.cs index 77cccdae..d586e1a5 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/EnterpriseSolutionStatisticsReport.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/EnterpriseSolutionStatisticsReport.cs @@ -32,6 +32,7 @@ { public ExchangeStatisticsReport ExchangeReport { get; set; } public SharePointStatisticsReport SharePointReport { get; set; } + public SharePointEnterpriseStatisticsReport SharePointEnterpriseReport { get; set; } public CRMStatisticsReport CRMReport { get; set; } public OrganizationStatisticsReport OrganizationReport { get; set; } public LyncStatisticsReport LyncReport { get; set; } diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsRepotItem.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsRepotItem.cs index 336a4afc..34d1a3e8 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsRepotItem.cs +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/OrganizationStatisticsRepotItem.cs @@ -60,6 +60,19 @@ set; } + public int TotalSharePointEnterpriseSiteCollections + { + get; + set; + } + + public long TotalSharePointEnterpriseSiteCollectionsSize + { + get; + set; + } + + public int TotalCRMUsers { get; diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/SharePointEnterpriseStatisticsReport.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/SharePointEnterpriseStatisticsReport.cs new file mode 100644 index 00000000..d2be9b9f --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/SharePointEnterpriseStatisticsReport.cs @@ -0,0 +1,71 @@ +// 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.Text; + +namespace WebsitePanel.Providers.HostedSolution +{ + public class SharePointEnterpriseStatisticsReport : BaseReport + { + public override string ToCSV() + { + StringBuilder mainBuilder = new StringBuilder(); + + AddCSVHeader(mainBuilder); + foreach (SharePointEnterpriseStatistics item in Items) + { + StringBuilder sb = new StringBuilder(); + sb.Append("\n"); + sb.AppendFormat("{0},", ToCsvString(item.TopResellerName)); + sb.AppendFormat("{0},", ToCsvString(item.ResellerName)); + sb.AppendFormat("{0},", ToCsvString(item.CustomerName)); + sb.AppendFormat("{0},", ToCsvString(item.CustomerCreated)); + sb.AppendFormat("{0},", ToCsvString(item.HostingSpace)); + sb.AppendFormat("{0},", ToCsvString(item.HostingSpaceCreated)); + sb.AppendFormat("{0},", ToCsvString(item.OrganizationName)); + sb.AppendFormat("{0},", ToCsvString(item.OrganizationCreated)); + sb.AppendFormat("{0},", ToCsvString(item.OrganizationID)); + + sb.AppendFormat("{0},", ToCsvString(item.SiteCollectionUrl)); + sb.AppendFormat("{0},", ToCsvString(item.SiteCollectionOwner)); + sb.AppendFormat("{0},", ToCsvString(item.SiteCollectionCreated)); + sb.AppendFormat("{0},", item.SiteCollectionQuota != 0 && item.SiteCollectionQuota != -1 ? ToCsvString(item.SiteCollectionQuota): "Unlimited"); + sb.AppendFormat("{0}", ToCsvString(item.SiteCollectionSize / 1024.0 / 1024.0)); + mainBuilder.Append(sb.ToString()); + + } + return mainBuilder.ToString(); + + } + + private static void AddCSVHeader(StringBuilder sb) + { + sb.Append("Top Reseller,Reseller,Customer,Customer Created,Hosting Space,Hosting Space Created,Ogranization Name,Ogranization Created,Organization ID,Site Collection URL,Site collection owner,Site collection created,Site collection quota(Mb),Site collection size(Mb)"); + } + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/SharePointStatisticsEnterprise.cs b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/SharePointStatisticsEnterprise.cs new file mode 100644 index 00000000..a1870725 --- /dev/null +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/HostedSolution/SharePointStatisticsEnterprise.cs @@ -0,0 +1,67 @@ +// 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.HostedSolution +{ + public class SharePointEnterpriseStatistics : BaseStatistics + { + public string SiteCollectionUrl + { + get; + set; + } + + public string SiteCollectionOwner + { + get; + set; + } + + public DateTime SiteCollectionCreated + { + get; + set; + } + + public long SiteCollectionQuota + { + get; + set; + } + + public long SiteCollectionSize + { + get; + set; + } + + + } +} diff --git a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj index 2dec0c17..90bec626 100644 --- a/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj +++ b/WebsitePanel/Sources/WebsitePanel.Providers.Base/WebsitePanel.Providers.Base.csproj @@ -122,6 +122,8 @@ + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx index 7b71c51e..bdad4791 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/App_LocalResources/OrganizationHome.ascx.resx @@ -196,7 +196,7 @@ OCS - SharePoint + SharePoint Foundation Home @@ -237,4 +237,7 @@ RDS Users + + SharePoint Enterprise + \ No newline at end of file diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx index 532fc488..cef4f5b3 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx @@ -218,6 +218,25 @@ + + + + + + + + + + + + + + + + + + diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs index 7a483c39..d582425b 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.cs @@ -249,6 +249,21 @@ namespace WebsitePanel.Portal.ExchangeServer else sharePointStatsPanel.Visible = false; + //Show SharePoint statistics + if (cntx.Groups.ContainsKey(ResourceGroups.SharepointEnterpriseServer)) + { + sharePointEnterpriseStatsPanel.Visible = true; + + lnkSiteCollections.NavigateUrl = EditUrl("ItemID", PanelRequest.ItemID.ToString(), "sharepoint_enterprise_sitecollections", + "SpaceID=" + PanelSecurity.PackageId); + enterpriseSiteCollectionsStats.QuotaUsedValue = orgStats.CreatedSharePointEnterpriseSiteCollections; + enterpriseSiteCollectionsStats.QuotaValue = orgStats.AllocatedSharePointEnterpriseSiteCollections; + if (orgStats.AllocatedSharePointEnterpriseSiteCollections != -1) enterpriseSiteCollectionsStats.QuotaAvailable = tenantStats.AllocatedSharePointEnterpriseSiteCollections - tenantStats.CreatedSharePointEnterpriseSiteCollections; + } + else + sharePointEnterpriseStatsPanel.Visible = false; + + if (cntx.Groups.ContainsKey(ResourceGroups.OCS)) { ocsStatsPanel.Visible = true; diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs index 26a5655d..4f73dfe2 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/ExchangeServer/OrganizationHome.ascx.designer.cs @@ -525,6 +525,42 @@ namespace WebsitePanel.Portal.ExchangeServer { /// protected global::WebsitePanel.Portal.QuotaViewer siteCollectionsStats; + /// + /// sharePointEnterpriseStatsPanel control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Panel sharePointEnterpriseStatsPanel; + + /// + /// locSharePointEnterprise control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.Localize locSharePointEnterprise; + + /// + /// lnkEnterpriseSiteCollections control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::System.Web.UI.WebControls.HyperLink lnkEnterpriseSiteCollections; + + /// + /// enterpriseSiteCollectionsStats control. + /// + /// + /// Auto-generated field. + /// To modify move field declaration from designer file to code-behind file. + /// + protected global::WebsitePanel.Portal.QuotaViewer enterpriseSiteCollectionsStats; + /// /// ocsStatsPanel control. /// diff --git a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseSiteCollections.ascx.cs b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseSiteCollections.ascx.cs index ed9e1457..1e8428bc 100644 --- a/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseSiteCollections.ascx.cs +++ b/WebsitePanel/Sources/WebsitePanel.WebPortal/DesktopModules/WebsitePanel/HostedSharePointEnterpriseSiteCollections.ascx.cs @@ -56,9 +56,9 @@ namespace WebsitePanel.Portal OrganizationStatistics stats = ES.Services.Organizations.GetOrganizationStatisticsByOrganization(PanelRequest.ItemID); OrganizationStatistics tenantStats = ES.Services.Organizations.GetOrganizationStatistics(PanelRequest.ItemID); - siteCollectionsQuota.QuotaUsedValue = stats.CreatedSharePointSiteCollections; - siteCollectionsQuota.QuotaValue = stats.AllocatedSharePointSiteCollections; - if (stats.AllocatedSharePointSiteCollections != -1) siteCollectionsQuota.QuotaAvailable = tenantStats.AllocatedSharePointSiteCollections - tenantStats.CreatedSharePointSiteCollections; + siteCollectionsQuota.QuotaUsedValue = stats.CreatedSharePointEnterpriseSiteCollections; + siteCollectionsQuota.QuotaValue = stats.AllocatedSharePointEnterpriseSiteCollections; + if (stats.AllocatedSharePointSiteCollections != -1) siteCollectionsQuota.QuotaAvailable = tenantStats.AllocatedSharePointEnterpriseSiteCollections - tenantStats.CreatedSharePointEnterpriseSiteCollections; } protected void btnCreateSiteCollection_Click(object sender, EventArgs e) @@ -90,7 +90,7 @@ namespace WebsitePanel.Portal try { - int result = ES.Services.HostedSharePointServers.DeleteSiteCollection(siteCollectionId); + int result = ES.Services.HostedSharePointServersEnt.Enterprise_DeleteSiteCollection(siteCollectionId); if (result < 0) { messageBox.ShowResultMessage(result);