moves package actions to correct namespace, no more _Legacy namespace

This commit is contained in:
Shannon
2019-01-29 23:31:59 +11:00
parent 2e527163f9
commit 1897c0f162
15 changed files with 21 additions and 111 deletions

View File

@@ -9,8 +9,8 @@ using Umbraco.Core.Persistence.Mappers;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Strings;
using Umbraco.Core.Sync;
using Umbraco.Core._Legacy.PackageActions;
using Umbraco.Core.Logging.Viewer;
using Umbraco.Core.PackageActions;
namespace Umbraco.Core.Components
{

View File

@@ -5,6 +5,7 @@ using Umbraco.Core.Dictionary;
using Umbraco.Core.IO;
using Umbraco.Core.Logging;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PackageActions;
using Umbraco.Core.Packaging;
using Umbraco.Core.Persistence;
using Umbraco.Core.PropertyEditors;
@@ -12,7 +13,6 @@ using Umbraco.Core.Scoping;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Core.Sync;
using Umbraco.Core._Legacy.PackageActions;
namespace Umbraco.Core.Composing
{

View File

@@ -2,10 +2,10 @@
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core.Cache;
using Umbraco.Core.PackageActions;
using Umbraco.Core.Persistence.Mappers;
using Umbraco.Core.Persistence.SqlSyntax;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core._Legacy.PackageActions;
namespace Umbraco.Core.Composing
{

View File

@@ -1,14 +1,10 @@
using System;
using System.Collections;
using System.Collections;
using System.Linq;
using System.Xml;
using System.Xml.Linq;
using Umbraco.Core;
using Umbraco.Core.Composing;
using Umbraco.Core.Models;
using Umbraco.Core._Legacy.PackageActions;
using Umbraco.Web.Composing;
namespace Umbraco.Web._Legacy.PackageActions
namespace Umbraco.Core.PackageActions
{
/// <summary>
/// This class implements the IPackageAction Interface, used to execute code when packages are installed.

View File

@@ -1,8 +1,7 @@
using System.Xml;
using System.Xml.Linq;
using Umbraco.Core.Composing;
namespace Umbraco.Core._Legacy.PackageActions
namespace Umbraco.Core.PackageActions
{
public interface IPackageAction : IDiscoverable
{

View File

@@ -1,7 +1,7 @@
using System.Collections.Generic;
using Umbraco.Core.Composing;
namespace Umbraco.Core._Legacy.PackageActions
namespace Umbraco.Core.PackageActions
{
public sealed class PackageActionCollection : BuilderCollectionBase<IPackageAction>
{

View File

@@ -1,6 +1,6 @@
using Umbraco.Core.Composing;
namespace Umbraco.Core._Legacy.PackageActions
namespace Umbraco.Core.PackageActions
{
internal class PackageActionCollectionBuilder : LazyCollectionBuilderBase<PackageActionCollectionBuilder, PackageActionCollection, IPackageAction>
{

View File

@@ -1,11 +1,7 @@
using System;
using System.Xml;
using System.Xml.Linq;
using Umbraco.Core;
using Umbraco.Core._Legacy.PackageActions;
using Umbraco.Web.Composing;
using System.Xml.Linq;
using Umbraco.Core.Composing;
namespace Umbraco.Web._Legacy.PackageActions
namespace Umbraco.Core.PackageActions
{
/// <summary>
/// This class implements the IPackageAction Interface, used to execute code when packages are installed.

View File

@@ -2,7 +2,7 @@
using System.Collections.Generic;
using System.Xml.Linq;
using Umbraco.Core.Logging;
using Umbraco.Core._Legacy.PackageActions;
using Umbraco.Core.PackageActions;
namespace Umbraco.Core.Packaging
{

View File

@@ -11,6 +11,7 @@ using Umbraco.Core.Manifest;
using Umbraco.Core.Migrations;
using Umbraco.Core.Migrations.Install;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.PackageActions;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.Mappers;
using Umbraco.Core.PropertyEditors;
@@ -19,7 +20,6 @@ using Umbraco.Core.Scoping;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Core.Sync;
using Umbraco.Core._Legacy.PackageActions;
using IntegerValidator = Umbraco.Core.PropertyEditors.Validators.IntegerValidator;
namespace Umbraco.Core.Runtime

View File

@@ -454,6 +454,8 @@
<Compile Include="Models\PublishedContent\ThreadCultureVariationContextAccessor.cs" />
<Compile Include="Models\PublishedContent\VariationContextAccessorExtensions.cs" />
<Compile Include="Models\Trees\IBackOfficeSection.cs" />
<Compile Include="PackageActions\AllowDoctype.cs" />
<Compile Include="PackageActions\PublishRootDocument.cs" />
<Compile Include="Packaging\CompiledPackageXmlParser.cs" />
<Compile Include="Packaging\ICreatedPackagesRepository.cs" />
<Compile Include="Packaging\IInstalledPackagesRepository.cs" />
@@ -1516,9 +1518,9 @@
<Compile Include="Xml\XPath\MacroNavigator.cs" />
<Compile Include="Xml\XPath\NavigableNavigator.cs" />
<Compile Include="Xml\XPath\RenamedRootNavigator.cs" />
<Compile Include="_Legacy\PackageActions\IPackageAction.cs" />
<Compile Include="_Legacy\PackageActions\PackageActionCollection.cs" />
<Compile Include="_Legacy\PackageActions\PackageActionCollectionBuilder.cs" />
<Compile Include="PackageActions\IPackageAction.cs" />
<Compile Include="PackageActions\PackageActionCollection.cs" />
<Compile Include="PackageActions\PackageActionCollectionBuilder.cs" />
<Compile Include="Persistence\FaultHandling\RetryDbConnection.cs">
<SubType>Component</SubType>
</Compile>

View File

@@ -8,7 +8,7 @@ using Umbraco.Core;
using Umbraco.Core.Components;
using Umbraco.Core.Composing;
using Umbraco.Core.Logging;
using Umbraco.Core._Legacy.PackageActions;
using Umbraco.Core.PackageActions;
using Umbraco.Tests.Components;
namespace Umbraco.Tests.Composing

View File

@@ -11,13 +11,13 @@ using Umbraco.Core.Models.PublishedContent;
using Umbraco.Core.Persistence;
using Umbraco.Core.Composing;
using Umbraco.Core.Configuration;
using Umbraco.Core.PackageActions;
using Umbraco.Core.Packaging;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Scoping;
using Umbraco.Core.Services;
using Umbraco.Core.Strings;
using Umbraco.Core.Sync;
using Umbraco.Core._Legacy.PackageActions;
using Umbraco.Web.Actions;
using Umbraco.Web.Cache;
using Umbraco.Web.Editors;

View File

@@ -1135,8 +1135,6 @@
<Compile Include="Templates\TemplateUtilities.cs" />
<Compile Include="Trees\PartialViewMacrosTreeController.cs" />
<Compile Include="Trees\PartialViewsTreeController.cs" />
<Compile Include="_Legacy\PackageActions\allowDoctype.cs" />
<Compile Include="_Legacy\PackageActions\publishRootDocument.cs" />
<Compile Include="Models\ContentEditing\NotificationStyle.cs" />
<Compile Include="UmbracoHelper.cs" />
<Compile Include="Mvc\ViewContextExtensions.cs" />

View File

@@ -1,81 +0,0 @@
using System.Xml;
using System.Xml.Linq;
using Umbraco.Core;
using Umbraco.Core.IO;
using Umbraco.Core.Xml;
using Umbraco.Core._Legacy.PackageActions;
namespace Umbraco.Web._Legacy.PackageActions
{
public class AddProxyFeedHost : IPackageAction
{
#region IPackageAction Members
public bool Execute(string packageName, XElement xmlData)
{
var hostname = xmlData.AttributeValue<string>("host");
if (string.IsNullOrEmpty(hostname))
return false;
var xdoc = XDocument.Load(IOHelper.MapPath(SystemFiles.FeedProxyConfig));
var insert = true;
if (xdoc.Root.HasElements)
{
foreach (var node in xdoc.Root.Elements("allow"))
{
if (node.AttributeValue<string>("host") != null && node.AttributeValue<string>("host") == hostname)
insert = false;
}
}
if (insert)
{
xdoc.Root.Add(new XElement("allow", new XAttribute("host", hostname)));
xdoc.Save(IOHelper.MapPath(SystemFiles.FeedProxyConfig));
return true;
}
return false;
}
public string Alias()
{
return "addProxyFeedHost";
}
public bool Undo(string packageName, XElement xmlData)
{
var hostname = xmlData.AttributeValue<string>("host");
if (string.IsNullOrEmpty(hostname))
return false;
var xdoc = XDocument.Load(IOHelper.MapPath(SystemFiles.FeedProxyConfig));
bool inserted = false;
if (xdoc.Root.HasElements)
{
foreach (var node in xdoc.Root.Elements("allow"))
{
if (node.AttributeValue<string>("host") != null && node.AttributeValue<string>("host") == hostname)
{
node.Remove();
inserted = true;
}
}
}
if (inserted)
{
xdoc.Save(IOHelper.MapPath(SystemFiles.FeedProxyConfig));
return true;
}
return false;
}
#endregion
}
}