KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > roller > presentation > velocity > CommentAuthenticator


1 package org.roller.presentation.velocity;
2
3 import javax.servlet.http.HttpServletRequest JavaDoc;
4 import javax.servlet.http.HttpServletResponse JavaDoc;
5 import org.apache.velocity.context.Context;
6 import org.roller.pojos.CommentData;
7
8 /**
9  * Interface for comment authentication plugin.
10  * @author David M Johnson
11  */

12 public interface CommentAuthenticator
13 {
14     /**
15      * Plugin should write out HTML for the form fields and other UI elements
16      * needed inside the Roller comment form. Called when HTML form is being
17      * displayed by Velocity template (see comments.vm).
18      *
19      * @param context Plugin can access objects in context of calling page.
20      * @param request Plugin can access request parameters
21      * @param response Plugin should write to response
22      */

23     public String JavaDoc getHtml(
24                         Context context,
25                         HttpServletRequest JavaDoc request,
26                         HttpServletResponse JavaDoc response);
27     /**
28      * Plugin should return true only if comment passes authentication test.
29      * Called when a comment is posted, not called when a comment is previewed.
30      *
31      * @param comment Comment data that was posted
32      * @param request Plugin can access request parameters
33      * @return True if comment passes authentication test
34      */

35     public boolean authenticate(
36                         CommentData comment,
37                         HttpServletRequest JavaDoc request);
38 }
39
Popular Tags