Exchange archiving part 2

This commit is contained in:
dev_amdtel 2014-04-02 14:44:15 +04:00
parent d625af5f7b
commit 4f500a356a
18 changed files with 122 additions and 61 deletions

View file

@ -2785,7 +2785,7 @@ namespace WebsitePanel.EnterpriseServer
bool isDefault, int issueWarningPct, int keepDeletedItemsDays, int mailboxSizeMB, int maxReceiveMessageSizeKB, int maxRecipients,
int maxSendMessageSizeKB, int prohibitSendPct, int prohibitSendReceivePct, bool hideFromAddressBook, int mailboxPlanType,
bool enabledLitigationHold, long recoverabelItemsSpace, long recoverabelItemsWarning, string litigationHoldUrl, string litigationHoldMsg,
bool archiving)
bool archiving, bool EnableArchiving)
{
SqlParameter outParam = new SqlParameter("@MailboxPlanId", SqlDbType.Int);
outParam.Direction = ParameterDirection.Output;
@ -2818,7 +2818,8 @@ namespace WebsitePanel.EnterpriseServer
new SqlParameter("@RecoverableItemsSpace", recoverabelItemsSpace),
new SqlParameter("@LitigationHoldUrl", litigationHoldUrl),
new SqlParameter("@LitigationHoldMsg", litigationHoldMsg),
new SqlParameter("@Archiving", archiving)
new SqlParameter("@Archiving", archiving),
new SqlParameter("@EnableArchiving", EnableArchiving)
);
return Convert.ToInt32(outParam.Value);

View file

@ -2881,7 +2881,7 @@ namespace WebsitePanel.EnterpriseServer
mailboxPlan.IsDefault, mailboxPlan.IssueWarningPct, mailboxPlan.KeepDeletedItemsDays, mailboxPlan.MailboxSizeMB, mailboxPlan.MaxReceiveMessageSizeKB, mailboxPlan.MaxRecipients,
mailboxPlan.MaxSendMessageSizeKB, mailboxPlan.ProhibitSendPct, mailboxPlan.ProhibitSendReceivePct, mailboxPlan.HideFromAddressBook, mailboxPlan.MailboxPlanType,
mailboxPlan.AllowLitigationHold, mailboxPlan.RecoverableItemsSpace, mailboxPlan.RecoverableItemsWarningPct,
mailboxPlan.LitigationHoldUrl, mailboxPlan.LitigationHoldMsg, mailboxPlan.Archiving);
mailboxPlan.LitigationHoldUrl, mailboxPlan.LitigationHoldMsg, mailboxPlan.Archiving, mailboxPlan.EnableArchiving);
}
catch (Exception ex)
{

View file

@ -216,5 +216,12 @@ namespace WebsitePanel.Providers.HostedSolution
get { return this.archiving; }
set { this.archiving = value; }
}
bool enableArchiving;
public bool EnableArchiving
{
get { return this.enableArchiving; }
set { this.enableArchiving = value; }
}
}
}

View file

@ -513,7 +513,7 @@
<Control key="storage_limits" src="WebsitePanel/ExchangeServer/ExchangeStorageLimits.ascx" title="ExchangeStorageLimits" type="View" />
<Control key="activesync_policy" src="WebsitePanel/ExchangeServer/ExchangeActiveSyncSettings.ascx" title="ExchangeActiveSyncSettings" type="View" />
<Control key="mailboxplans" src="WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx" title="ExchangeMailboxPlans" type="View" />
<Control key="archivingmailboxplans" src="WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx" title="ExchangeArchivingMailboxPlans" type="View" />
<Control key="retentionpolicy" src="WebsitePanel/ExchangeServer/ExchangeMailboxPlans.ascx" title="ExchangeRetentionPolicy" type="View" />
<Control key="add_mailboxplan" src="WebsitePanel/ExchangeServer/ExchangeAddMailboxPlan.ascx" title="ExchangeAddMailboxPlan" type="View" />
<Control key="CRMOrganizationDetails" src="WebsitePanel/CRM/CRMOrganizationDetails.ascx" title="ExchangeActiveSyncSettings" type="View" />

View file

@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnAddMailboxPlan.Text" xml:space="preserve">
<value>Add New Mailbox plan</value>
<value>Add New</value>
</data>
<data name="btnSetDefaultMailboxPlan.Text" xml:space="preserve">
<value>Set Default Mailbox plan</value>
@ -226,7 +226,7 @@
<value>Restamp mailboxes</value>
</data>
<data name="btnUpdateMailboxPlan.Text" xml:space="preserve">
<value>Update Mailbox Plan</value>
<value>Update</value>
</data>
<data name="chkEnableLitigationHold.Text" xml:space="preserve">
<value>Enable Litigation Hold</value>

