Ability to change main WPI (Microsoft) feed url in System Settings.

This commit is contained in:
ruslanht 2013-01-30 17:33:37 +02:00
parent 815519b650
commit 54c8438ece
14 changed files with 122 additions and 1041 deletions

View file

@ -147,4 +147,10 @@
<data name="locEnableSsl.Text" xml:space="preserve">
<value>Enable SSL:</value>
</data>
<data name="lclWpiMainFeedUrl.Text" xml:space="preserve">
<value>Main feed URL:</value>
</data>
<data name="lclWpiCustomFeeds.Text" xml:space="preserve">
<value>Custom feeds:</value>
</data>
</root>

View file

@ -35,34 +35,28 @@
<asp:Panel ID="BackupPanel" runat="server" Height="0" style="overflow:hidden;">
<table>
<tr>
<td class="SubHead" style="width:200px;"><asp:Localize ID="Localize1" runat="server" meta:resourcekey="lclBackupFolderPath" /></td>
<td><asp:TextBox runat="server" ID="txtBackupsPath" Width="300px" /></td>
<td class="SubHead" style="width:200px;"><asp:Localize runat="server" meta:resourcekey="lclBackupFolderPath" /></td>
<td><asp:TextBox runat="server" ID="txtBackupsPath" Width="450px" /></td>
</tr>
</table>
</asp:Panel>
<wsp:CollapsiblePanel id="lclWpiSettings" runat="server"
TargetControlID="WpiPanel" meta:resourcekey="lclWpiSettings" Text="WebPlatformInstaller Settings"/>
<asp:Panel ID="WpiPanel" runat="server" Height="0" style="overflow:hidden;">
<asp:CheckBox ID="wpiMicrosoftFeed" runat="server" Text="Yes" Visible="false"/>
<asp:CheckBox ID="wpiHeliconTechFeed" runat="server" Text="Yes" Visible="false" />
<%-- <table>
TargetControlID="WpiPanel" meta:resourcekey="lclWpiSettings" Text="Web Platform Installer Settings"/>
<asp:Panel ID="WpiPanel" runat="server" Height="0" style="overflow:hidden;">
<table>
<tr>
<td class="SubHead" style="width:200px;">Enable Microsoft feed</td>
<td class="Normal">
<asp:CheckBox ID="wpiMicrosoftFeed" runat="server" Text="Yes" Visible="false"/>
</td>
<td class="SubHead" style="width:200px;"><asp:Localize runat="server" meta:resourcekey="lclWpiMainFeedUrl" Text="Main feed URL:" /></td>
<td><asp:TextBox runat="server" ID="txtMainFeedUrl" Width="450px" /></td>
</tr>
<tr>
<td class="SubHead" style="width:200px;">Enable HeliconTech feed</td>
<td class="Normal">
<asp:CheckBox ID="wpiHeliconTechFeed" runat="server" Text="Yes" Visible="false" />
<td class="SubHead" style="width:200px; vertical-align: top;"><asp:Localize runat="server" meta:resourcekey="lclWpiCustomFeeds" Text="Custom feeds:" /></td>
<td>
<uc1:EditFeedsList ID="wpiEditFeedsList" runat="server" DisplayNames="false" />
</td>
</tr>
</table>
--%>
<uc1:EditFeedsList ID="wpiEditFeedsList" runat="server" DisplayNames="false" />
</table>
</asp:Panel>
</div>
<div class="FormFooter">

View file

@ -36,7 +36,7 @@ using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using WebsitePanel.EnterpriseServer.Base.Common;
using WSP = WebsitePanel.EnterpriseServer;
namespace WebsitePanel.Portal
@ -48,12 +48,12 @@ namespace WebsitePanel.Portal
public const string SMTP_USERNAME = "SmtpUsername";
public const string SMTP_PASSWORD = "SmtpPassword";
public const string SMTP_ENABLE_SSL = "SmtpEnableSsl";
public const string BACKUPS_PATH = "BackupsPath";
public const string FEED_ULS = "FeedUrls";
/*
public const string FEED_ENABLE_MICROSOFT = "FeedEnableMicrosoft";
public const string FEED_ENABLE_HELICON = "FeedEnableHelicon";
*/
protected void Page_Load(object sender, EventArgs e)
{
@ -95,20 +95,31 @@ namespace WebsitePanel.Portal
// WPI
settings = ES.Services.System.GetSystemSettings(
WSP.SystemSettings.WPI_SETTINGS);
settings = ES.Services.System.GetSystemSettings(WSP.SystemSettings.WPI_SETTINGS);
/*
if (settings != null)
{
wpiMicrosoftFeed.Checked = Utils.ParseBool(settings[FEED_ENABLE_MICROSOFT],true);
wpiHeliconTechFeed.Checked = Utils.ParseBool(settings[FEED_ENABLE_HELICON],true);
wpiEditFeedsList.Value = settings[FEED_ULS];
}
else
{
wpiMicrosoftFeed.Checked = true;
wpiHeliconTechFeed.Checked = true;
}
*/
if (null != settings)
{
wpiEditFeedsList.Value = settings[WSP.SystemSettings.FEED_ULS_KEY];
string mainFeedUrl = settings[WSP.SystemSettings.WPI_MAIN_FEED_KEY];
if (string.IsNullOrEmpty(mainFeedUrl))
{
mainFeedUrl = WebPlatformInstaller.MAIN_FEED_URL;
}
txtMainFeedUrl.Text = mainFeedUrl;
}
@ -152,13 +163,21 @@ namespace WebsitePanel.Portal
// WPI
settings[FEED_ULS] = wpiEditFeedsList.Value;
/*
settings[FEED_ENABLE_MICROSOFT] = wpiMicrosoftFeed.Checked.ToString();
settings[FEED_ENABLE_HELICON] = wpiHeliconTechFeed.Checked.ToString();
*/
settings[WSP.SystemSettings.FEED_ULS_KEY] = wpiEditFeedsList.Value;
string mainFeedUrl = txtMainFeedUrl.Text;
if (string.IsNullOrEmpty(mainFeedUrl))
{
mainFeedUrl = WebPlatformInstaller.MAIN_FEED_URL;
}
settings[WSP.SystemSettings.WPI_MAIN_FEED_KEY] = mainFeedUrl;
result = ES.Services.System.SetSystemSettings(
WSP.SystemSettings.WPI_SETTINGS, settings);
result = ES.Services.System.SetSystemSettings(WSP.SystemSettings.WPI_SETTINGS, settings);
if (result < 0)
{

View file

@ -130,15 +130,6 @@ namespace WebsitePanel.Portal {
/// </remarks>
protected global::System.Web.UI.WebControls.Panel BackupPanel;
/// <summary>
/// Localize1 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 Localize1;
/// <summary>
/// txtBackupsPath control.
/// </summary>
@ -167,22 +158,13 @@ namespace WebsitePanel.Portal {
protected global::System.Web.UI.WebControls.Panel WpiPanel;
/// <summary>
/// wpiMicrosoftFeed control.
/// txtMainFeedUrl 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 wpiMicrosoftFeed;
/// <summary>
/// wpiHeliconTechFeed 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 wpiHeliconTechFeed;
protected global::System.Web.UI.WebControls.TextBox txtMainFeedUrl;
/// <summary>
/// wpiEditFeedsList control.