pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.component.survey
Class SurveyCreatorController

java.lang.Object
  extended by org.torweg.pulse.bundle.Controller
      extended by org.torweg.pulse.component.survey.SurveyCreatorController
All Implemented Interfaces:
Configurable<SurveyCreatorControllerConfiguration>

public class SurveyCreatorController
extends Controller
implements Configurable<SurveyCreatorControllerConfiguration>

Creates and persists a Survey from the given Configuration.

Version:
$Revision: 1914 $
Author:
Daniel Dietz

Nested Class Summary
 
Nested classes/interfaces inherited from class org.torweg.pulse.bundle.Controller
Controller.AlwaysRun
 
Constructor Summary
SurveyCreatorController()
           
 
Method Summary
 SurveyCreatorControllerResult createSurvey(Bundle bundle, ServiceRequest request)
          Creates and persists the Survey from the given config specified by request-parameter as given by SurveyCreatorControllerConfiguration.getSurveyParameterName().
 void initialize(SurveyCreatorControllerConfiguration conf)
          Initialises the SurveyCreatorController with the given Configuration.
 java.lang.Object removeQuestionnaire(Bundle bundle, ServiceRequest request)
          Removes the Questionnaire specified by request-parameter idfrom database.
 java.lang.Object removeSurvey(Bundle bundle, ServiceRequest request)
          Removes the Survey specified by request-parameter id from database.
 java.lang.Object updateSurvey(Bundle bundle, ServiceRequest request)
          Update and persists the Survey from the given config specified by request-parameter as given by SurveyCreatorControllerConfiguration.getSurveyParameterName().
 
Methods inherited from class org.torweg.pulse.bundle.Controller
getAlwaysRun, isAlwaysRun, setAlwaysRun
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SurveyCreatorController

public SurveyCreatorController()
Method Detail

createSurvey

@Action(value="createSurvey")
@Permission(value="createSurvey")
public final SurveyCreatorControllerResult createSurvey(Bundle bundle, ServiceRequest request)
Creates and persists the Survey from the given config specified by request-parameter as given by SurveyCreatorControllerConfiguration.getSurveyParameterName().

default: surveyName

Parameters:
bundle - the Bundle
request - the ServiceRequest
Returns:
a JAXB-able result-Object, precisely a SurveyCreatorControllerResult

updateSurvey

@Action(value="updateSurvey")
@Permission(value="updateSurvey")
public final java.lang.Object updateSurvey(Bundle bundle, ServiceRequest request)
Update and persists the Survey from the given config specified by request-parameter as given by SurveyCreatorControllerConfiguration.getSurveyParameterName().

default: surveyName

NOTE: This task will fail if the Surveys are not fully compatible meaning its amount and question-types are fully identical. This task is only to override settings for the Survey and its AbstractQuestions.

Parameters:
bundle - the Bundle
request - the ServiceRequest
Returns:
a JAXB-able result-Object, precisely a SurveyCreatorControllerResult

removeSurvey

@Action(value="removeSurvey")
@Permission(value="removeSurvey")
public final java.lang.Object removeSurvey(Bundle bundle, ServiceRequest request)
Removes the Survey specified by request-parameter id from database. If request-parameter q = "q" the questionnaires associated with the Survey will be removed also.

Parameters:
bundle - the Bundle
request - the ServiceRequest
Returns:
a JAXB-able result-Object, precisely a SurveyCreatorControllerResult

removeQuestionnaire

@Action(value="removeQuestionnaire")
@Permission(value="removeQuestionnaire")
public final java.lang.Object removeQuestionnaire(Bundle bundle, ServiceRequest request)
Removes the Questionnaire specified by request-parameter idfrom database.

Parameters:
bundle - the Bundle
request - the ServiceRequest
Returns:
a JAXB-able result-Object, precisely a SurveyCreatorControllerResult

initialize

public final void initialize(SurveyCreatorControllerConfiguration conf)
Initialises the SurveyCreatorController with the given Configuration.

Specified by:
initialize in interface Configurable<SurveyCreatorControllerConfiguration>
Parameters:
conf - the Configuration