View file

@ -118,7 +118,7 @@
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<data name="btnAddMailboxPlan.Text" xml:space="preserve">
<value>Add New Mailbox plan</value>
<value>Add New</value>
</data>
<data name="btnSave.Text" xml:space="preserve">
<value>Stamp mailboxes</value>
@ -162,7 +162,7 @@
<data name="Text.PageName" xml:space="preserve">
<value>Mailbox plans</value>
</data>
<data name="locTitleArchiving.Text" xml:space="preserve">
<value>Archiving Mailbox plans</value>
<data name="locTitleRetentionPolicy.Text" xml:space="preserve">
<value>Retention Policy</value>
</data>
</root>

View file

@ -78,6 +78,11 @@
<asp:CheckBox ID="chkActiveSync" runat="server" meta:resourcekey="chkActiveSync" Text="ActiveSync"></asp:CheckBox>
</td>
</tr>
<tr>
<td>
<asp:CheckBox ID="chkEnableArchiving" runat="server" meta:resourcekey="chkEnableArchiving" Text="Archiving"></asp:CheckBox>
</td>
</tr>
</table>
<br />
</asp:Panel>

View file

@ -35,7 +35,7 @@ namespace WebsitePanel.Portal.ExchangeServer
{
public partial class ExchangeAddMailboxPlan : WebsitePanelModuleBase
{
private bool ArchivingPlan
private bool RetentionPolicy
{
get
{
@ -80,7 +80,9 @@ namespace WebsitePanel.Portal.ExchangeServer
txtLitigationHoldMsg.Text = plan.LitigationHoldMsg;
txtLitigationHoldUrl.Text = plan.LitigationHoldUrl;
ArchivingPlan = plan.Archiving;
RetentionPolicy = plan.Archiving;
chkEnableArchiving.Checked = plan.EnableArchiving;
locTitle.Text = plan.MailboxPlan;
this.DisableControls = true;
@ -151,17 +153,17 @@ namespace WebsitePanel.Portal.ExchangeServer
sizeProhibitSendReceive.ValueKB = 100;
recoverableItemsWarning.ValueKB = 95;
ArchivingPlan = PanelRequest.GetBool("archiving", false);
RetentionPolicy = PanelRequest.GetBool("archiving", false);
}
}
else
this.DisableControls = true;
}
locTitle.Text = ArchivingPlan ? GetLocalizedString("locTitleArchiving.Text") : GetLocalizedString("locTitle.Text");
locTitle.Text = RetentionPolicy ? GetLocalizedString("locTitleArchiving.Text") : GetLocalizedString("locTitle.Text");
secMailboxFeatures.Visible = !ArchivingPlan;
secMailboxGeneral.Visible = !ArchivingPlan;
secMailboxFeatures.Visible = !RetentionPolicy;
secMailboxGeneral.Visible = !RetentionPolicy;
}
@ -205,7 +207,9 @@ namespace WebsitePanel.Portal.ExchangeServer
plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim();
plan.LitigationHoldUrl = txtLitigationHoldUrl.Text.Trim();
plan.Archiving = ArchivingPlan;
plan.Archiving = RetentionPolicy;
plan.EnableArchiving = chkEnableArchiving.Checked;
int result = ES.Services.ExchangeServer.AddExchangeMailboxPlan(PanelRequest.ItemID,
plan);
@ -217,7 +221,7 @@ namespace WebsitePanel.Portal.ExchangeServer
return;
}
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), ArchivingPlan ? "archivingmailboxplans" : "mailboxplans",
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), RetentionPolicy ? "retentionpolicy" : "mailboxplans",
"SpaceID=" + PanelSecurity.PackageId));
}
catch (Exception ex)

View file

