Documentation Center

Implementing a spam filter for UGC in .NET

Implement the SpamFilter interface and configure any configuration options for your filter in the web.config file.

Procedure

  1. Create a new .NET class that implements the interface Tridion.ContentDelivery.UGC.WebService.SpamFilter.
  2. To implement the interface, implement the method Comment ValidateComment(ClaimStore claimStore, Comment comment), which evaluates a comment and either rejects or accepts it.
  3. Configure the spam filter by opening the UGC Web application's configuration file, web.config, located in the root folder of the Web application, in a plain-text or XML editor.
  4. In this file, ensure the presence of one add element in the <appSettings> section, with its key attribute set to a property name and its value attribute set to your class, and another add element specifying the assembly:
    <add key="Comment.SpamFilter.Implementation" value="MyNameSpace.MySpamFilter" />
    <add key="Comment.SpamFilter.Assembly" value="Assembly.Name" />