Ability to change main WPI (Microsoft) feed url in System Settings.
This commit is contained in:
parent
815519b650
commit
54c8438ece
14 changed files with 122 additions and 1041 deletions
|
@ -29,15 +29,14 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Threading;
|
||||
using WebsitePanel.Providers.Web;
|
||||
using WebsitePanel.EnterpriseServer.Base.Common;
|
||||
using WebsitePanel.Providers.Web;
|
||||
using WebsitePanel.Providers.ResultObjects;
|
||||
using WebsitePanel.Providers.Database;
|
||||
using WebsitePanel.Providers.WebAppGallery;
|
||||
using System.Collections.Specialized;
|
||||
using System.Reflection;
|
||||
using WebsitePanel.Providers.Common;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
|
||||
namespace WebsitePanel.EnterpriseServer
|
||||
{
|
||||
|
@ -72,28 +71,33 @@ namespace WebsitePanel.EnterpriseServer
|
|||
|
||||
private static string[] getFeedsFromSettingsByServiceId(int serviceId)
|
||||
{
|
||||
StringDictionary serviceSettings = ServerController.GetServiceSettings(serviceId);
|
||||
var wpiSettings = SystemController.GetSystemSettings(SystemSettings.WPI_SETTINGS);
|
||||
|
||||
List<string> arFeeds = new List<string>();
|
||||
List<string> feeds = new List<string>();
|
||||
|
||||
if (Utils.ParseBool(serviceSettings["FeedEnableMicrosoft"], true))
|
||||
// Microsoft feed
|
||||
string mainFeedUrl = wpiSettings[SystemSettings.WPI_MAIN_FEED_KEY];
|
||||
if (string.IsNullOrEmpty(mainFeedUrl))
|
||||
{
|
||||
arFeeds.Add(esServers.MAIN_WPI_FEED);
|
||||
mainFeedUrl = WebPlatformInstaller.MAIN_FEED_URL;
|
||||
}
|
||||
feeds.Add(mainFeedUrl);
|
||||
|
||||
if (Utils.ParseBool(serviceSettings["FeedEnableHelicon"], true))
|
||||
{
|
||||
arFeeds.Add(esServers.HELICON_WPI_FEED);
|
||||
}
|
||||
// Zoo Feed
|
||||
feeds.Add(WebPlatformInstaller.ZOO_FEED);
|
||||
|
||||
string additionalFeeds = serviceSettings["FeedUrls"];
|
||||
|
||||
// additional feeds
|
||||
string additionalFeeds = wpiSettings[SystemSettings.FEED_ULS_KEY];
|
||||
if (!string.IsNullOrEmpty(additionalFeeds))
|
||||
{
|
||||
arFeeds.AddRange(additionalFeeds.Split(';'));
|
||||
feeds.AddRange(additionalFeeds.Split(';'));
|
||||
}
|
||||
|
||||
return arFeeds.ToArray();
|
||||
return feeds.ToArray();
|
||||
}
|
||||
|
||||
|
||||
public static void InitFeedsByServiceId(int UserId, int serviceId)
|
||||
{
|
||||
string[] feeds = getFeedsFromSettingsByServiceId(serviceId);
|
||||
|
|
|
@ -35,6 +35,7 @@ using System.Collections.Generic;
|
|||
using System.Web.Services;
|
||||
using System.Web.Services.Protocols;
|
||||
using System.ComponentModel;
|
||||
using WebsitePanel.EnterpriseServer.Base.Common;
|
||||
using WebsitePanel.Providers.Common;
|
||||
using Microsoft.Web.Services3;
|
||||
|
||||
|
@ -54,8 +55,10 @@ namespace WebsitePanel.EnterpriseServer
|
|||
[ToolboxItem(false)]
|
||||
public class esServers : System.Web.Services.WebService
|
||||
{
|
||||
public const string MAIN_WPI_FEED = "https://www.microsoft.com/web/webpi/4.0/WebProductList.xml";
|
||||
/*
|
||||
public const string MAIN_WPI_FEED = "https://www.microsoft.com/web/webpi/4.2/WebProductList.xml";
|
||||
public const string HELICON_WPI_FEED = "http://www.helicontech.com/zoo/feed/wsp4";
|
||||
*/
|
||||
|
||||
#region Servers
|
||||
[WebMethod]
|
||||
|
@ -696,25 +699,28 @@ namespace WebsitePanel.EnterpriseServer
|
|||
var wpiSettings = SystemController.GetSystemSettings(SystemSettings.WPI_SETTINGS);
|
||||
|
||||
|
||||
List<string> arFeeds = new List<string>();
|
||||
List<string> feeds = new List<string>();
|
||||
|
||||
if (Utils.ParseBool(wpiSettings["FeedEnableMicrosoft"] ,true))
|
||||
// Microsoft feed
|
||||
string mainFeedUrl = wpiSettings[SystemSettings.WPI_MAIN_FEED_KEY];
|
||||
if (string.IsNullOrEmpty(mainFeedUrl))
|
||||
{
|
||||
arFeeds.Add( MAIN_WPI_FEED );
|
||||
mainFeedUrl = WebPlatformInstaller.MAIN_FEED_URL;
|
||||
}
|
||||
feeds.Add(mainFeedUrl);
|
||||
|
||||
if (Utils.ParseBool(wpiSettings["FeedEnableHelicon"] ,true))
|
||||
{
|
||||
arFeeds.Add( HELICON_WPI_FEED );
|
||||
}
|
||||
|
||||
string additionalFeeds = wpiSettings["FeedUrls"];
|
||||
// Zoo Feed
|
||||
feeds.Add(WebPlatformInstaller.ZOO_FEED);
|
||||
|
||||
|
||||
// additional feeds
|
||||
string additionalFeeds = wpiSettings[SystemSettings.FEED_ULS_KEY];
|
||||
if (!string.IsNullOrEmpty(additionalFeeds))
|
||||
{
|
||||
arFeeds.AddRange(additionalFeeds.Split(';'));
|
||||
feeds.AddRange(additionalFeeds.Split(';'));
|
||||
}
|
||||
|
||||
OperatingSystemController.InitWPIFeeds(serverId, string.Join(";", arFeeds));
|
||||
OperatingSystemController.InitWPIFeeds(serverId, string.Join(";", feeds));
|
||||
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue