cmu.survey.jsp.tags
Class GenericUpdateSQL

java.lang.Object
  extended by cmu.survey.jsp.tags.GenericUpdate
      extended by cmu.survey.jsp.tags.GenericUpdateSQL

public class GenericUpdateSQL
extends GenericUpdate

A generic tag for inserting, updating and deleting records from a database. It reads the information straight from the form in the request object, if a form was submitted.


In pre-2003, or more customized surveys:
If you are writing a generic survey without using the <survey:Survey> tag (for example, if you use the <survey:DatabaseConnection> tag instead), you'll want to put this somewhere in your JSP file so that data will automatically get saved to the database.
In newer, standard surveys:
You should probably be using the <survey:Survey> tag. If so, you don't need to put this anywhere -- it's automatically called from the <survey:Survey> tag.


Field Summary
 
Fields inherited from class cmu.survey.jsp.tags.GenericUpdate
changedDBLastUpdate, dateInsertStringNames, dateInsertStringValues, dateMap, dateMapIsNull, dateNames, dateSubtypes, dateTimeInsertStringNames, dateTimeInsertStringValues, dateTimeMap, dateTimeMapIsEmpty, dateTimeNames, dateTimeSubtypes, dateTimeValues, dateValues, debug, DELETE, didParseOutParameters, formWasSubmitted, INSERT, keyValueLists, lastMessage, NOTHING, numberKeyNames, numberKeyValues, numberNames, numberValues, pageContext, parametersTurnedIntoTextForm, parametersWerePassedIn, saveChangesToDB, stringKeyNames, stringKeyValues, stringNames, stringValues, survey, tableName, theRequest, thingToDo, timeInsertStringNames, timeInsertStringValues, timeMap, timeMapIsEmpty, timeNames, timeSubtypes, timeValues, UPDATE, VALID_SUBTYPES
 
Constructor Summary
GenericUpdateSQL(Survey theSurvey, javax.servlet.jsp.PageContext usePageContext)
           
 
Method Summary
protected  int decideWhatToDo()
          Only call when thingToDo is undefined -- i.e. if you're not sure what to do yet (don't call it if it's a delete).
protected  void defineWhereClause()
           
protected  void doDatabaseChanges()
           
protected  java.util.Calendar getCalendar()
           
protected  java.lang.String getDateTimeNowStringFormat()
          Get the date and time right now as a string
 java.lang.String getWhereOfKeys()
           
 java.util.Vector<Filter> getWhereOfKeysFilters()
           
protected  void handleKeyValueLists()
           
 
Methods inherited from class cmu.survey.jsp.tags.GenericUpdate
cleanStringValue, convertDateTimeFormToCalendars, doUpdate, getChangedDBLastUpdate, getKeys, getLastMessage, getQuestionInfo, getTypeOfChangeDone, getWasPageSubmitted, getWereParametersPassedIn, hasParamBeenAddedBefore, isValidSubtype, parseOutParameters, parseOutParameters, setLastMessage, setSaveChangesToDB, updateFormToCalendar
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

GenericUpdateSQL

public GenericUpdateSQL(Survey theSurvey,
                        javax.servlet.jsp.PageContext usePageContext)
Method Detail

getWhereOfKeys

public java.lang.String getWhereOfKeys()

getWhereOfKeysFilters

public java.util.Vector<Filter> getWhereOfKeysFilters()

getCalendar

protected java.util.Calendar getCalendar()
Specified by:
getCalendar in class GenericUpdate

getDateTimeNowStringFormat

protected java.lang.String getDateTimeNowStringFormat()
Description copied from class: GenericUpdate
Get the date and time right now as a string

Specified by:
getDateTimeNowStringFormat in class GenericUpdate

defineWhereClause

protected void defineWhereClause()

decideWhatToDo

protected int decideWhatToDo()
Only call when thingToDo is undefined -- i.e. if you're not sure what to do yet (don't call it if it's a delete).

Specified by:
decideWhatToDo in class GenericUpdate
Parameters:
whereClause -
Returns:

handleKeyValueLists

protected void handleKeyValueLists()

doDatabaseChanges

protected void doDatabaseChanges()
Specified by:
doDatabaseChanges in class GenericUpdate