Skip to content

Commit 673e24a

Browse files
committed
Merge branch '7.0.2' of https://github.com/umbraco/Umbraco-CMS into 7.0.2
2 parents 4842be0 + dddb38d commit 673e24a

File tree

8 files changed

+331
-116
lines changed

8 files changed

+331
-116
lines changed

build/Build.proj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -267,7 +267,7 @@
267267
<Message Text="Compiling web project to build\$(BuildFolder)" Importance="high" />
268268
<!-- For UseWPP_CopyWebApplication=True see http://stackoverflow.com/questions/1983575/copywebapplication-with-web-config-transformations -->
269269
<!-- Build the Umbraco.Web.UI project -->
270-
<MSBuild Projects="..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj" Properties="WarningLevel=0;Configuration=$(BuildConfiguration);UseWPP_CopyWebApplication=True;PipelineDependsOnBuild=False;OutDir=$(SolutionBinFolderAbsolutePath);WebProjectOutputDir=$(WebAppFolderAbsolutePath)" Targets="Clean;Build;" BuildInParallel="False" ToolsVersion="4.0" UnloadProjectsOnCompletion="False">
270+
<MSBuild Projects="..\src\Umbraco.Web.UI\Umbraco.Web.UI.csproj" Properties="WarningLevel=0;Configuration=$(BuildConfiguration);UseWPP_CopyWebApplication=True;PipelineDependsOnBuild=False;OutDir=$(SolutionBinFolderAbsolutePath);WebProjectOutputDir=$(WebAppFolderAbsolutePath)" Targets="Clean;Rebuild;" BuildInParallel="False" ToolsVersion="4.0" UnloadProjectsOnCompletion="False">
271271
</MSBuild>
272272

273273
<!-- DONE -->
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
using System.Collections.Generic;
2+
using System.Xml.Linq;
3+
4+
namespace Umbraco.Core.Events
5+
{
6+
public class ExportEventArgs<TEntity> : CancellableObjectEventArgs<IEnumerable<TEntity>>
7+
{
8+
/// <summary>
9+
/// Constructor accepting a single entity instance
10+
/// </summary>
11+
/// <param name="eventObject"></param>
12+
/// <param name="xml"></param>
13+
/// <param name="canCancel"></param>
14+
public ExportEventArgs(TEntity eventObject, XElement xml, bool canCancel)
15+
: base(new List<TEntity> { eventObject }, canCancel)
16+
{
17+
Xml = xml;
18+
}
19+
20+
/// <summary>
21+
/// Constructor accepting a single entity instance
22+
/// and cancellable by default
23+
/// </summary>
24+
/// <param name="eventObject"></param>
25+
/// <param name="elementName"></param>
26+
public ExportEventArgs(TEntity eventObject, string elementName) : base(new List<TEntity> {eventObject}, true)
27+
{
28+
Xml = new XElement(elementName);
29+
}
30+
31+
protected ExportEventArgs(IEnumerable<TEntity> eventObject, bool canCancel) : base(eventObject, canCancel)
32+
{
33+
}
34+
35+
protected ExportEventArgs(IEnumerable<TEntity> eventObject) : base(eventObject)
36+
{
37+
}
38+
39+
/// <summary>
40+
/// Returns all entities that were exported during the operation
41+
/// </summary>
42+
public IEnumerable<TEntity> ExportedEntities
43+
{
44+
get { return EventObject; }
45+
}
46+
47+
/// <summary>
48+
/// Returns the xml relating to the export event
49+
/// </summary>
50+
public XElement Xml { get; private set; }
51+
}
52+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
using System.Collections.Generic;
2+
using System.Xml.Linq;
3+
4+
namespace Umbraco.Core.Events
5+
{
6+
public class ImportEventArgs<TEntity> : CancellableObjectEventArgs<IEnumerable<TEntity>>
7+
{
8+
/// <summary>
9+
/// Constructor accepting an XElement with the xml being imported
10+
/// </summary>
11+
/// <param name="xml"></param>
12+
public ImportEventArgs(XElement xml) : base(new List<TEntity>(), true)
13+
{
14+
Xml = xml;
15+
}
16+
17+
/// <summary>
18+
/// Constructor accepting a list of entities and an XElement with the imported xml
19+
/// </summary>
20+
/// <param name="eventObject"></param>
21+
/// <param name="xml"></param>
22+
/// <param name="canCancel"></param>
23+
public ImportEventArgs(IEnumerable<TEntity> eventObject, XElement xml, bool canCancel)
24+
: base(eventObject, canCancel)
25+
{
26+
Xml = xml;
27+
}
28+
29+
protected ImportEventArgs(IEnumerable<TEntity> eventObject, bool canCancel) : base(eventObject, canCancel)
30+
{
31+
}
32+
33+
protected ImportEventArgs(IEnumerable<TEntity> eventObject) : base(eventObject)
34+
{
35+
}
36+
37+
/// <summary>
38+
/// Returns all entities that were imported during the operation
39+
/// </summary>
40+
public IEnumerable<TEntity> ImportedEntities
41+
{
42+
get { return EventObject; }
43+
}
44+
45+
/// <summary>
46+
/// Returns the xml relating to the import event
47+
/// </summary>
48+
public XElement Xml { get; private set; }
49+
}
50+
}

src/Umbraco.Core/Services/IPackagingService.cs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,15 @@ public interface IPackagingService : IService
6161
/// <returns>An enumerable list of generated languages</returns>
6262
IEnumerable<ILanguage> ImportLanguages(XElement languageElementList, int userId = 0, bool raiseEvents = true);
6363

64+
/// <summary>
65+
/// Imports and saves the 'Macros' part of a package xml as a list of <see cref="IMacro"/>
66+
/// </summary>
67+
/// <param name="element">Xml to import</param>
68+
/// <param name="userId">Optional id of the User performing the operation</param>
69+
/// <param name="raiseEvents">Optional parameter indicating whether or not to raise events</param>
70+
/// <returns></returns>
71+
IEnumerable<IMacro> ImportMacros(XElement element, int userId = 0, bool raiseEvents = true);
72+
6473
/// <summary>
6574
/// Imports and saves package xml as <see cref="ITemplate"/>
6675
/// </summary>

0 commit comments

Comments
 (0)