mirror of
https://github.com/OrchardCMS/Orchard.git
synced 2026-01-19 17:51:45 +08:00
Adding session to import context with an utility method.
Import handlers for common and route parts. --HG-- branch : dev
This commit is contained in:
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user