Adding session to import context with an utility method.

Import handlers for common and route parts.

--HG--
branch : dev
This commit is contained in:
Suha Can
2011-03-16 10:03:45 -07:00
parent 173af2bcbe
commit 527c8612f0
4 changed files with 51 additions and 3 deletions

View File

@@ -1,7 +1,6 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Xml.Linq;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Aspects;
using Orchard.ContentManagement.Drivers;
@@ -96,6 +95,23 @@ namespace Orchard.Core.Routable.Drivers {
return Editor(part, shapeHelper);
}
protected override void Importing(RoutePart part, ImportContentContext context) {
var title = context.Attribute(part.PartDefinition.Name, "Title");
if (title != null) {
part.Title = title;
}
var slug = context.Attribute(part.PartDefinition.Name, "Slug");
if (slug != null) {
part.Slug = slug;
}
var path = context.Attribute(part.PartDefinition.Name, "Path");
if (path != null) {
part.Path = path;
}
}
protected override void Exporting(RoutePart part, ExportContentContext context) {
context.Element(part.PartDefinition.Name).SetAttributeValue("Title", part.Title);
context.Element(part.PartDefinition.Name).SetAttributeValue("Slug", part.Slug);