Skip to content

Comment Creation Pipeline

Alistair Deneys edited this page Oct 28, 2012 · 4 revisions

Updating the Comment Creation Process

WeBlog Release 2.1 added the weblogCreateComment pipeline which is executed when a new comment is submitted. The pipeline is responsible for creation of the comment, verification of the comment and submission into workflow.

The following configuration shows the default pipeline. <weblogCreateComment> <processor type="Sitecore.Modules.WeBlog.Pipelines.CreateComment.CreateCommentItem"/> <processor type="Sitecore.Modules.WeBlog.Pipelines.CreateComment.AkismetSpamCheck"/> <processor type="Sitecore.Modules.WeBlog.Pipelines.CreateComment.WorkflowSubmit"/> </weblogCreateComment>

To alter the comment creation process you can simply update the pipeline and swap processors or introduce new processors to perform specific actions.

For example, a developer could update the pipeline to include a processor which checks the users email against a blacklist to ensure the user should be allowed to submit the comment.

All processors should implement the Sitecore.Modules.WeBlog.Pipelines.CreateComment.ICreateCommentProcessor interface which declares the Process() method which accepts a single parameter of type Sitecore.Modules.WeBlog.Pipelines.CreateComment.CreateCommentArgs. This type defines a few properties containing information about the comment and entry. The following list details these properties.

EntryID: The ID of the entry the comment is being created against Comment: The comment data submitted by the user CommentItem: The comment item once created. This property is null when the pipeline starts and is populated by the CreateCommentItem processor ** Database**: The database the entry is being created in

Clone this wiki locally