@ -174,6 +174,15 @@ namespace WebsitePanel.Portal.ExchangeServer {
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkActiveSync;
/// <summary>
/// chkEnableArchiving 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.CheckBox chkEnableArchiving;
/// <summary>
/// secMailboxGeneral control.
/// </summary>

View file

@ -28,7 +28,7 @@
<div class="FormButtonsBarClean">
<asp:Button ID="btnAddMailboxPlan" runat="server" meta:resourcekey="btnAddMailboxPlan"
Text="Add New Mailboxplan" CssClass="Button1" OnClick="btnAddMailboxPlan_Click" />
Text="Add New" CssClass="Button1" OnClick="btnAddMailboxPlan_Click" />
</div>
<asp:GridView ID="gvMailboxPlans" runat="server" AutoGenerateColumns="False" EnableViewState="true"

View file

@ -35,18 +35,18 @@ namespace WebsitePanel.Portal.ExchangeServer
{
public partial class ExchangeMailboxPlans : WebsitePanelModuleBase
{
private bool ArchivingPlans
private bool RetentionPolicy
{
get
{
return PanelRequest.Ctl.ToLower().Contains("archiving");
return PanelRequest.Ctl.ToLower().Contains("retentionpolicy");
}
}
protected void Page_Load(object sender, EventArgs e)
{
locTitle.Text = ArchivingPlans ? GetLocalizedString("locTitleArchiving.Text") : GetLocalizedString("locTitle.Text");
locTitle.Text = RetentionPolicy ? GetLocalizedString("locTitleRetentionPolicy.Text") : GetLocalizedString("locTitle.Text");
if (!IsPostBack)
{
@ -82,7 +82,7 @@ namespace WebsitePanel.Portal.ExchangeServer
private void BindMailboxPlans()
{
ExchangeMailboxPlan[] list = ES.Services.ExchangeServer.GetExchangeMailboxPlans(PanelRequest.ItemID, ArchivingPlans);
ExchangeMailboxPlan[] list = ES.Services.ExchangeServer.GetExchangeMailboxPlans(PanelRequest.ItemID, RetentionPolicy);
gvMailboxPlans.DataSource = list;
gvMailboxPlans.DataBind();
@ -105,7 +105,7 @@ namespace WebsitePanel.Portal.ExchangeServer
{
btnSetDefaultMailboxPlan.Enabled = true;
Response.Redirect(EditUrl("ItemID", PanelRequest.ItemID.ToString(), "add_mailboxplan",
"SpaceID=" + PanelSecurity.PackageId, "archiving="+ArchivingPlans));
"SpaceID=" + PanelSecurity.PackageId, "archiving="+RetentionPolicy));
}
protected void gvMailboxPlan_RowCommand(object sender, GridViewCommandEventArgs e)

View file

@ -219,7 +219,7 @@
<data name="Text.ArchivingMailboxes" xml:space="preserve">
<value>Archiving Mailboxes</value>
</data>
<data name="Text.ArchivingMailboxPlans" xml:space="preserve">
<value>Archiving Mailbox Plans</value>
<data name="Text.RetentionPolicy" xml:space="preserve">
<value>Retention Policy</value>
</data>
</root>

View file

@ -142,7 +142,7 @@ namespace WebsitePanel.Portal.ExchangeServer.UserControls
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2013_ALLOWARCHIVING, cntx))
exchangeGroup.MenuItems.Add(CreateMenuItem("ArchivingMailboxPlans", "archivingmailboxplans"));
exchangeGroup.MenuItems.Add(CreateMenuItem("RetentionPolicy", "retentionpolicy"));
if (!hideItems)
if (Utils.CheckQouta(Quotas.EXCHANGE2007_MAILBOXES, cntx))

View file

@ -103,6 +103,11 @@
<asp:CheckBox ID="chkActiveSync" runat="server" meta:resourcekey="chkActiveSync" Text="ActiveSync"></asp:CheckBox>
</td>
</tr>
<tr>
<td>
<asp:CheckBox ID="chkEnableArchiving" runat="server" meta:resourcekey="chkEnableArchiving" Text="Archiving"></asp:CheckBox>
</td>
</tr>
</table>
<br />
</asp:Panel>
@ -261,13 +266,13 @@
<td>
<div class="FormButtonsBarClean">
<asp:Button ID="btnAddMailboxPlan" runat="server" meta:resourcekey="btnAddMailboxPlan"
Text="Add New Mailboxplan" CssClass="Button1" OnClick="btnAddMailboxPlan_Click" />
Text="Add New" CssClass="Button1" OnClick="btnAddMailboxPlan_Click" />
</div>
</td>
<td>
<div class="FormButtonsBarClean">
<asp:Button ID="btnUpdateMailboxPlan" runat="server" meta:resourcekey="btnUpdateMailboxPlan"
Text="Update Mailboxplan" CssClass="Button1" OnClick="btnUpdateMailboxPlan_Click" />
Text="Update" CssClass="Button1" OnClick="btnUpdateMailboxPlan_Click" />
</td>
</tr>
</table>

View file

@ -53,11 +53,27 @@ namespace WebsitePanel.Portal
public partial class SettingsExchangeMailboxPlansPolicy : WebsitePanelControlBase, IUserSettingsEditorControl
{
private bool RetentionPolicy
{
get
{
return Request["SettingsName"].ToLower().Contains("retentionpolicy");
}
}
public void BindSettings(UserSettings settings)
{
BindMailboxPlans();
txtStatus.Visible = false;
secMailboxFeatures.Visible = !RetentionPolicy;
secMailboxGeneral.Visible = !RetentionPolicy;
gvMailboxPlans.Columns[2].Visible = !RetentionPolicy;
gvMailboxPlans.Columns[3].Visible = !RetentionPolicy;
}
@ -81,7 +97,7 @@ namespace WebsitePanel.Portal
if ((orgs != null) & (orgs.GetLength(0) > 0))
{
ExchangeMailboxPlan[] list = ES.Services.ExchangeServer.GetExchangeMailboxPlans(orgs[0].Id, false);
ExchangeMailboxPlan[] list = ES.Services.ExchangeServer.GetExchangeMailboxPlans(orgs[0].Id, RetentionPolicy);
gvMailboxPlans.DataSource = list;
gvMailboxPlans.DataBind();
@ -127,6 +143,9 @@ namespace WebsitePanel.Portal
plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim();
plan.LitigationHoldUrl = txtLitigationHoldUrl.Text.Trim();
plan.EnableArchiving = chkEnableArchiving.Checked;
plan.Archiving = RetentionPolicy;
if (PanelSecurity.SelectedUser.Role == UserRole.Administrator)
plan.MailboxPlanType = (int)ExchangeMailboxPlanType.Administrator;
@ -231,7 +250,7 @@ namespace WebsitePanel.Portal
txtLitigationHoldMsg.Text = string.Empty;
txtLitigationHoldUrl.Text = string.Empty;
chkEnableArchiving.Checked = false;
btnUpdateMailboxPlan.Enabled = (string.IsNullOrEmpty(txtMailboxPlan.Text)) ? false : true;
@ -286,6 +305,8 @@ namespace WebsitePanel.Portal
txtLitigationHoldMsg.Text = plan.LitigationHoldMsg;
txtLitigationHoldUrl.Text = plan.LitigationHoldUrl;
chkEnableArchiving.Checked = plan.EnableArchiving;
btnUpdateMailboxPlan.Enabled = (string.IsNullOrEmpty(txtMailboxPlan.Text)) ? false : true;
break;
@ -394,6 +415,9 @@ namespace WebsitePanel.Portal
plan.LitigationHoldMsg = txtLitigationHoldMsg.Text.Trim();
plan.LitigationHoldUrl = txtLitigationHoldUrl.Text.Trim();
plan.EnableArchiving = chkEnableArchiving.Checked;
plan.Archiving = RetentionPolicy;
if (PanelSecurity.SelectedUser.Role == UserRole.Administrator)
plan.MailboxPlanType = (int)ExchangeMailboxPlanType.Administrator;

View file

@ -138,6 +138,15 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.CheckBox chkActiveSync;
/// <summary>
/// chkEnableArchiving 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.CheckBox chkEnableArchiving;
/// <summary>
/// secMailboxGeneral control.
/// </summary>

View file

@ -13,6 +13,14 @@
<asp:HyperLink ID="lnkExchangeMailboxPlansPolicy" runat="server" meta:resourcekey="lnkExchangeMailboxPlansPolicy"
Text="Global Exchange Mailbox Plans" NavigateUrl='<%# GetSettingsLink("ExchangeMailboxPlansPolicy", "SettingsExchangeMailboxPlansPolicy") %>'></asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="lnkExchangeRetentionPolicy" runat="server" meta:resourcekey="lnkExchangeRetentionPolicy"
Text="Global Retention Policy" NavigateUrl='<%# GetSettingsLink("RetentionPolicy", "SettingsExchangeMailboxPlansPolicy") %>'></asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="lnkExchangeRetentionPolicyTag" runat="server" meta:resourcekey="lnkExchangeRetentionPolicyTag"
Text="Global Retention Policy Tag" NavigateUrl='<%# GetSettingsLink("RetentionPolicyTag", "SettingsExchangeMailboxPlansPolicy") %>'></asp:HyperLink>
</li>
<li>
<asp:HyperLink ID="lnkLyncUserPlansPolicy" runat="server" meta:resourcekey="lnkLyncUserPlansPolicy"

View file

@ -1,32 +1,3 @@
// Copyright (c) 2012, 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.
@ -68,6 +39,24 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.HyperLink lnkExchangeMailboxPlansPolicy;
/// <summary>
/// lnkExchangeRetentionPolicy 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 lnkExchangeRetentionPolicy;
/// <summary>
/// lnkExchangeRetentionPolicyTag 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 lnkExchangeRetentionPolicyTag;
/// <summary>
/// lnkLyncUserPlansPolicy control.
/// </summary>