org.blojsom.plugin.comment
Class MathCommentAuthenticationPlugin
java.lang.Object
org.blojsom.plugin.comment.CommentModerationPlugin
org.blojsom.plugin.comment.MathCommentAuthenticationPlugin
- All Implemented Interfaces:
- BlojsomPlugin
- public class MathCommentAuthenticationPlugin
- extends CommentModerationPlugin
Math comment authenticator plugin
- Since:
- blojsom 2.22
- Version:
- $Id: MathCommentAuthenticationPlugin.java,v 1.7 2006/01/25 18:29:46 czarneckid Exp $
- Author:
- David Czarnecki
Method Summary |
protected int |
getAnswerForOperation(int value1,
int value2,
int operation)
Return the result from the specified operation where 0 = addition, 1 = subtraction, 2 = multiplication |
protected java.lang.String |
getOperatorForOperation(int operation)
Return the appropriate operator for the operation |
protected void |
moderateComment(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse,
BlogUser user,
java.util.Map context,
BlogEntry[] entries)
Simple check to see if comment moderation is enabled
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_ANSWER
public static final java.lang.String BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_ANSWER
- See Also:
- Constant Field Values
BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_VALUE1
public static final java.lang.String BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_VALUE1
- See Also:
- Constant Field Values
BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_VALUE2
public static final java.lang.String BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_VALUE2
- See Also:
- Constant Field Values
BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_OPERATION
public static final java.lang.String BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_OPERATION
- See Also:
- Constant Field Values
BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_ANSWER_CHECK_PARAM
public static final java.lang.String BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_ANSWER_CHECK_PARAM
- See Also:
- Constant Field Values
BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_STATUS_MESSAGE
public static final java.lang.String BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_STATUS_MESSAGE
- See Also:
- Constant Field Values
MathCommentAuthenticationPlugin
public MathCommentAuthenticationPlugin()
- Math comment authenticator plugin
moderateComment
protected void moderateComment(javax.servlet.http.HttpServletRequest httpServletRequest,
javax.servlet.http.HttpServletResponse httpServletResponse,
BlogUser user,
java.util.Map context,
BlogEntry[] entries)
throws BlojsomPluginException
- Simple check to see if comment moderation is enabled
- Overrides:
moderateComment
in class CommentModerationPlugin
- Parameters:
httpServletRequest
- RequesthttpServletResponse
- Responseuser
- BlogUser
instancecontext
- Contextentries
- Blog entries retrieved for the particular request
- Throws:
BlojsomPluginException
- If there is an error in moderating a comment
getAnswerForOperation
protected int getAnswerForOperation(int value1,
int value2,
int operation)
- Return the result from the specified operation where 0 = addition, 1 = subtraction, 2 = multiplication
- Parameters:
value1
- Value 1value2
- Value 2operation
- Operation where 0 = addition, 1 = subtraction, 2 = multiplication
- Returns:
- Value of operation
getOperatorForOperation
protected java.lang.String getOperatorForOperation(int operation)
- Return the appropriate operator for the operation
- Parameters:
operation
- Operation where 0 = addition, 1 = subtraction, 2 = multiplication
- Returns:
- + for addition, - for subtraction, and * for multiplication