[gee-svn] SF.net SVN: gabel: [114] trunk/gee/war
Status: Alpha
Brought to you by:
alllee
|
From: <al...@us...> - 2006-02-26 23:00:27
|
Revision: 114 Author: alllee Date: 2006-02-26 15:00:21 -0800 (Sun, 26 Feb 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=114&view=rev Log Message: ----------- When validation fails, StartExperiment's action methods don't get invoked so getConsentForm() has to lazily initialize StartExperiment.consentForm - another problem right now is that StartExperiment is registered to be validated whenever it gets touched, this should be more specifically targeted at just the start() method in StartExperiment; right now spurious validation happens when you hit StartExperiment.prepare... Modified Paths: -------------- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentService.java trunk/gee/war/WEB-INF/classes/xwork.xml trunk/gee/war/getConsent.jsp Removed Paths: ------------- trunk/gee/src/java/edu/indiana/psych/gee/action/PrepareConsentForm.properties Deleted: trunk/gee/src/java/edu/indiana/psych/gee/action/PrepareConsentForm.properties =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/PrepareConsentForm.properties 2006-02-26 22:23:29 UTC (rev 113) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/PrepareConsentForm.properties 2006-02-26 23:00:21 UTC (rev 114) @@ -1,2 +0,0 @@ -approval.date = Approval Date: {0, date, MMMMMMMMM dd, yyyy} -approval.expiration.date = Expires: {0, date, MMMMMMMMM dd, yyyy} Modified: trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java 2006-02-26 22:23:29 UTC (rev 113) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java 2006-02-26 23:00:21 UTC (rev 114) @@ -21,15 +21,17 @@ private String message; public String prepare() { - consentForm = getExperiment().getConsentForm(); return SUCCESS; } public String start() { - // FIXME: start up on a new port if it's already running? - prepare(); - getExperiment().start(); - return SUCCESS; + if ( getExperimentService().start(experimentName) ) { + return SUCCESS; + } + else { + // denote some useful message? + return ERROR; + } } public String getMessage() { @@ -41,6 +43,9 @@ } public ConsentForm getConsentForm() { + if (consentForm == null) { + consentForm = getExperiment().getConsentForm(); + } return consentForm; } Modified: trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentService.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentService.java 2006-02-26 22:23:29 UTC (rev 113) +++ trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentService.java 2006-02-26 23:00:21 UTC (rev 114) @@ -39,6 +39,15 @@ } } + public boolean start(String experimentName) { + find(experimentName).start(); + return available(experimentName); + } + + public boolean available(String experimentName) { + return allExperiments.containsKey(experimentName); + } + public void add(Experiment experiment) { if (experiment == null) { throw new IllegalArgumentException("Trying to add a null experiment to the experiment service"); Modified: trunk/gee/war/WEB-INF/classes/xwork.xml =================================================================== --- trunk/gee/war/WEB-INF/classes/xwork.xml 2006-02-26 22:23:29 UTC (rev 113) +++ trunk/gee/war/WEB-INF/classes/xwork.xml 2006-02-26 23:00:21 UTC (rev 114) @@ -26,13 +26,11 @@ </action> <action name="start" class="edu.indiana.psych.gee.action.StartExperiment" method="start"> <result name="success">startExperiment.jsp</result> - <result name="error">error.jsp</result> <result name="input">getConsent.jsp</result> </action> <action name="consent" class="edu.indiana.psych.gee.action.StartExperiment" method="prepare"> <result name="success">getConsent.jsp</result> <result name="input">getConsent.jsp</result> - <result name="error">error.jsp</result> </action> <action name='contact'> <result>contact.jsp</result> @@ -46,7 +44,7 @@ </action> <action name="configure" class="edu.indiana.psych.gee.action.AdminAction" method="configure"> - <result name="error" type="chain">configure</result> + <result name="error">index.action</result> <result name="success">configureExperiment.jsp</result> </action> <action name="list" class="edu.indiana.psych.gee.action.AdminAction" @@ -69,4 +67,4 @@ </action> </package> -</xwork> \ No newline at end of file +</xwork> Modified: trunk/gee/war/getConsent.jsp =================================================================== --- trunk/gee/war/getConsent.jsp 2006-02-26 22:23:29 UTC (rev 113) +++ trunk/gee/war/getConsent.jsp 2006-02-26 23:00:21 UTC (rev 114) @@ -133,12 +133,12 @@ understand the information presented above. I agree to participate in this study.</p> <ww:form action='start'> -<ww:textfield label="Name" name="participantName" required="true" /> -<ww:select label="Age" name="participantAge" required="true" - list="#{'17':'Under 18', '18':'18-24', '25':'25-36', '37':'37-55', '55':'Over 55'}" - value="17"/> -<ww:submit label="Begin the experiment!" value='Begin the experiment!' /> -<ww:hidden name="experimentName" /> + <ww:textfield label="Name" name="participantName" required="true" /> + <ww:select label="Age" name="participantAge" required="true" + list="#{'17':'Under 18', '18':'18-24', '25':'25-36', '37':'37-55', '55':'Over 55'}" + value="18"/> + <ww:submit align="center" value='Begin the experiment!' /> + <ww:hidden name="experimentName" /> </ww:form> <hr /> <small> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |