mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-02-09 09:16:41 +08:00
Commenting.
--HG-- branch : dev
This commit is contained in:
@@ -25,6 +25,7 @@ namespace Orchard.ImportExport.RecipeHandlers {
|
||||
return;
|
||||
}
|
||||
|
||||
// First pass to resolve content items from content identities for all content items, new and old.
|
||||
var importContentSession = new ImportContentSession(_orchardServices.ContentManager);
|
||||
foreach (var element in recipeContext.RecipeStep.Step.Elements()) {
|
||||
var elementId = element.Attribute("Id");
|
||||
@@ -41,6 +42,7 @@ namespace Orchard.ImportExport.RecipeHandlers {
|
||||
}
|
||||
}
|
||||
|
||||
// Second pass to import the content items.
|
||||
foreach (var element in recipeContext.RecipeStep.Step.Elements()) {
|
||||
_orchardServices.ContentManager.Import(element, importContentSession);
|
||||
}
|
||||
|
||||
@@ -398,6 +398,8 @@ namespace Orchard.ContentManagement {
|
||||
return query.ForPart<ContentItem>();
|
||||
}
|
||||
|
||||
// Insert or Update imported data into the content manager.
|
||||
// Call content item handlers.
|
||||
public void Import(XElement element, ImportContentSession importContentSession) {
|
||||
var elementId = element.Attribute("Id");
|
||||
if (elementId == null)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Orchard.ContentManagement {
|
||||
// Maps content identities to content items on the importer.
|
||||
public class ImportContentSession {
|
||||
private readonly IContentManager _contentManager;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user