Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.blojsom.plugin.comment
Class MathCommentAuthenticationPlugin

    java.lang.Object
      org.blojsom.plugin.comment.CommentModerationPlugin
          org.blojsom.plugin.comment.MathCommentAuthenticationPlugin

All Implemented Interfaces:
  Plugin

public class MathCommentAuthenticationPlugin
extends CommentModerationPlugin

Math comment authenticator plugin

Since:
  blojsom 3.0
Version:
  $Id: MathCommentAuthenticationPlugin.java,v 1.2 2006/03/20 22:50:34 czarneckid Exp $
Author:
  David Czarnecki

Field Summary
`static java.lang.String` | `BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_ANSWER`
`static java.lang.String` | `BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_ANSWER_CHECK_PARAM`
`static java.lang.String` | `BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_OPERATION`
`static java.lang.String` | `BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_STATUS_MESSAGE`
`static java.lang.String` | `BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_VALUE1`
`static java.lang.String` | `BLOJSOM_MATH_AUTHENTICATOR_PLUGIN_VALUE2`

Fields inherited from class org.blojsom.plugin.comment.CommentModerationPlugin
`BLOJSOM_COMMENT_MODERATION_PLUGIN_APPROVED, COMMENT_MODERATION_ENABLED`

Constructor Summary
`MathCommentAuthenticationPlugin()` Math comment authenticator plugin

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, Blog blog, java.util.Map context, Entry[] entries)` Simple check to see if comment moderation is enabled

Methods inherited from class org.blojsom.plugin.comment.CommentModerationPlugin
`cleanup, destroy, init, process`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### 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

Constructor Detail

### MathCommentAuthenticationPlugin

    public MathCommentAuthenticationPlugin()

  Math comment authenticator plugin

Method Detail

### moderateComment

    protected void moderateComment(javax.servlet.http.HttpServletRequest httpServletRequest,
                                   javax.servlet.http.HttpServletResponse httpServletResponse,
                                   Blog blog,
                                   java.util.Map context,
                                   Entry[] entries)
                            throws PluginException

  Simple check to see if comment moderation is enabled

  Overrides:
    `moderateComment` in class `CommentModerationPlugin`
  Parameters:
    `httpServletRequest` - Request
    `httpServletResponse` - Response
    `blog` - `Blog` instance
    `context` - Context
    `entries` - Blog entries retrieved for the particular request
  Throws:
    `PluginException` - 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 1
    `value2` - Value 2
    `operation` - 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

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD