UI Fixes Sharepoint 2013

This commit is contained in:
robvde 2015-04-06 03:03:30 +08:00
parent f49224028c
commit f075f54084
11 changed files with 265 additions and 8 deletions

View file

@ -116,6 +116,21 @@ namespace WebsitePanel.EnterpriseServer.Code.HostedSolution
}
}
if (report.SharePointEnterpriseReport != null)
{
List<SharePointEnterpriseStatistics> 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> 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<SharePointSiteCollection> 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)
{

View file

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

View file

@ -60,6 +60,19 @@
set;
}
public int TotalSharePointEnterpriseSiteCollections
{
get;
set;
}
public long TotalSharePointEnterpriseSiteCollectionsSize
{
get;
set;
}
public int TotalCRMUsers
{
get;

View file

@ -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<SharePointEnterpriseStatistics>
{
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)");
}
}
}

View file

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

View file

@ -122,6 +122,8 @@
<Compile Include="HostedSolution\OrganizationSecurityGroup.cs" />
<Compile Include="HostedSolution\OrganizationDeletedUser.cs" />
<Compile Include="HostedSolution\OrganizationDeletedUsersPaged.cs" />
<Compile Include="HostedSolution\SharePointEnterpriseStatisticsReport.cs" />
<Compile Include="HostedSolution\SharePointStatisticsEnterprise.cs" />
<Compile Include="HostedSolution\TransactionAction.cs" />
<Compile Include="OS\MappedDrivesPaged.cs" />
<Compile Include="OS\MappedDrive.cs" />

View file

@ -196,7 +196,7 @@
<value>OCS</value>
</data>
<data name="locSharePoint.Text" xml:space="preserve">
<value>SharePoint</value>
<value>SharePoint Foundation</value>
</data>
<data name="locTitle.Text" xml:space="preserve">
<value>Home</value>
@ -237,4 +237,7 @@
<data name="lnkRdsUsers.Text" xml:space="preserve">
<value>RDS Users</value>
</data>
<data name="locSharePointEnterprise.Text" xml:space="preserve">
<value>SharePoint Enterprise</value>
</data>
</root>

View file

@ -218,6 +218,25 @@
</tr>
</asp:Panel>
<asp:Panel runat="server" ID="sharePointEnterpriseStatsPanel">
<tr class="OrgStatsRow">
<td class="OrgStatsGroup" width="100%" colspan="2">
<asp:Localize ID="locSharePointEnterprise" runat="server" meta:resourcekey="locSharePointEnterprise"
Text="Organization Statistics"></asp:Localize>
</td>
</tr>
<tr class="OrgStatsRow">
<td class="OrgStatsQuota" nowrap>
<asp:HyperLink ID="lnkEnterpriseSiteCollections" runat="server" meta:resourcekey="lnkSiteCollections"></asp:HyperLink>
</td>
<td>
<wsp:QuotaViewer ID="enterpriseSiteCollectionsStats" QuotaTypeId="2" runat="server" DisplayGauge="true" />
</td>
</tr>
</asp:Panel>
<asp:Panel runat="server" ID="ocsStatsPanel">
<tr>
<td class="OrgStatsGroup" width="100%" colspan="2">

View file

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

View file

@ -525,6 +525,42 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer siteCollectionsStats;
/// <summary>
/// sharePointEnterpriseStatsPanel control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Panel sharePointEnterpriseStatsPanel;
/// <summary>
/// locSharePointEnterprise control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.Localize locSharePointEnterprise;
/// <summary>
/// lnkEnterpriseSiteCollections control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::System.Web.UI.WebControls.HyperLink lnkEnterpriseSiteCollections;
/// <summary>
/// enterpriseSiteCollectionsStats control.
/// </summary>
/// <remarks>
/// Auto-generated field.
/// To modify move field declaration from designer file to code-behind file.
/// </remarks>
protected global::WebsitePanel.Portal.QuotaViewer enterpriseSiteCollectionsStats;
/// <summary>
/// ocsStatsPanel control.
/// </summary>

View file

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