Thread: [gee-svn] SF.net SVN: gabel: [109] trunk/gee/war
Status: Alpha
Brought to you by:
alllee
|
From: <al...@us...> - 2006-02-26 19:03:43
|
Revision: 109 Author: alllee Date: 2006-02-26 11:03:39 -0800 (Sun, 26 Feb 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=109&view=rev Log Message: ----------- minor presentation changes to CSS (more contrast for highlight css class and testing SVN date keyword replacement - currently seems a little more verbose than it needs to be) Modified Paths: -------------- trunk/gee/war/css/gee.css trunk/gee/war/index.jsp Modified: trunk/gee/war/css/gee.css =================================================================== --- trunk/gee/war/css/gee.css 2006-02-26 18:39:18 UTC (rev 108) +++ trunk/gee/war/css/gee.css 2006-02-26 19:03:39 UTC (rev 109) @@ -80,7 +80,7 @@ .highlight { - color: #D19275; + color: #8B2500; font-family: arial, helvetica, sans-serif; font-weight: bolder; background-color: #DBDBDB; Modified: trunk/gee/war/index.jsp =================================================================== --- trunk/gee/war/index.jsp 2006-02-26 18:39:18 UTC (rev 108) +++ trunk/gee/war/index.jsp 2006-02-26 19:03:39 UTC (rev 109) @@ -1,7 +1,7 @@ <%@ taglib prefix="ww" uri="webwork" %> <head> -<meta name="lastModifiedDate" content="$Date$"/> +<meta name="lastModifiedDate" content="$Date: 2006-02-02 18:17:26$"/> </head> <TABLE BGCOLOR="#A4B5C5" CELLPADDING="4" CELLSPACING="0" WIDTH="100%" BORDER="0"> @@ -30,14 +30,15 @@ with a mind of its own. <p> -We are currently studying several collective phenomena. In <b>Forager</b>, we -are interested in how people search their environment for resources when a -large part of their environment consists of other people competing for the -same resources. In <b> Group Path Formation </b> we are interested in the -kinds of path systems that develop when people are motivated to take advantage -of the trails left by others. In <b> Innovation Dissemination</b> we explore -how innovative ideas diffuse within a group of participants, each of whom is -individually trying to find the best solution to a problem that they can. Our +We are currently studying several collective phenomena. In +<span class="highlight">Forager</span>, we are interested in how people search +their environment for resources when a large part of their environment +consists of other people competing for the same resources. In <span class="highlight"> Group Path +Formation </span> we are interested in the kinds of path systems that develop +when people are motivated to take advantage of the trails left by others. In +<span class="highlight"> Innovation Dissemination</span> we explore how innovative ideas diffuse +within a group of participants, each of whom is individually trying to find +the best solution to a problem that they can. Our typical research cycle is to first observe group behavior, and then develop <A HREF="http://www.econ.iastate.edu/tesfatsi/ace.htm"> agent-based computational models </A> of the behavior we observe. One fortuitous @@ -51,19 +52,18 @@ virtual partners in an experiment. <p> -These experiments require that you have Java 1.4 or later installed on your -machine. Windows/Linux users can download the JDK from <a -href='http://java.sun.com/j2se/index.jsp'>Sun's web site</a>, Apple users can find the latest JDK -via SoftwareUpdate. Thank you for trying our experiments! -<p> +These experiments require that you have Java 1.5 installed on your machine. +Windows/Linux users can download the JDK from <a +href='http://java.sun.com/j2se/index.jsp'>Sun's web site</a>, Apple users can +find the latest JDK via SoftwareUpdate. Thank you for trying our experiments! - <P> - <B>Current Experiments</B><BR> - <%-- iterate through ListExperiments experiments property and emit its description and link --%> +<P> +<B>Current Experiments</B><BR> <div id="scrollingTableWrapper"> <table> <tbody style="padding: 10px;"> <tr> +<%-- iterate through ListExperiments experiments property and emit its description and link --%> <ww:iterator value="experiments" status="rowStatus" id="experiment"> <ww:if test="#rowStatus.odd == true"> <tr class="displayodd"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <al...@us...> - 2006-02-26 22:02:57
|
Revision: 112 Author: alllee Date: 2006-02-26 14:02:44 -0800 (Sun, 26 Feb 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=112&view=rev Log Message: ----------- fixed consent form validation bug where submitting invalid data to the consent form would cause the form to reappear with null IRB approval dates. Modified Paths: -------------- trunk/gee/src/java/edu/indiana/psych/gee/Experiment.java trunk/gee/src/java/edu/indiana/psych/gee/action/AdminAction.java trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java trunk/gee/war/WEB-INF/classes/xwork.xml trunk/gee/war/getConsent.jsp trunk/gee/war/includes/footer.jsp trunk/gee/war/index.jsp Added Paths: ----------- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.properties Modified: trunk/gee/src/java/edu/indiana/psych/gee/Experiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/Experiment.java 2006-02-26 19:20:49 UTC (rev 111) +++ trunk/gee/src/java/edu/indiana/psych/gee/Experiment.java 2006-02-26 22:02:44 UTC (rev 112) @@ -14,7 +14,6 @@ public interface Experiment { - public static final Experiment NULL = new Experiment() { private final Log logger = LogFactory.getLog(getClass()); public void start() { Modified: trunk/gee/src/java/edu/indiana/psych/gee/action/AdminAction.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/AdminAction.java 2006-02-26 19:20:49 UTC (rev 111) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/AdminAction.java 2006-02-26 22:02:44 UTC (rev 112) @@ -16,6 +16,7 @@ private Set<Experiment> experiments; + private Experiment experiment; private String experimentName; public String authenticate() { @@ -23,20 +24,20 @@ return SUCCESS; } - public String execute() { - // load experiments and various pieces of configuration information? - + public String configure() { + // load experiment and various pieces of configuration information? + this.experiment = getExperiment(experimentName); return SUCCESS; } public String start() { getLogger().debug("Starting: " + experimentName); - getExperimentService().find(experimentName).start(); + getExperiment(experimentName).start(); return SUCCESS; } public String stop() { - Experiment experiment = getExperimentService().find(experimentName); + Experiment experiment = getExperiment(experimentName); getLogger().debug("Stopping: " + experimentName + ": " + experiment); experiment.stop(); return SUCCESS; @@ -58,10 +59,17 @@ return experiments; } + public Experiment getExperiment() { + return experiment; + } public void setExperimentName(String experimentName) { this.experimentName = experimentName; } + + private Experiment getExperiment(String experimentName) { + return getExperimentService().find(experimentName); + } } /* * $Log$ 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 19:20:49 UTC (rev 111) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java 2006-02-26 22:02:44 UTC (rev 112) @@ -1,5 +1,6 @@ package edu.indiana.psych.gee.action; +import edu.indiana.psych.gee.ConsentForm; import edu.indiana.psych.gee.Experiment; /** @@ -13,15 +14,14 @@ public class StartExperiment extends GeeAction { private String experimentName; - private Experiment experiment; private int participantAge; private String participantName; - + private ConsentForm consentForm; private String message; public String execute() { - experiment = getExperimentService().find(experimentName); + Experiment experiment = getExperiment(); if (experiment == Experiment.NULL) { // FIXME: this String does not belong here at all, should be // presentation-layer. Could provide a list and link of possible @@ -39,10 +39,20 @@ } public Experiment getExperiment() { - return experiment; + return getExperimentService().find(experimentName); } + public ConsentForm getConsentForm() { + if (consentForm == null) { + consentForm = getExperiment().getConsentForm(); + } + return consentForm; + } + public String getExperimentName() { + return experimentName; + } + public void setExperimentName(String experimentName) { this.experimentName = experimentName; } Added: trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.properties =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.properties (rev 0) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.properties 2006-02-26 22:02:44 UTC (rev 112) @@ -0,0 +1,2 @@ +approval.date = Approval Date: {0, date, MMMMMMMMM dd, yyyy} +approval.expiration.date = Expires: {0, date, MMMMMMMMM dd, yyyy} Modified: trunk/gee/war/WEB-INF/classes/xwork.xml =================================================================== --- trunk/gee/war/WEB-INF/classes/xwork.xml 2006-02-26 19:20:49 UTC (rev 111) +++ trunk/gee/war/WEB-INF/classes/xwork.xml 2006-02-26 22:02:44 UTC (rev 112) @@ -26,7 +26,7 @@ <action name="start" class="edu.indiana.psych.gee.action.StartExperiment"> <result name="success">startExperiment.jsp</result> <result name="error">error.jsp</result> - <result name="input" type="chain">consent</result> + <result name="input">getConsent.jsp</result> </action> <action name="consent" class="edu.indiana.psych.gee.action.PrepareConsentForm"> <result name="success">getConsent.jsp</result> @@ -42,7 +42,8 @@ <result name="success" type="freemarker">listExperiments.jsp</result> <result name="error">error.jsp</result> </action> - <action name="configure" class="edu.indiana.psych.gee.action.AdminAction" method="execute"> + <action name="configure" class="edu.indiana.psych.gee.action.AdminAction" method="configure"> + <result name="error" type="chain">configure</result> <result name="success">configureExperiment.jsp</result> </action> <action name="list" class="edu.indiana.psych.gee.action.AdminAction" method="listExperiments"> Modified: trunk/gee/war/getConsent.jsp =================================================================== --- trunk/gee/war/getConsent.jsp 2006-02-26 19:20:49 UTC (rev 111) +++ trunk/gee/war/getConsent.jsp 2006-02-26 22:02:44 UTC (rev 112) @@ -144,7 +144,7 @@ <small> IRB Approved <br/> -<%-- FIXME: use ConsentForm's dates --%> +<%-- FIXME: date approved is not getting reset appropriately after invalid input --%> <ww:text name="approval.date"> <ww:param name="value" value="consentForm.irbDateApproved"/> </ww:text> Modified: trunk/gee/war/includes/footer.jsp =================================================================== --- trunk/gee/war/includes/footer.jsp 2006-02-26 19:20:49 UTC (rev 111) +++ trunk/gee/war/includes/footer.jsp 2006-02-26 22:02:44 UTC (rev 112) @@ -1,22 +1,22 @@ <hr/> <table> <tr> -<td colspan="2"> -<small> -<A HREF="http://cognitrn.psych.indiana.edu/">Sponsored by the Percepts and Concepts Laboratory </A> -</small> -</td> + <td colspan="2"> + <small> + <a href="http://sourceforge.net/projects/gabel">Source code repository, mailing lists, and other development infrastructure miscellany provided by SourceForge.</a> + </small> + </td> </tr> <tr> -<td colspan="2"> -<small> -<a href="http://sourceforge.net/projects/gabel">Source code repository, mailing lists, and other development infrastructure miscellany provided by SourceForge.</a> -</small> -</td> + <td colspan="2"> + <small> + <A HREF="http://cognitrn.psych.indiana.edu/">Sponsored by the Percepts and Concepts Laboratory </A> + </small> + </td> </tr> <tr> <td> -<small>Last modified: <decorator:getProperty property="meta.lastModifiedDate" default="$Date$"/> </small> +<font size="-2">Last modified: <decorator:getProperty property="meta.lastModifiedDate" default="$Date$"/> </font> </td> <td align="right"> <a href="http://sourceforge.net"><img src="http://sflogo.sourceforge.net/sflogo.php?group_id=104532&type=1" width="88" height="31" border="0" alt="SourceForge.net Logo" /></a> Modified: trunk/gee/war/index.jsp =================================================================== --- trunk/gee/war/index.jsp 2006-02-26 19:20:49 UTC (rev 111) +++ trunk/gee/war/index.jsp 2006-02-26 22:02:44 UTC (rev 112) @@ -1,7 +1,6 @@ <%@ taglib prefix="ww" uri="webwork" %> <head> -<meta name="svnId" content="$Id$"/> <meta name="lastModifiedDate" content="$Date$"/> </head> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
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. |
|
From: <al...@us...> - 2006-02-27 09:17:55
|
Revision: 115 Author: alllee Date: 2006-02-27 01:17:44 -0800 (Mon, 27 Feb 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=115&view=rev Log Message: ----------- updating webwork jar, encountering weird bug where the freemarker configureExperiments page isn't reflecting its latest changes for some reason... Modified Paths: -------------- trunk/gee/src/java/edu/indiana/psych/gee/action/AdminAction.java trunk/gee/war/WEB-INF/classes/xwork.xml trunk/gee/war/WEB-INF/lib/webwork.jar trunk/gee/war/admin/listExperiments.jsp Added Paths: ----------- trunk/gee/war/admin/configureExperiments.jsp Removed Paths: ------------- trunk/gee/war/admin.jsp Modified: trunk/gee/src/java/edu/indiana/psych/gee/action/AdminAction.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/AdminAction.java 2006-02-26 23:00:21 UTC (rev 114) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/AdminAction.java 2006-02-27 09:17:44 UTC (rev 115) @@ -26,18 +26,17 @@ public String configure() { // load experiment and various pieces of configuration information? - this.experiment = getExperiment(experimentName); return SUCCESS; } public String start() { getLogger().debug("Starting: " + experimentName); - getExperiment(experimentName).start(); + getExperiment().start(); return SUCCESS; } public String stop() { - Experiment experiment = getExperiment(experimentName); + Experiment experiment = getExperiment(); getLogger().debug("Stopping: " + experimentName + ": " + experiment); experiment.stop(); return SUCCESS; @@ -60,6 +59,9 @@ } public Experiment getExperiment() { + if (experiment == null) { + experiment = getExperimentService().find(experimentName); + } return experiment; } @@ -67,9 +69,6 @@ this.experimentName = experimentName; } - private Experiment getExperiment(String experimentName) { - return getExperimentService().find(experimentName); - } } /* * $Log$ Modified: trunk/gee/war/WEB-INF/classes/xwork.xml =================================================================== --- trunk/gee/war/WEB-INF/classes/xwork.xml 2006-02-26 23:00:21 UTC (rev 114) +++ trunk/gee/war/WEB-INF/classes/xwork.xml 2006-02-27 09:17:44 UTC (rev 115) @@ -44,8 +44,7 @@ </action> <action name="configure" class="edu.indiana.psych.gee.action.AdminAction" method="configure"> - <result name="error">index.action</result> - <result name="success">configureExperiment.jsp</result> + <result type="freemarker">configureExperiment.jsp</result> </action> <action name="list" class="edu.indiana.psych.gee.action.AdminAction" method="listExperiments"> Modified: trunk/gee/war/WEB-INF/lib/webwork.jar =================================================================== (Binary files differ) Added: trunk/gee/war/admin/configureExperiments.jsp =================================================================== --- trunk/gee/war/admin/configureExperiments.jsp (rev 0) +++ trunk/gee/war/admin/configureExperiments.jsp 2006-02-27 09:17:44 UTC (rev 115) @@ -0,0 +1,16 @@ +<head> +<meta name="lastModifiedDate" content="$Date: 2006-02-23 13:12:23 -0500 (Thu, 23 Feb 2006) $"/> +<title>Configuring [ ${experiment.name} ]</title> +</head> +<body> +<p> +Configuring the <span class="highlight">${experiment.name}</span> experiment: +</p> +<@ww.form action="updateExperimentConfiguration"> + <@ww.textfield label="Server port" name="experiment.serverPort"/> + <@ww.textfield label="Name" name="experiment.name"/> + <@ww.textfield label="Server Address" name="experiment.configuration.serverAddress"/> + <@ww.textfield label="Description" name="experiment.description"/> + <@ww.submit value="Submit"/> +</@ww.form> +</body> Modified: trunk/gee/war/admin/listExperiments.jsp =================================================================== --- trunk/gee/war/admin/listExperiments.jsp 2006-02-26 23:00:21 UTC (rev 114) +++ trunk/gee/war/admin/listExperiments.jsp 2006-02-27 09:17:44 UTC (rev 115) @@ -20,11 +20,10 @@ Start</a> | <a href='<@ww.url action="stop" experimentName="${experiment.name}" />'> Stop</a> - | <a href='<@ww.url action="edit" experimentName="${experiment.name}" />'> + | <a href='<@ww.url action="configure" experimentName="${experiment.name}" />'> Edit</a> ) </td> </tr> </#list> </table> </body> -</html> Deleted: trunk/gee/war/admin.jsp =================================================================== --- trunk/gee/war/admin.jsp 2006-02-26 23:00:21 UTC (rev 114) +++ trunk/gee/war/admin.jsp 2006-02-27 09:17:44 UTC (rev 115) @@ -1,21 +0,0 @@ -<!-- -vim:sts=2:sw=2: ---> -<%@ taglib prefix="ww" uri="webwork" %> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> -<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> - <head> - <LINK REL="stylesheet" HREF="/gee/css/gee.css" TYPE="text/css"/> - <title> </title> - </head> - <body> - <span style="float:left"> - <a href="http://validator.w3.org/check/referer"> - <img border="0" src="http://www.w3.org/Icons/valid-html40" alt="Valid HTML 4.0!" height="31" width="88"/> - </a> - <a href="http://jigsaw.w3.org/css-validator/"> - <img style="border:0;width:88px;height:31px" src="http://jigsaw.w3.org/css-validator/images/vcss" alt="Valid CSS!"/> - </a> - </span> - </body> -</html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <al...@us...> - 2006-02-28 01:47:26
|
Revision: 118 Author: alllee Date: 2006-02-27 17:47:08 -0800 (Mon, 27 Feb 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=118&view=rev Log Message: ----------- lots of hygiene. WebWork 2.2.1 release fixed a bunch of loosely interpretable things that I was loosely interpreting (read: doing wrong). Had to change ui.theme to ajax, no matter what I did it was failing to find tree.ftl when using the xhtml theme. Modified Paths: -------------- trunk/gee/war/WEB-INF/applicationContext.xml trunk/gee/war/WEB-INF/classes/webwork.properties trunk/gee/war/WEB-INF/classes/xwork.xml trunk/gee/war/WEB-INF/lib/webwork.jar trunk/gee/war/WEB-INF/lib/xwork.jar trunk/gee/war/WEB-INF/web.xml trunk/gee/war/getConsent.jsp trunk/gee/war/template.jsp Modified: trunk/gee/war/WEB-INF/applicationContext.xml =================================================================== --- trunk/gee/war/WEB-INF/applicationContext.xml 2006-02-27 20:50:49 UTC (rev 117) +++ trunk/gee/war/WEB-INF/applicationContext.xml 2006-02-28 01:47:08 UTC (rev 118) @@ -1,53 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN//EN" "http://www.springframework.org/dtd/spring-beans.dtd"> <beans default-autowire="autodetect"> - <!-- MySQL Connection, we may not need any of this stuff.--> - <bean id="mysqlDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> - <property name="driverClassName"><value>com.mysql.jdbc.Driver</value></property> - <property name="url"> - <value>jdbc:mysql://127.0.0.1:3306/gee</value> - </property> - <property name="username"><value></value></property> - <property name="password"><value></value></property> - </bean> - <!-- hibernate session factory --> - <bean id="hibernateSessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> - <property name='configLocation'> - <value>WEB-INF/hibernate-session-factory-config.xml</value> - </property> - <property name='configurationClass'> - <value>org.hibernate.cfg.AnnotationConfiguration</value> - </property> - <property name="hibernateProperties"> - <props> - <prop key="hibernate.cglib.use_reflection_optimizer">false</prop> - <prop key="hibernate.dialect">org.hibernate.dialect.MySQLDialect</prop> - <prop key="hibernate.show_sql">true</prop> - </props> - </property> - <property name="dataSource"> - <ref bean="mysqlDataSource"/> - </property> - </bean> - <bean id="hibernateTransactionManager" - class="org.springframework.orm.hibernate3.HibernateTransactionManager"> - <property name="sessionFactory"> - <ref local="hibernateSessionFactory"/> - </property> - </bean> - <!-- DAO and Service beans --> - <!-- - XXX: may not need any of this. - database-wise we only need to keep track of participants and users - (roles: experiment creator, technician, administrator). Maybe in the - future we will want to deal with persisting experiment data in the DB? - - <bean id="userDao" class="edu.indiana.psych.gee.persistence.UserDaoImpl"> - <property name="sessionFactory"><ref local="hibernateSessionFactory"/></property> - </bean> - <bean id="participantDao" class="edu.indiana.psych.gee.persistence.ParticipantDaoImpl"> - <property name="sessionFactory"><ref local="hibernateSessionFactory"/></property> - </bean> - --> <bean id="experimentService" class="edu.indiana.psych.gee.service.ExperimentService"/> </beans> Modified: trunk/gee/war/WEB-INF/classes/webwork.properties =================================================================== --- trunk/gee/war/WEB-INF/classes/webwork.properties 2006-02-27 20:50:49 UTC (rev 117) +++ trunk/gee/war/WEB-INF/classes/webwork.properties 2006-02-28 01:47:08 UTC (rev 118) @@ -1,2 +1,4 @@ -webwork.objectFactory = spring -webwork.devMode = true \ No newline at end of file +webwork.objectFactory=spring +webwork.devMode=true + +webwork.ui.theme=ajax Modified: trunk/gee/war/WEB-INF/classes/xwork.xml =================================================================== --- trunk/gee/war/WEB-INF/classes/xwork.xml 2006-02-27 20:50:49 UTC (rev 117) +++ trunk/gee/war/WEB-INF/classes/xwork.xml 2006-02-28 01:47:08 UTC (rev 118) @@ -4,37 +4,31 @@ <xwork> <include file="webwork-default.xml"/> - <!-- + <!-- FIXME: cannot find the following <include file="config-browser.xml"/> - - <include file="xwork-continuations.xml"/> - - <include file="xwork-tags.xml"/> - - <include file="xwork-validation.xml" /> - + <include file="xwork-validation.xml" /> <include file="xwork-actionchaining.xml" /> - <include file="xwork-ajax.xml" /> + <include file="xwork-continuations.xml"/> + <include file="xwork-tags.xml"/> --> <package name="default" extends="webwork-default"> <default-interceptor-ref name="defaultStack"/> <!-- the start page lists all available experiments --> <action name="index" class="edu.indiana.psych.gee.action.ListExperiments"> - <result>index.jsp</result> + <result name="success">index.jsp</result> </action> <action name="start" class="edu.indiana.psych.gee.action.StartExperiment" method="start"> <result name="success">startExperiment.jsp</result> <result name="input">getConsent.jsp</result> </action> <action name="consent" class="edu.indiana.psych.gee.action.StartExperiment" method="prepare"> + <!-- FIXME: make sure the stack doesn't validate --> + <interceptor-ref name="basicStack"/> <result name="success">getConsent.jsp</result> <result name="input">getConsent.jsp</result> </action> - <action name='contact'> - <result>contact.jsp</result> - </action> </package> <package name="admin" extends="default" namespace="/admin"> <action name="index" class="edu.indiana.psych.gee.action.AdminAction" @@ -44,7 +38,7 @@ </action> <action name="configure" class="edu.indiana.psych.gee.action.AdminAction" method="configure"> - <result type="freemarker">configureExperiment.jsp</result> + <result name="success" type="freemarker">configureExperiment.jsp</result> </action> <action name="list" class="edu.indiana.psych.gee.action.AdminAction" method="listExperiments"> @@ -53,16 +47,16 @@ </action> <action name="create" class="edu.indiana.psych.gee.action.AdminAction" method="createExperiment"> - <result type="redirect">listExperiments.jsp</result> + <result name="success" type="redirect">listExperiments.jsp</result> <result name="input">createExperiment.jsp</result> </action> <action name="start" class="edu.indiana.psych.gee.action.AdminAction" method="start"> - <result type="freemarker">listExperiments.jsp</result> + <result name="success" type="freemarker">listExperiments.jsp</result> </action> <action name="stop" class="edu.indiana.psych.gee.action.AdminAction" method="stop"> - <result type="freemarker">listExperiments.jsp</result> + <result name="success" type="freemarker">listExperiments.jsp</result> </action> </package> Modified: trunk/gee/war/WEB-INF/lib/webwork.jar =================================================================== (Binary files differ) Modified: trunk/gee/war/WEB-INF/lib/xwork.jar =================================================================== (Binary files differ) Modified: trunk/gee/war/WEB-INF/web.xml =================================================================== --- trunk/gee/war/WEB-INF/web.xml 2006-02-27 20:50:49 UTC (rev 117) +++ trunk/gee/war/WEB-INF/web.xml 2006-02-28 01:47:08 UTC (rev 118) @@ -8,20 +8,32 @@ </description> <filter> - <filter-name>webwork</filter-name> - <filter-class>com.opensymphony.webwork.dispatcher.FilterDispatcher</filter-class> + <filter-name>webwork-cleanup</filter-name> + <filter-class>com.opensymphony.webwork.dispatcher.ActionContextCleanUp</filter-class> </filter> - + <!-- <filter> <filter-name>sitemesh</filter-name> + <filter-class>com.opensymphony.webwork.sitemesh.FreeMarkerPageFilter</filter-class> + </filter> + --> + <filter> + <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> </filter> + <filter> + <filter-name>webwork</filter-name> + <filter-class>com.opensymphony.webwork.dispatcher.FilterDispatcher</filter-class> + </filter> <filter-mapping> + <filter-name>webwork-cleanup</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + <filter-mapping> <filter-name>sitemesh</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> - <filter-mapping> <filter-name>webwork</filter-name> <url-pattern>/*</url-pattern> @@ -37,6 +49,6 @@ <taglib> <taglib-uri>webwork</taglib-uri> - <taglib-location>/WEB-INF/lib/webwork-2.2.jar</taglib-location> + <taglib-location>/WEB-INF/webwork.tld</taglib-location> </taglib> </web-app> Modified: trunk/gee/war/getConsent.jsp =================================================================== --- trunk/gee/war/getConsent.jsp 2006-02-27 20:50:49 UTC (rev 117) +++ trunk/gee/war/getConsent.jsp 2006-02-28 01:47:08 UTC (rev 118) @@ -146,11 +146,11 @@ <br/> <%-- FIXME: date approved is not getting reset appropriately after invalid input --%> <ww:text name="approval.date"> - <ww:param name="value" value="consentForm.irbDateApproved"/> + <ww:param name="value" value="%{consentForm.irbDateApproved}"/> </ww:text> <br/> <ww:text name="approval.expiration.date"> - <ww:param name="value" value="consentForm.irbDateApprovalExpires"/> + <ww:param name="value" value="%{consentForm.irbDateApprovalExpires}"/> </ww:text> </small> Modified: trunk/gee/war/template.jsp =================================================================== --- trunk/gee/war/template.jsp 2006-02-27 20:50:49 UTC (rev 117) +++ trunk/gee/war/template.jsp 2006-02-28 01:47:08 UTC (rev 118) @@ -1,7 +1,6 @@ <!-- vim:sts=2:sw=2: --> -<%@ taglib uri="webwork" prefix="ww"%> <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %> <%@ include file="/includes/cache.jsp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <al...@us...> - 2006-02-28 04:34:19
|
Revision: 121 Author: alllee Date: 2006-02-27 20:34:13 -0800 (Mon, 27 Feb 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=121&view=rev Log Message: ----------- presentation level changes, getting ajax theme to work with client-side validation, via dwr. Modified Paths: -------------- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment-validation.xml trunk/gee/war/WEB-INF/classes/xwork.xml trunk/gee/war/WEB-INF/web.xml trunk/gee/war/css/gee.css trunk/gee/war/getConsent.jsp trunk/gee/war/template.jsp Modified: trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment-validation.xml =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment-validation.xml 2006-02-28 02:52:37 UTC (rev 120) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment-validation.xml 2006-02-28 04:34:13 UTC (rev 121) @@ -12,7 +12,7 @@ <field name="participantAge"> <field-validator type="int"> <param name="min">18</param> - <message>You must be 18 or older to participate.</message> + <message>You must be 18 or older.</message> </field-validator> </field> Modified: trunk/gee/war/WEB-INF/classes/xwork.xml =================================================================== --- trunk/gee/war/WEB-INF/classes/xwork.xml 2006-02-28 02:52:37 UTC (rev 120) +++ trunk/gee/war/WEB-INF/classes/xwork.xml 2006-02-28 04:34:13 UTC (rev 121) @@ -1,10 +1,11 @@ -<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN" - "http://www.opensymphony.com/xwork/xwork-1.1.dtd"> - +<?xml version="1.0"?> +<!-- +vim:sts=2:sw=2: +--> +<!DOCTYPE xwork PUBLIC "-//OpenSymphony Group//XWork 1.0//EN" "http://www.opensymphony.com/xwork/xwork-1.1.dtd"> <xwork> - <include file="webwork-default.xml"/> - - <!-- FIXME: cannot find the following + <include file="webwork-default.xml"/> +<!-- FIXME: cannot find the following <include file="config-browser.xml"/> <include file="xwork-validation.xml" /> <include file="xwork-actionchaining.xml" /> @@ -12,52 +13,44 @@ <include file="xwork-continuations.xml"/> <include file="xwork-tags.xml"/> --> - - <package name="default" extends="webwork-default"> - <default-interceptor-ref name="defaultStack"/> - <!-- the start page lists all available experiments --> - <action name="index" class="edu.indiana.psych.gee.action.ListExperiments"> - <result name="success">index.jsp</result> - </action> - <action name="start" class="edu.indiana.psych.gee.action.StartExperiment" method="start"> - <result name="success">startExperiment.jsp</result> - <result name="input">getConsent.jsp</result> - </action> - <action name="consent" class="edu.indiana.psych.gee.action.StartExperiment" method="prepare"> - <!-- FIXME: make sure the stack doesn't validate --> - <interceptor-ref name="basicStack"/> - <result name="success">getConsent.jsp</result> - <result name="input">getConsent.jsp</result> - </action> - </package> - <package name="admin" extends="default" namespace="/admin"> - <action name="index" class="edu.indiana.psych.gee.action.AdminAction" - method="authenticate"> - <result name="success" type="freemarker">listExperiments.jsp</result> - <result name="error">error.jsp</result> - </action> - <action name="configure" class="edu.indiana.psych.gee.action.AdminAction" - method="configure"> - <result name="success" type="freemarker">configureExperiment.jsp</result> - </action> - <action name="list" class="edu.indiana.psych.gee.action.AdminAction" - method="listExperiments"> - <result name="success" type="freemarker">listExperiments.jsp</result> - <result name="error">error.jsp</result> - </action> - <action name="create" class="edu.indiana.psych.gee.action.AdminAction" - method="createExperiment"> - <result name="success" type="redirect">listExperiments.jsp</result> - <result name="input">createExperiment.jsp</result> - </action> - <action name="start" class="edu.indiana.psych.gee.action.AdminAction" - method="start"> - <result name="success" type="freemarker">listExperiments.jsp</result> - </action> - <action name="stop" class="edu.indiana.psych.gee.action.AdminAction" - method="stop"> - <result name="success" type="freemarker">listExperiments.jsp</result> - </action> - </package> - + <package name="default" extends="webwork-default"> + <default-interceptor-ref name="defaultStack"/> +<!-- the start page lists all available experiments --> + <action name="index" class="edu.indiana.psych.gee.action.ListExperiments"> + <result name="success">index.jsp</result> + </action> + <action name="start" class="edu.indiana.psych.gee.action.StartExperiment" method="start"> + <result name="success">startExperiment.jsp</result> + <result name="input">getConsent.jsp</result> + </action> + <action name="consent" class="edu.indiana.psych.gee.action.StartExperiment" method="prepare"> +<!-- FIXME: make sure the stack doesn't validate --> + <interceptor-ref name="basicStack"/> + <result name="success">getConsent.jsp</result> + <result name="input">getConsent.jsp</result> + </action> + </package> + <package name="admin" extends="default" namespace="/admin"> + <action name="index" class="edu.indiana.psych.gee.action.AdminAction" method="authenticate"> + <result name="success" type="freemarker">listExperiments.jsp</result> + <result name="error">error.jsp</result> + </action> + <action name="configure" class="edu.indiana.psych.gee.action.AdminAction" method="configure"> + <result name="success" type="freemarker">configureExperiment.jsp</result> + </action> + <action name="list" class="edu.indiana.psych.gee.action.AdminAction" method="listExperiments"> + <result name="success" type="freemarker">listExperiments.jsp</result> + <result name="error">error.jsp</result> + </action> + <action name="create" class="edu.indiana.psych.gee.action.AdminAction" method="createExperiment"> + <result name="success" type="redirect">listExperiments.jsp</result> + <result name="input">createExperiment.jsp</result> + </action> + <action name="start" class="edu.indiana.psych.gee.action.AdminAction" method="start"> + <result name="success" type="freemarker">listExperiments.jsp</result> + </action> + <action name="stop" class="edu.indiana.psych.gee.action.AdminAction" method="stop"> + <result name="success" type="freemarker">listExperiments.jsp</result> + </action> + </package> </xwork> Modified: trunk/gee/war/WEB-INF/web.xml =================================================================== --- trunk/gee/war/WEB-INF/web.xml 2006-02-28 02:52:37 UTC (rev 120) +++ trunk/gee/war/WEB-INF/web.xml 2006-02-28 04:34:13 UTC (rev 121) @@ -1,54 +1,60 @@ <?xml version="1.0" encoding="ISO-8859-1"?> +<!-- +vim:sts=2:sw=2: +--> <!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd"> <web-app> - <display-name>Percepts and Concepts Laboratory</display-name> - <description> + <display-name>Percepts and Concepts Laboratory</display-name> + <description> Group Experiments Environment, a framework for building online Java experiments. </description> - + <servlet> + <servlet-name>dwr</servlet-name> + <servlet-class>uk.ltd.getahead.dwr.DWRServlet</servlet-class> + </servlet> + <servlet-mapping> + <servlet-name>dwr</servlet-name> + <url-pattern>/dwr/*</url-pattern> + </servlet-mapping> + <filter> + <filter-name>webwork-cleanup</filter-name> + <filter-class>com.opensymphony.webwork.dispatcher.ActionContextCleanUp</filter-class> + </filter> +<!-- <filter> - <filter-name>webwork-cleanup</filter-name> - <filter-class>com.opensymphony.webwork.dispatcher.ActionContextCleanUp</filter-class> - </filter> - <!-- - <filter> <filter-name>sitemesh</filter-name> <filter-class>com.opensymphony.webwork.sitemesh.FreeMarkerPageFilter</filter-class> </filter> --> - <filter> - <filter-name>sitemesh</filter-name> - <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> - </filter> - <filter> - <filter-name>webwork</filter-name> - <filter-class>com.opensymphony.webwork.dispatcher.FilterDispatcher</filter-class> - </filter> - - <filter-mapping> - <filter-name>webwork-cleanup</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - <filter-mapping> - <filter-name>sitemesh</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - <filter-mapping> - <filter-name>webwork</filter-name> - <url-pattern>/*</url-pattern> - </filter-mapping> - - <listener> - <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> - </listener> - - <welcome-file-list> - <welcome-file>index.html</welcome-file> - </welcome-file-list> - - <taglib> - <taglib-uri>webwork</taglib-uri> - <taglib-location>/WEB-INF/webwork.tld</taglib-location> - </taglib> + <filter> + <filter-name>sitemesh</filter-name> + <filter-class>com.opensymphony.module.sitemesh.filter.PageFilter</filter-class> + </filter> + <filter> + <filter-name>webwork</filter-name> + <filter-class>com.opensymphony.webwork.dispatcher.FilterDispatcher</filter-class> + </filter> + <filter-mapping> + <filter-name>webwork-cleanup</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + <filter-mapping> + <filter-name>sitemesh</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + <filter-mapping> + <filter-name>webwork</filter-name> + <url-pattern>/*</url-pattern> + </filter-mapping> + <listener> + <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> + </listener> + <welcome-file-list> + <welcome-file>index.html</welcome-file> + </welcome-file-list> + <taglib> + <taglib-uri>webwork</taglib-uri> + <taglib-location>/WEB-INF/webwork.tld</taglib-location> + </taglib> </web-app> Modified: trunk/gee/war/css/gee.css =================================================================== --- trunk/gee/war/css/gee.css 2006-02-28 02:52:37 UTC (rev 120) +++ trunk/gee/war/css/gee.css 2006-02-28 04:34:13 UTC (rev 121) @@ -18,7 +18,7 @@ } #Content { - width:650px; + width:750px; margin:0px auto; text-align:left; padding:10px; Modified: trunk/gee/war/getConsent.jsp =================================================================== --- trunk/gee/war/getConsent.jsp 2006-02-28 02:52:37 UTC (rev 120) +++ trunk/gee/war/getConsent.jsp 2006-02-28 04:34:13 UTC (rev 121) @@ -16,9 +16,8 @@ <H3><ww:property value="experimentName"/> consent form</H3> </TD> <TD ALIGN="right" VALIGN="top" BGCOLOR="#A4B5C5" WIDTH="70%" style="white-space: nowrap;"> - <FONT SIZE="-2"> - Study #04-9064<br/> - Last Modified: <%= lastModifiedDate %></FONT> + <b>Study #04-9064</b><br/> + <small>Last Modified: <%= lastModifiedDate %></small> </TD> </TR> </TABLE> @@ -132,19 +131,18 @@ <p style="font-weight: bolder; background-color: #FFE303;">I have read and 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:form method="post" validate="true" action='start'> <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" /> + value="'18'"/> + <ww:textfield label="Name" name="participantName" required="true" /> + <ww:hidden name="experimentName"/> + <ww:submit/> </ww:form> <hr /> <small> IRB Approved <br/> -<%-- FIXME: date approved is not getting reset appropriately after invalid input --%> <ww:text name="approval.date"> <ww:param name="value" value="%{consentForm.irbDateApproved}"/> </ww:text> Modified: trunk/gee/war/template.jsp =================================================================== --- trunk/gee/war/template.jsp 2006-02-28 02:52:37 UTC (rev 120) +++ trunk/gee/war/template.jsp 2006-02-28 04:34:13 UTC (rev 121) @@ -1,11 +1,13 @@ <!-- vim:sts=2:sw=2: --> +<%@ taglib prefix="ww" uri="webwork" %> <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %> <%@ include file="/includes/cache.jsp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> + <ww:head theme="ajax"/> <LINK REL="stylesheet" HREF="/gee/css/gee.css" TYPE="text/css" /> <title><decorator:title default="Group Experiments Environment" /></title> <decorator:head /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <al...@us...> - 2006-03-01 17:06:03
|
Revision: 126 Author: alllee Date: 2006-03-01 09:05:55 -0800 (Wed, 01 Mar 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=126&view=rev Log Message: ----------- * adding cglib to WEB-INF lib directory to keep hibernate happy * moving <ww:head theme="ajax"> into the classes that need it only. Modified Paths: -------------- trunk/gee/war/admin/listExperiments.jsp trunk/gee/war/template.jsp Added Paths: ----------- trunk/gee/war/WEB-INF/lib/cglib.jar Added: trunk/gee/war/WEB-INF/lib/cglib.jar =================================================================== (Binary files differ) Property changes on: trunk/gee/war/WEB-INF/lib/cglib.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/gee/war/admin/listExperiments.jsp =================================================================== --- trunk/gee/war/admin/listExperiments.jsp 2006-03-01 05:14:24 UTC (rev 125) +++ trunk/gee/war/admin/listExperiments.jsp 2006-03-01 17:05:55 UTC (rev 126) @@ -1,5 +1,6 @@ <head> <meta name="lastModifiedDate" content="$Date$"/> +<@ww.head theme="ajax"/> <title>Experiment Statuses</title> </head> <body> Modified: trunk/gee/war/template.jsp =================================================================== --- trunk/gee/war/template.jsp 2006-03-01 05:14:24 UTC (rev 125) +++ trunk/gee/war/template.jsp 2006-03-01 17:05:55 UTC (rev 126) @@ -1,13 +1,11 @@ <!-- vim:sts=2:sw=2: --> -<%@ taglib prefix="ww" uri="webwork" %> <%@ taglib uri="http://www.opensymphony.com/sitemesh/decorator" prefix="decorator" %> <%@ include file="/includes/cache.jsp" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en"> <head> - <ww:head theme="ajax"/> <LINK REL="stylesheet" HREF="/gee/css/gee.css" TYPE="text/css" /> <title><decorator:title default="Group Experiments Environment" /></title> <decorator:head /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <al...@us...> - 2006-03-04 19:10:45
|
Revision: 138 Author: alllee Date: 2006-03-04 11:10:37 -0800 (Sat, 04 Mar 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=138&view=rev Log Message: ----------- webapp now starts up again at least. Modified Paths: -------------- trunk/gee/src/java/edu/indiana/psych/gee/ConsentForm.java trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.java trunk/gee/src/java/edu/indiana/psych/gee/ExperimentParametersEntity.java trunk/gee/src/java/edu/indiana/psych/gee/ExperimentRoundParameters.java trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.java trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java trunk/gee/war/startExperiment.jsp Added Paths: ----------- trunk/gee/war/WEB-INF/lib/asm.jar Modified: trunk/gee/src/java/edu/indiana/psych/gee/ConsentForm.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/ConsentForm.java 2006-03-04 18:55:18 UTC (rev 137) +++ trunk/gee/src/java/edu/indiana/psych/gee/ConsentForm.java 2006-03-04 19:10:37 UTC (rev 138) @@ -7,6 +7,7 @@ import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Table; +import javax.persistence.*; /** * $Id$ @@ -77,12 +78,14 @@ public void setDescription(String description) { this.description = description; } + @Transient public Date getIrbDateApprovalExpires() { Calendar calendar = Calendar.getInstance(); calendar.setTime(getIrbDateApproved()); calendar.add(Calendar.DAY_OF_MONTH, 364); return calendar.getTime(); } + @Temporal(TemporalType.DATE) public Date getIrbDateApproved() { if (irbDateApproved == null || isToday(irbDateApproved)) { Calendar calendar = Calendar.getInstance(); @@ -91,6 +94,11 @@ } return irbDateApproved; } + + public void setIrbDateApproved(Date irbDateApproved) { + this.irbDateApproved = irbDateApproved; + } + // FIXME: atrocity private boolean isToday(Date date) { Calendar now = Calendar.getInstance(); @@ -101,9 +109,7 @@ && now.get(Calendar.YEAR) == then.get(Calendar.YEAR) && now.get(Calendar.DAY_OF_MONTH) == then.get(Calendar.DAY_OF_MONTH)); } - public void setIrbDateApproved(Date irbDateApproved) { - this.irbDateApproved = irbDateApproved; - } + public String getParticipation() { return participation; } Modified: trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.java 2006-03-04 18:55:18 UTC (rev 137) +++ trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.java 2006-03-04 19:10:37 UTC (rev 138) @@ -3,6 +3,7 @@ import java.net.InetSocketAddress; import java.util.List; +import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Inheritance; @@ -23,6 +24,7 @@ * @version $Revision$ */ +@Entity @Table(name="experiment_configuration") @Inheritance(strategy=InheritanceType.JOINED) public abstract class ExperimentConfigurationEntity<T extends ExperimentRoundParameters> @@ -35,6 +37,7 @@ private String description; private String experimentName; private String clientJarName; + private String clientMainClass; private ForagerExperimentParameters currentParameters; @@ -149,6 +152,14 @@ public void setExperimentName(String experimentName) { this.experimentName = experimentName; } + + public String getClientMainClass() { + return clientMainClass; + } + + public void setClientMainClass(String clientMainClass) { + this.clientMainClass = clientMainClass; + } } Modified: trunk/gee/src/java/edu/indiana/psych/gee/ExperimentParametersEntity.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/ExperimentParametersEntity.java 2006-03-04 18:55:18 UTC (rev 137) +++ trunk/gee/src/java/edu/indiana/psych/gee/ExperimentParametersEntity.java 2006-03-04 19:10:37 UTC (rev 138) @@ -6,6 +6,7 @@ import javax.persistence.Inheritance; import javax.persistence.InheritanceType; import javax.persistence.Table; +import javax.persistence.*; /** * $Id: Exp$ @@ -19,11 +20,12 @@ @Entity @Table(name="experiment_parameters") @Inheritance(strategy=InheritanceType.JOINED) -public abstract class ExperimentParametersEntity implements ExperimentRoundParameters { +public abstract class ExperimentParametersEntity<T extends ExperimentConfiguration> +implements ExperimentRoundParameters { private long id = -1; - private ExperimentConfiguration configuration; + private T configuration; @Id @GeneratedValue public long getId() { @@ -34,11 +36,13 @@ this.id = id; } - public ExperimentConfiguration getConfiguration() { + @ManyToOne(targetEntity=ExperimentConfigurationEntity.class) + @JoinColumn(name="configuration_id", nullable=false) + public T getConfiguration() { return configuration; } - public void setConfiguration(ExperimentConfiguration configuration) { + public void setConfiguration(T configuration) { this.configuration = configuration; } Modified: trunk/gee/src/java/edu/indiana/psych/gee/ExperimentRoundParameters.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/ExperimentRoundParameters.java 2006-03-04 18:55:18 UTC (rev 137) +++ trunk/gee/src/java/edu/indiana/psych/gee/ExperimentRoundParameters.java 2006-03-04 19:10:37 UTC (rev 138) @@ -15,13 +15,13 @@ * @version $Revision$ */ -public interface ExperimentRoundParameters { +public interface ExperimentRoundParameters<T extends ExperimentConfiguration> { public String getSpecialInstructions(); public Dimension getBoardSize(); - public ExperimentConfiguration getConfiguration(); + public T getConfiguration(); public Duration getRoundDuration(); Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.java 2006-03-04 18:55:18 UTC (rev 137) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.java 2006-03-04 19:10:37 UTC (rev 138) @@ -28,7 +28,6 @@ @Table(name="forager_configuration") public class ForagerConfiguration extends ExperimentConfigurationEntity<ForagerExperimentParameters> { - public ForagerConfiguration(String serverName, int port) { super(serverName, port); } @@ -38,9 +37,10 @@ return "forager-client.jar"; } - public String getClientClass() { + public String getClientMainClass() { return ForagerApplet.class.getName(); } + public String getExperimentName() { return "forager"; } Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java 2006-03-04 18:55:18 UTC (rev 137) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java 2006-03-04 19:10:37 UTC (rev 138) @@ -27,7 +27,7 @@ @PrimaryKeyJoinColumn(name="forager_parameters_id") @Proxy(proxyClass=ExperimentRoundParameters.class) @Table(name="forager_parameters") -public class ForagerExperimentParameters extends ExperimentParametersEntity { +public class ForagerExperimentParameters extends ExperimentParametersEntity<ForagerConfiguration> { private ForagerAgentConfiguration agentConfiguration; @@ -102,12 +102,7 @@ return Duration.create(240); } - @ManyToOne(targetEntity=ForagerConfiguration.class) - @JoinColumn(name="configuration_id", nullable=false) - public ForagerConfiguration getConfiguration() { - return (ForagerConfiguration) super.getConfiguration(); - } - + @Transient public List getAllFoodRegions() { return Collections.EMPTY_LIST; Added: trunk/gee/war/WEB-INF/lib/asm.jar =================================================================== (Binary files differ) Property changes on: trunk/gee/war/WEB-INF/lib/asm.jar ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/gee/war/startExperiment.jsp =================================================================== --- trunk/gee/war/startExperiment.jsp 2006-03-04 18:55:18 UTC (rev 137) +++ trunk/gee/war/startExperiment.jsp 2006-03-04 19:10:37 UTC (rev 138) @@ -15,7 +15,7 @@ <!-- FIXME: make width/height configurable later? --> - <applet code='<ww:property value="experiment.configuration.clientClass"/>' width="600" height="600" + <applet code='<ww:property value="experiment.configuration.clientMainClass"/>' width="600" height="600" archive='<ww:property value="experiment.configuration.clientJarName"/>'> <param name='experiment-hostname' value="<ww:property value='experiment.configuration.serverAddress.hostName'/>" /> <param name='experiment-port' value="<ww:property value='experiment.serverPort'/>" /> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: Allen L. <ano...@gm...> - 2006-03-05 17:01:38
|
Is this mailing list borked? On 3/4/06, al...@us... <al...@us...> wrote: > > Revision: 138 > Author: alllee > Date: 2006-03-04 11:10:37 -0800 (Sat, 04 Mar 2006) > ViewCVS: http://svn.sourceforge.net/gabel/?rev=3D138&view=3Drev > > Log Message: > ----------- > webapp now starts up again at least. > > Modified Paths: > -------------- > trunk/gee/src/java/edu/indiana/psych/gee/ConsentForm.java > > trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntit= y.java > > trunk/gee/src/java/edu/indiana/psych/gee/ExperimentParametersEntity.j= ava > > trunk/gee/src/java/edu/indiana/psych/gee/ExperimentRoundParameters.ja= va > > trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration= .java > > trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentPar= ameters.java > trunk/gee/war/startExperiment.jsp > > Added Paths: > ----------- > trunk/gee/war/WEB-INF/lib/asm.jar > Modified: trunk/gee/src/java/edu/indiana/psych/gee/ConsentForm.java > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- trunk/gee/src/java/edu/indiana/psych/gee/ConsentForm.java 2006-03-0= 4 > 18:55:18 UTC (rev 137) > +++ trunk/gee/src/java/edu/indiana/psych/gee/ConsentForm.java 2006-03-0= 4 > 19:10:37 UTC (rev 138) > @@ -7,6 +7,7 @@ > import javax.persistence.GeneratedValue; > import javax.persistence.Id; > import javax.persistence.Table; > +import javax.persistence.*; > > /** > * $Id$ > @@ -77,12 +78,14 @@ > public void setDescription(String description) { > this.description =3D description; > } > + @Transient > public Date getIrbDateApprovalExpires() { > Calendar calendar =3D Calendar.getInstance(); > calendar.setTime(getIrbDateApproved()); > calendar.add(Calendar.DAY_OF_MONTH, 364); > return calendar.getTime(); > } > + @Temporal(TemporalType.DATE) > public Date getIrbDateApproved() { > if (irbDateApproved =3D=3D null || isToday(irbDateApproved)) { > Calendar calendar =3D Calendar.getInstance(); > @@ -91,6 +94,11 @@ > } > return irbDateApproved; > } > + > + public void setIrbDateApproved(Date irbDateApproved) { > + this.irbDateApproved =3D irbDateApproved; > + } > + > // FIXME: atrocity > private boolean isToday(Date date) { > Calendar now =3D Calendar.getInstance(); > @@ -101,9 +109,7 @@ > && now.get(Calendar.YEAR) =3D=3D then.get(Calendar.YEAR) > && now.get(Calendar.DAY_OF_MONTH) =3D=3D then.get( > Calendar.DAY_OF_MONTH)); > } > - public void setIrbDateApproved(Date irbDateApproved) { > - this.irbDateApproved =3D irbDateApproved; > - } > + > public String getParticipation() { > return participation; > } > > Modified: > trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.ja= va > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- > trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.ja= va > 2006-03-04 18:55:18 UTC (rev 137) > +++ > trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.ja= va > 2006-03-04 19:10:37 UTC (rev 138) > @@ -3,6 +3,7 @@ > import java.net.InetSocketAddress; > import java.util.List; > > +import javax.persistence.Entity; > import javax.persistence.GeneratedValue; > import javax.persistence.Id; > import javax.persistence.Inheritance; > @@ -23,6 +24,7 @@ > * @version $Revision$ > */ > > +@Entity > @Table(name=3D"experiment_configuration") > @Inheritance(strategy=3DInheritanceType.JOINED) > public abstract class ExperimentConfigurationEntity<T extends > ExperimentRoundParameters> > @@ -35,6 +37,7 @@ > private String description; > private String experimentName; > private String clientJarName; > + private String clientMainClass; > > > private ForagerExperimentParameters currentParameters; > @@ -149,6 +152,14 @@ > public void setExperimentName(String experimentName) { > this.experimentName =3D experimentName; > } > + > + public String getClientMainClass() { > + return clientMainClass; > + } > + > + public void setClientMainClass(String clientMainClass) { > + this.clientMainClass =3D clientMainClass; > + } > } > > > > Modified: > trunk/gee/src/java/edu/indiana/psych/gee/ExperimentParametersEntity.java > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- > trunk/gee/src/java/edu/indiana/psych/gee/ExperimentParametersEntity.java = 2006-03-04 > 18:55:18 UTC (rev 137) > +++ > trunk/gee/src/java/edu/indiana/psych/gee/ExperimentParametersEntity.java = 2006-03-04 > 19:10:37 UTC (rev 138) > @@ -6,6 +6,7 @@ > import javax.persistence.Inheritance; > import javax.persistence.InheritanceType; > import javax.persistence.Table; > +import javax.persistence.*; > > /** > * $Id: Exp$ > @@ -19,11 +20,12 @@ > @Entity > @Table(name=3D"experiment_parameters") > @Inheritance(strategy=3DInheritanceType.JOINED) > -public abstract class ExperimentParametersEntity implements > ExperimentRoundParameters { > +public abstract class ExperimentParametersEntity<T extends > ExperimentConfiguration> > +implements ExperimentRoundParameters { > > private long id =3D -1; > > - private ExperimentConfiguration configuration; > + private T configuration; > > @Id @GeneratedValue > public long getId() { > @@ -34,11 +36,13 @@ > this.id =3D id; > } > > - public ExperimentConfiguration getConfiguration() { > + @ManyToOne(targetEntity=3DExperimentConfigurationEntity.class) > + @JoinColumn(name=3D"configuration_id", nullable=3Dfalse) > + public T getConfiguration() { > return configuration; > } > > - public void setConfiguration(ExperimentConfiguration configuration) = { > + public void setConfiguration(T configuration) { > this.configuration =3D configuration; > } > > > Modified: > trunk/gee/src/java/edu/indiana/psych/gee/ExperimentRoundParameters.java > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- > trunk/gee/src/java/edu/indiana/psych/gee/ExperimentRoundParameters.java > 2006-03-04 18:55:18 UTC (rev 137) > +++ > trunk/gee/src/java/edu/indiana/psych/gee/ExperimentRoundParameters.java > 2006-03-04 19:10:37 UTC (rev 138) > @@ -15,13 +15,13 @@ > * @version $Revision$ > */ > > -public interface ExperimentRoundParameters { > +public interface ExperimentRoundParameters<T extends > ExperimentConfiguration> { > > public String getSpecialInstructions(); > > public Dimension getBoardSize(); > > - public ExperimentConfiguration getConfiguration(); > + public T getConfiguration(); > > public Duration getRoundDuration(); > > > Modified: > trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.jav= a > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- > trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.jav= a 2006-03-04 > 18:55:18 UTC (rev 137) > +++ > trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.jav= a 2006-03-04 > 19:10:37 UTC (rev 138) > @@ -28,7 +28,6 @@ > @Table(name=3D"forager_configuration") > public class ForagerConfiguration extends > ExperimentConfigurationEntity<ForagerExperimentParameters> { > > - > public ForagerConfiguration(String serverName, int port) { > super(serverName, port); > } > @@ -38,9 +37,10 @@ > return "forager-client.jar"; > } > > - public String getClientClass() { > + public String getClientMainClass() { > return ForagerApplet.class.getName(); > } > + > public String getExperimentName() { > return "forager"; > } > > Modified: > trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParamet= ers.java > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- > trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParamet= ers.java > 2006-03-04 18:55:18 UTC (rev 137) > +++ > trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParamet= ers.java > 2006-03-04 19:10:37 UTC (rev 138) > @@ -27,7 +27,7 @@ > @PrimaryKeyJoinColumn(name=3D"forager_parameters_id") > @Proxy(proxyClass=3DExperimentRoundParameters.class) > @Table(name=3D"forager_parameters") > -public class ForagerExperimentParameters extends > ExperimentParametersEntity { > +public class ForagerExperimentParameters extends > ExperimentParametersEntity<ForagerConfiguration> { > > > private ForagerAgentConfiguration agentConfiguration; > @@ -102,12 +102,7 @@ > return Duration.create(240); > } > > - @ManyToOne(targetEntity=3DForagerConfiguration.class) > - @JoinColumn(name=3D"configuration_id", nullable=3Dfalse) > - public ForagerConfiguration getConfiguration() { > - return (ForagerConfiguration) super.getConfiguration(); > - } > - > + > @Transient > public List getAllFoodRegions() { > return Collections.EMPTY_LIST; > > Added: trunk/gee/war/WEB-INF/lib/asm.jar > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > (Binary files differ) > > > Property changes on: trunk/gee/war/WEB-INF/lib/asm.jar > ___________________________________________________________________ > Name: svn:mime-type > + application/octet-stream > > Modified: trunk/gee/war/startExperiment.jsp > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- trunk/gee/war/startExperiment.jsp 2006-03-04 18:55:18 UTC (rev 137) > +++ trunk/gee/war/startExperiment.jsp 2006-03-04 19:10:37 UTC (rev 138) > @@ -15,7 +15,7 @@ > > > <!-- FIXME: make width/height configurable later? --> > - <applet code=3D'<ww:property value=3D"experiment.configuration.clientC= lass"/>' > width=3D"600" height=3D"600" > + <applet code=3D'<ww:property value=3D" > experiment.configuration.clientMainClass"/>' width=3D"600" height=3D"600" > archive=3D'<ww:property value=3D" > experiment.configuration.clientJarName"/>'> > <param name=3D'experiment-hostname' value=3D"<ww:property value=3D' > experiment.configuration.serverAddress.hostName'/>" /> > <param name=3D'experiment-port' value=3D"<ww:property value=3D' > experiment.serverPort'/>" /> > > > > This was sent by the SourceForge.net collaborative development platform, > the world's largest Open Source development site. > > > > > ------------------------------------------------------- > This SF.Net email is sponsored by xPML, a groundbreaking scripting > language > that extends applications into web and mobile media. Attend the live > webcast > and join the prime developer group breaking into this new coding > territory! > http://sel.as-us.falkag.net/sel?cmd=3Dlnk&kid=3D110944&bid=3D241720&dat= =3D121642 > _______________________________________________ > Gabel-svn mailing list > Gab...@li... > https://lists.sourceforge.net/lists/listinfo/gabel-svn > |
|
From: <al...@us...> - 2006-03-08 16:42:52
|
Revision: 154 Author: alllee Date: 2006-03-08 08:42:46 -0800 (Wed, 08 Mar 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=154&view=rev Log Message: ----------- Creating an ajax directory and package for all ajax page results to live in. The reason for this is so we can configure SiteMesh not to decorate these page results - in order to do this we have to make requests to WebWork Actions that live in a separate namespace, e.g., /ajax/status.action and so on. Modified Paths: -------------- trunk/gee/war/WEB-INF/classes/xwork.xml trunk/gee/war/WEB-INF/decorators.xml trunk/gee/war/admin/listExperiments.jsp trunk/gee/war/css/gee.css Added Paths: ----------- trunk/gee/war/ajax/ trunk/gee/war/ajax/status.ajax Modified: trunk/gee/war/WEB-INF/classes/xwork.xml =================================================================== --- trunk/gee/war/WEB-INF/classes/xwork.xml 2006-03-08 01:53:28 UTC (rev 153) +++ trunk/gee/war/WEB-INF/classes/xwork.xml 2006-03-08 16:42:46 UTC (rev 154) @@ -30,6 +30,11 @@ <result name="input">getConsent.jsp</result> </action> </package> + <package name="ajax" extends="default" namespace="/ajax"> + <action name="status" class="edu.indiana.psych.gee.action.AdminAction" method="status"> + <result name="success" type="freemarker">status.ajax</result> + </action> + </package> <package name="admin" extends="default" namespace="/admin"> <action name="index" class="edu.indiana.psych.gee.action.AdminAction" method="authenticate"> <result name="success" type="freemarker">listExperiments.jsp</result> @@ -38,9 +43,6 @@ <action name="configure" class="edu.indiana.psych.gee.action.AdminAction" method="configure"> <result name="success" type="freemarker">configureExperiment.jsp</result> </action> - <action name="status" class="edu.indiana.psych.gee.action.AdminAction" method="status"> - <result>status.jsp</result> - </action> <action name="list" class="edu.indiana.psych.gee.action.AdminAction" method="listExperiments"> <result name="success" type="freemarker">listExperiments.jsp</result> <result name="error">error.jsp</result> Modified: trunk/gee/war/WEB-INF/decorators.xml =================================================================== --- trunk/gee/war/WEB-INF/decorators.xml 2006-03-08 01:53:28 UTC (rev 153) +++ trunk/gee/war/WEB-INF/decorators.xml 2006-03-08 16:42:46 UTC (rev 154) @@ -3,6 +3,9 @@ vim:sts=2:sw=2: --> <decorators defaultdir="/"> + <excludes> + <pattern>/ajax/*</pattern> + </excludes> <decorator name="main" page="template.jsp"> <pattern>/*</pattern> </decorator> Modified: trunk/gee/war/admin/listExperiments.jsp =================================================================== --- trunk/gee/war/admin/listExperiments.jsp 2006-03-08 01:53:28 UTC (rev 153) +++ trunk/gee/war/admin/listExperiments.jsp 2006-03-08 16:42:46 UTC (rev 154) @@ -16,17 +16,17 @@ <td width="10%">${experiment.name}</td> <td width="50%">${experiment.description}</td> <td width="15%"> - <@ww.div id="status" href="status.action?experimentName=${experiment.name}" listenTopics="start, stop"> + <@ww.div id="status" href="/ajax/status.action?experimentName=${experiment.name}" listenTopics="start, stop"> ${experiment.running?string("running", "not running")} </@ww.div> </td> <td width="25%"> ( - <@ww.a id="start" href="start.action" notifyTopics="start" experimentName="${experiment.name}"> + <@ww.a id="start" href="start.action?experimentName=${experiment.name}" notifyTopics="start"> Start </@ww.a> | - <@ww.a id="stop" href='stop.action' notifyTopics="stop" experimentName="${experiment.name}"> + <@ww.a id="stop" href='stop.action?experimentName=${experiment.name}' notifyTopics="stop" > Stop </@ww.a> | Added: trunk/gee/war/ajax/status.ajax =================================================================== --- trunk/gee/war/ajax/status.ajax (rev 0) +++ trunk/gee/war/ajax/status.ajax 2006-03-08 16:42:46 UTC (rev 154) @@ -0,0 +1 @@ +<font color='brown'>${experiment.running?string("running", "not running")}</font> Modified: trunk/gee/war/css/gee.css =================================================================== --- trunk/gee/war/css/gee.css 2006-03-08 01:53:28 UTC (rev 153) +++ trunk/gee/war/css/gee.css 2006-03-08 16:42:46 UTC (rev 154) @@ -115,7 +115,6 @@ border-right: 1px solid #B74; border-top: 1px solid #EB8; font-weight: normal; - font: Arial, Helvetica, sans-serif; color: white; padding: 4px 3px; white-space: nowrap; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <al...@us...> - 2006-03-10 20:21:11
|
Revision: 160 Author: alllee Date: 2006-03-10 12:21:07 -0800 (Fri, 10 Mar 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=160&view=rev Log Message: ----------- switched index.jsp to freemarker as it simplifies the output considerably. Modified Paths: -------------- trunk/gee/war/WEB-INF/classes/xwork.xml trunk/gee/war/index.jsp Modified: trunk/gee/war/WEB-INF/classes/xwork.xml =================================================================== --- trunk/gee/war/WEB-INF/classes/xwork.xml 2006-03-10 04:23:41 UTC (rev 159) +++ trunk/gee/war/WEB-INF/classes/xwork.xml 2006-03-10 20:21:07 UTC (rev 160) @@ -12,14 +12,14 @@ <default-interceptor-ref name="defaultStack"/> <!-- the start page lists all available experiments --> <action name="index" class="edu.indiana.psych.gee.action.ListExperiments"> - <result name="success">index.jsp</result> + <result name="success" type="freemarker">index.jsp</result> </action> <action name="start" class="edu.indiana.psych.gee.action.StartExperiment" method="start"> <result name="success">startExperiment.jsp</result> <result name="input">getConsent.jsp</result> </action> <action name="consent" class="edu.indiana.psych.gee.action.StartExperiment" method="prepare"> -<!-- FIXME: make sure the stack doesn't validate --> +<!-- FIXME: do not use a validating stack here --> <interceptor-ref name="basicStack"/> <result name="success">getConsent.jsp</result> <result name="input">getConsent.jsp</result> Modified: trunk/gee/war/index.jsp =================================================================== --- trunk/gee/war/index.jsp 2006-03-10 04:23:41 UTC (rev 159) +++ trunk/gee/war/index.jsp 2006-03-10 20:21:07 UTC (rev 160) @@ -1,5 +1,3 @@ -<%@ taglib prefix="ww" uri="webwork" %> - <head> <meta name="lastModifiedDate" content="$Date$"/> </head> @@ -63,41 +61,21 @@ <table> <tbody style="padding: 10px;"> <tr> -<%-- iterate through ListExperiments experiments property and emit its description and link --%> -<ww:iterator value="experiments" status="rowStatus" id="experiment"> - <ww:if test="#rowStatus.odd == true"> - <tr class="displayodd"> - </ww:if> - <ww:else> - <tr class="displayeven"> - </ww:else> +<@ww.iterator value="experiments" status="rowStatus" id="experiment"> + <#if rowStatus.odd> + <tr class="displayodd"> + <#else> + <tr class="displayeven"> + </#if> <td style="white-space: nowrap;"> - <a href=' - <ww:url action="consent"> - <ww:param name="experimentName" value="name"/> - </ww:url> - '> - <span class="highlight"> - [ <ww:property value="name"/> ] - </span> - </a> + <a href='consent.action?experimentName=${name}'> + <span class="highlight">[ ${name} ]</span> + </a> </td> - <td> - <ww:property value="description"/> - </td> - <td> - <a href=' - <ww:url action="consent"> - <ww:param name="experimentName" value="name"/> - </ww:url> - '> - <i> - start - </i> - </a> - </td> + <td>${description}</td> + <td><a href='consent.action?experimentName=${name}'><i>start</i></a></td> </tr> -</ww:iterator> +</@ww.iterator> </tbody> </table> </div> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <al...@us...> - 2006-03-11 01:30:58
|
Revision: 161 Author: alllee Date: 2006-03-10 17:30:40 -0800 (Fri, 10 Mar 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=161&view=rev Log Message: ----------- renamed getConsent.jsp => consent.jsp, and changing startExperiment.jsp to use freemarker instead. Should make freemarker the default in webwork.properties. Modified Paths: -------------- trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.java trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.java trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerClient.java trunk/gee/war/WEB-INF/classes/xwork.xml trunk/gee/war/startExperiment.jsp Added Paths: ----------- trunk/gee/war/consent.jsp Removed Paths: ------------- trunk/gee/war/getConsent.jsp Modified: trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.java 2006-03-10 20:21:07 UTC (rev 160) +++ trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.java 2006-03-11 01:30:40 UTC (rev 161) @@ -45,6 +45,8 @@ private String experimentName; private String clientJarName; private String clientMainClass; + private int worldHeight; + private int worldWidth; private ConsentForm consentForm; private int serverPort; private String serverName; Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.java 2006-03-10 20:21:07 UTC (rev 160) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.java 2006-03-11 01:30:40 UTC (rev 161) @@ -32,14 +32,11 @@ private List<ForagerExperimentParameters> allParameters; + public ForagerConfiguration(String serverName, int port) { super(serverName, port); } - public static ForagerConfiguration getDefaultConfiguration() { - return new ForagerConfiguration("groups.psych.indiana.edu", 25000); - } - @Transient public Duration getDelayBetweenRounds() { return Duration.create(30); Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerClient.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerClient.java 2006-03-10 20:21:07 UTC (rev 160) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerClient.java 2006-03-11 01:30:40 UTC (rev 161) @@ -65,11 +65,6 @@ private ClientDispatcher dispatcher; private Identifier id; - - public ForagerClient(Dimension screenSize) { - this(screenSize, ForagerConfiguration.getDefaultConfiguration()); - } - public ForagerClient(Dimension screenSize, ForagerConfiguration configuration) { setConfiguration(configuration); @@ -256,10 +251,11 @@ System.err.println(message); } + /* public static void main(String[] args) { Runnable createGuiRunnable = new Runnable() { public void run() { - Dimension defaultDimension = new Dimension(500, 500); + Dimension defaultDimension = new Dimension(600, 600); JFrame frame = new JFrame(); ForagerClient client = new ForagerClient(defaultDimension); client.connect(); @@ -272,6 +268,7 @@ }; SwingUtilities.invokeLater(createGuiRunnable); } + */ /** Modified: trunk/gee/war/WEB-INF/classes/xwork.xml =================================================================== --- trunk/gee/war/WEB-INF/classes/xwork.xml 2006-03-10 20:21:07 UTC (rev 160) +++ trunk/gee/war/WEB-INF/classes/xwork.xml 2006-03-11 01:30:40 UTC (rev 161) @@ -15,8 +15,8 @@ <result name="success" type="freemarker">index.jsp</result> </action> <action name="start" class="edu.indiana.psych.gee.action.StartExperiment" method="start"> - <result name="success">startExperiment.jsp</result> - <result name="input">getConsent.jsp</result> + <result name="success" type="freemarker">startExperiment.jsp</result> + <result name="input">consent.jsp</result> </action> <action name="consent" class="edu.indiana.psych.gee.action.StartExperiment" method="prepare"> <!-- FIXME: do not use a validating stack here --> Copied: trunk/gee/war/consent.jsp (from rev 152, trunk/gee/war/getConsent.jsp) =================================================================== --- trunk/gee/war/consent.jsp (rev 0) +++ trunk/gee/war/consent.jsp 2006-03-11 01:30:40 UTC (rev 161) @@ -0,0 +1,154 @@ +<%@ taglib prefix="ww" uri="webwork" %> +<head> +<title> Consent Form for [ <ww:property value="experimentName"/> ]</title> + <% + String commitDate = "$Date$"; + java.util.StringTokenizer toke = new java.util.StringTokenizer(commitDate, " "); + toke.nextToken(); + String lastModifiedDate = toke.nextToken(); + %> +<meta name="lastModifiedDate" content="<%= commitDate %>"/> +</head> + +<TABLE BGCOLOR="#A4B5C5" CELLPADDING="4" CELLSPACING="0" WIDTH="100%" BORDER="0"> + <TR> + <TD WIDTH="100%"> + <H3><ww:property value="experimentName"/> consent form</H3> + </TD> + <TD ALIGN="right" VALIGN="top" BGCOLOR="#A4B5C5" WIDTH="70%" style="white-space: nowrap;"> + <b>Study #04-9064</b><br/> + <small>Last Modified: <%= lastModifiedDate %></small> + </TD> + </TR> +</TABLE> + +<TABLE CELLPADDING="4" CELLSPACING="2" BORDER="0"> + <TR> + <TD> + + <B>Forager</B><BR> + <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> + <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> + </TABLE> + + You are invited to participate in a research study, entitled Group Behavior. The purpose of the study is to investigate how people think, act, and make decisions in groups. You will be given a full debriefing at the end of the experiment. Each of the experiments will take 5-10 minutes to complete. The particular instructions for an experiment will be displayed on the computer screen. During the experiment, you will be interacting with a group of humans or artificial intelligence agents. You will see the choices they make, and they will see your choices. <P> + + <B>Deception</B><BR> + <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> + <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> + </TABLE> + + No deception is used in this study.<P> + + <B>Confidentiality</B><BR> + <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> + <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> + </TABLE> + + The information in the study records will be kept confidential. Data will be made available only to persons conducting the study. No reference will be made in verbal or written form which could link your name to the study. Your name is not recorded with your data. <P> + + <B>Compensation</B><BR> + <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> + <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> + </TABLE> + + There is no monetary compensation for participating in this study.<P> + + <B>Risks</B><BR> + <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> + <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> + </TABLE> + + There are no anticipated risks associated with the experiments.<P> + + <B>Benefits</B><BR> + <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> + <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> + </TABLE> + +Society benefits from this research because an understanding of how groups behave can help us to predict the behaviors of complex organizations and develop technologies that promote the efficient and accurate flow of information within groups. You benefit from this experience because you learn something about how group psychology experiments are designed and conducted, what issues are of interest to cognitive scientists, and what kinds of group behaviors emerge when individuals try to reach their goals in an environment that consists largely of other individuals. In addition, many people find the experiments to be fun and intriguing. At the end of the experiment, you will be shown your own performance compared to the average performance of others in your group, a debriefing that describes what the experiment was about, and links to related research. <P> + + + <B>Contact</B><BR> + <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> + <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> + </TABLE> + + If you have questions at any time about the study or the procedures, you may + contact the researcher, Robert Goldstone, at: <P> + + <TABLE CELLPADDING="1" CELLSPACING="0" BORDER="0"> + <TR><TD BGCOLOR="#5566AA"> + <TABLE CELLPADDING="10" CELLSPACING="0" BORDER="0"> + <TR><TD BGCOLOR="#F0F4FF"> + <PRE> +Dr. Robert Goldstone +338 Psychology Building +Indiana University +Bloomington, IN, 47405 +Phone: 812-855-4853 +Email: <a href='mailto:rgo...@in...'>rgo...@in...</a></PRE> + </TD></TR> + </TABLE> + </TD></TR></TABLE> + + <P> + If you have questions about your rights as a subject, contact the + office for the Human Subjects Committee at:<P> + + <TABLE CELLPADDING="1" CELLSPACING="0" BORDER="0"> + <TR><TD BGCOLOR="#5566AA"> + <TABLE CELLPADDING="10" CELLSPACING="0" BORDER="0"> + <TR><TD BGCOLOR="#F0F4FF"> + <PRE> +Human Subjects Committee +Indiana University Carmichael Center L03 +530 E. Kirkwood Ave +Bloomington, IN 47408 +Phone: 812-855-3067 +Email: <a href='mailto:iu...@in...'>iu...@in...</a></PRE> + </TD></TR> + </TABLE> + </TD></TR></TABLE> + <P> + + <B>Participation</B><BR> + <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> + <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> + </TABLE> + + Your participation in this study is purely voluntary. You may decline to participate. + If you decide to participate, you may withdraw from the study at any time without + penalty or loss of benefits. If you withdraw from the study prior to the completion + of your session your data will not be saved. <P> + + + + </TD> + </TR> +</TABLE> + +<p style="font-weight: bolder; background-color: #FFE303;">I have read and +understand the information presented above. I agree to participate in this +study.</p> +<ww:form method="post" validate="true" action='start'> + <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:textfield label="Name" name="participantName" required="true" /> + <ww:hidden name="experimentName"/> + <ww:submit/> +</ww:form> +<hr /> +<small> +IRB Approved +<br/> +<ww:text name="approval.date"> + <ww:param name="value" value="%{consentForm.irbDateApproved}"/> +</ww:text> +<br/> +<ww:text name="approval.expiration.date"> + <ww:param name="value" value="%{consentForm.irbDateApprovalExpires}"/> +</ww:text> +</small> + Deleted: trunk/gee/war/getConsent.jsp =================================================================== --- trunk/gee/war/getConsent.jsp 2006-03-10 20:21:07 UTC (rev 160) +++ trunk/gee/war/getConsent.jsp 2006-03-11 01:30:40 UTC (rev 161) @@ -1,154 +0,0 @@ -<%@ taglib prefix="ww" uri="webwork" %> -<head> -<title> Consent Form for [ <ww:property value="experimentName"/> ]</title> - <% - String commitDate = "$Date$"; - java.util.StringTokenizer toke = new java.util.StringTokenizer(commitDate, " "); - toke.nextToken(); - String lastModifiedDate = toke.nextToken(); - %> -<meta name="lastModifiedDate" content="<%= commitDate %>"/> -</head> - -<TABLE BGCOLOR="#A4B5C5" CELLPADDING="4" CELLSPACING="0" WIDTH="100%" BORDER="0"> - <TR> - <TD WIDTH="100%"> - <H3><ww:property value="experimentName"/> consent form</H3> - </TD> - <TD ALIGN="right" VALIGN="top" BGCOLOR="#A4B5C5" WIDTH="70%" style="white-space: nowrap;"> - <b>Study #04-9064</b><br/> - <small>Last Modified: <%= lastModifiedDate %></small> - </TD> - </TR> -</TABLE> - -<TABLE CELLPADDING="4" CELLSPACING="2" BORDER="0"> - <TR> - <TD> - - <B>Forager</B><BR> - <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> - <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> - </TABLE> - - You are invited to participate in a research study, entitled Group Behavior. The purpose of the study is to investigate how people think, act, and make decisions in groups. You will be given a full debriefing at the end of the experiment. Each of the experiments will take 5-10 minutes to complete. The particular instructions for an experiment will be displayed on the computer screen. During the experiment, you will be interacting with a group of humans or artificial intelligence agents. You will see the choices they make, and they will see your choices. <P> - - <B>Deception</B><BR> - <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> - <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> - </TABLE> - - No deception is used in this study.<P> - - <B>Confidentiality</B><BR> - <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> - <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> - </TABLE> - - The information in the study records will be kept confidential. Data will be made available only to persons conducting the study. No reference will be made in verbal or written form which could link your name to the study. Your name is not recorded with your data. <P> - - <B>Compensation</B><BR> - <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> - <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> - </TABLE> - - There is no monetary compensation for participating in this study.<P> - - <B>Risks</B><BR> - <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> - <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> - </TABLE> - - There are no anticipated risks associated with the experiments.<P> - - <B>Benefits</B><BR> - <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> - <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> - </TABLE> - -Society benefits from this research because an understanding of how groups behave can help us to predict the behaviors of complex organizations and develop technologies that promote the efficient and accurate flow of information within groups. You benefit from this experience because you learn something about how group psychology experiments are designed and conducted, what issues are of interest to cognitive scientists, and what kinds of group behaviors emerge when individuals try to reach their goals in an environment that consists largely of other individuals. In addition, many people find the experiments to be fun and intriguing. At the end of the experiment, you will be shown your own performance compared to the average performance of others in your group, a debriefing that describes what the experiment was about, and links to related research. <P> - - - <B>Contact</B><BR> - <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> - <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> - </TABLE> - - If you have questions at any time about the study or the procedures, you may - contact the researcher, Robert Goldstone, at: <P> - - <TABLE CELLPADDING="1" CELLSPACING="0" BORDER="0"> - <TR><TD BGCOLOR="#5566AA"> - <TABLE CELLPADDING="10" CELLSPACING="0" BORDER="0"> - <TR><TD BGCOLOR="#F0F4FF"> - <PRE> -Dr. Robert Goldstone -338 Psychology Building -Indiana University -Bloomington, IN, 47405 -Phone: 812-855-4853 -Email: <a href='mailto:rgo...@in...'>rgo...@in...</a></PRE> - </TD></TR> - </TABLE> - </TD></TR></TABLE> - - <P> - If you have questions about your rights as a subject, contact the - office for the Human Subjects Committee at:<P> - - <TABLE CELLPADDING="1" CELLSPACING="0" BORDER="0"> - <TR><TD BGCOLOR="#5566AA"> - <TABLE CELLPADDING="10" CELLSPACING="0" BORDER="0"> - <TR><TD BGCOLOR="#F0F4FF"> - <PRE> -Human Subjects Committee -Indiana University Carmichael Center L03 -530 E. Kirkwood Ave -Bloomington, IN 47408 -Phone: 812-855-3067 -Email: <a href='mailto:iu...@in...'>iu...@in...</a></PRE> - </TD></TR> - </TABLE> - </TD></TR></TABLE> - <P> - - <B>Participation</B><BR> - <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> - <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> - </TABLE> - - Your participation in this study is purely voluntary. You may decline to participate. - If you decide to participate, you may withdraw from the study at any time without - penalty or loss of benefits. If you withdraw from the study prior to the completion - of your session your data will not be saved. <P> - - - - </TD> - </TR> -</TABLE> - -<p style="font-weight: bolder; background-color: #FFE303;">I have read and -understand the information presented above. I agree to participate in this -study.</p> -<ww:form method="post" validate="true" action='start'> - <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:textfield label="Name" name="participantName" required="true" /> - <ww:hidden name="experimentName"/> - <ww:submit/> -</ww:form> -<hr /> -<small> -IRB Approved -<br/> -<ww:text name="approval.date"> - <ww:param name="value" value="%{consentForm.irbDateApproved}"/> -</ww:text> -<br/> -<ww:text name="approval.expiration.date"> - <ww:param name="value" value="%{consentForm.irbDateApprovalExpires}"/> -</ww:text> -</small> - Modified: trunk/gee/war/startExperiment.jsp =================================================================== --- trunk/gee/war/startExperiment.jsp 2006-03-10 20:21:07 UTC (rev 160) +++ trunk/gee/war/startExperiment.jsp 2006-03-11 01:30:40 UTC (rev 161) @@ -1,7 +1,6 @@ <!-- vim:sts=2:sw=2: --> -<%@ taglib prefix="ww" uri="webwork" %> <head> <meta name="lastModifiedDate" content="$Date$"/> </head> @@ -9,16 +8,17 @@ If you experience any problems, please read the <a href='<ww:url action="faq"/>'> FAQ </a> or <a href='<ww:url action="contact"/>'>contact us.</a> </p> - <p>Currently participating in the <span class="highlight"><ww:property value="experiment.name"/></span> experiment. + <@ww.push value="experiment"> + <p>Currently participating in the <span class="highlight">${name}</span> experiment. </p> <!-- FIXME: add instructions to the right panel --> - <!-- FIXME: make width/height configurable later? --> - <applet code='<ww:property value="experiment.configuration.clientMainClass"/>' width="600" height="600" - archive='<ww:property value="experiment.configuration.clientJarName"/>'> - <param name='experiment-hostname' value="<ww:property value='experiment.configuration.serverAddress.hostName'/>" /> - <param name='experiment-port' value="<ww:property value='experiment.serverPort'/>" /> + <applet code='${configuration.clientMainClass}' width="600" height="600" + archive='${configuration.clientJarName}'> + <param name='experiment-hostname' value="${configuration.serverAddress.hostName}" /> + <param name='experiment-port' value="${serverPort?c}" /> </applet> + </@ww.push> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <al...@us...> - 2006-05-17 23:11:08
|
Revision: 178 Author: alllee Date: 2006-05-17 16:10:56 -0700 (Wed, 17 May 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=178&view=rev Log Message: ----------- converted consent.jsp to freemarker, improving validation and overall webwork usage. Modified Paths: -------------- trunk/gee/src/java/edu/indiana/psych/gee/ConsentForm.java trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment-validation.xml trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java trunk/gee/war/WEB-INF/classes/xwork.xml trunk/gee/war/consent.jsp trunk/gee/war/css/gee.css trunk/gee/war/includes/header.jsp trunk/gee/war/index.jsp trunk/gee/war/template.jsp Added Paths: ----------- trunk/gee/war/images/gee.png Modified: trunk/gee/src/java/edu/indiana/psych/gee/ConsentForm.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/ConsentForm.java 2006-05-17 22:29:35 UTC (rev 177) +++ trunk/gee/src/java/edu/indiana/psych/gee/ConsentForm.java 2006-05-17 23:10:56 UTC (rev 178) @@ -27,6 +27,7 @@ // are longs overkill? private Long id = Long.valueOf(-1); + private String studyNumber; private String description; private String deception; private String confidentiality; Modified: trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment-validation.xml =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment-validation.xml 2006-05-17 22:29:35 UTC (rev 177) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment-validation.xml 2006-05-17 23:10:56 UTC (rev 178) @@ -4,43 +4,10 @@ vim:sts=2:sw=2: --> <validators> - <field name="participantName"> - <field-validator type="requiredstring"> - <message>Please enter a name.</message> + <field name="participant"> + <field-validator type="visitor"> + <message/> </field-validator> </field> - <field name="participantAge"> - <field-validator type="int"> - <param name="min">18</param> - <message>You must be 18 or older.</message> - </field-validator> - </field> - - <!-- other sample validators. - <field name="bar2"> - <field-validator type="regex"> - <param name="regex">[0-9],[0-9]</param> - <message>The value of bar2 must be in the format "x, y", where x and y are between 0 and 9</message> - </field-validator> - </field> - <field name="date"> - <field-validator type="date"> - <param name="min">12/22/2002</param> - <param name="max">12/25/2002</param> - <message>The date must be between 12-22-2002 and 12-25-2002.</message> - </field-validator> - </field> - <field name="foo"> - <field-validator type="int"> - <param name="min">0</param> - <param name="max">100</param> - <message key="foo.range">Could not find foo.range!</message> - </field-validator> - </field> - <validator type="expression"> - <param name="expression"<foo < bar</param> - <message>Foo must be greater than Bar. Foo = ${foo}, Bar = ${bar}.</message> - </validator> - --> </validators> Modified: trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java 2006-05-17 22:29:35 UTC (rev 177) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java 2006-05-17 23:10:56 UTC (rev 178) @@ -2,6 +2,7 @@ import edu.indiana.psych.gee.ConsentForm; import edu.indiana.psych.gee.Experiment; +import edu.indiana.psych.gee.bean.Participant; /** * $Id$ @@ -14,14 +15,16 @@ public class StartExperiment extends GeeAction { private String experimentName; - - private int participantAge; - private String participantName; + private Participant participant; private ConsentForm consentForm; - private String message; public String prepare() { - return SUCCESS; + consentForm = getExperiment().getConsentForm(); + if (consentForm == null) { + // no consent form available for this experiment.. just start? + getLogger().warn("No consent form available for this experiment: " + getExperiment()); + } + return INPUT; } public String start() { @@ -34,18 +37,11 @@ } } - public String getMessage() { - return message; - } - public Experiment getExperiment() { return getExperimentService().find(experimentName); } public ConsentForm getConsentForm() { - if (consentForm == null) { - consentForm = getExperiment().getConsentForm(); - } return consentForm; } @@ -57,20 +53,12 @@ this.experimentName = experimentName; } - public void setParticipantAge(int participantAge) { - this.participantAge = participantAge; + public Participant getParticipant() { + return participant; } - public int getParticipantAge() { - return participantAge; + public void setParticipant(Participant participant) { + this.participant = participant; } - public void setParticipantName(String participantName) { - this.participantName = participantName; - } - - public String getParticipantName() { - return participantName; - } - } Modified: trunk/gee/war/WEB-INF/classes/xwork.xml =================================================================== --- trunk/gee/war/WEB-INF/classes/xwork.xml 2006-05-17 22:29:35 UTC (rev 177) +++ trunk/gee/war/WEB-INF/classes/xwork.xml 2006-05-17 23:10:56 UTC (rev 178) @@ -37,17 +37,17 @@ <default-interceptor-ref name="geeDefaultStack"/> <!-- the start page lists all available experiments --> <action name="index" class="edu.indiana.psych.gee.action.ListExperiments"> - <result name="success" type="freemarker">index.jsp</result> + <result type="freemarker">index.jsp</result> </action> <action name="start" class="edu.indiana.psych.gee.action.StartExperiment" method="start"> - <result name="success" type="freemarker">startExperiment.jsp</result> - <result name="input">consent.jsp</result> + <result type="freemarker">startExperiment.jsp</result> + <result name="input" type="freemarker">consent.jsp</result> </action> <action name="consent" class="edu.indiana.psych.gee.action.StartExperiment" method="prepare"> <!-- FIXME: do not use a validating stack here --> <interceptor-ref name="basicStack"/> - <result name="success">consent.jsp</result> - <result name="input">consent.jsp</result> + <result type="freemarker">consent.jsp</result> + <result name="input" type="freemarker">consent.jsp</result> </action> </package> <include file="gee-ajax.xml"/> Modified: trunk/gee/war/consent.jsp =================================================================== --- trunk/gee/war/consent.jsp 2006-05-17 22:29:35 UTC (rev 177) +++ trunk/gee/war/consent.jsp 2006-05-17 23:10:56 UTC (rev 178) @@ -1,23 +1,18 @@ -<%@ taglib prefix="ww" uri="webwork" %> <head> -<title> Consent Form for [ <ww:property value="experimentName"/> ]</title> - <% - String commitDate = "$Date$"; - java.util.StringTokenizer toke = new java.util.StringTokenizer(commitDate, " "); - toke.nextToken(); - String lastModifiedDate = toke.nextToken(); - %> -<meta name="lastModifiedDate" content="<%= commitDate %>"/> +<title> Consent Form for ${experimentName}</title> +<#assign commitDate="$Date$"> +<#assign lastModified=commitDate?word_list[1]> +<meta name="lastModifiedDate" content="${commitDate}"/> </head> <TABLE BGCOLOR="#A4B5C5" CELLPADDING="4" CELLSPACING="0" WIDTH="100%" BORDER="0"> <TR> <TD WIDTH="100%"> - <H3><ww:property value="experimentName"/> consent form</H3> + <H3>${experimentName} consent form</H3> </TD> <TD ALIGN="right" VALIGN="top" BGCOLOR="#A4B5C5" WIDTH="70%" style="white-space: nowrap;"> <b>Study #04-9064</b><br/> - <small>Last Modified: <%= lastModifiedDate %></small> + <small>Last Modified: ${lastModified}</small> </TD> </TR> </TABLE> @@ -25,8 +20,7 @@ <TABLE CELLPADDING="4" CELLSPACING="2" BORDER="0"> <TR> <TD> - - <B>Forager</B><BR> + <B>${experimentName} consent form</B><BR> <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> </TABLE> @@ -131,24 +125,23 @@ <p style="font-weight: bolder; background-color: #FFE303;">I have read and understand the information presented above. I agree to participate in this study.</p> -<ww:form method="post" validate="true" action='start'> - <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:textfield label="Name" name="participantName" required="true" /> - <ww:hidden name="experimentName"/> - <ww:submit/> -</ww:form> +<@ww.form method="post" action='start' validate='true'> + <@ww.select label="Age" name="participant.age" required="true" + list=["Under 18", "18-24", "25-36", "37-55", "Over 55"]/> + <@ww.textfield label="Name" name="participant.name" required="true" /> + <@ww.hidden name="experimentName"/> + <@ww.submit/> +</@ww.form> <hr /> <small> IRB Approved <br/> -<ww:text name="approval.date"> - <ww:param name="value" value="%{consentForm.irbDateApproved}"/> -</ww:text> +<@ww.text name="approval.date"> + <@ww.param name="value" value="%{consentForm.irbDateApproved}"/> +</@ww.text> <br/> -<ww:text name="approval.expiration.date"> - <ww:param name="value" value="%{consentForm.irbDateApprovalExpires}"/> -</ww:text> +<@ww.text name="approval.expiration.date"> + <@ww.param name="value" value="%{consentForm.irbDateApprovalExpires}"/> +</@ww.text> </small> Modified: trunk/gee/war/css/gee.css =================================================================== --- trunk/gee/war/css/gee.css 2006-05-17 22:29:35 UTC (rev 177) +++ trunk/gee/war/css/gee.css 2006-05-17 23:10:56 UTC (rev 178) @@ -5,6 +5,12 @@ font-family: helvetica, arial, sans-serif; } +.frame { margin: 5px 20px 5px 20px; font-size: 90%; } +.frame .content { margin: 0px; } + +.note { border: solid 1px #7099C5; background-color: #f0f0ff; } +.note .label { background-color: #7099C5; color: #ffffff; } + #Error { color: #802A2A; font-weight: bold; Added: trunk/gee/war/images/gee.png =================================================================== (Binary files differ) Property changes on: trunk/gee/war/images/gee.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/gee/war/includes/header.jsp =================================================================== --- trunk/gee/war/includes/header.jsp 2006-05-17 22:29:35 UTC (rev 177) +++ trunk/gee/war/includes/header.jsp 2006-05-17 23:10:56 UTC (rev 178) @@ -1 +1,23 @@ +<%@ taglib prefix="ww" uri="webwork" %> +<head> +<script src="http://www.google-analytics.com/urchin.js" type="text/javascript"> +</script> +<script type="text/javascript"> +_uacct = "UA-321755-2"; +urchinTracker(); +</script> +</head> +<TABLE BGCOLOR="#A4B5C5" CELLPADDING="4" CELLSPACING="0" WIDTH="100%" BORDER="0"> + <TR> + <TD><img src='images/gee.png'/><b>Group Experiments Environment</b></td> + </TR> +</TABLE> +<div class="frame note"> +<div class="label">Note</div> +<div class="content"> +This web application is still under development and may not function properly. +Please visit <a href='http://groups.psych.indiana.edu'>http://groups.psych.indiana.edu</a> to +try our experiments. Thanks! +</div> +</div> Modified: trunk/gee/war/index.jsp =================================================================== --- trunk/gee/war/index.jsp 2006-05-17 22:29:35 UTC (rev 177) +++ trunk/gee/war/index.jsp 2006-05-17 23:10:56 UTC (rev 178) @@ -2,16 +2,6 @@ <meta name="lastModifiedDate" content="$Date$"/> </head> -<TABLE BGCOLOR="#A4B5C5" CELLPADDING="4" CELLSPACING="0" WIDTH="100%" BORDER="0"> - <TR> - <TD WIDTH="100%"> - <H3>Group Experiments Environment</H3> - </TD> - <td> </td> - </TR><TR> - <td colspan="2"> </td> - </TR> -</TABLE> <I><center>Welcome to the Group Experiments Environment (GEE) project!</center></I> <hr/> <P> Modified: trunk/gee/war/template.jsp =================================================================== --- trunk/gee/war/template.jsp 2006-05-17 22:29:35 UTC (rev 177) +++ trunk/gee/war/template.jsp 2006-05-17 23:10:56 UTC (rev 178) @@ -11,8 +11,8 @@ <decorator:head /> </head> <body> + <div id="Content"> <%@ include file="/includes/header.jsp" %> - <div id="Content"> <decorator:body /> <%@ include file="/includes/footer.jsp" %> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <al...@us...> - 2006-05-19 00:48:24
|
Revision: 182 Author: alllee Date: 2006-05-18 17:48:18 -0700 (Thu, 18 May 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=182&view=rev Log Message: ----------- fixing hibernate mapping file to reflect the movement of persistent beans into the edu.indiana.psych.gee.bean package. Heavy refactoring about to take place in ForagerExperiment/AbstractExperiment Modified Paths: -------------- trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.java trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperiment.java trunk/gee/war/WEB-INF/applicationContext.xml trunk/gee/war/WEB-INF/hibernate.cfg.xml trunk/gee/war/consent.jsp Added Paths: ----------- trunk/gee/src/java/edu/indiana/psych/gee/bean/ExperimentConfigurationEntity.java Removed Paths: ------------- trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.java Modified: trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java 2006-05-18 05:43:53 UTC (rev 181) +++ trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java 2006-05-19 00:48:18 UTC (rev 182) @@ -45,22 +45,6 @@ dispatcher = DispatcherFactory.getInstance().createServerDispatcher(channel); } - public AbstractExperiment(Class<C> configurationClass, C defaultConfiguration, - ExperimentConfigurationService configurationService) { - this(); - // FIXME: alas, this doesn't seem to be easy to do it the way I'd like - // to, i.e., - // C persistedConfiguration = configurationService.find(defaultConfiguration); - C persistedConfiguration = configurationService.find(configurationClass, defaultConfiguration.getExperimentName()); - if (persistedConfiguration == null) { - setConfiguration(defaultConfiguration); - configurationService.persist(defaultConfiguration); - } - else { - setConfiguration(persistedConfiguration); - } - } - public C getConfiguration() { return configuration; } Deleted: trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.java 2006-05-18 05:43:53 UTC (rev 181) +++ trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.java 2006-05-19 00:48:18 UTC (rev 182) @@ -1,190 +0,0 @@ -package edu.indiana.psych.gee; - -import java.net.InetSocketAddress; -import java.util.Iterator; -import java.util.List; - -import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.Id; -import javax.persistence.Inheritance; -import javax.persistence.InheritanceType; -import javax.persistence.ManyToOne; -import javax.persistence.Table; -import javax.persistence.Transient; - -import edu.indiana.psych.gee.bean.ConsentForm; -import edu.indiana.psych.gee.time.Duration; - -/** - * $Id$ - * - * Provides hibernate object/relational annotations for fields common to most - * ExperimentConfigurations, things like consent forms, experiment names, and - * a Collection of ExperimentRoundParameters. - * - * - * @author Allen Lee - * @version $Revision$ - */ - -@Entity -@Inheritance(strategy=InheritanceType.JOINED) -@Table(name="experiment_configuration") -public abstract class ExperimentConfigurationEntity<T extends ExperimentRoundParameters> -implements ExperimentConfiguration<T> { - - // this should be a configurable property.. - private final static String DEFAULT_SERVER_HOST_NAME = "groups.psych.indiana.edu"; - - // persistent fields - private Long id = Long.valueOf(-1); - private String description; - private String experimentName; - private String clientJarName; - private String clientMainClass; - private int worldHeight; - private int worldWidth; - private ConsentForm consentForm; - private int serverPort; - private String serverName; - private boolean triggeredExperiment; - // generated transient fields, no need to persist. - private transient InetSocketAddress serverAddress; - private transient T currentParameters; - private transient Iterator<T> parametersIterator; - - public ExperimentConfigurationEntity() { - this(DEFAULT_SERVER_HOST_NAME, -1); - } - - public ExperimentConfigurationEntity(String serverName, int port) { - setServerName(serverName); - setServerPort(port); - } - - @Transient - public synchronized InetSocketAddress getServerAddress() { - // FIXME: return configuration address instead? - if (serverAddress == null) { - serverAddress = new InetSocketAddress(serverName, getServerPort()); - if (serverAddress.isUnresolved()) { - // default should be specified via config file. - serverAddress = new InetSocketAddress(DEFAULT_SERVER_HOST_NAME, getServerPort()); - } - } - return serverAddress; - } - - @Id @GeneratedValue - public Long getId() { - return id; - } - - public void setId(Long id) { - this.id = id; - } - - public int getServerPort() { - return serverPort; - } - - public void setServerPort(int serverPort) { - this.serverPort = serverPort; - } - - public String getServerName() { - return serverName; - } - - public void setServerName(String serverName) { - this.serverName = serverName; - } - - public boolean isTriggeredExperiment() { - // TODO Auto-generated method stub - return triggeredExperiment; - } - - public void setTriggeredExperiment(boolean triggeredExperiment) { - this.triggeredExperiment = triggeredExperiment; - } - - @ManyToOne - public ConsentForm getConsentForm() { - return consentForm; - } - public void setConsentForm(ConsentForm consentForm) { - this.consentForm = consentForm; - } - - // advances the parameters iterator or resets it. - public void updateCurrentParameters() { - if (parametersIterator == null || ! parametersIterator.hasNext()) { - parametersIterator = getAllParameters().iterator(); - } - currentParameters = parametersIterator.next(); - } - - @Transient - public synchronized T getCurrentParameters() { - List<T> allParameters = getAllParameters(); - if (currentParameters == null) { - if (allParameters.isEmpty()) { - throw new ExperimentLifecycleException("No experiment round parameters available for : " + getExperimentName()); - } - currentParameters = allParameters.get(0); - } - return currentParameters; - } - - - /* - @Transient - public List<T> getAllParameters() { - throw new UnsupportedOperationException("Subclasses must override getAllParameters."); - } - - @Transient - public void setAllParameters(List<T> allParameters) { - throw new UnsupportedOperationException("Subclasses must override setAllParameters."); - } - */ - - public String getClientJarName() { - return clientJarName; - } - - public void setClientJarName(String clientJarName) { - this.clientJarName = clientJarName; - } - - public String getDescription() { - return description; - } - - public void setDescription(String description) { - this.description = description; - } - - public String getExperimentName() { - return experimentName; - } - - public void setExperimentName(String experimentName) { - this.experimentName = experimentName; - } - - public String getClientMainClass() { - return clientMainClass; - } - - public void setClientMainClass(String clientMainClass) { - this.clientMainClass = clientMainClass; - } - - @Transient - public Duration getDelayBetweenRounds() { - return Duration.create(30); - } -} Modified: trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java 2006-05-18 05:43:53 UTC (rev 181) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java 2006-05-19 00:48:18 UTC (rev 182) @@ -22,7 +22,7 @@ consentForm = getExperiment().getConsentForm(); if (consentForm == null) { // no consent form available for this experiment.. just start? - getLogger().warn("No consent form available for this experiment: " + getExperiment()); + getLogger().warn("XXX: No consent form available for this experiment: " + getExperiment()); } return INPUT; } Copied: trunk/gee/src/java/edu/indiana/psych/gee/bean/ExperimentConfigurationEntity.java (from rev 181, trunk/gee/src/java/edu/indiana/psych/gee/ExperimentConfigurationEntity.java) =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/bean/ExperimentConfigurationEntity.java (rev 0) +++ trunk/gee/src/java/edu/indiana/psych/gee/bean/ExperimentConfigurationEntity.java 2006-05-19 00:48:18 UTC (rev 182) @@ -0,0 +1,177 @@ +package edu.indiana.psych.gee.bean; + +import java.net.InetSocketAddress; +import java.util.Iterator; +import java.util.List; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.ManyToOne; +import javax.persistence.Table; +import javax.persistence.Transient; + +import edu.indiana.psych.gee.ExperimentConfiguration; +import edu.indiana.psych.gee.ExperimentLifecycleException; +import edu.indiana.psych.gee.ExperimentRoundParameters; +import edu.indiana.psych.gee.time.Duration; + +/** + * $Id$ + * + * Provides hibernate object/relational annotations for fields common to most + * ExperimentConfigurations, things like consent forms, experiment names, and + * a Collection of ExperimentRoundParameters. + * + * + * @author Allen Lee + * @version $Revision$ + */ + +@Entity +@Inheritance(strategy=InheritanceType.JOINED) +@Table(name="experiment_configuration") +public abstract class ExperimentConfigurationEntity<T extends ExperimentRoundParameters> +implements ExperimentConfiguration<T> { + + // this should be a configurable property.. + private final static String DEFAULT_SERVER_HOST_NAME = "groups.psych.indiana.edu"; + + // persistent fields + private Long id = Long.valueOf(-1); + private String description; + private String experimentName; + private String clientJarName; + private String clientMainClass; + private ConsentForm consentForm; + private int serverPort; + private String serverName; + private boolean triggeredExperiment; + // generated transient fields, no need to persist. + private transient InetSocketAddress serverAddress; + private transient T currentParameters; + private transient Iterator<T> parametersIterator; + + public ExperimentConfigurationEntity() { + this(DEFAULT_SERVER_HOST_NAME, -1); + } + + public ExperimentConfigurationEntity(String serverName, int port) { + setServerName(serverName); + setServerPort(port); + } + + @Transient + public synchronized InetSocketAddress getServerAddress() { + // FIXME: return configuration address instead? + if (serverAddress == null) { + serverAddress = new InetSocketAddress(serverName, getServerPort()); + if (serverAddress.isUnresolved()) { + // default should be specified via config file. + serverAddress = new InetSocketAddress(DEFAULT_SERVER_HOST_NAME, getServerPort()); + } + } + return serverAddress; + } + + @Id @GeneratedValue + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + + public int getServerPort() { + return serverPort; + } + + public void setServerPort(int serverPort) { + this.serverPort = serverPort; + } + + public String getServerName() { + return serverName; + } + + public void setServerName(String serverName) { + this.serverName = serverName; + } + + public boolean isTriggeredExperiment() { + // TODO Auto-generated method stub + return triggeredExperiment; + } + + public void setTriggeredExperiment(boolean triggeredExperiment) { + this.triggeredExperiment = triggeredExperiment; + } + + @ManyToOne + public ConsentForm getConsentForm() { + return consentForm; + } + public void setConsentForm(ConsentForm consentForm) { + this.consentForm = consentForm; + } + + // advances the parameters iterator or resets it. + public void updateCurrentParameters() { + if (parametersIterator == null || ! parametersIterator.hasNext()) { + parametersIterator = getAllParameters().iterator(); + } + currentParameters = parametersIterator.next(); + } + + @Transient + public synchronized T getCurrentParameters() { + List<T> allParameters = getAllParameters(); + if (currentParameters == null) { + if (allParameters.isEmpty()) { + throw new ExperimentLifecycleException("No experiment round parameters available for : " + getExperimentName()); + } + currentParameters = allParameters.get(0); + } + return currentParameters; + } + + public String getClientJarName() { + return clientJarName; + } + + public void setClientJarName(String clientJarName) { + this.clientJarName = clientJarName; + } + + public String getDescription() { + return description; + } + + public void setDescription(String description) { + this.description = description; + } + + public String getExperimentName() { + return experimentName; + } + + public void setExperimentName(String experimentName) { + this.experimentName = experimentName; + } + + public String getClientMainClass() { + return clientMainClass; + } + + public void setClientMainClass(String clientMainClass) { + this.clientMainClass = clientMainClass; + } + + @Transient + public Duration getDelayBetweenRounds() { + return Duration.create(30); + } +} Property changes on: trunk/gee/src/java/edu/indiana/psych/gee/bean/ExperimentConfigurationEntity.java ___________________________________________________________________ Name: svn:keywords + Author Date Id Revision Name: svn:eol-style + native Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.java 2006-05-18 05:43:53 UTC (rev 181) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerConfiguration.java 2006-05-19 00:48:18 UTC (rev 182) @@ -10,7 +10,7 @@ import javax.persistence.Table; import javax.persistence.Transient; -import edu.indiana.psych.gee.ExperimentConfigurationEntity; +import edu.indiana.psych.gee.bean.ExperimentConfigurationEntity; /** * $Id$ Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperiment.java 2006-05-18 05:43:53 UTC (rev 181) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperiment.java 2006-05-19 00:48:18 UTC (rev 182) @@ -64,13 +64,8 @@ private boolean roundRunning; - // FIXME: instead, need to find configurations from - // ExperimentConfigurationDao, yes? - public ForagerExperiment(ForagerConfiguration defaultConfiguration, - ExperimentConfigurationService configurationService) { - super(ForagerConfiguration.class, defaultConfiguration, configurationService); + public ForagerExperiment() { addEventProcessors(); - getLogger().debug("Creating a new ForagerExperiment with configuration: " + defaultConfiguration); } private void sendRegistrationEvent(Collection<Identifier> identifiers) { Modified: trunk/gee/war/WEB-INF/applicationContext.xml =================================================================== --- trunk/gee/war/WEB-INF/applicationContext.xml 2006-05-18 05:43:53 UTC (rev 181) +++ trunk/gee/war/WEB-INF/applicationContext.xml 2006-05-19 00:48:18 UTC (rev 182) @@ -53,17 +53,16 @@ <property name="sessionFactory" ref="sessionFactory"/> </bean> <!-- persistence layer daos--> - <bean id="experimentConfigurationDao" class="edu.indiana.psych.gee.service.HibernateExperimentConfigurationDao"> + <bean id="experimentConfigurationDao" class="edu.indiana.psych.gee.dao.HibernateExperimentConfigurationDao"> <property name="sessionFactory" ref="sessionFactory"/> </bean> - <bean id="consentFormDao" class="edu.indiana.psych.gee.service.HibernateConsentFormDao"> + <bean id="consentFormDao" class="edu.indiana.psych.gee.dao.HibernateConsentFormDao"> <property name="sessionFactory" ref="sessionFactory"/> </bean> <!-- application layer beans --> <bean id="experimentService" class="edu.indiana.psych.gee.service.ExperimentService"/> <bean id="configurationService" class="edu.indiana.psych.gee.service.ExperimentConfigurationService"> <property name="experimentConfigurationDao" ref="experimentConfigurationDao"/> - <property name="consentFormDao" ref="consentFormDao"/> </bean> <bean id="defaultForagerWebConfiguration" class="edu.indiana.psych.gee.forager.ForagerConfiguration"> <constructor-arg value="groups.psych.indiana.edu"/> Modified: trunk/gee/war/WEB-INF/hibernate.cfg.xml =================================================================== --- trunk/gee/war/WEB-INF/hibernate.cfg.xml 2006-05-18 05:43:53 UTC (rev 181) +++ trunk/gee/war/WEB-INF/hibernate.cfg.xml 2006-05-19 00:48:18 UTC (rev 182) @@ -7,9 +7,10 @@ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd "> <hibernate-configuration> <session-factory> - <mapping package="edu.indiana.psych.gee"/> - <mapping class="edu.indiana.psych.gee.ConsentForm"/> - <mapping class="edu.indiana.psych.gee.ExperimentConfigurationEntity"/> + <mapping package="edu.indiana.psych.gee.bean"/> + <mapping class="edu.indiana.psych.gee.bean.ConsentForm"/> + <mapping class="edu.indiana.psych.gee.bean.ExperimentConfigurationEntity"/> + <mapping class="edu.indiana.psych.gee.bean.Participant"/> <mapping package="edu.indiana.psych.gee.forager"/> <mapping class="edu.indiana.psych.gee.forager.ForagerAgentConfiguration"/> <mapping class="edu.indiana.psych.gee.forager.ForagerConfiguration"/> Modified: trunk/gee/war/consent.jsp =================================================================== --- trunk/gee/war/consent.jsp 2006-05-18 05:43:53 UTC (rev 181) +++ trunk/gee/war/consent.jsp 2006-05-19 00:48:18 UTC (rev 182) @@ -20,7 +20,7 @@ <TABLE CELLPADDING="4" CELLSPACING="2" BORDER="0"> <TR> <TD> - <B>${experimentName} consent form</B><BR> + <B>${experimentName}</B><BR> <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> </TABLE> @@ -137,11 +137,11 @@ IRB Approved <br/> <@ww.text name="approval.date"> - <@ww.param name="value" value="%{consentForm.irbDateApproved}"/> + <@ww.param value="'consentForm.irbDateApproved'"/> </@ww.text> <br/> <@ww.text name="approval.expiration.date"> - <@ww.param name="value" value="%{consentForm.irbDateApprovalExpires}"/> + <@ww.param value="'consentForm.irbDateApprovalExpires'"/> </@ww.text> </small> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
|
From: <al...@us...> - 2006-05-31 22:54:04
|
Revision: 186 Author: alllee Date: 2006-05-31 15:53:54 -0700 (Wed, 31 May 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=186&view=rev Log Message: ----------- default experiment configurations are now persisted/loaded from the DB when AbstractExperiment is being instantiated. Modified Paths: -------------- trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java trunk/gee/src/java/edu/indiana/psych/gee/Experiment.java trunk/gee/src/java/edu/indiana/psych/gee/action/ManageExperiment.java trunk/gee/src/java/edu/indiana/psych/gee/action/ManageExperimentConfiguration.java trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java trunk/gee/src/java/edu/indiana/psych/gee/dao/ExperimentConfigurationDao.java trunk/gee/src/java/edu/indiana/psych/gee/dao/HibernateExperimentConfigurationDao.java trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerServerGameState.java trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentConfigurationService.java trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentService.java trunk/gee/war/WEB-INF/applicationContext.xml trunk/gee/war/WEB-INF/classes/gee-admin.xml trunk/gee/war/WEB-INF/classes/xwork.xml trunk/gee/war/admin/configureExperiment.jsp trunk/gee/war/admin/listExperiments.jsp trunk/gee/war/css/gee.css trunk/gee/war/index.jsp trunk/gee/war/template.jsp Modified: trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java 2006-05-31 22:53:54 UTC (rev 186) @@ -32,9 +32,8 @@ private boolean running; private ExperimentService experimentService; -// private ExperimentConfigurationService configurationService; + private ExperimentConfigurationService configurationService; - private String name; private C configuration; // private ExperimentRoundParameters currentParameters; @@ -64,11 +63,6 @@ return defaultConfiguration; } - public void setDefaultConfiguration(C defaultConfiguration) { - this.defaultConfiguration = defaultConfiguration; - } - - public synchronized void start() throws ExperimentLifecycleException { if ( isRunning() ) { getLogger().warn("Ignoring request to START an already running experiment."); @@ -94,6 +88,9 @@ } public int getServerPort() { + if (configuration == null) { + return -1; + } return getConfiguration().getServerPort(); } @@ -107,12 +104,16 @@ } public String getName() { - if (name == null) { - name = getConfiguration().getExperimentName(); + if (configuration == null) { + return super.toString(); } - return name; + return getConfiguration().getExperimentName(); } + public String getIdentifier() { + return getConfiguration().getExperimentIdentifier(); + } + public boolean equals(Object object) { return (this == object) || ((object instanceof Experiment) && ((Experiment) object).getName().equals(getName())); @@ -187,7 +188,6 @@ protected abstract StateMachine getStateMachine(); - private Thread createExperimentServerThread() { return new Thread(new Runnable() { public void run() { @@ -211,6 +211,22 @@ } public void setConfigurationService(ExperimentConfigurationService configurationService) { -// this.configurationService = configurationService; + this.configurationService = configurationService; } + + public void setDefaultConfiguration(C defaultConfiguration) { + if (defaultConfiguration == null) { + throw new IllegalArgumentException("Cannot set default configuration to null."); + } + ExperimentConfiguration configuration = configurationService.find(defaultConfiguration.getClass(), defaultConfiguration.getExperimentIdentifier()); + if (configuration == null) { + this.defaultConfiguration = defaultConfiguration; + configurationService.persist(defaultConfiguration); + } + else { + this.defaultConfiguration = (C) configuration; + } + } + + } Modified: trunk/gee/src/java/edu/indiana/psych/gee/Experiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/Experiment.java 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/src/java/edu/indiana/psych/gee/Experiment.java 2006-05-31 22:53:54 UTC (rev 186) @@ -31,6 +31,9 @@ public String getName() { return "null"; } + public String getIdentifier() { + return "null"; + } public ConsentForm getConsentForm() { return null; } @@ -61,6 +64,7 @@ public String getDescription(); public String getName(); + public String getIdentifier(); public ConsentForm getConsentForm(); Modified: trunk/gee/src/java/edu/indiana/psych/gee/action/ManageExperiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/ManageExperiment.java 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/ManageExperiment.java 2006-05-31 22:53:54 UTC (rev 186) @@ -23,7 +23,7 @@ private Set<Experiment> experiments; - private String experimentName; + private String experimentIdentifier; private ExperimentConfiguration configuration; @@ -37,32 +37,18 @@ } public String start() { - getLogger().debug("Starting: " + experimentName); + getLogger().debug("Starting: " + experimentIdentifier); getExperiment().start(); return NONE; } - public String status() { - getLogger().debug("Retrieving status for: " + experimentName); - return SUCCESS; - } - public String stop() { Experiment experiment = getExperiment(); - getLogger().debug("Stopping: " + experimentName + ": " + experiment); + getLogger().debug("Stopping: " + experimentIdentifier + ": " + experiment); experiment.stop(); return NONE; } - public String listExperiments() { - return SUCCESS; - } - - public String createExperiment() { - - return SUCCESS; - } - public ExperimentConfiguration getConfiguration() { return getExperiment().getConfiguration(); } @@ -79,11 +65,11 @@ } public Experiment getExperiment() { - return getExperimentService().find(experimentName); + return getExperimentService().find(experimentIdentifier); } - public void setExperimentName(String experimentName) { - this.experimentName = experimentName; + public void setExperimentIdentifier(String experimentName) { + this.experimentIdentifier = experimentName; } } Modified: trunk/gee/src/java/edu/indiana/psych/gee/action/ManageExperimentConfiguration.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/ManageExperimentConfiguration.java 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/ManageExperimentConfiguration.java 2006-05-31 22:53:54 UTC (rev 186) @@ -15,22 +15,71 @@ @SuppressWarnings("serial") public class ManageExperimentConfiguration extends GeeAction { + private ExperimentConfiguration<? extends ExperimentRoundParameters> configuration; + private String configurationId; + private String configurationClass; public String save() { + if (configuration == null) { + configuration = findConfiguration(getConfigurationId()); + getLogger().warn("Trying to save a null configuration, ignoring.."); + return INPUT; + } getConfigurationService().persist(configuration); return SUCCESS; } + public String add() { + configuration = findConfiguration(-1L); + return INPUT; + } + + public String edit() { + configuration = findConfiguration(getConfigurationId()); + return INPUT; + } + + public String addParameters() { + return INPUT; + } + public String delete() { getConfigurationService().delete(configuration); return SUCCESS; } + public ExperimentConfiguration<? extends ExperimentRoundParameters> getConfiguration() { + return configuration; + } + + public Long getConfigurationId() { + return Long.valueOf(configurationId); + } + public void setConfigurationId(String configurationId) { + this.configurationId = configurationId; + } + + private ExperimentConfiguration<? extends ExperimentRoundParameters> findConfiguration(Long configurationId) { + return getConfigurationService().find(getConfigurationClass(), configurationId); + } + + private Class getConfigurationClass() { + // TODO Auto-generated method stub + try { + return Class.forName(configurationClass); + } + catch (ClassNotFoundException e) { + // TODO Auto-generated catch block + e.printStackTrace(); + getLogger().error("Could not find class:" + configurationClass); + return null; + } + } - public void setConfiguration(ExperimentConfiguration<? extends ExperimentRoundParameters> configuration) { - this.configuration = configuration; + public void setConfigurationClass(String configurationClass) { + this.configurationClass = configurationClass; } } Modified: trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java 2006-05-31 22:53:54 UTC (rev 186) @@ -14,11 +14,11 @@ @SuppressWarnings("serial") public class StartExperiment extends GeeAction { - private String experimentName; + private String experimentIdentifier; private Participant participant; private ConsentForm consentForm; - public String prepare() { + public String consent() { consentForm = getExperiment().getConsentForm(); if (consentForm == null) { // no consent form available for this experiment.. just start? @@ -28,7 +28,7 @@ } public String start() { - if ( getExperimentService().start(experimentName) ) { + if ( getExperimentService().start(experimentIdentifier) ) { return SUCCESS; } else { @@ -38,21 +38,17 @@ } public Experiment getExperiment() { - return getExperimentService().find(experimentName); + return getExperimentService().find(experimentIdentifier); } public ConsentForm getConsentForm() { return consentForm; } - public String getExperimentName() { - return experimentName; + public void setExperimentIdentifier(String experimentName) { + this.experimentIdentifier = experimentName; } - public void setExperimentName(String experimentName) { - this.experimentName = experimentName; - } - public Participant getParticipant() { return participant; } Modified: trunk/gee/src/java/edu/indiana/psych/gee/dao/ExperimentConfigurationDao.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/dao/ExperimentConfigurationDao.java 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/src/java/edu/indiana/psych/gee/dao/ExperimentConfigurationDao.java 2006-05-31 22:53:54 UTC (rev 186) @@ -5,6 +5,8 @@ import edu.indiana.psych.gee.ExperimentConfiguration; import edu.indiana.psych.gee.ExperimentRoundParameters; +import java.util.List; + /** * $Id$ * @@ -22,6 +24,8 @@ public <E extends ExperimentConfiguration> E find(final Class<E> configurationClass, final String experimentName); + public <E extends ExperimentConfiguration> List<E> findAll(Class<E> configurationClass); + public void persist(ExperimentConfiguration<? extends ExperimentRoundParameters> configuration); public void delete(ExperimentConfiguration<? extends ExperimentRoundParameters> configuration); Modified: trunk/gee/src/java/edu/indiana/psych/gee/dao/HibernateExperimentConfigurationDao.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/dao/HibernateExperimentConfigurationDao.java 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/src/java/edu/indiana/psych/gee/dao/HibernateExperimentConfigurationDao.java 2006-05-31 22:53:54 UTC (rev 186) @@ -5,6 +5,7 @@ import org.hibernate.Criteria; import org.hibernate.HibernateException; import org.hibernate.Session; +import org.hibernate.criterion.DetachedCriteria; import org.hibernate.criterion.Restrictions; import org.springframework.orm.hibernate3.HibernateCallback; import org.springframework.orm.hibernate3.support.HibernateDaoSupport; @@ -12,6 +13,8 @@ import edu.indiana.psych.gee.ExperimentConfiguration; import edu.indiana.psych.gee.ExperimentRoundParameters; +import java.util.List; + /** * $Id: Exp $ * @@ -26,16 +29,31 @@ private final Log logger = LogFactory.getLog(getClass()); + public <E extends ExperimentConfiguration> List<E> findAll(Class<E> configurationClass) { + return (List<E>) getHibernateTemplate().findByCriteria( DetachedCriteria.forClass(configurationClass) ); + } + public <E extends ExperimentConfiguration> E find(Class<E> configurationClass, Long id) { + if (id == -1L) { + try { + return configurationClass.newInstance(); + } + catch (Exception e) { + e.printStackTrace(); + String errorMessage = "Unable to instantiate instance of: " + configurationClass; + logger.error(errorMessage); + throw new IllegalArgumentException(errorMessage, e); + } + } return configurationClass.cast(getHibernateTemplate().get(configurationClass, id)); } - public <E extends ExperimentConfiguration> E find(final Class<E> configurationClass, final String experimentName) { + public <E extends ExperimentConfiguration> E find(final Class<E> configurationClass, final String experimentIdentifier) { return configurationClass.cast( getHibernateTemplate().execute(new HibernateCallback() { public Object doInHibernate(Session session) throws HibernateException { Criteria criteria = session.createCriteria(configurationClass); - criteria.add(Restrictions.eq("experimentName", experimentName)); + criteria.add(Restrictions.eq("experimentIdentifier", experimentIdentifier)); return criteria.uniqueResult(); } })); Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java 2006-05-31 22:53:54 UTC (rev 186) @@ -9,7 +9,6 @@ import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.JoinColumn; -import javax.persistence.OneToMany; import javax.persistence.ManyToOne; import javax.persistence.Table; import javax.persistence.Transient; Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerServerGameState.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerServerGameState.java 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerServerGameState.java 2006-05-31 22:53:54 UTC (rev 186) @@ -25,7 +25,7 @@ /** * $Id$ * - * The ForagerServerGameState is the data model needed on the server side. + * Represents the server side data model. * * * @author Allen Lee Modified: trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentConfigurationService.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentConfigurationService.java 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentConfigurationService.java 2006-05-31 22:53:54 UTC (rev 186) @@ -1,9 +1,12 @@ package edu.indiana.psych.gee.service; + import edu.indiana.psych.gee.ExperimentConfiguration; import edu.indiana.psych.gee.ExperimentRoundParameters; import edu.indiana.psych.gee.dao.ExperimentConfigurationDao; +import java.util.List; + /** * $Id: Exp $ * @@ -21,9 +24,15 @@ // private ConsentFormDao consentFormDao; + public <E extends ExperimentConfiguration> List<E> findAll(Class<E> configurationClass) { + return experimentConfigurationDao.findAll(configurationClass); + } public <E extends ExperimentConfiguration> E find(Class<E> configurationClass, Long id) { - return experimentConfigurationDao.find(configurationClass, id); + if (configurationClass == null) { + return null; + } + return experimentConfigurationDao.find(configurationClass, id); } /* FIXME: figure out if it is even possible to support this sort of @@ -37,8 +46,8 @@ } */ - public <E extends ExperimentConfiguration> E find(Class<E> configurationClass, String experimentName) { - return experimentConfigurationDao.find(configurationClass, experimentName); + public <E extends ExperimentConfiguration> E find(Class<E> configurationClass, String experimentIdentifier) { + return experimentConfigurationDao.find(configurationClass, experimentIdentifier); } public void persist(ExperimentConfiguration<? extends ExperimentRoundParameters> configuration) { Modified: trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentService.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentService.java 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentService.java 2006-05-31 22:53:54 UTC (rev 186) @@ -21,32 +21,24 @@ public class ExperimentService { @SuppressWarnings("serial") - private final Map<String, Experiment> allExperiments = - new HashMap<String, Experiment>() { - public Experiment get(String key) { - if (key == null) { - return Experiment.NULL; - } - return super.get(key); - } - }; + private final Map<String, Experiment> allExperiments = new HashMap<String, Experiment>(); private final Log logger = LogFactory.getLog(getClass()); - public boolean start(String experimentName) { - find(experimentName).start(); - return available(experimentName); + public boolean start(String experimentIdentifier) { + find(experimentIdentifier).start(); + return available(experimentIdentifier); } - public boolean available(String experimentName) { - return allExperiments.containsKey(experimentName); + public boolean available(String experimentIdentifier) { + return allExperiments.containsKey(experimentIdentifier); } public void add(Experiment experiment) { if (experiment == null) { throw new IllegalArgumentException("Trying to add a null experiment to the experiment service"); } - allExperiments.put(experiment.getName(), experiment); + allExperiments.put(experiment.getIdentifier(), experiment); } public void remove(Experiment experiment) { @@ -54,13 +46,13 @@ logger.warn("Trying to remove a null experiment from ExperimentService - ignoring"); return; } - if ( allExperiments.remove(experiment.getName()) == null ) { + if ( allExperiments.remove(experiment.getIdentifier()) == null ) { logger.warn("Tried to remove " + experiment + " which doesn't exist in ExperimentService"); } } - public Experiment find(String name) { - Experiment experiment = allExperiments.get(name); + public Experiment find(String experimentIdentifier) { + Experiment experiment = allExperiments.get(experimentIdentifier); if (experiment == null) { return Experiment.NULL; } Modified: trunk/gee/war/WEB-INF/applicationContext.xml =================================================================== --- trunk/gee/war/WEB-INF/applicationContext.xml 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/war/WEB-INF/applicationContext.xml 2006-05-31 22:53:54 UTC (rev 186) @@ -67,7 +67,8 @@ <bean id="defaultForagerWebConfiguration" class="edu.indiana.psych.gee.forager.ForagerConfiguration"> <constructor-arg value="groups.psych.indiana.edu"/> <constructor-arg type="int"><value>26000</value></constructor-arg> - <property name="experimentName" value="forager-web"/> + <property name="experimentName" value="forager"/> + <property name="experimentIdentifier" value="forager-web"/> <property name="description" value="The Forager web experiment explores how individuals allocate themselves in a world with scarce resources via an always-available applet."/> <property name='clientJarName' value='forager-client.jar'/> <property name='clientMainClass' value='edu.indiana.psych.gee.forager.client.ForagerApplet'/> @@ -75,20 +76,21 @@ <bean id="defaultForagerExperimentConfiguration" class="edu.indiana.psych.gee.forager.ForagerConfiguration"> <constructor-arg value="groups.psych.indiana.edu"/> <constructor-arg type="int"><value>26001</value></constructor-arg> - <property name="experimentName" value="forager-experiment"/> + <property name="experimentName" value="forager"/> + <property name="experimentIdentifier" value="forager-experiment"/> <property name="description" value="The in-house Forager experiment explores how individuals allocate themselves in a world with scarce resources under a facilitator's guidance in controlled settings."/> <property name='clientJarName' value='forager-client.jar'/> <property name='clientMainClass' value='edu.indiana.psych.gee.forager.client.ForagerApplet'/> <property name='triggeredExperiment' value='true'/> </bean> <bean id="forager-web" class="edu.indiana.psych.gee.forager.ForagerExperiment"> + <property name="configurationService" ref='configurationService'/> <property name="defaultConfiguration" ref="defaultForagerWebConfiguration"/> - <property name="configurationService" ref='configurationService'/> <property name="experimentService" ref="experimentService"/> </bean> <bean id="forager-experiment" class="edu.indiana.psych.gee.forager.ForagerExperiment"> + <property name="configurationService" ref='configurationService'/> <property name="defaultConfiguration" ref="defaultForagerExperimentConfiguration"/> - <property name="configurationService" ref='configurationService'/> <property name="experimentService" ref="experimentService"/> </bean> </beans> Modified: trunk/gee/war/WEB-INF/classes/gee-admin.xml =================================================================== --- trunk/gee/war/WEB-INF/classes/gee-admin.xml 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/war/WEB-INF/classes/gee-admin.xml 2006-05-31 22:53:54 UTC (rev 186) @@ -8,9 +8,9 @@ admin package o' actions and urls. define the login filter here? --> <package name="admin" extends="default" namespace="/admin"> - <action name="index" class="edu.indiana.psych.gee.action.ManageExperiment" method="authenticate"> + <action name="index" class="edu.indiana.psych.gee.action.ManageExperiment"> <result name="success" type="freemarker">listExperiments.jsp</result> - <result name="error">error.jsp</result> + <result name="error">/error.jsp</result> </action> <action name="experiment" class="edu.indiana.psych.gee.action.ManageExperiment"> <result name="success" type="freemarker">listExperiments.jsp</result> Modified: trunk/gee/war/WEB-INF/classes/xwork.xml =================================================================== --- trunk/gee/war/WEB-INF/classes/xwork.xml 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/war/WEB-INF/classes/xwork.xml 2006-05-31 22:53:54 UTC (rev 186) @@ -43,9 +43,8 @@ <result type="freemarker">startExperiment.jsp</result> <result name="input" type="freemarker">consent.jsp</result> </action> - <action name="consent" class="edu.indiana.psych.gee.action.StartExperiment" method="prepare"> + <action name="consent" class="edu.indiana.psych.gee.action.StartExperiment" method="consent"> <!-- FIXME: do not use a validating stack here --> - <interceptor-ref name="basicStack"/> <result type="freemarker">consent.jsp</result> <result name="input" type="freemarker">consent.jsp</result> </action> Modified: trunk/gee/war/admin/configureExperiment.jsp =================================================================== --- trunk/gee/war/admin/configureExperiment.jsp 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/war/admin/configureExperiment.jsp 2006-05-31 22:53:54 UTC (rev 186) @@ -6,10 +6,12 @@ <p> Configuring the <span class="highlight">${configuration.experimentName}</span> experiment: </p> -<@ww.form action="updateExperimentConfiguration"> - <@ww.hidden name="experimentName" value="${configuration.experimentName}"/> +<@ww.form action="configuration!save.action" method="post"> + <@ww.hidden name="configurationClass" value="${configuration.class.name}"/> + <@ww.hidden name="configurationId" value="${configuration.id}"/> <@ww.textfield size=40 label="Server port" name="configuration.serverPort"/> <@ww.textfield size=40 label="Experiment name" name="configuration.experimentName"/> + <@ww.textfield size=40 label="Experiment id" name="configuration.experimentIdentifier"/> <@ww.textfield size=40 label="Server name" name="configuration.serverName"/> <@ww.textarea cols=37 rows=6 label="Description" name="configuration.description"/> <@ww.checkbox label="Triggered?" name="configuration.triggeredExperiment"/> @@ -25,13 +27,16 @@ <#else> <h3> <div id="Error"> -No experiment parameters associated with ${configuration.experimentName}, please add some! +No experiment parameters associated with ${configuration.experimentName}, + <a href='javascript:void(0)' onclick='toggle("addExperimentParametersDiv")'>add some?</a>. </div> </h3> </#if> <hr/> -<@ww.form action="addExperimentParameters" method="POST" enctype="multipart/form-data"> +<div id="addExperimentParametersDiv" style="display:none;"> +<@ww.form action="configuration!addParameters.action" method="POST" enctype="multipart/form-data"> <@ww.file label="Add experiment parameters from file: " name="'experimentParametersFile'"/> <@ww.submit value="Load"/> </@ww.form> +</div> </body> Modified: trunk/gee/war/admin/listExperiments.jsp =================================================================== --- trunk/gee/war/admin/listExperiments.jsp 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/war/admin/listExperiments.jsp 2006-05-31 22:53:54 UTC (rev 186) @@ -9,7 +9,7 @@ (not implemented yet). <table> <tr> - <th>Name</th> + <th>Name/Identifier</th> <th>Description</th> <th>Status</th> <th>Action</th> @@ -20,18 +20,18 @@ <#else> <tr class="displayeven"> </#if> - <td width="10%"><span class='highlight'>${name}</span></td> + <td width="10%"><span class='highlight'>${name} / ${identifier}</span></td> <td width="50%">${description}</td> <td width="15%"> ${running?string("running", "not running")} </td> <td width="25%"> ( - <a href="experiment!start.action?experimentName=${name}">Start<a> + <a href="experiment!start.action?experimentIdentifier=${identifier}">Start<a> | - <a href='experiment!stop.action?experimentName=${name}'>Stop<a> + <a href='experiment!stop.action?experimentIdentifier=${identifier}'>Stop<a> | - <a href='experiment!configure.action?experimentName=${name}'>Edit</a> + <a href='experiment!configure.action?experimentIdentifier=${identifier}'>Edit</a> ) </td> </tr> Modified: trunk/gee/war/css/gee.css =================================================================== --- trunk/gee/war/css/gee.css 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/war/css/gee.css 2006-05-31 22:53:54 UTC (rev 186) @@ -73,7 +73,7 @@ } th { - background: #C96; + background: #A4B5C5; border-left: 1px solid #EB8; border-right: 1px solid #B74; border-top: 1px solid #EB8; Modified: trunk/gee/war/index.jsp =================================================================== --- trunk/gee/war/index.jsp 2006-05-27 22:58:09 UTC (rev 185) +++ trunk/gee/war/index.jsp 2006-05-31 22:53:54 UTC (rev 186) @@ -57,12 +57,13 @@ <tr class="displayeven"> </#if> <td style="white-space: nowrap;"> - <a href='consent.action?experimentName=${name}'> - <span class="highlight">[ ${name} ]</span> - </a> + <#assign url='consent.action?experimentIdentifier=${identifier}'> + <@ww.a hre... [truncated message content] |
|
From: <al...@us...> - 2006-06-18 18:34:54
|
Revision: 188 Author: alllee Date: 2006-06-18 11:34:40 -0700 (Sun, 18 Jun 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=188&view=rev Log Message: ----------- * adding new forager images * NioDispatcher's connect() now blocks until it receives an Identifier from the server it's connecting to. * some more refactoring. Modified Paths: -------------- trunk/gee/lib/junit.jar trunk/gee/src/java/edu/indiana/psych/gee/event/AbstractEvent.java trunk/gee/src/java/edu/indiana/psych/gee/event/AbstractPersistableEvent.java trunk/gee/src/java/edu/indiana/psych/gee/event/Event.java trunk/gee/src/java/edu/indiana/psych/gee/event/EventChannel.java trunk/gee/src/java/edu/indiana/psych/gee/event/EventProcessor.java trunk/gee/src/java/edu/indiana/psych/gee/event/EventTypeProcessor.java trunk/gee/src/java/edu/indiana/psych/gee/forager/DebriefingAssistant.java trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperiment.java trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerServerGameState.java trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerClient.java trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerClientGameState.java trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerGameWindow.java trunk/gee/src/java/edu/indiana/psych/gee/forager/event/ClientUpdateEvent.java trunk/gee/src/java/edu/indiana/psych/gee/net/AbstractServerDispatcher.java trunk/gee/src/java/edu/indiana/psych/gee/net/ClientSocketDispatcher.java trunk/gee/src/java/edu/indiana/psych/gee/net/NioDispatcher.java trunk/gee/src/java/edu/indiana/psych/gee/net/ServerSocketDispatcher.java trunk/gee/src/java/edu/indiana/psych/gee/net/Worker.java trunk/gee/src/java/edu/indiana/psych/gee/net/WorkerPool.java trunk/gee/war/WEB-INF/classes/xwork.xml trunk/gee/war/index.jsp Added Paths: ----------- trunk/gee/src/test/edu/indiana/psych/gee/net/NioDispatcherTester.java trunk/gee/war/WEB-INF/lib/dwr.jar trunk/gee/war/images/forager-v2/ trunk/gee/war/images/forager-v2/bot-back.gif trunk/gee/war/images/forager-v2/bot-front.gif trunk/gee/war/images/forager-v2/bot-side-left.gif trunk/gee/war/images/forager-v2/bot-side-right.gif trunk/gee/war/images/forager-v2/grass-1.gif trunk/gee/war/images/forager-v2/grass-2.gif trunk/gee/war/images/forager-v2/grass-3.gif trunk/gee/war/images/forager-v2/grass-4.gif trunk/gee/war/images/forager-v2/others-back.gif trunk/gee/war/images/forager-v2/others-front.gif trunk/gee/war/images/forager-v2/others-side-left.gif trunk/gee/war/images/forager-v2/others-side-right.gif trunk/gee/war/images/forager-v2/you-back.gif trunk/gee/war/images/forager-v2/you-front.gif trunk/gee/war/images/forager-v2/you-side-left.gif trunk/gee/war/images/forager-v2/you-side-right.gif Removed Paths: ------------- trunk/gee/src/java/edu/indiana/psych/gee/net/event/ServerAssignedIdentifierEvent.java trunk/gee/src/test/edu/indiana/psych/gee/net/SocketIdentifierTester.java Modified: trunk/gee/lib/junit.jar =================================================================== (Binary files differ) Modified: trunk/gee/src/java/edu/indiana/psych/gee/event/AbstractEvent.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/event/AbstractEvent.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/event/AbstractEvent.java 2006-06-18 18:34:40 UTC (rev 188) @@ -43,7 +43,7 @@ /** * Returns the event's identifier */ - public Identifier id() { + public Identifier getId() { return id; } Modified: trunk/gee/src/java/edu/indiana/psych/gee/event/AbstractPersistableEvent.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/event/AbstractPersistableEvent.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/event/AbstractPersistableEvent.java 2006-06-18 18:34:40 UTC (rev 188) @@ -42,7 +42,6 @@ // ordinal to help impose a total ordering across all persistable events. int comparison = compare(getCreationTime(), e.getCreationTime()); if (comparison == 0) { - // this may cause problems with overflow if that should ever happen. return compare(ordinal, e.ordinal); } return comparison; Modified: trunk/gee/src/java/edu/indiana/psych/gee/event/Event.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/event/Event.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/event/Event.java 2006-06-18 18:34:40 UTC (rev 188) @@ -15,7 +15,7 @@ */ public interface Event extends Serializable { - public Identifier id(); + public Identifier getId(); // FIXME: use TimePoints instead. public long getCreationTime(); Modified: trunk/gee/src/java/edu/indiana/psych/gee/event/EventChannel.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/event/EventChannel.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/event/EventChannel.java 2006-06-18 18:34:40 UTC (rev 188) @@ -1,6 +1,7 @@ package edu.indiana.psych.gee.event; import java.util.ArrayList; +import java.util.Collection; import java.util.HashMap; import java.util.List; import java.util.Map; @@ -17,21 +18,17 @@ private final static EventChannel INSTANCE = new EventChannel(); - /** - * EventDispatcher helper class manages the EventChannel's EventGenerator - * duties (subscribe/unsubscribe) as well as dispatching requests. It - * installs new EventHandlers, removes extant EventHandlers, and propagates - * events generated by the pool or passed in via the handle(Event event) - * method. - */ - private final EventDispatcher assistant = new EventDispatcher(); + private final Map<EventHandler, EventConstraint> eventListeners = + new HashMap<EventHandler, EventConstraint>(); + // Maps a 'module' owner to a list of event processors (which encapsulate both EventHandling + // and an EventConstraint). private final Map<Object, List<EventProcessor>> owners = new HashMap<Object, List<EventProcessor>>(); /** * Provides access to a singleton version of the EventChannel. - * @return + * @return the EventChannel singleton */ public static EventChannel getInstance() { return INSTANCE; @@ -39,160 +36,162 @@ /** * Adds an event to the EventChannel which then propagates the event to - * all interested subscribers. + * all interested subscribers. EventHandler.handle(Event) is invoked in a separate + * thread of execution. * - * @param event The event to add to the Pool. + * @param event The event to distribute via this EventChannel. */ - public synchronized void handle(Event event) { - assistant.dispatch(event); + public void handle(final Event event) { + synchronized (eventListeners) { + for (final Map.Entry<EventHandler, EventConstraint> entry : eventListeners.entrySet()) { + if (entry.getValue().accepts(event)) { + new Thread() { + public void run() { + entry.getKey().handle(event); + } + }.start(); + } + } + } } - + /** * An EventTypeProcessor is a convenience type for subscribing to the pool and * provides localized event handling for a given constraint. * @param processor */ - public synchronized void add(EventProcessor processor) { + public void add(EventProcessor processor) { subscribe(processor, processor); } - + /** * An EventTypeProcessor is a convenience type for subscribing to the pool and * provides localized event handling for a given constraint. * @param processor */ - public synchronized void add(Object owner, EventProcessor processor) { + public void add(Object owner, EventProcessor processor) { getEventProcessorsFor(owner).add(processor); } - - @SuppressWarnings("serial") + private List<EventProcessor> getEventProcessorsFor(Object owner) { - List<EventProcessor> processors = owners.get(owner); - if (processors == null) { - // overrides the add method to auto-subscribe the EventProcessor - // with this EventChannel. Should probably override all other - // add/insert methods in the future. - processors = new ArrayList<EventProcessor>() { - public boolean add(EventProcessor processor) { - subscribe(processor, processor); - return super.add(processor); - } - }; - owners.put(owner, processors); + synchronized (owners) { + List<EventProcessor> processors = owners.get(owner); + if (processors == null) { + processors = new EventProcessorList(); + owners.put(owner, processors); + } + return processors; } - return processors; + } - + public List<EventProcessor> register(Object owner) { return getEventProcessorsFor(owner); } - - public synchronized void unregister(Object owner) { - List<EventProcessor> processors = owners.remove(owner); + + public void unregister(Object owner) { + List<EventProcessor> processors = null; + synchronized (owners) { + processors = owners.remove(owner); + } if (processors != null) { for (EventProcessor processor: processors) { unsubscribe(processor); } } } - - public synchronized void remove(Object owner) { + + public void remove(Object owner) { unregister(owner); } /** - * Informs the pool that the given handler should receive all Events added - * to the Pool satisfying the given EventConstraint. + * The given handler will receive all Events received by this EventChannel + * accept()-ed by the given EventConstraint. * * @param handler The EventHandler to subscribe. * @param constraint The constraint with which to filter events. */ - public synchronized void subscribe(EventHandler handler, EventConstraint constraint) { + public void subscribe(EventHandler handler, EventConstraint constraint) { if (handler == this) { throw new IllegalArgumentException( "Cannot subscribe the event channel to itself."); } - assistant.put(handler, constraint); + synchronized (eventListeners) { + eventListeners.put(handler, constraint); + } } - - public synchronized void subscribe(EventHandler handler) { - subscribe(handler, EventConstraint.NONE); + + public void subscribe(EventHandler handler) { + subscribe(handler, EventConstraint.NONE); } /** - * Unsubscribes an EventHandler. + * Unsubscribes an EventHandler from this EventChannel, stopping it from receiving any + * events from this EventChannel. * * @param handler The EventHandler to unsubscribe. - * - * @throws KnownspaceException */ - public synchronized void unsubscribe(EventHandler handler) { - assistant.remove(handler); + public void unsubscribe(EventHandler handler) { + synchronized (eventListeners) { + eventListeners.remove(handler); + } } - + /** - * Extract this class to top level if it turns out to be useful in more contexts. - * - * @see mud.engine.EventGenerator + * $Id$ + * + * FIXME: this class should support automatic subscription/unsubscription with all methods that + * add/remove to this List. Right now only the basic add/remove methods are supported. */ - private static class EventDispatcher { - private final Map<EventHandler, EventConstraint> eventListeners; - - /** - * Create a new EventDispatcher. - */ - protected EventDispatcher() { - eventListeners = new HashMap<EventHandler, EventConstraint>(); + private class EventProcessorList extends ArrayList<EventProcessor> { + private static final long serialVersionUID = -4756601346604320046L; + @Override + public boolean add(EventProcessor processor) { + subscribe(processor, processor); + return super.add(processor); } - - /** - * Associates a constraint with a given handler; whenever an Event passes - * through the EventChannel the constraint is applied to the event. If - * successful, the Event is passed to the EventHandler, otherwise it's - * skipped. Currently only supports 1-1 mappings between constraints - * and handlers. - * - * @param handler EventHandler to subscribe. - * @param constraint EventConstraint to filter with. - */ - protected synchronized void put(EventHandler handler, EventConstraint constraint) { - eventListeners.put(handler, constraint); + @Override + public void add(int index, EventProcessor processor) { + subscribe(processor, processor); + super.add(index, processor); } - - /** - * Removes an EventHandler and its associated constraint. This method - * provides access for removing EventHandlers. It should be used - * within the EventGenerator's unsubscribe() method. - * - * @param handler The EventHandler to remove. - */ - protected synchronized void remove(EventHandler handler) { - eventListeners.remove(handler); + @Override + public boolean addAll(Collection<? extends EventProcessor> c) { + for (EventProcessor processor: c) { + subscribe(processor, processor); + } + return super.addAll(c); } - - /** - * Fires the given event to all interested EventHandlers. This method - * provides a way for Events to be sent to all EventHandlers subscribed - * for them. - * - * @param event The event to fire. - */ - protected synchronized void dispatch(final Event event) { - for (Map.Entry<EventHandler, EventConstraint> entry : eventListeners.entrySet()) { - if (entry.getValue().accepts(event)) { - entry.getKey().handle(event); - } + @Override + public boolean addAll(int index, Collection<? extends EventProcessor> c) { + for (EventProcessor processor: c) { + subscribe(processor, processor); } - /* - for (Iterator handlers = eventListeners.keySet().iterator(); handlers.hasNext(); ) { - final EventHandler handler = (EventHandler) handlers.next(); - final EventConstraint constraint = eventListeners.get(handler); - if ( constraint.accepts(event) ) { - handler.handle(event); + return super.addAll(index, c); + } + @Override + public EventProcessor remove(int index) { + EventProcessor removed = super.remove(index); + unsubscribe(removed); + return removed; + } + @Override + public boolean remove(Object o) { + if (o instanceof EventProcessor) { + unsubscribe((EventProcessor) o); + } + return super.remove(o); + } + @Override + public boolean removeAll(Collection<?> c) { + for (Object o: c) { + if (o instanceof EventProcessor) { + unsubscribe((EventProcessor) o); } } - */ + return super.removeAll(c); } - + } } Modified: trunk/gee/src/java/edu/indiana/psych/gee/event/EventProcessor.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/event/EventProcessor.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/event/EventProcessor.java 2006-06-18 18:34:40 UTC (rev 188) @@ -4,7 +4,9 @@ /** * $Id$ * - * Support class for processing events by type. + * Support interface for processing events, encapsulating both an EventHandler and an EventConstraint + * in the same class/type. + * * * @author <a href='al...@cs...'>Allen Lee</a> * @version $Revision$ Modified: trunk/gee/src/java/edu/indiana/psych/gee/event/EventTypeProcessor.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/event/EventTypeProcessor.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/event/EventTypeProcessor.java 2006-06-18 18:34:40 UTC (rev 188) @@ -4,7 +4,8 @@ /** * $Id$ * - * Generified version of EventTypeProcessor. + * An EventTypeProcessor encapsulates both an EventHandler and an EventInstanceofConstraint + * within the same class for convenience sake. * * @author <a href='al...@cs...'>Allen Lee</a> * @version $Revision$ @@ -12,7 +13,7 @@ public abstract class EventTypeProcessor<E extends Event> implements EventProcessor<E> { - private final EventConstraint constraint; + private final EventInstanceofConstraint constraint; /** * FIXME: find a way to get around having to specify the type of the class @@ -29,5 +30,4 @@ public boolean accepts(Event event) { return constraint.accepts(event); } - } Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/DebriefingAssistant.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/DebriefingAssistant.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/DebriefingAssistant.java 2006-06-18 18:34:40 UTC (rev 188) @@ -50,7 +50,7 @@ List<EventProcessor> processors = channel.register(this); processors.add(new EventTypeProcessor<PersistableEvent>(PersistableEvent.class) { public boolean accepts(Event event) { - return super.accepts(event) && ! (event.id() instanceof AgentIdentifier); + return super.accepts(event) && ! (event.getId() instanceof AgentIdentifier); } public void handle(PersistableEvent event) { if (event instanceof FoodAddedEvent) { @@ -62,7 +62,7 @@ else { // otherwise, associate it with the actions of the given client // only. - TreeSet<PersistableEvent> actions = clientActions.get(event.id()); + TreeSet<PersistableEvent> actions = clientActions.get(event.getId()); if (actions == null) { // FIXME: should assert that there are no actions ONLY for bot // identifiers. Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperiment.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperiment.java 2006-06-18 18:34:40 UTC (rev 188) @@ -92,9 +92,9 @@ processors.add(new EventTypeProcessor<ClientReadyEvent>(ClientReadyEvent.class) { public void handle(ClientReadyEvent event) { synchronized (queuedParticipants) { - if ( queuedParticipants.remove(event.id()) ) { - readyToJoinParticipants.add(event.id()); - sendRegistrationEvent(event.id()); + if ( queuedParticipants.remove(event.getId()) ) { + readyToJoinParticipants.add(event.getId()); + sendRegistrationEvent(event.getId()); } } } @@ -102,7 +102,7 @@ processors.add(new EventTypeProcessor<ClientUpdateEvent>(ClientUpdateEvent.class) { public void handle(ClientUpdateEvent event) { synchronized (currentParticipantHeadings) { - currentParticipantHeadings.put(event.id(), event.getDirection()); + currentParticipantHeadings.put(event.getId(), event.getDirection()); } } }); @@ -110,9 +110,9 @@ processors.add(new EventTypeProcessor<ConnectionEvent>(ConnectionEvent.class) { public void handle(ConnectionEvent event) { synchronized (queuedParticipants) { - queuedParticipants.add(event.id()); + queuedParticipants.add(event.getId()); } - sendRegistrationEvent(event.id()); + sendRegistrationEvent(event.getId()); } }); Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerServerGameState.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerServerGameState.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerServerGameState.java 2006-06-18 18:34:40 UTC (rev 188) @@ -95,11 +95,11 @@ // the ForagerServerGameState. if (event instanceof AddClientEvent) { AddClientEvent addClientEvent = (AddClientEvent) event; - addClient(addClientEvent.id(), addClientEvent.getPosition()); + addClient(addClientEvent.getId(), addClientEvent.getPosition()); } else if (event instanceof MovementEvent) { MovementEvent movementEvent = (MovementEvent) event; - moveClient(movementEvent.id(), movementEvent.getDirection()); + moveClient(movementEvent.getId(), movementEvent.getDirection()); } else if (event instanceof FoodAddedEvent) { FoodAddedEvent foodAddedEvent = (FoodAddedEvent) event; Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerClient.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerClient.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerClient.java 2006-06-18 18:34:40 UTC (rev 188) @@ -96,12 +96,12 @@ // FIXME: should state change should happen in a consistent way // by a consistent class? state = READY; - if (event.id().equals(id)) { + if (event.getId().equals(id)) { dispatcher.transmit(event); } else { error("Invalid client id ready, expected [" + id + "] actual [" - + event.id() + "]"); + + event.getId() + "]"); } } }); @@ -294,7 +294,7 @@ private ClientMessageQueueHandler(EventChannel channel) { channel.add(new EventTypeProcessor<ClientUpdateEvent>(ClientUpdateEvent.class) { public void handle(ClientUpdateEvent event) { - assert event.id().equals(ForagerClient.this.id); + assert event.getId().equals(ForagerClient.this.id); if (ForagerClient.this.state != RUNNING) { info("game is currently not running, ignoring: " + event + " state: " + ForagerClient.this.state); return; Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerClientGameState.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerClientGameState.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerClientGameState.java 2006-06-18 18:34:40 UTC (rev 188) @@ -74,7 +74,7 @@ clientState.setPosition(point); } if (event.didConsumeFood()) { - ClientState clientState = clients.get(event.id()); + ClientState clientState = clients.get(event.getId()); clientState.incrementFoodEaten(); // FIXME: drop an event into the event channel to signal the ForagerGameWindow // instead of doing this. Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerGameWindow.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerGameWindow.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/client/ForagerGameWindow.java 2006-06-18 18:34:40 UTC (rev 188) @@ -160,7 +160,7 @@ // reading through the debriefing! } setSpecialInstructions(event.toString()); - clientIdentifier = event.id(); + clientIdentifier = event.getId(); } private synchronized void setSpecialInstructions(String specialInstructions) { Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/event/ClientUpdateEvent.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/event/ClientUpdateEvent.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/event/ClientUpdateEvent.java 2006-06-18 18:34:40 UTC (rev 188) @@ -32,6 +32,6 @@ } public String toString() { - return "Client update: " + id() + "\n\tDirection: " + direction; + return "Client update: " + getId() + "\n\tDirection: " + direction; } } Modified: trunk/gee/src/java/edu/indiana/psych/gee/net/AbstractServerDispatcher.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/net/AbstractServerDispatcher.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/net/AbstractServerDispatcher.java 2006-06-18 18:34:40 UTC (rev 188) @@ -37,8 +37,8 @@ super(channel); channel.add(this, new EventTypeProcessor<DisconnectionRequest>(DisconnectionRequest.class) { public void handle(DisconnectionRequest request) { - logger.warn("disconnecting: " + request.id(), request.getException()); - disconnectedClients.add( request.id() ); + logger.warn("disconnecting: " + request.getId(), request.getException()); + disconnectedClients.add( request.getId() ); } }); } @@ -68,7 +68,6 @@ port, listeningPort)); return; } - listening = true; listeningPort = port; dispatcherThread = createDispatcherThread(); dispatcherThread.start(); @@ -93,7 +92,7 @@ } private Thread createDispatcherThread() { - return new Thread(new Runnable() { + return new Thread() { /** * Template method controlling the flow of execution for this Dispatcher. * Subclasses should implement bind(int port) and processIncomingConnections() @@ -104,6 +103,7 @@ logger.debug(getClass() + " listening on port:" + port); try { bind(port); + listening = true; while ( listening ) { processIncomingConnections(); // disconnect any pending disconnected clients and so on. @@ -116,9 +116,13 @@ shutdown(); } } - }); + }; } + public boolean isListening() { + return listening; + } + private void performConnectionMaintenance() { for (Iterator<Identifier> iter = disconnectedClients.iterator(); iter.hasNext(); ) { Identifier id = iter.next(); Modified: trunk/gee/src/java/edu/indiana/psych/gee/net/ClientSocketDispatcher.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/net/ClientSocketDispatcher.java 2006-05-31 23:57:30 UTC (rev 187) +++ trunk/gee/src/java/edu/indiana/psych/gee/net/ClientSocketDispatcher.java 2006-06-18 18:34:40 UTC (rev 188) @@ -10,22 +10,13 @@ import edu.indiana.psych.gee.event.EventTypeProcessor; import edu.indiana.psych.gee.net.event.ConnectionEvent; import edu.indiana.psych.gee.net.event.DisconnectionRequest; -import edu.indiana.psych.gee.net.event.ServerAssignedIdentifierEvent; /** * $Id$ * - * FIXME: Confused class hierarchy needs some work. Both ClientSocketDispatcher - * and ServerSocketDispatcher have common code for reading and transmitting - * Events across the network that should live somewhere common. Perhaps this is - * the case for SocketDispatcherWorker being its bona fide class. - * across the network - where should this live? The AbstractServerDispatcher - * has additional helper methods that it can use. + * The client dispatcher only implements the connecting part of the network business. * - * Perhaps this is a sign that we should be using composition instead of - * inheritance. * - * - * + * * @author Allen Lee * @version $Revision$ */ @@ -37,7 +28,7 @@ super(channel); channel.add(new EventTypeProcessor<DisconnectionRequest>(DisconnectionRequest.class) { public void handle(DisconnectionRequest event) { - disconnect(event.id()); + disc... [truncated message content] |
|
From: <al...@us...> - 2006-06-20 06:45:02
|
Revision: 196 Author: alllee Date: 2006-06-19 23:44:52 -0700 (Mon, 19 Jun 2006) ViewCVS: http://svn.sourceforge.net/gabel/?rev=196&view=rev Log Message: ----------- adding default forager consent form bean to application context. Modified Paths: -------------- trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java trunk/gee/src/java/edu/indiana/psych/gee/bean/ConsentForm.java trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentConfigurationService.java trunk/gee/war/WEB-INF/applicationContext.xml trunk/gee/war/WEB-INF/classes/webwork.properties trunk/gee/war/WEB-INF/classes/xwork.xml trunk/gee/war/consent.jsp trunk/gee/war/index.jsp Removed Paths: ------------- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.properties Modified: trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/src/java/edu/indiana/psych/gee/AbstractExperiment.java 2006-06-20 06:44:52 UTC (rev 196) @@ -8,6 +8,7 @@ import edu.indiana.psych.gee.event.EventChannel; import edu.indiana.psych.gee.net.DispatcherFactory; import edu.indiana.psych.gee.net.ServerDispatcher; +import edu.indiana.psych.gee.service.ConsentFormService; import edu.indiana.psych.gee.service.ExperimentConfigurationService; import edu.indiana.psych.gee.service.ExperimentService; import edu.indiana.psych.gee.time.Duration; @@ -33,6 +34,7 @@ private ExperimentService experimentService; private ExperimentConfigurationService configurationService; + private ConsentFormService consentFormService; private C configuration; // private ExperimentRoundParameters currentParameters; @@ -134,8 +136,8 @@ } public String toString() { - return String.format("[ %s ] experiment [ %s ] running on port %d", - super.toString(), getName(), getServerPort()); + return String.format("[ %s ] experiment [ %s:%s ] running on port %d", + super.toString(), getName(), getIdentifier(), getServerPort()); } @@ -215,6 +217,10 @@ this.configurationService = configurationService; } + public void setConsentFormService(ConsentFormService consentFormService) { + this.consentFormService = consentFormService; + } + public void setDefaultConfiguration(C defaultConfiguration) { if (defaultConfiguration == null) { throw new IllegalArgumentException("Cannot set default configuration to null."); @@ -222,11 +228,17 @@ ExperimentConfiguration configuration = configurationService.find(defaultConfiguration.getClass(), defaultConfiguration.getExperimentIdentifier()); if (configuration == null) { this.defaultConfiguration = defaultConfiguration; + consentFormService.persist(defaultConfiguration.getConsentForm()); configurationService.persist(defaultConfiguration); } else { this.defaultConfiguration = (C) configuration; } + if (configuration == null) { + configuration = defaultConfiguration; + } + + } Modified: trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.java 2006-06-20 06:44:52 UTC (rev 196) @@ -24,6 +24,11 @@ // no consent form available for this experiment.. just start? getLogger().warn("XXX: No consent form available for this experiment: " + getExperiment()); } + getLogger().warn("XXX: configuration: " + getExperiment().getConfiguration()); + getLogger().warn("XXX: configuration's consent: " + getExperiment().getConfiguration().getConsentForm()); + getLogger().warn("XXX: consent form: " + consentForm); + getLogger().warn("XXX: consent form date approved: " + consentForm.getIrbDateApproved()); + getLogger().warn("XXX: consent form date expires: " + consentForm.getIrbDateApprovalExpires()); return INPUT; } @@ -45,10 +50,14 @@ return consentForm; } - public void setExperimentIdentifier(String experimentName) { - this.experimentIdentifier = experimentName; + public String getExperimentIdentifier() { + return experimentIdentifier; } + public void setExperimentIdentifier(String experimentIdentifier) { + this.experimentIdentifier = experimentIdentifier; + } + public Participant getParticipant() { return participant; } Deleted: trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.properties =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.properties 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/src/java/edu/indiana/psych/gee/action/StartExperiment.properties 2006-06-20 06:44:52 UTC (rev 196) @@ -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/bean/ConsentForm.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/bean/ConsentForm.java 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/src/java/edu/indiana/psych/gee/bean/ConsentForm.java 2006-06-20 06:44:52 UTC (rev 196) @@ -91,11 +91,6 @@ } @Temporal(TemporalType.DATE) public Date getIrbDateApproved() { - if (irbDateApproved == null || isToday(irbDateApproved)) { - Calendar calendar = Calendar.getInstance(); - calendar.set(2005, 9, 26); - irbDateApproved = calendar.getTime(); - } return irbDateApproved; } @@ -103,17 +98,6 @@ this.irbDateApproved = irbDateApproved; } - // FIXME: atrocity - private boolean isToday(Date date) { - Calendar now = Calendar.getInstance(); - now.setTime(new Date()); - Calendar then = Calendar.getInstance(); - then.setTime(date); - return (now.get(Calendar.MONTH) == then.get(Calendar.MONTH) - && now.get(Calendar.YEAR) == then.get(Calendar.YEAR) - && now.get(Calendar.DAY_OF_MONTH) == then.get(Calendar.DAY_OF_MONTH)); - } - public String getParticipation() { return participation; } Modified: trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/src/java/edu/indiana/psych/gee/forager/ForagerExperimentParameters.java 2006-06-20 06:44:52 UTC (rev 196) @@ -1,6 +1,8 @@ package edu.indiana.psych.gee.forager; import java.awt.Dimension; +import java.io.IOException; +import java.io.InputStream; import java.util.Collections; import java.util.List; import java.util.Properties; Modified: trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentConfigurationService.java =================================================================== --- trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentConfigurationService.java 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/src/java/edu/indiana/psych/gee/service/ExperimentConfigurationService.java 2006-06-20 06:44:52 UTC (rev 196) @@ -21,7 +21,6 @@ public class ExperimentConfigurationService { private ExperimentConfigurationDao experimentConfigurationDao; -// private ConsentFormDao consentFormDao; public <E extends ExperimentConfiguration> List<E> findAll(Class<E> configurationClass) { @@ -62,8 +61,4 @@ this.experimentConfigurationDao = experimentConfigurationDao; } -// public void setConsentFormDao(ConsentFormDao consentFormDao) { -// this.consentFormDao = consentFormDao; -// } - } Modified: trunk/gee/war/WEB-INF/applicationContext.xml =================================================================== --- trunk/gee/war/WEB-INF/applicationContext.xml 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/war/WEB-INF/applicationContext.xml 2006-06-20 06:44:52 UTC (rev 196) @@ -35,7 +35,6 @@ <property name="password" value="${db.password}"/> </bean> - <!-- hibernate beans, session factory and transaction manager --> <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="configLocation" value="/WEB-INF/hibernate.cfg.xml"/> @@ -60,6 +59,9 @@ <property name="sessionFactory" ref="sessionFactory"/> </bean> <!-- application layer beans --> + <bean id="consentFormService" class="edu.indiana.psych.gee.service.ConsentFormService"> + <property name='consentFormDao' ref='consentFormDao'/> + </bean> <bean id="experimentService" class="edu.indiana.psych.gee.service.ExperimentService"/> <bean id="configurationService" class="edu.indiana.psych.gee.service.ExperimentConfigurationService"> <property name="experimentConfigurationDao" ref="experimentConfigurationDao"/> @@ -72,6 +74,7 @@ <property name="description" value="The Forager web experiment explores how individuals allocate themselves in a world with scarce resources via an always-available applet."/> <property name='clientJarName' value='forager-client.jar'/> <property name='clientMainClass' value='edu.indiana.psych.gee.forager.client.ForagerApplet'/> + <property name='consentForm' ref='foragerConsentForm'/> </bean> <bean id="defaultForagerExperimentConfiguration" class="edu.indiana.psych.gee.forager.ForagerConfiguration"> <constructor-arg value="groups.psych.indiana.edu"/> @@ -82,15 +85,65 @@ <property name='clientJarName' value='forager-client.jar'/> <property name='clientMainClass' value='edu.indiana.psych.gee.forager.client.ForagerApplet'/> <property name='triggeredExperiment' value='true'/> + <property name='consentForm' ref='foragerConsentForm'/> </bean> <bean id="forager-web" class="edu.indiana.psych.gee.forager.ForagerExperiment"> <property name="configurationService" ref='configurationService'/> + <property name="consentFormService" ref='consentFormService'/> <property name="defaultConfiguration" ref="defaultForagerWebConfiguration"/> <property name="experimentService" ref="experimentService"/> </bean> <bean id="forager-experiment" class="edu.indiana.psych.gee.forager.ForagerExperiment"> <property name="configurationService" ref='configurationService'/> + <property name="consentFormService" ref='consentFormService'/> <property name="defaultConfiguration" ref="defaultForagerExperimentConfiguration"/> <property name="experimentService" ref="experimentService"/> </bean> + <bean id='foragerConsentForm' class='edu.indiana.psych.gee.bean.ConsentForm'> + <property name='studyNumber' value='#04-9064'/> + <property name='description' value='You are invited to participate in a + research study, entitled Group Behavior. The purpose of the study is to + investigate how people think, act, and make decisions in groups. You will + be given a full debriefing at the end of the experiment. Each of the + experiments will take 5-10 minutes to complete. The particular + instructions for an experiment will be displayed on the computer screen. + During the experiment, you will be interacting with a group of humans or + artificial intelligence agents. You will see the choices they make, and + they will see your choices.'/> + <property name='deception' value='No deception is used in this study.'/> + <property name='confidentiality' value='The information in the study + records will be kept confidential. Data will be made available only to + persons conducting the study. No reference will be made in verbal or + written form which could link your name to the study. Your name is not + recorded with your data.'/> + <property name='compensation' value='There is no monetary compensation for + participating in this study.'/> + <property name='risks' value='There are no anticipated risks associated + with the experiments.'/> + <property name='benefits' value='Society benefits from this research + because an understanding of how groups behave can help us to predict the + behaviors of complex organizations and develop technologies that promote + the efficient and accurate flow of information within groups. You benefit + from this experience because you learn something about how group + psychology experiments are designed and conducted, what issues are of + interest to cognitive scientists, and what kinds of group behaviors emerge + when individuals try to reach their goals in an environment that consists + largely of other individuals. In addition, many people find the + experiments to be fun and intriguing. At the end of the experiment, you + will be shown your own performance compared to the average performance of + others in your group, a debriefing that describes what the experiment was + about, and links to related research.'/> + <property name='participation' value='Your participation in this study is + purely voluntary. You may decline to participate. If you decide to + participate, you may withdraw from the study at any time without penalty + or loss of benefits. If you withdraw from the study prior to the + completion of your session your data will not be saved.'/> + <property name='irbDateApproved' ref='consentFormDate'/> + </bean> + <bean id='consentFormDate' factory-bean='dateFormatter' factory-method='parse'> + <constructor-arg><value>10/26/2005</value></constructor-arg> + </bean> + <bean id="dateFormatter" class="java.text.SimpleDateFormat"> + <constructor-arg><value>MM/dd/yyyy</value></constructor-arg> + </bean> </beans> Modified: trunk/gee/war/WEB-INF/classes/webwork.properties =================================================================== --- trunk/gee/war/WEB-INF/classes/webwork.properties 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/war/WEB-INF/classes/webwork.properties 2006-06-20 06:44:52 UTC (rev 196) @@ -1,3 +1,4 @@ webwork.objectFactory=spring webwork.devMode=true webwork.ui.theme=ajax +webwork.custom.i18n.resources=format.properties Modified: trunk/gee/war/WEB-INF/classes/xwork.xml =================================================================== --- trunk/gee/war/WEB-INF/classes/xwork.xml 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/war/WEB-INF/classes/xwork.xml 2006-06-20 06:44:52 UTC (rev 196) @@ -51,5 +51,4 @@ </package> <include file="gee-ajax.xml"/> <include file="gee-admin.xml"/> - <include file="gee-csan.xml"/> </xwork> Modified: trunk/gee/war/consent.jsp =================================================================== --- trunk/gee/war/consent.jsp 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/war/consent.jsp 2006-06-20 06:44:52 UTC (rev 196) @@ -1,5 +1,5 @@ <head> -<title> Consent Form for ${experimentName}</title> +<title>Consent Form for ${experimentIdentifier}</title> <#assign commitDate="$Date$"> <#assign lastModified=commitDate?word_list[1]> <meta name="lastModifiedDate" content="${commitDate}"/> @@ -8,7 +8,7 @@ <TABLE BGCOLOR="#A4B5C5" CELLPADDING="4" CELLSPACING="0" WIDTH="100%" BORDER="0"> <TR> <TD WIDTH="100%"> - <H3>${experimentName} consent form</H3> + <H3>${experimentIdentifier} consent form</H3> </TD> <TD ALIGN="right" VALIGN="top" BGCOLOR="#A4B5C5" WIDTH="70%" style="white-space: nowrap;"> <b>Study #04-9064</b><br/> @@ -20,7 +20,7 @@ <TABLE CELLPADDING="4" CELLSPACING="2" BORDER="0"> <TR> <TD> - <B>${experimentName}</B><BR> + <B>${experimentIdentifier}</B><BR> <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> </TABLE> @@ -64,6 +64,9 @@ <B>Contact</B><BR> + <#if consentForm.contact?exists> + ${consentForm.contact} + <#else> <TABLE CELLPADDING="0" CELLSPACING="0" BORDER="0" WIDTH="100%"> <TR><TD WIDTH="100%" BGCOLOR="#A4B5C5" HEIGHT="5"><IMG SRC="/images/blank.gif" WIDTH="1" HEIGHT="1"></TD></TR> </TABLE> @@ -104,6 +107,7 @@ </TD></TR> </TABLE> </TD></TR></TABLE> + </#if> <P> <B>Participation</B><BR> @@ -129,19 +133,23 @@ <@ww.select label="Age" name="participant.age" required="true" list=["Under 18", "18-24", "25-36", "37-55", "Over 55"]/> <@ww.textfield label="Name" name="participant.name" required="true" /> - <@ww.hidden name="experimentName"/> + <@ww.hidden name="experimentIdentifier"/> <@ww.submit/> </@ww.form> <hr /> <small> -IRB Approved -<br/> -<@ww.text name="approval.date"> - <@ww.param value="'consentForm.irbDateApproved'"/> -</@ww.text> -<br/> -<@ww.text name="approval.expiration.date"> - <@ww.param value="'consentForm.irbDateApprovalExpires'"/> -</@ww.text> +<table border=1 cellspacing=1 cellpadding=4 style='border-style:outset;'> +<thead> +<th style='border-style:none;'>IRB Approved</td><td style='border-style:none;'> </td> +</thead> +<tr> +<td style='border-style:none;'>Approval Date:</td> +<td style='border-style:none;'>${consentForm.irbDateApproved?date}</td> +</tr> +<tr> +<td style='border-style:none;'>Expires:</td> +<td style='border-style:none;'>${consentForm.irbDateApprovalExpires?date}</td> +</tr> +</table> </small> Modified: trunk/gee/war/index.jsp =================================================================== --- trunk/gee/war/index.jsp 2006-06-19 21:52:04 UTC (rev 195) +++ trunk/gee/war/index.jsp 2006-06-20 06:44:52 UTC (rev 196) @@ -76,10 +76,10 @@ <!-- emit developers dynamically? --> <UL> <LI><A HREF="http://cognitrn.psych.indiana.edu/rgoldsto/rob.html">Rob Goldstone - Director</A> - <LI>Andy Jones - Developer / Researcher - <LI><a href="http://www.cs.indiana.edu/~alllee">Allen Lee - Lead Programmer / "Researcher"</a> - <LI>Zoran Rilak - Developer / Researcher - <LI>Michael Roberts - Developer / Researcher + <LI>Andy Jones + <LI><a href="http://www.cs.indiana.edu/~alllee">Allen Lee</a> + <LI>Zoran Rilak + <LI>Michael Roberts </UL> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |