Adding the x.500 id for the exported comments.

Fixing a typo.

--HG--
branch : dev
This commit is contained in:
Suha Can
2011-03-15 11:58:07 -07:00
parent c736214117
commit ba595143cb
2 changed files with 11 additions and 1 deletions

View File

@@ -19,7 +19,7 @@ namespace Orchard.Comments.Drivers {
context.Element(part.PartDefinition.Name).SetAttributeValue("UserName", part.Record.UserName);
context.Element(part.PartDefinition.Name).SetAttributeValue("Email", part.Record.Email);
context.Element(part.PartDefinition.Name).SetAttributeValue("Status", part.Record.Status.ToString());
context.Element(part.PartDefinition.Name).SetAttributeValue("CommentDataUtc", part.Record.CommentDateUtc.ToString());
context.Element(part.PartDefinition.Name).SetAttributeValue("CommentDateUtc", part.Record.CommentDateUtc.ToString());
context.Element(part.PartDefinition.Name).SetAttributeValue("CommentText", part.Record.CommentText);
var commentedOn = _contentManager.Get(part.Record.CommentedOn);

View File

@@ -1,5 +1,6 @@
using JetBrains.Annotations;
using Orchard.Comments.Models;
using Orchard.ContentManagement;
using Orchard.ContentManagement.Handlers;
using Orchard.Data;
@@ -9,5 +10,14 @@ namespace Orchard.Comments.Handlers {
public CommentPartHandler(IRepository<CommentPartRecord> commentsRepository) {
Filters.Add(StorageFilter.For(commentsRepository));
}
protected override void GetItemMetadata(GetContentItemMetadataContext context) {
var part = context.ContentItem.As<CommentPart>();
if (part != null) {
context.Metadata.Identity.Add("Comment.CommentAuthor", part.Record.Author);
context.Metadata.Identity.Add("Comment.CommentDateUtc", part.Record.CommentDateUtc.ToString());
}
}
}
}