com.heckmansoft.surjey.model.manager
Class QuestionManager

java.lang.Object
  extended bycom.heckmansoft.surjey.model.datastore.Datastore
      extended bycom.heckmansoft.surjey.model.datastore.QuestionDatastore
          extended bycom.heckmansoft.surjey.model.manager.QuestionManager

public class QuestionManager
extends QuestionDatastore

Manages Question objects


Constructor Summary
QuestionManager()
          Constructor.
 
Method Summary
 Question createQuestion()
          Create a new question.
 Question createQuestion(java.lang.String sectionId)
          Create a new question for a given section.
 ValueObjectList findAllTypes()
          Get all the question types.
protected  java.lang.String getNextPosition(java.lang.String sectionId)
          Lookup position of next question
 QuestionType getQuestionType(java.lang.String id)
          Get a question type
 java.util.Iterator getTypesIterator()
          Get an iterator over the question types.
 
Methods inherited from class com.heckmansoft.surjey.model.datastore.QuestionDatastore
extract, findById, findBySectionId, getArgs, removeBySectionId
 
Methods inherited from class com.heckmansoft.surjey.model.datastore.Datastore
executeDelete, executeInsert, executeUpdate, extract, extractList, extractSingle, findAll, generateDeleteSQL, generateInsertSQL, generateSelectSQL, generateUpdateSQL, getConnection, getTransaction, insert, insert, populateStatement, remove, remove, remove, selectAll, selectById, selectWhere, update, update
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

QuestionManager

public QuestionManager()
Constructor.

Method Detail

getQuestionType

public QuestionType getQuestionType(java.lang.String id)
                             throws DatastoreException
Get a question type

Parameters:
id - The question id.
Returns:
The Question type instance
Throws:
DatastoreException

getTypesIterator

public java.util.Iterator getTypesIterator()
                                    throws DatastoreException
Get an iterator over the question types.

Returns:
An iterator over the list of QuestionTypes.
Throws:
DatastoreException

findAllTypes

public ValueObjectList findAllTypes()
                             throws DatastoreException
Get all the question types.

Returns:
A list of QuestionTypes
Throws:
DatastoreException

createQuestion

public Question createQuestion()
Create a new question.

Overrides:
createQuestion in class QuestionDatastore
Returns:
newly created question.

createQuestion

public Question createQuestion(java.lang.String sectionId)
                        throws DatastoreException
Create a new question for a given section.

Parameters:
sectionId - Id of section for new question.
Returns:
newly created question.
Throws:
DatastoreException

getNextPosition

protected java.lang.String getNextPosition(java.lang.String sectionId)
                                    throws DatastoreException
Lookup position of next question

Throws:
DatastoreException