Commenting.

--HG--
branch : dev
This commit is contained in:
Suha Can
2011-03-15 18:47:33 -07:00
parent 20a04a24ea
commit cef8dbc4e7
3 changed files with 5 additions and 0 deletions

View File

@@ -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);
}

View File

@@ -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)

View File

@@ -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;