Predictions 4.10.0.0

hirondelle.predict.main.prediction
Class PredictionAction

Object
  extended by ActionImpl
      extended by ActionTemplateListAndEdit
          extended by hirondelle.predict.main.prediction.PredictionAction
All Implemented Interfaces:
Action, FetchIdentifierOwner

public final class PredictionAction
extends ActionTemplateListAndEdit
implements FetchIdentifierOwner

List and edit Prediction objects.

This feature is a prime example of implementing data ownership constraints. Here, each Prediction is linked to a PredictionList. Each PredictionList is in turned linked to a specific user - the owner of the PredictionList, and all of the Predictions it contains.

View : SQL Statements :

Field Summary
static SqlId ADD_PREDICTION
           
static SqlId CHANGE_PREDICTION
           
static RequestParameter CREATIONDATE
           
static SqlId DELETE_PREDICTION
           
static SqlId FETCH_OWNER
           
static SqlId FETCH_PREDICTION
           
static RequestParameter ID
           
static SqlId LIST_PREDICTIONS
           
static RequestParameter OUTCOME
           
static RequestParameter OUTCOME_DATE
           
static RequestParameter PREDICTION_LIST_ID
           
static RequestParameter REMARK
           
static RequestParameter TEXT
           
 
Fields inherited from class ActionTemplateListAndEdit
SupportedOperation
 
Fields inherited from class ActionImpl
DATA, ERRORS, ITEM_FOR_EDIT, ITEMS_FOR_LISTING, MESSAGES, USER_ID
 
Constructor Summary
PredictionAction(RequestParser aRequestParser)
          Constructor.
 
Method Summary
protected  void attemptAdd()
          Attempt to add a new Prediction.
protected  void attemptChange()
          Attempt to change an existing Prediction.
protected  void attemptDelete()
          Attempt to delete an existing Prediction.
protected  void attemptFetchForChange()
          Fetch an existing Prediction in preparation for editing it.
protected  void doList()
          Show the list of Predictions in a given prediction list.
 Id fetchOwner()
          Helps enforce an ownership constraint.
protected  void validateUserInput()
          Attempt to build a Prediction out of user input.
 
Methods inherited from class ActionTemplateListAndEdit
addDynamicParameterToRedirectPage, execute
 
Methods inherited from class ActionImpl
addError, addError, addError, addMessage, addMessage, addToRequest, addToSession, copyFromSessionToRequest, createSessionAndCsrfToken, endSession, getErrors, getExistingSession, getFromSession, getIdParam, getIdParams, getLocale, getLoggedInUserName, getMessages, getOperation, getOrderBy, getParam, getParamUnsafe, getRequestParser, getResponsePage, getTimeZone, getUserId, hasErrors, removeFromSession, setResponsePage
 
Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LIST_PREDICTIONS

public static final SqlId LIST_PREDICTIONS

FETCH_PREDICTION

public static final SqlId FETCH_PREDICTION

ADD_PREDICTION

public static final SqlId ADD_PREDICTION

CHANGE_PREDICTION

public static final SqlId CHANGE_PREDICTION

DELETE_PREDICTION

public static final SqlId DELETE_PREDICTION

FETCH_OWNER

public static final SqlId FETCH_OWNER

PREDICTION_LIST_ID

public static final RequestParameter PREDICTION_LIST_ID

ID

public static final RequestParameter ID

TEXT

public static final RequestParameter TEXT

CREATIONDATE

public static final RequestParameter CREATIONDATE

REMARK

public static final RequestParameter REMARK

OUTCOME

public static final RequestParameter OUTCOME

OUTCOME_DATE

public static final RequestParameter OUTCOME_DATE
Constructor Detail

PredictionAction

public PredictionAction(RequestParser aRequestParser)
Constructor.

Method Detail

fetchOwner

public Id fetchOwner()
              throws DAOException
Helps enforce an ownership constraint. Only the owner of a PredictionList can perform edits on its content.

Specified by:
fetchOwner in interface FetchIdentifierOwner
Throws:
DAOException

doList

protected void doList()
               throws DAOException
Show the list of Predictions in a given prediction list.

Specified by:
doList in class ActionTemplateListAndEdit
Throws:
DAOException

validateUserInput

protected void validateUserInput()
Attempt to build a Prediction out of user input.

Specified by:
validateUserInput in class ActionTemplateListAndEdit

attemptAdd

protected void attemptAdd()
                   throws DAOException
Attempt to add a new Prediction.

Specified by:
attemptAdd in class ActionTemplateListAndEdit
Throws:
DAOException

attemptFetchForChange

protected void attemptFetchForChange()
                              throws DAOException
Fetch an existing Prediction in preparation for editing it.

Specified by:
attemptFetchForChange in class ActionTemplateListAndEdit
Throws:
DAOException

attemptChange

protected void attemptChange()
                      throws DAOException
Attempt to change an existing Prediction.

Specified by:
attemptChange in class ActionTemplateListAndEdit
Throws:
DAOException

attemptDelete

protected void attemptDelete()
                      throws DAOException
Attempt to delete an existing Prediction.

Specified by:
attemptDelete in class ActionTemplateListAndEdit
Throws:
DAOException

Predictions 4.10.0.0

Copyright Hirondelle Systems - Generated 2013Oct19.12.27