virtualcommons-svn Mailing List for Virtual Commons Experiment Software (Page 75)
Status: Beta
Brought to you by:
alllee
You can subscribe to this list here.
2008 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
(21) |
Aug
(31) |
Sep
(6) |
Oct
(15) |
Nov
(2) |
Dec
(9) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2009 |
Jan
(4) |
Feb
(6) |
Mar
(12) |
Apr
(52) |
May
(14) |
Jun
(19) |
Jul
(81) |
Aug
(115) |
Sep
(36) |
Oct
(88) |
Nov
(46) |
Dec
(58) |
2010 |
Jan
(52) |
Feb
(55) |
Mar
(48) |
Apr
(15) |
May
(5) |
Jun
(38) |
Jul
(27) |
Aug
(24) |
Sep
(28) |
Oct
(1) |
Nov
(2) |
Dec
(29) |
2011 |
Jan
(87) |
Feb
(39) |
Mar
(63) |
Apr
(42) |
May
(26) |
Jun
(53) |
Jul
(23) |
Aug
(43) |
Sep
(37) |
Oct
(25) |
Nov
(4) |
Dec
(7) |
2012 |
Jan
(73) |
Feb
(79) |
Mar
(62) |
Apr
(28) |
May
(12) |
Jun
(2) |
Jul
(9) |
Aug
(1) |
Sep
(8) |
Oct
|
Nov
(3) |
Dec
(3) |
2013 |
Jan
(8) |
Feb
(16) |
Mar
(38) |
Apr
(74) |
May
(62) |
Jun
(15) |
Jul
(49) |
Aug
(19) |
Sep
(9) |
Oct
|
Nov
|
Dec
|
2014 |
Jan
|
Feb
|
Mar
|
Apr
(2) |
May
(25) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
From: <al...@us...> - 2009-04-20 20:21:17
|
Revision: 114 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=114&view=rev Author: alllee Date: 2009-04-20 20:21:13 +0000 (Mon, 20 Apr 2009) Log Message: ----------- working on NioDispatcher again for new set of experiments. It appears to be working OK but we need to test it with several clients to be sure. Still unresolved issues with the read buffer size and handling requests that are too big to fit within one sent buffer. Mike Spille's blog here has some good info on NIO: http://www.jroller.com/pyrasun/entry/practical_nio Modified Paths: -------------- csidex/trunk/src/main/java/edu/asu/commons/net/DispatcherFactory.java csidex/trunk/src/main/java/edu/asu/commons/net/NioDispatcher.java Modified: csidex/trunk/src/main/java/edu/asu/commons/net/DispatcherFactory.java =================================================================== --- csidex/trunk/src/main/java/edu/asu/commons/net/DispatcherFactory.java 2009-04-20 05:24:33 UTC (rev 113) +++ csidex/trunk/src/main/java/edu/asu/commons/net/DispatcherFactory.java 2009-04-20 20:21:13 UTC (rev 114) @@ -23,7 +23,8 @@ } public ClientDispatcher createClientDispatcher(EventChannel channel) { - return new ClientSocketDispatcher(channel); +// return new ClientSocketDispatcher(channel); + return new NioDispatcher(channel, 1); } public ServerDispatcher createServerDispatcher(EventChannel channel) { @@ -31,7 +32,7 @@ } public ServerDispatcher createServerDispatcher(EventChannel channel, int workerPoolSize) { - // return new NioDispatcher(sink, workerPoolSize); - return new ServerSocketDispatcher(channel, workerPoolSize); + return new NioDispatcher(channel, workerPoolSize); +// return new ServerSocketDispatcher(channel, workerPoolSize); } } Modified: csidex/trunk/src/main/java/edu/asu/commons/net/NioDispatcher.java =================================================================== --- csidex/trunk/src/main/java/edu/asu/commons/net/NioDispatcher.java 2009-04-20 05:24:33 UTC (rev 113) +++ csidex/trunk/src/main/java/edu/asu/commons/net/NioDispatcher.java 2009-04-20 20:21:13 UTC (rev 114) @@ -21,6 +21,7 @@ import edu.asu.commons.event.EventChannel; import edu.asu.commons.net.event.ConnectionEvent; import edu.asu.commons.net.event.DisconnectionEvent; +import edu.asu.commons.util.Duration; /** @@ -32,6 +33,7 @@ * The NioDispatcher is both a client and a server dispatcher, allowing p2p * connections. * + * * FIXME: replace WorkerPool implementation with 1.5 concurrency constructs * instead from java.util.concurrent. * @@ -40,7 +42,8 @@ */ public class NioDispatcher extends AbstractServerDispatcher implements ClientDispatcher { - private final static int READ_BUFFER_SIZE = 8192; + // FIXME: this is a potential source of bugs + private final static int READ_BUFFER_SIZE = 32768; private final static int BYTES_PER_INT = 4; @@ -106,8 +109,10 @@ public Identifier connect(InetSocketAddress address) { try { SocketChannel connection = SocketChannel.open(address); + connection.configureBlocking(true); // block until we've read the socket identifier from server. Identifier id = readConnectionEvent(connection); + connection.configureBlocking(false); worker.process(connection); // XXX: we return an Identifier that's .equals() with the // Identifiers used on the Server side. @@ -122,9 +127,9 @@ } private Identifier readConnectionEvent(SocketChannel connection) throws IOException { - connection.configureBlocking(true); InputStream in = connection.socket().getInputStream(); // read past the int header + in.read(); in.read(); in.read(); in.read(); ObjectInputStream ois = new ObjectInputStream(in); try { @@ -209,6 +214,7 @@ } } +// private Duration duration = Duration.create(1).start(); /** * Writes the given byte array to the SocketChannel identified by this id. */ @@ -223,19 +229,21 @@ } synchronized (channel) { final int objectSize = data.length; +// if (duration.hasExpired()) { +// System.err.println("object size: " + objectSize); +// duration.restart(); +// } // FIXME: could be a performance bottle-neck in the future, allocation // can be expensive. - // allocate enough space for the object and the int header, which is - // defined by the language spec to be 32-bits (4 bytes). See if - // there's a way to dynamically/reliably determine the size of an int - // in Java, i.e., equivalent to sizeof operator in C. Then again, - // maybe Java will never change from having 32-bit ints. + // allocate enough space for the object and the int header. + // ints in Java are defined by the language spec to always + // be 32-bits (4 bytes) ByteBuffer buffer = ByteBuffer.allocate(objectSize + BYTES_PER_INT); // int header specifying how big the object is is needed so that the // other side can know how much data to expect to read. buffer.putInt(objectSize); buffer.put(data); - buffer.clear(); + buffer.flip(); channel.write(buffer); } } @@ -262,10 +270,7 @@ buffer.flip(); if (buffer.remaining() == 0) { - // FIXME: add some notification to all objects as well, - // perhaps pump a DisconnectionEvent into the client-side - // EventChannel? - getLogger().info("buffer of size 0 for id: " + id + " - disconnecting!"); + getLogger().warning("buffer of size 0 for id: " + id + " - disconnecting!"); disconnect(id, channel); return; } @@ -296,6 +301,7 @@ // FIXME: assumes that the int itself won't get interrupted! int expectedSize = buffer.getInt(); int actualSize = buffer.remaining(); +// System.err.println("expected size: " + expectedSize); byte[] data = new byte[expectedSize]; if (actualSize >= expectedSize) { @@ -316,6 +322,7 @@ // XXX: we are guaranteed that the pending clients doesn't // contain the id already, otherwise handleRequest wouldn't have // gotten called. +// System.err.println("creating new pending data buffer for " + id + " with actual size " + actualSize); pendingClients.put(id, new PendingDataBuffer(actualSize, data)); } } @@ -393,7 +400,7 @@ @Override public void run() { Identifier id = worker.process(incoming); - System.err.println("generated id" + id); +// System.err.println("generated id" + id); addMapping(id, incoming); // send the newly generated Identifier to the client dispatcher, // which should be blocked, waiting for it. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-20 05:24:36
|
Revision: 113 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=113&view=rev Author: alllee Date: 2009-04-20 05:24:33 +0000 (Mon, 20 Apr 2009) Log Message: ----------- making field of vision for subjects configuration parameter key consistent with tokens field of vision for tokens Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2009-04-20 03:37:49 UTC (rev 112) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/conf/RoundConfiguration.java 2009-04-20 05:24:33 UTC (rev 113) @@ -105,19 +105,19 @@ } public boolean isSubjectFieldOfVisionEnabled() { - return getBooleanProperty("subject-field-of-vision", false); + return getBooleanProperty("subjects-field-of-vision", false); } public double getViewSubjectsRadius() { if (isSubjectFieldOfVisionEnabled()) { - return getDoubleProperty("view-subjects-radius", 10.0d); + return getDoubleProperty("view-subjects-radius", 6.0d); } throw new UnsupportedOperationException("subject field of vision is not enabled."); } public double getViewTokensRadius() { if (isTokensFieldOfVisionEnabled()) { - return getDoubleProperty("view-tokens-radius", 10.0d); + return getDoubleProperty("view-tokens-radius", 6.0d); } throw new UnsupportedOperationException("view tokens field of vision is not enabled."); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-20 03:37:56
|
Revision: 112 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=112&view=rev Author: alllee Date: 2009-04-20 03:37:49 +0000 (Mon, 20 Apr 2009) Log Message: ----------- fixing bug in getValidMooreNeighborhood that was returning points outside of the bounds of the resource grid. Modified Paths: -------------- foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceDispenser.java Modified: foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceDispenser.java =================================================================== --- foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceDispenser.java 2009-04-20 03:17:21 UTC (rev 111) +++ foraging/trunk/src/main/java/edu/asu/commons/foraging/model/ResourceDispenser.java 2009-04-20 03:37:49 UTC (rev 112) @@ -205,30 +205,19 @@ List<Point> neighborhoodPoints = new ArrayList<Point>(); int currentX = referencePoint.x; int currentY = referencePoint.y; - for (int x = currentX - 1; x < currentX + 2; x++) { - for (int y = currentY - 1; y < currentY + 2; y++) { + int endX = currentX + 2; + int endY = currentY + 2; + for (int x = currentX - 1; x < endX; x++) { + for (int y = currentY - 1; y < endY; y++) { Point point = new Point(x, y); // only add a point to the neighborhood set if it doesn't already have a resource. - if (! existingPositions.contains(point)) { + if (serverDataModel.isValidPosition(point) && ! existingPositions.contains(point)) { neighborhoodPoints.add(point); } - } } return neighborhoodPoints; } - - private Set<Point> getMooreNeighborhood(Point point) { - Set<Point> neighborhoodPoints = new HashSet<Point>(); - int currentX = point.x; - int currentY = point.y; - for (int x = currentX - 1; x < currentX + 2; x++) { - for (int y = currentY - 1; y < currentY + 2; y++) { - neighborhoodPoints.add(new Point(x, y)); - } - } - return neighborhoodPoints; - } } public class TopBottomPatchGenerator extends DensityDependentResourceGenerator { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-20 03:17:22
|
Revision: 111 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=111&view=rev Author: alllee Date: 2009-04-20 03:17:21 +0000 (Mon, 20 Apr 2009) Log Message: ----------- separating configuration target out. Need to fix some bugs in the mobile resource visualization Modified Paths: -------------- foraging/trunk/build.xml Modified: foraging/trunk/build.xml =================================================================== --- foraging/trunk/build.xml 2009-04-20 02:00:43 UTC (rev 110) +++ foraging/trunk/build.xml 2009-04-20 03:17:21 UTC (rev 111) @@ -190,7 +190,7 @@ </target> - <target name='server-jar' depends='compile'> + <target name='server-jar' depends='compile, configure'> <antcall target='build-jar'> <param name='main.class' value='${server.class}'/> <param name='jar.name' value='server.jar'/> @@ -253,6 +253,9 @@ <copy todir='${build.dir}/images'> <fileset dir='${resources.dir}/images'/> </copy> + </target> + + <target name='configure'> <copy todir='${build.dir}/conf'> <fileset dir='${conf.dir}'/> <filterset> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-20 02:00:45
|
Revision: 110 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=110&view=rev Author: alllee Date: 2009-04-20 02:00:43 +0000 (Mon, 20 Apr 2009) Log Message: ----------- round configuration for upcoming pretest, 3 rounds of open access + 3 rounds of chat/sanction with a mobile resource and limited field of vision for both subjects and tokens. Added Paths: ----------- foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/ foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round1.xml foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round2.xml foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round3.xml foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round4.xml foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round5.xml foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round6.xml foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/server.xml Added: foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml (rev 0) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round0.xml 2009-04-20 02:00:43 UTC (rev 110) @@ -0,0 +1,125 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Foraging XML-ized experiment round configuration</comment> +<entry key="resource-width">13</entry> +<entry key="resource-depth">13</entry> +<entry key="practice-round">true</entry> +<entry key="private-property">true</entry> +<entry key="duration">240</entry> + +<entry key='resource-generator'>mobile</entry> +<entry key='tokens-field-of-vision'>true</entry> +<entry key='subjects-field-of-vision'>true</entry> + +<entry key='regrowth-rate'>.01</entry> +<entry key='initial-distribution'>.25</entry> +<entry key='always-explicit'>true</entry> + +<entry key="quiz">true</entry> +<entry key="q1">C</entry> +<entry key="q2">B</entry> + +<entry key="instructions"> +<![CDATA[ +<h3>General Instructions</h3> +<p> +You will appear on the screen as a yellow dot <img +src="@CODEBASE_URL@/images/gem-self.gif">, You can move by pressing the four arrow +keys on your keyboard. You can move either up, down, left, or right. You have to +press a key for each and every move of your yellow dot. In this experiment you can +collect green diamond shaped tokens +<img src="@CODEBASE_URL@/images/gem-token.gif"> and you will +earn two cents for each collected token. To collect a token, simply move your +yellow dot over a green token and press the <b>space bar</b>. If you move +over a token without pressing the <b>space bar</> you will NOT collect that +token. +</p> + +<p> +The tokens that you collect have the potential to regenerate. After you have +collected a green token, a new token can once again appear on that empty cell. +However, the rate at which new tokens will appear depends on the number of +adjacent cells that still have tokens. The more tokens in the 8 cells around +an empty cell, the faster a new token will appear on that empty cell. Tokens +generate new tokens. Thus the middle cell in Image 1 denoted with X will be +regenerated at a faster rate than the middle cell in Image 2. When all +neighboring cells are empty, there is no renewal. + +<table width="100%"> +<tr> +<td align="center"><b>Image 1</b></td> +<td align="center"><b>Image 2</b></td> +</tr> +<tr> +<td align="center"> +<img src="@CODEBASE_URL@/images/8neighbors.jpg" alt="image 1"> +</td> +<td align="center"> +<img src="@CODEBASE_URL@/images/5neighbors.jpg" alt="image 2"> +</td> +</tr> +</table> +<hr> +<h3>Practice Round Instructions</h3> +<hr> +<p> +You will now have four minutes to practice with the experimental environment. +The decisions you make in this round will NOT influence your earnings. At the +At the beginning of the practice round half of the cells are occupied +with green tokens. The environment is a 13 x 13 grid of cells. +</p> +<p> +When you push the <b>R</b> key you will reset the distribution of +the tokens to randomly occupying half of the cells with green tokens. +</p> + +<p><center><b>Please do not communicate with any other participant.</b></center></p> +<p>If you have any questions please raise your hand. <b>Do you have any +questions so far?</b></p> +]]> +</entry> + +<entry key="quiz-instructions"> +<![CDATA[ +<p> +Before we begin the practice round you need to answer the following questions +correctly. You can only continue when you have answered all questions +correctly. If an error is made you will need to answer the questions again. +</p> +<br> +<form> +Which of the statements is incorrect? <br> +<input type="radio" name="q1" value="A">Your decisions of where to collect tokens affect the regeneration of tokens.<br> +<input type="radio" name="q1" value="B">When you have collected all tokens on +the screen, no new tokens will appear.<br> +<input type="radio" name="q1" value="C">Tokens grow from the middle of the +screen.<br> +<input type="radio" name="q1" value="D">In order to collect a token you need +to press the space bar while your avatar is on a cell with a token.<br> +<br><br> + +Which sequence of situations is not possible? <br> +<img src="@CODEBASE_URL@/images/question2.jpg"><br> +<input type="radio" name="q2" value="A">A<br> +<input type="radio" name="q2" value="B">B<br> +<input type="radio" name="q2" value="C">C<br> +<br> +<input type="submit" name="submit" value="Submit"> +</form> +]]> +</entry> +<entry key="welcome-instructions"> +<![CDATA[ +<h3>Welcome</h3> +<p> +Welcome. You have already earned 5 dollars for showing up at this experiment. +You can earn more, up to a maximum of 40 dollars, by participating in this +experiment, which will take about an hour. The amount of money you earn +depends on your decisions as well as the decisions of your group members +during the four rounds of the experiment. +</p> +]]> +</entry> + +</properties> Added: foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round1.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round1.xml (rev 0) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round1.xml 2009-04-20 02:00:43 UTC (rev 110) @@ -0,0 +1,52 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Foraging XML-ized experiment round configuration</comment> +<entry key="display-group-tokens">true</entry> +<entry key="clients-per-group">5</entry> +<entry key="duration">240</entry> +<entry key="resource-depth">29</entry> +<entry key="resource-width">29</entry> + +<entry key='resource-generator'>mobile</entry> +<entry key='tokens-field-of-vision'>true</entry> +<entry key='subjects-field-of-vision'>true</entry> + +<entry key='always-explicit'>true</entry> +<entry key='max-cell-occupancy'>1</entry> + +<entry key="initial-distribution">.25</entry> +<entry key="regrowth-rate">0.01</entry> + + +<entry key="instructions"> +<![CDATA[ +<h3>Round 1 Instructions</h3> +<hr> +<p> +This is the first round of the experiment. The length of the round is 4 +minutes. Like in the practice round you can collect green tokens. This time +you earn <b>two cents</b> for each token collected. This time you +<b>cannot</b> reset the distribution of green tokens. +</p> +<p> +In this round the renewable resource will become five times bigger. You +will share this larger environment with four other players in this room. +Each of you has been randomly assigned to one of several equal-sized +groups. Each of the groups is collecting tokens from an identical, but +separate resource. +</p> +<p> +Each of you has been assigned a number from 1 to 5. The other four players +will appear on the screen as blue dots +<img src="@CODEBASE_URL@/images/gem-other.gif"> with a white +number embedded in the dot. On the top right corner of the screen you can see +how many tokens each player has collected. +</p> +<p> +If you have any questions please raise your hand. <b>Do you have any +questions so far?</b> +</p> +]]> +</entry> +</properties> Added: foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round2.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round2.xml (rev 0) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round2.xml 2009-04-20 02:00:43 UTC (rev 110) @@ -0,0 +1,34 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Foraging XML-ized experiment round configuration</comment> +<entry key="display-group-tokens">true</entry> +<entry key="clients-per-group">5</entry> +<entry key="duration">240</entry> +<entry key="resource-depth">29</entry> +<entry key="resource-width">29</entry> + +<entry key='resource-generator'>mobile</entry> +<entry key='tokens-field-of-vision'>true</entry> +<entry key='subjects-field-of-vision'>true</entry> + +<entry key='always-explicit'>true</entry> +<entry key='max-cell-occupancy'>1</entry> + +<entry key="initial-distribution">.25</entry> +<entry key="regrowth-rate">0.01</entry> + +<entry key="instructions"> +<![CDATA[ +<h3>Round 2 Instructions</h3> +<hr> +<p> +Round 2 is the same as round 1. +</p> +<p> +If you have any questions please raise your hand. <b>Do you have any +questions so far?</b> +</p> +]]> +</entry> +</properties> Added: foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round3.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round3.xml (rev 0) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round3.xml 2009-04-20 02:00:43 UTC (rev 110) @@ -0,0 +1,43 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Foraging XML-ized experiment round configuration</comment> +<entry key="display-group-tokens">true</entry> +<entry key="clients-per-group">5</entry> +<entry key="duration">240</entry> +<entry key="resource-depth">29</entry> +<entry key="resource-width">29</entry> + +<entry key='resource-generator'>mobile</entry> +<entry key='tokens-field-of-vision'>true</entry> +<entry key='subjects-field-of-vision'>true</entry> + +<entry key='always-explicit'>true</entry> +<entry key='max-cell-occupancy'>1</entry> + +<!-- resource regrowth parameters --> +<entry key="initial-distribution">.25</entry> +<entry key="regrowth-rate">0.01</entry> + +<!-- +<entry key="patchy">true</entry> +<entry key="top-initial-distribution">0.50</entry> +<entry key="top-rate">0.02</entry> +<entry key="bottom-initial-distribution">0.25</entry> +<entry key="bottom-rate">0.01</entry> +--> + +<entry key="instructions"> +<![CDATA[ +<h3>Round 3 Instructions</h3> +<hr> +<p> +Round 3 is the same as round 2. +</p> +<p> +If you have any questions please raise your hand. <b>Do you have any +questions so far?</b> +</p> +]]> +</entry> +</properties> Added: foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round4.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round4.xml (rev 0) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round4.xml 2009-04-20 02:00:43 UTC (rev 110) @@ -0,0 +1,158 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Foraging XML-ized experiment round configuration</comment> +<entry key="display-group-tokens">true</entry> +<entry key="clients-per-group">5</entry> +<entry key="resource-depth">29</entry> +<entry key="resource-width">29</entry> +<entry key="duration">240</entry> + +<entry key='resource-generator'>mobile</entry> +<entry key='tokens-field-of-vision'>true</entry> +<entry key='subjects-field-of-vision'>true</entry> + +<entry key='always-explicit'>true</entry> +<entry key='max-cell-occupancy'>1</entry> + +<!-- before this round begins, we have a chat session --> +<entry key="chat-enabled">true</entry> +<entry key="chat-duration">240</entry> + +<!-- enable sanctioning --> +<entry key="sanction-type">real-time</entry> +<entry key="sanction-cost">1</entry> +<entry key="sanction-multiplier">2</entry> + + +<entry key="initial-distribution">.25</entry> +<entry key="regrowth-rate">0.01</entry> + +<!-- enable quiz --> +<entry key='quiz'>true</entry> +<entry key='q1'>1</entry> +<entry key='q2'>2</entry> +<entry key='q3'>1</entry> +<entry key='q4'>1</entry> + +<entry key="instructions"> +<![CDATA[ +<h3>Round 4 Instructions</h3> +<hr> +<p> +Round 4 is the same as the previous two rounds with two exceptions. +</p> +<p> +Before the next round starts you can anonymously communicate by text messages +for four minutes with the other participants in your group. You can use this +opportunity to discuss the experiment and coordinate your actions to improve +your earnings. You may not promise side-payments after the experiment is +completed or make any threats. You are also not allowed to reveal your real +identity. We are monitoring the chat traffic while you chat. +</p> +<p> +During the next round you will have the option to reduce the earnings of another +participant at a cost to your own earnings. +</p> +<ul> +<li>If you press the numeric key 1-5 corresponding to another participant, you +will reduce the number of tokens they have collected in this round by two +tokens. This will also reduce your own token amount by one token. The decision +whether or when to use this option is up to you. +<li>When you reduce the number of tokens of another participant, they will +receive a message stating that you have reduced their tokens. Likewise, if +another participant reduces your number of tokens, you will also receive a +message. These messages will be displayed on the bottom of your screen. +<li>If your tokens are being reduced or you are reducing another participant's +tokens, you will receive some visual cues. When your tokens are being reduced +your yellow dot will turn red briefly with a blue background. The participant +currently reducing your tokens will turn purple with a white background. +<li>You may reduce the earnings of other participants as long as there are +tokens remaining on the screen and while both you and the other participant +have a positive number of tokens collected during the round. <b>Each time</b> +you press the numeric key corresponding to another participant your token +amount is reduced by <b>one</b>, and their token amount is reduced by +<b>two</b>. <b>Note:</b> You can only remove tokens from a participant that is +visible to you. +</ul> +<p> + +<p> +The length of this round is four minutes. +</p> +<p> +If you have any questions please raise your hand. <b>Do you have any +questions so far?</b> +</p> +]]> +</entry> + +<entry key="chat-instructions"> +<![CDATA[ +<p> +You can now chat with the other participants in your group for 4 minutes +total. During the chat round, you may communicate about any aspect of the +experiment that you would like to discuss with other participants with whom +you have been matched. You may not promise them side-payments after the +experiment is completed or threaten them with any consequence after the +experiment is finished. We are monitoring the chat traffic while you chat. If +we see that somebody reveals his or her identity, we have to stop the +experiment and remove the whole group from which this person is a member out +of this room. +</p> +<p> +You will see other participants labeled as "1", "2","3", "4", or "5" in the +chat box. You can send a chat message by typing into the textfield at the +bottom of the screen and clicking the "send" button with your mouse or +pressing the "enter" key on your keyboard. +</p> +]]> +</entry> +<entry key="quiz-instructions"> +<![CDATA[ +<p>Before the next round begins you must complete the quiz below. You can +only continue when you have answered all questions correctly. If an error is +made you will need to answer the questions again. +</p> + +<form> +Each time I press the numeric keys between 1-5 my tokens will be reduced +by:<br> +<input type="radio" name="q1" value="0">0 tokens<br> +<input type="radio" name="q1" value="1">1 token<br> +<input type="radio" name="q1" value="2">2 tokens<br> +<input type="radio" name="q1" value="4">4 tokens<br> +<br><br> + +Each time I press the numeric keys between 1-5 the number of tokens of the +corresponding participant is reduced by:<br> +<input type="radio" name="q2" value="0">0 tokens<br> +<input type="radio" name="q2" value="1">1 token<br> +<input type="radio" name="q2" value="2">2 tokens<br> +<input type="radio" name="q2" value="4">4 tokens<br> +<br><br> + +The background of your avatar turns blue. What does this represent?<br> +<input type="radio" name="q3" value="0">You collected a token<br> +<input type="radio" name="q3" value="1">Another participant is subtracting two +tokens from you<br> +<input type="radio" name="q3" value="2">You are subtracting two tokens from another +participant<br> +<input type="radio" name="q3" value="3">You are moving too fast<br> +<br><br> + +Every time I press the numeric keys between 1-5:<br> +<input type="radio" name="q4" value="0">Two tokens are subtracted from my tokens +collected this round<br> +<input type="radio" name="q4" value="1">One token is subtracted from my tokens +collected this round<br> +<input type="radio" name="q4" value="2">The background of my avatar turns blue +momentarily<br> +<input type="radio" name="q4" value="3">My avatar is paused for two seconds<br> + +<input type="submit" name="submit" value="Submit"> +</form> +]]> +</entry> + +</properties> Added: foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round5.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round5.xml (rev 0) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round5.xml 2009-04-20 02:00:43 UTC (rev 110) @@ -0,0 +1,79 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Foraging XML-ized experiment round configuration</comment> +<entry key="display-group-tokens">true</entry> +<entry key="clients-per-group">5</entry> +<entry key="resource-depth">29</entry> +<entry key="resource-width">29</entry> +<entry key="duration">240</entry> + +<!-- enable mobile offspring-generating resource --> +<entry key='resource-generator'>mobile</entry> +<!-- enable field of vision for tokens and subjects --> +<entry key='tokens-field-of-vision'>true</entry> +<entry key='subjects-field-of-vision'>true</entry> + +<!-- enable sanctioning --> +<entry key="sanction-type">real-time</entry> +<entry key="sanction-cost">1</entry> +<entry key="sanction-multiplier">2</entry> + +<entry key="initial-distribution">.25</entry> +<entry key="regrowth-rate">0.01</entry> + +<entry key='always-explicit'>true</entry> +<entry key='max-cell-occupancy'>1</entry> + +<!-- before this round begins, we have a chat session --> +<entry key="chat-enabled">true</entry> +<entry key="chat-duration">240</entry> + +<entry key="instructions"> +<![CDATA[ +<h3>Round 5 Instructions</h3> +<hr> +<p> +Round 5 is the same as round 4.</p> +<p> +The length of this round is again four minutes. +</p> +<p> +If you have any questions please raise your hand. <b>Do you have any +questions so far?</b> +</p> +]]> +</entry> + +<entry key="chat-instructions"> +<![CDATA[ +<p> +You can now chat with the other participants in your group for 4 minutes +total. During the chat round, you may communicate about any aspect of the +experiment that you would like to discuss with other participants with whom +you have been matched. You may not promise them side-payments after the +experiment is completed or threaten them with any consequence after the +experiment is finished. We are monitoring the chat traffic while you chat. If +we see that somebody reveals his or her identity, we have to stop the +experiment and remove the whole group from which this person is a member out +of this room. +</p> +<p> +You will see other participants labeled as "1", "2","3", "4", or "5" in the +chat box. You can send a chat message by typing into the textfield at the +bottom of the screen and clicking the "send" button with your mouse or +pressing the "enter" key on your keyboard. +</p> +]]> +</entry> + +<entry key='private-chat-instructions'> +<![CDATA[ +You may send private messages to a specific participant by clicking on the +appropriately labeled button (1, 2, 3, 4, or 5) before typing your message in +the chat box and sending it. By default you are communicating with all +members of your group. +]]> +</entry> + +</properties> Added: foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round6.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round6.xml (rev 0) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/round6.xml 2009-04-20 02:00:43 UTC (rev 110) @@ -0,0 +1,83 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Foraging XML-ized experiment round configuration</comment> +<entry key="display-group-tokens">true</entry> +<entry key="clients-per-group">5</entry> +<entry key="resource-depth">29</entry> +<entry key="resource-width">29</entry> +<entry key="duration">240</entry> + +<entry key='resource-generator'>mobile</entry> +<entry key='tokens-field-of-vision'>true</entry> +<entry key='subjects-field-of-vision'>true</entry> +<!-- enable sanctioning --> +<entry key="sanction-type">real-time</entry> +<entry key="sanction-cost">1</entry> +<entry key="sanction-multiplier">2</entry> + +<entry key="initial-distribution">.25</entry> +<entry key="regrowth-rate">0.01</entry> + +<entry key='always-explicit'>true</entry> +<entry key='max-cell-occupancy'>1</entry> + +<!-- before this round begins, we have a chat session --> +<entry key="chat-enabled">true</entry> +<entry key="chat-duration">240</entry> + +<entry key="instructions"> +<![CDATA[ +<h3>Round 6 Instructions</h3> +<hr> +<p> +Round 6 is the same as round 5.</p> +<p> +The length of this round is again four minutes. +</p> +<p> +If you have any questions please raise your hand. <b>Do you have any +questions so far?</b> +</p> +]]> +</entry> + +<entry key="last-round-debriefing"> +<![CDATA[ +<p> +This was the last round, but not the end of the experiment. We will now +determine your payments. While we are doing this, we request that you +carefully fill out a brief survey. +</p> +<p> +When we are ready we will call you one by one to the room next door. We will +pay you there in private. Please wait until your computer number is called, +and then proceed to the room next door to turn in your computer number and +your survey. +</p> +<p> +Please answer the survey carefully and thank you for participating. +</p> +]]> +</entry> + +<entry key="chat-instructions"> +<![CDATA[ +<p> +You can now chat with the other participants in your group for 4 minutes +total. During the chat round, you may communicate about any aspect of the +experiment that you would like to discuss with other participants with whom +you have been matched. You may not promise them side-payments after the +experiment is completed or threaten them with any consequence after the +experiment is finished. We are monitoring the chat traffic while you chat. If +we detect that somebody has revealed their identity, we will have to stop the +experiment and remove that person's entire group from the experiment. +</p> +<p> +You will see other participants labeled as "1", "2","3", "4", or "5" in the +chat box. You can send a chat message by typing into the textfield at the +bottom of the screen and clicking the "send" button with your mouse or +pressing the "enter" key on your keyboard. </p> +]]> +</entry> +</properties> Added: foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/server.xml =================================================================== --- foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/server.xml (rev 0) +++ foraging/trunk/src/main/resources/configuration/asu-experiments/mobile-fov-oa-chat-sanction/server.xml 2009-04-20 02:00:43 UTC (rev 110) @@ -0,0 +1,30 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!DOCTYPE properties SYSTEM "http://java.sun.com/dtd/properties.dtd"> +<properties> +<comment>Costly Sanctioning XML-ized experiment round configuration</comment> +<entry key="hostname">@SERVER_ADDRESS@</entry> +<entry key="port">@PORT_NUMBER@</entry> +<entry key="round0">round0.xml</entry> +<entry key="round1">round1.xml</entry> +<entry key="round2">round2.xml</entry> +<entry key="round3">round3.xml</entry> +<entry key="round4">round4.xml</entry> +<entry key="round5">round5.xml</entry> +<entry key="round6">round6.xml</entry> +<entry key="wait-for-participants">true</entry> +<entry key="number-of-rounds">7</entry> +<entry key="facilitator-instructions"> +<![CDATA[ +<h3>Facilitator Instructions</h3> +<p> +Welcome to the facilitator interface. This interface allows you to control +the experiment. You may only modify configuration parameters <b>before</b> +you start the experiment by selecting the Configuration menu. When all the +participants are ready to begin the experiment, you can start the experiment +by selecting Experiment -> Start. After a round has been completed you +will be able to view the statistics for all of the participants. You can +begin the next round by selecting Round -> Start. +</p> +]]> +</entry> +</properties> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-18 02:47:47
|
Revision: 109 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=109&view=rev Author: alllee Date: 2009-04-18 02:47:45 +0000 (Sat, 18 Apr 2009) Log Message: ----------- adding cglib-nodep to dependencies so we don't need to have an interface per DAO. Modified Paths: -------------- mentalmodels/trunk/pom.xml mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml Modified: mentalmodels/trunk/pom.xml =================================================================== --- mentalmodels/trunk/pom.xml 2009-04-18 02:36:30 UTC (rev 108) +++ mentalmodels/trunk/pom.xml 2009-04-18 02:47:45 UTC (rev 109) @@ -53,6 +53,11 @@ <artifactId>spring-hibernate3</artifactId> <version>2.0-m3</version> </dependency> + <dependency> + <groupId>cglib</groupId> + <artifactId>cglib-nodep</artifactId> + <version>2.2</version> + </dependency> <!-- hibernate and JPA persistence --> <dependency> <groupId>javax.persistence</groupId> Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java 2009-04-18 02:36:30 UTC (rev 108) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java 2009-04-18 02:47:45 UTC (rev 109) @@ -19,7 +19,6 @@ * @author <a href='mailto:All...@as...'>Allen Lee</a> * @version $Rev$ */ -@Transactional public class HibernateStudentDao extends HibernateDao<Student> { Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-04-18 02:36:30 UTC (rev 108) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-04-18 02:47:45 UTC (rev 109) @@ -1,16 +1,10 @@ package edu.asu.commons.mme.service; -import org.apache.log4j.Logger; -import org.hibernate.Session; -import org.hibernate.SessionFactory; -import org.hibernate.Transaction; import org.springframework.transaction.annotation.Transactional; import edu.asu.commons.mme.dao.HibernateStudentDao; -import edu.asu.commons.mme.entity.GameConfig; -import edu.asu.commons.mme.entity.Gender; -import edu.asu.commons.mme.entity.Student; import edu.asu.commons.mme.entity.Group; +import edu.asu.commons.mme.entity.Student; /** * @@ -21,7 +15,7 @@ * @version $Rev$ */ - +@Transactional public class StudentService extends Service.Base<Student, HibernateStudentDao> { Student newstudent; Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-18 02:36:30 UTC (rev 108) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-18 02:47:45 UTC (rev 109) @@ -26,8 +26,7 @@ <!-- Flex related information started --> - <flex:message-broker > - </flex:message-broker> + <flex:message-broker /> <!-- XXX: Split these out into separate XML files and import them if this file gets too large --> <!-- spring managed daos --> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-04-18 02:36:32
|
Revision: 108 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=108&view=rev Author: seematalele Date: 2009-04-18 02:36:30 +0000 (Sat, 18 Apr 2009) Log Message: ----------- written code in StudentService and HibernateStudentDao. Tested it but getting error if I make class as transactional. Otherwise it does not give any error. Modified Paths: -------------- mentalmodels/trunk/flex/src/MME.mxml mentalmodels/trunk/flex/src/Socio_Demographic_Information.mxml mentalmodels/trunk/flex/src/actionscript/RoundConfig.as mentalmodels/trunk/pom.xml mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml Added Paths: ----------- mentalmodels/trunk/src/main/webapp/FisheryExperiment.html mentalmodels/trunk/src/main/webapp/FisheryExperiment.swf Modified: mentalmodels/trunk/flex/src/MME.mxml =================================================================== --- mentalmodels/trunk/flex/src/MME.mxml 2009-04-18 00:59:30 UTC (rev 107) +++ mentalmodels/trunk/flex/src/MME.mxml 2009-04-18 02:36:30 UTC (rev 108) @@ -9,6 +9,9 @@ <![CDATA[ import mx.collections.ArrayCollection; import actionscript.RoundConfig; + import mx.controls.Alert; + import mx.rpc.events.ResultEvent; + import mx.rpc.events.FaultEvent; // request config data from server private var rndConfig:RoundConfig = getConfig(); @@ -22,6 +25,47 @@ new ArrayCollection([5, 10, 15])); } + [Bindable] public var outputresp : Boolean; + private function resultHandler(event:ResultEvent):void + { + outputresp = event.result as Boolean; + } + + private function faultHandler(event:FaultEvent):void + { + Alert.show(event.fault.faultDetail); + } + + /*private function getData():void + { + outputresp = ss.getStudentFname(); + + }*/ + + private function save():void + { + + changeState(); + /*Alert.show("In save() function"); + Alert.show("year of birth is " + socio_demographic_information1.txtipYOB.text); + Alert.show(socio_demographic_information1.txtipMajor.text); + Alert.show(socio_demographic_information1.study.selectedValue.toString());*/ + //Alert.show(socio_demographic_information1.female.selected?'Correct Answer!':'Wrong Answer', 'Result'); + if(ss.createStudent(socio_demographic_information1.txtipYOB.text, socio_demographic_information1.txtipMajor.text,"Female",socio_demographic_information1.study.selectedValue.toString())) + { + Alert.show("Record is sucessfully added!"); + } + else + Alert.show("Record is NOT sucessfully added!"); + + } + + private function changeState():void + { + this.currentState = 'forecasting'; + } + + ]]> </mx:Script> @@ -45,7 +89,7 @@ </ns1:Socio_Demographic_Information> <mx:HBox x="42" width="100%" height="10%" verticalAlign="bottom" horizontalAlign="center" bottom="5" id="hbox1"> - <mx:Button label="Submit" id="btnSubmit_Socio_Demographic_Info" click="currentState='forecasting'" fontSize="12"/> + <mx:Button label="Submit" id="btnSubmit_Socio_Demographic_Info" click="save()" fontSize="12"/> </mx:HBox> </mx:Canvas> <mx:HBox width="100%" id="hboxfooter" horizontalAlign="center" verticalAlign="bottom"> @@ -56,4 +100,5 @@ </mx:HBox> </mx:VBox> </mx:Canvas> + <mx:RemoteObject id="ss" destination="studentservice" fault="faultHandler(event)" result="resultHandler(event)"/> </mx:Application> Modified: mentalmodels/trunk/flex/src/Socio_Demographic_Information.mxml =================================================================== --- mentalmodels/trunk/flex/src/Socio_Demographic_Information.mxml 2009-04-18 00:59:30 UTC (rev 107) +++ mentalmodels/trunk/flex/src/Socio_Demographic_Information.mxml 2009-04-18 02:36:30 UTC (rev 108) @@ -7,18 +7,21 @@ <mx:FormHeading label="Socio DemographicInformation " id="frmheadingSocioDemographicInfo" fontSize="24" textAlign="left" themeColor="#1200FF" color="#186BE8" width="5%" height="10%"/> <mx:FormItem id="frmitemStudy" horizontalAlign="left" fontSize="14" required="true"> <mx:Label text="What year are you in your study?"/> - <mx:RadioButton id="freshman" groupName="study"> + <mx:RadioButtonGroup id="study"/> + <mx:RadioButton id="freshman" groupName="{study}"> <mx:label>Freshman</mx:label> </mx:RadioButton> - <mx:RadioButton id="sophomore" groupName="study"> + <mx:RadioButton id="sophomore" groupName="{study}"> <mx:label>Sophomore</mx:label> </mx:RadioButton> - <mx:RadioButton id="junior" groupName="study"> + <mx:RadioButton id="junior" groupName="{study}"> <mx:label>Junior</mx:label> </mx:RadioButton> - <mx:RadioButton id="senior" groupName="study"> + <mx:RadioButton id="senior" groupName="{study}"> <mx:label>Senior</mx:label> </mx:RadioButton> + + </mx:FormItem> <mx:FormItem label="What is your major?" id="frmitemMajor" horizontalAlign="left" fontSize="14" required="true"> @@ -28,6 +31,7 @@ <mx:TextInput id="txtipYOB" maxChars="4"/> </mx:FormItem> <mx:FormItem label="Gender" id="frmitemGender" horizontalAlign="left" fontSize="14" required="true"> + <mx:RadioButtonGroup id="gender"/> <mx:RadioButton id="male" groupName="gender"> <mx:label>Male</mx:label> </mx:RadioButton> Modified: mentalmodels/trunk/flex/src/actionscript/RoundConfig.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/RoundConfig.as 2009-04-18 00:59:30 UTC (rev 107) +++ mentalmodels/trunk/flex/src/actionscript/RoundConfig.as 2009-04-18 02:36:30 UTC (rev 108) @@ -2,6 +2,7 @@ { import mx.collections.ArrayCollection; + public class RoundConfig { private var number:Number; // what round is it? Modified: mentalmodels/trunk/pom.xml =================================================================== --- mentalmodels/trunk/pom.xml 2009-04-18 00:59:30 UTC (rev 107) +++ mentalmodels/trunk/pom.xml 2009-04-18 02:36:30 UTC (rev 108) @@ -131,6 +131,7 @@ <artifactId>xalan</artifactId> <version>2.7.1</version> </dependency> + </dependencies> <build> <finalName>mme</finalName> @@ -150,6 +151,10 @@ <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>tomcat-maven-plugin</artifactId> + <configuration> + <server>myserver</server> + </configuration> + </plugin> <plugin> <groupId>org.mortbay.jetty</groupId> Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java 2009-04-18 00:59:30 UTC (rev 107) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java 2009-04-18 02:36:30 UTC (rev 108) @@ -1,5 +1,13 @@ package edu.asu.commons.mme.dao; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.Transaction; +import org.springframework.transaction.annotation.Transactional; + +import edu.asu.commons.mme.entity.GameConfig; +import edu.asu.commons.mme.entity.Gender; +import edu.asu.commons.mme.entity.Group; import edu.asu.commons.mme.entity.Student; /** @@ -11,10 +19,84 @@ * @author <a href='mailto:All...@as...'>Allen Lee</a> * @version $Rev$ */ +@Transactional public class HibernateStudentDao extends HibernateDao<Student> { + + private static Integer groupNo=0; + private static Integer studentNo=0; + private SessionFactory sessionFactory; public HibernateStudentDao() { super(Student.class); } + + public SessionFactory getSessionFactory() { + return super.getSessionFactory(); + } + public void setSessionFactory(SessionFactory sessionFactory) { + this.sessionFactory = sessionFactory; + } + public static void setGroupNo(Integer groupNo) { + HibernateStudentDao.groupNo = groupNo; + } + + public static Integer getGroupNo() { + return groupNo; + } + + public static void setStudentNo(Integer studentNo) { + HibernateStudentDao.studentNo = studentNo; + } + + public static Integer getStudentNo() { + return studentNo; + } + + public Long createStudent(Integer birthyear, String ethnicity, String gender,String major) + { + Student newstudent = null; + try{ + sessionFactory = this.getSessionFactory(); + Session session = + sessionFactory.getCurrentSession(); + Transaction tx = session.beginTransaction(); + //generateGroups(); + studentNo = getStudentNo() + 1; + newstudent = new Student(); + //newstudent.setGroup(newgroup); + newstudent.setBirthYear(birthyear); + newstudent.setEthnicity(ethnicity); + if(gender.equals(Gender.F)) + newstudent.setGender(Gender.F); + else + newstudent.setGender(Gender.M); + newstudent.setMajor(major); + newstudent.setStudentNo(studentNo); + session.save(newstudent); + tx.commit(); + + } + catch(Exception e) + { + logger.error("Can not create student."); + + } + finally{ + sessionFactory.close(); + } + return newstudent.getId(); + + } + + + + + + + + + + + } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java 2009-04-18 00:59:30 UTC (rev 107) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java 2009-04-18 02:36:30 UTC (rev 108) @@ -1,5 +1,5 @@ package edu.asu.commons.mme.entity; public enum Gender { -FEMALE, MALE +F, M } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-18 00:59:30 UTC (rev 107) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-18 02:36:30 UTC (rev 108) @@ -21,7 +21,6 @@ private Long id; @ManyToOne - @JoinColumn(nullable=false) private Group group; @Column(name="student_no",nullable = false) Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-04-18 00:59:30 UTC (rev 107) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-04-18 02:36:30 UTC (rev 108) @@ -1,7 +1,16 @@ package edu.asu.commons.mme.service; +import org.apache.log4j.Logger; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.Transaction; +import org.springframework.transaction.annotation.Transactional; + import edu.asu.commons.mme.dao.HibernateStudentDao; +import edu.asu.commons.mme.entity.GameConfig; +import edu.asu.commons.mme.entity.Gender; import edu.asu.commons.mme.entity.Student; +import edu.asu.commons.mme.entity.Group; /** * @@ -11,6 +20,33 @@ * @author <a href='mailto:All...@as...'>Allen Lee</a> * @version $Rev$ */ + + public class StudentService extends Service.Base<Student, HibernateStudentDao> { + Student newstudent; + Group newgroup; + + + private static Integer groupNo; + private static Integer studentNo; + + public boolean createGroup() + { + return false; + } + + public Long createStudent(Integer birthYear, String ethnicity,String gender,String major) + { + //createGroup(); + System.out.println("Birthyear" + birthYear); + System.out.println("Ethnicity" + ethnicity); + System.out.println("Gender" + gender); + System.out.println("Major" + major); + + this.getDao().createStudent(birthYear, ethnicity, gender, major); + return newstudent.getId(); + + } + } Added: mentalmodels/trunk/src/main/webapp/FisheryExperiment.html =================================================================== --- mentalmodels/trunk/src/main/webapp/FisheryExperiment.html (rev 0) +++ mentalmodels/trunk/src/main/webapp/FisheryExperiment.html 2009-04-18 02:36:30 UTC (rev 108) @@ -0,0 +1,121 @@ +<!-- saved from url=(0014)about:internet --> +<html lang="en"> + +<!-- +Smart developers always View Source. + +This application was built using Adobe Flex, an open source framework +for building rich Internet applications that get delivered via the +Flash Player or to desktops via Adobe AIR. + +Learn more about Flex at http://flex.org +// --> + +<head> +<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> + +<!-- BEGIN Browser History required section --> +<link rel="stylesheet" type="text/css" href="history/history.css" /> +<!-- END Browser History required section --> + +<title></title> +<script src="AC_OETags.js" language="javascript"></script> + +<!-- BEGIN Browser History required section --> +<script src="history/history.js" language="javascript"></script> +<!-- END Browser History required section --> + +<style> +body { margin: 0px; overflow:hidden } +</style> +<script language="JavaScript" type="text/javascript"> +<!-- +// ----------------------------------------------------------------------------- +// Globals +// Major version of Flash required +var requiredMajorVersion = 9; +// Minor version of Flash required +var requiredMinorVersion = 0; +// Minor version of Flash required +var requiredRevision = 124; +// ----------------------------------------------------------------------------- +// --> +</script> +</head> + +<body scroll="no"> +<script language="JavaScript" type="text/javascript"> +<!-- +// Version check for the Flash Player that has the ability to start Player Product Install (6.0r65) +var hasProductInstall = DetectFlashVer(6, 0, 65); + +// Version check based upon the values defined in globals +var hasRequestedVersion = DetectFlashVer(requiredMajorVersion, requiredMinorVersion, requiredRevision); + +if ( hasProductInstall && !hasRequestedVersion ) { + // DO NOT MODIFY THE FOLLOWING FOUR LINES + // Location visited after installation is complete if installation is required + var MMPlayerType = (isIE == true) ? "ActiveX" : "PlugIn"; + var MMredirectURL = window.location; + document.title = document.title.slice(0, 47) + " - Flash Player Installation"; + var MMdoctitle = document.title; + + AC_FL_RunContent( + "src", "playerProductInstall", + "FlashVars", "MMredirectURL="+MMredirectURL+'&MMplayerType='+MMPlayerType+'&MMdoctitle='+MMdoctitle+"", + "width", "760", + "height", "510", + "align", "middle", + "id", "FisheryExperiment", + "quality", "high", + "bgcolor", "#869ca7", + "name", "FisheryExperiment", + "allowScriptAccess","sameDomain", + "type", "application/x-shockwave-flash", + "pluginspage", "http://www.adobe.com/go/getflashplayer" + ); +} else if (hasRequestedVersion) { + // if we've detected an acceptable version + // embed the Flash Content SWF when all tests are passed + AC_FL_RunContent( + "src", "FisheryExperiment", + "width", "760", + "height", "510", + "align", "middle", + "id", "FisheryExperiment", + "quality", "high", + "bgcolor", "#869ca7", + "name", "FisheryExperiment", + "allowScriptAccess","sameDomain", + "type", "application/x-shockwave-flash", + "pluginspage", "http://www.adobe.com/go/getflashplayer" + ); + } else { // flash is too old or we can't detect the plugin + var alternateContent = 'Alternate HTML content should be placed here. ' + + 'This content requires the Adobe Flash Player. ' + + '<a href=http://www.adobe.com/go/getflash/>Get Flash</a>'; + document.write(alternateContent); // insert non-flash content + } +// --> +</script> +<noscript> + <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" + id="FisheryExperiment" width="760" height="510" + codebase="http://fpdownload.macromedia.com/get/flashplayer/current/swflash.cab"> + <param name="movie" value="FisheryExperiment.swf" /> + <param name="quality" value="high" /> + <param name="bgcolor" value="#869ca7" /> + <param name="allowScriptAccess" value="sameDomain" /> + <embed src="FisheryExperiment.swf" quality="high" bgcolor="#869ca7" + width="760" height="510" name="FisheryExperiment" align="middle" + play="true" + loop="false" + quality="high" + allowScriptAccess="sameDomain" + type="application/x-shockwave-flash" + pluginspage="http://www.adobe.com/go/getflashplayer"> + </embed> + </object> +</noscript> +</body> +</html> Added: mentalmodels/trunk/src/main/webapp/FisheryExperiment.swf =================================================================== (Binary files differ) Property changes on: mentalmodels/trunk/src/main/webapp/FisheryExperiment.swf ___________________________________________________________________ Added: svn:mime-type + application/octet-stream Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-18 00:59:30 UTC (rev 107) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-18 02:36:30 UTC (rev 108) @@ -12,6 +12,7 @@ xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xsi:schemaLocation=" + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/aop @@ -23,7 +24,8 @@ http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-2.0.4.xsd"> -<!-- Flex related information started --> + +<!-- Flex related information started --> <flex:message-broker > </flex:message-broker> @@ -71,6 +73,6 @@ <property name="sessionFactory" ref="sessionFactory"/> </bean> <!-- XXX: don't need proxy-target-class if services are interfaces instead --> - <tx:annotation-driven proxy-target-class='true'/> + <tx:annotation-driven proxy-target-class="true"/> </beans> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kj...@us...> - 2009-04-18 00:59:33
|
Revision: 107 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=107&view=rev Author: kjonas Date: 2009-04-18 00:59:30 +0000 (Sat, 18 Apr 2009) Log Message: ----------- fills in 'question_group' and 'question' tables. cut down entries in 'question_group' to lower number just enough to test every type of question; does not meet requirements proposed by Marco Modified Paths: -------------- mentalmodels/trunk/src/main/db/init-mme.sql Modified: mentalmodels/trunk/src/main/db/init-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-18 00:18:06 UTC (rev 106) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-18 00:59:30 UTC (rev 107) @@ -20,32 +20,67 @@ insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,2); insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,3); insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,4); - -insert into question_group(sequence_no,header_question) values(1,"Leaving strategy design -During a quick check of your strategy the following possible errors were found"); -insert into question_group(sequence_no,header_question) values(2,"Explain the strategy in your own words"); -insert into question_group(sequence_no,header_question) values(3,"What goals did you follow when designing your strategy?"); -insert into question_group(sequence_no,header_question) values(4,"What goals do you think the others follow?"); -insert into question_group(sequence_no,header_question) values(5,"How do you perceive your group?"); -insert into question_group(sequence_no,header_question) values(6,"How much do you count on others and how much can they count on you?"); -insert into question_group(sequence_no,header_question) values(7,"What else influenced your strategy design?"); -insert into question_group(sequence_no,header_question) values(8,"How confident are you in reaching the outcomes you are expecting?"); -insert into question_group(sequence_no,header_question) values(9,"What are you expecting the others will do?"); -insert into question_group(sequence_no,header_question) values(10,"What are you expecting how the fish population will develop?"); -insert into question_group(sequence_no,header_question) values(11,"Leaving strategy design"); -insert into question_group(sequence_no,header_question) values(12,"What are your emotional reactions to the outcomes?"); -insert into question_group(sequence_no,header_question) values(13,"What is your evaluation of the outcomes?"); -insert into question_group(sequence_no,header_question) values(14,"What might be the causes for the outcomes?"); -insert into question_group(sequence_no,header_question) values(15,"Comparing your day-by-day decisions with the strategy"); -insert into question_group(sequence_no,header_question) values(16,"Lessons learned"); -insert into question_group(sequence_no,header_question) values(17,"Explain the strategy in your own words"); -insert into question_group(sequence_no,header_question) values(18,"Leaving strategy design"); -insert into question_group(sequence_no,header_question) values(19,"Did the communication have any effect on you?"); -insert into question_group(sequence_no,header_question) values(20,"What do you think were the effects of the communication on the others?"); -insert into question_group(sequence_no,header_question) values(21,"Did the communication lead to some sort of coordination of the fishing?"); -insert into question_group(sequence_no,header_question) values(22,"What is your opinion about the rule that emerged from communication?"); -insert into question_group(sequence_no,header_question) values(23,"What will be the effects of the rule?"); -insert into question_group(sequence_no,header_question) values(24,"Lessons learned"); -insert into question_group(sequence_no,header_question) values(25,"Some final questions about the experiment"); -insert into question_group(sequence_no,header_question) values(26,"Some final questions about you"); -insert into question_group(sequence_no,header_question) values(27,"The end"); + +insert into question_group(sequence_no,header_question) values(1,"What goals did you follow when designing your strategy?"); +insert into question_group(sequence_no,header_question) values(2,"How do you perceive your group?"); +insert into question_group(sequence_no,header_question) values(3,"How much do you count on others and how much can they count on you?"); +insert into question_group(sequence_no,header_question) values(4,"How confident are you in reaching the outcomes you are expecting?"); +insert into question_group(sequence_no,header_question) values(5,"What might be the causes for the outcomes?"); +insert into question_group(sequence_no,header_question) values(6,"Comparing your day-by-day decisions with the strategy"); +insert into question_group(sequence_no,header_question) values(7,"Lessons learned"); +insert into question_group(sequence_no,header_question) values(8,"What is your opinion about the rule that emerged from communication?"); +insert into question_group(sequence_no,header_question) values(9,"What will be the effects of the rule?"); +insert into question_group(sequence_no,header_question) values(10,"The end"); + + + + +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 1, 1, "Most Important Goal:"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 1, 2, "Second Most Important Goal:"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 1, 3, "Third Most Important Goal:"); + +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 2, 1, "Over all, how much do like your group?"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 2, 2, "How important is it for you what the others think about you and your behavior?"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 2, 3, "How important is it for you that the others can reach their goals?"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 2, 4, "What do you think, how important is it for the others that you can reach your goals?"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 2, 5, "Do you perceive the group as a team or as competing players?"); + +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 3, 1, "How much do you trust the others in your group?"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 3, 2, "How important is it for you that the others in your group can and do trust you?"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 3, 3, "How much do you think your group trying to coordinate their actions to reach better outcomes for all?"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 3, 4, "How much are you trying to follow rules or agreements that emerged from the communication?"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 3, 5, "How much do you think the others are trying to follow rules or agreements that emerged from the communication?"); + +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 4, 1, "How well did you understand the dynamics of the fish population?"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 4, 2, "Did the others in your group understand the dynamics better or worse than you?"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 4, 3, "How confident are you in having developed a strategy that leads to ‘good’ outcomes regarding your goals?"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 4, 4, "How much does your strategy depend on how the others in the group will act to reach the desired outcomes?"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 4, 5, "Would you classify your strategy as ‘safe’, or ‘risky’?"); + +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 1, "I did not understand well enough the dynamics of the fish population."); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 2, "Some of the other fishermen did not understand well enough the dynamics of the fish population."); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 3, "The others in my group acted differently then would have been necessary for my strategy to work out well."); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 4, "Some of the other fishermen acted too reluctantly (harvested too few)."); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 5, "Some of the other fishermen acted too aggressively (harvested too much)."); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 6, "The group acted too uncoordinated."); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 7, "The group did not follow enough the rules or agreements that emerged from the communication."); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 5, 8, "The rules or agreements that emerged from the communication did not work out well."); + +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 6, 1, "If you open the results of the day-by-day decisions in one information window and your strategy in the other, you can compare the actions and developments.\nWhat were the most important reasons for you to deviate from your strategy during the day-by-day decisions?\nIf you did not deviate from your strategy then please write something like “No difference” in the text field below."); + +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 7, 1, "In the fields below you can note what you have learned from the results of your strategy and the day-by-day decisions to improve your strategy.\nThink about your understanding of the dynamics of the fish population, your expectations about the behavior of the other fishermen in your group and possibilities to improve your strategy. For each of these aspects we offer you a separate field. This information will be available in the next round of designing your strategy.\nIf you have no entry for one of the fields below, write “none” in the respective field."); + +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 8, 1, "The rule, agreement or coordination attempt is..."); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 8, 2, ""); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 8, 3, ""); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 8, 4, ""); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 8, 5, ""); + +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 9, 1, "How clear is it to you, that you have to fish conforming to this rule, agreement or coordination attempt?"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 9, 2, "Do you think the other fishermen understood how they have to act according to this rule?\nI think the others..."); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 9, 3, "Will you follow the rule, agreement, or coordination attempt that emerged from communication?"); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 9, 4, "Do you think, the other fishermen in you group will follow the rule, agreement, or coordination attempt?\nI think, the others will..."); +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 9, 5, "Considering the effects you expect for following the rule and your expectations of how the group will follow the rule, do you think the group will do better or worse due to the rule?"); + +insert into question(multi_location, misc_location, single_location, question_group_id, sequence_no, question) values(1, 0, 0, 10, 1, "If you wish to give us any comment or feedback on the experiment, you can use the following field."); + This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-18 00:18:13
|
Revision: 106 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=106&view=rev Author: alllee Date: 2009-04-18 00:18:06 +0000 (Sat, 18 Apr 2009) Log Message: ----------- mvn jetty:run should work now, removed spring security from web.xml and flex:message-broker since I don't think we are going to use it for this first incarnation of the application. Also ran through xmllint --format Modified Paths: -------------- mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml mentalmodels/trunk/src/main/webapp/WEB-INF/web.xml Added Paths: ----------- mentalmodels/trunk/src/main/webapp/WEB-INF/mme-servlet.xml Removed Paths: ------------- mentalmodels/trunk/src/main/webapp/WEB-INF/testdrive-servlet.xml Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-17 23:17:48 UTC (rev 105) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-18 00:18:06 UTC (rev 106) @@ -25,7 +25,6 @@ <!-- Flex related information started --> <flex:message-broker > - <flex:secured /> </flex:message-broker> <!-- XXX: Split these out into separate XML files and import them if this file gets too large --> Copied: mentalmodels/trunk/src/main/webapp/WEB-INF/mme-servlet.xml (from rev 105, mentalmodels/trunk/src/main/webapp/WEB-INF/testdrive-servlet.xml) =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/mme-servlet.xml (rev 0) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/mme-servlet.xml 2009-04-18 00:18:06 UTC (rev 106) @@ -0,0 +1,6 @@ +<?xml version="1.0" encoding="UTF-8"?> +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> + +</beans> \ No newline at end of file Property changes on: mentalmodels/trunk/src/main/webapp/WEB-INF/mme-servlet.xml ___________________________________________________________________ Added: svn:mergeinfo + Deleted: mentalmodels/trunk/src/main/webapp/WEB-INF/testdrive-servlet.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/testdrive-servlet.xml 2009-04-17 23:17:48 UTC (rev 105) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/testdrive-servlet.xml 2009-04-18 00:18:06 UTC (rev 106) @@ -1,6 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" - xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd"> - -</beans> \ No newline at end of file Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/web.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/web.xml 2009-04-17 23:17:48 UTC (rev 105) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/web.xml 2009-04-18 00:18:06 UTC (rev 106) @@ -4,7 +4,7 @@ --> <web-app> <display-name>Mental Models Experiment</display-name> - + <!-- <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> @@ -14,24 +14,20 @@ <filter-name>springSecurityFilterChain</filter-name> <url-pattern>/*</url-pattern> </filter-mapping> - - <listener> - <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> - </listener> - - <servlet> - <servlet-name>mme</servlet-name> - <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> - <load-on-startup>1</load-on-startup> - </servlet> - - <servlet-mapping> - <servlet-name>mme</servlet-name> - <url-pattern>/messagebroker/*</url-pattern> - </servlet-mapping> - - <welcome-file-list> - <welcome-file>index.html</welcome-file> - </welcome-file-list> - + --> + <listener> + <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> + </listener> + <servlet> + <servlet-name>mme</servlet-name> + <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> + <load-on-startup>1</load-on-startup> + </servlet> + <servlet-mapping> + <servlet-name>mme</servlet-name> + <url-pattern>/messagebroker/*</url-pattern> + </servlet-mapping> + <welcome-file-list> + <welcome-file>index.html</welcome-file> + </welcome-file-list> </web-app> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-04-17 23:18:07
|
Revision: 105 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=105&view=rev Author: seematalele Date: 2009-04-17 23:17:48 +0000 (Fri, 17 Apr 2009) Log Message: ----------- Changed the question_group table's insert statements. One field(header_question) was missing in the insert statements. Modified Paths: -------------- mentalmodels/trunk/src/main/db/init-mme.sql Modified: mentalmodels/trunk/src/main/db/init-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-17 23:06:15 UTC (rev 104) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-17 23:17:48 UTC (rev 105) @@ -23,29 +23,29 @@ insert into question_group(sequence_no,header_question) values(1,"Leaving strategy design During a quick check of your strategy the following possible errors were found"); -insert into question_group(sequence_no) values(2,"Explain the strategy in your own words"); -insert into question_group(sequence_no) values(3,"What goals did you follow when designing your strategy?"); -insert into question_group(sequence_no) values(4,"What goals do you think the others follow?"); -insert into question_group(sequence_no) values(5,"How do you perceive your group?"); -insert into question_group(sequence_no) values(6,"How much do you count on others and how much can they count on you?"); -insert into question_group(sequence_no) values(7,"What else influenced your strategy design?"); -insert into question_group(sequence_no) values(8,"How confident are you in reaching the outcomes you are expecting?"); -insert into question_group(sequence_no) values(9,"What are you expecting the others will do?"); -insert into question_group(sequence_no) values(10,"What are you expecting how the fish population will develop?"); -insert into question_group(sequence_no) values(11,"Leaving strategy design"); -insert into question_group(sequence_no) values(12,"What are your emotional reactions to the outcomes?"); -insert into question_group(sequence_no) values(13,"What is your evaluation of the outcomes?"); -insert into question_group(sequence_no) values(14,"What might be the causes for the outcomes?"); -insert into question_group(sequence_no) values(15,"Comparing your day-by-day decisions with the strategy"); -insert into question_group(sequence_no) values(16,"Lessons learned"); -insert into question_group(sequence_no) values(17,"Explain the strategy in your own words"); -insert into question_group(sequence_no) values(18,"Leaving strategy design"); -insert into question_group(sequence_no) values(19,"Did the communication have any effect on you?"); -insert into question_group(sequence_no) values(20,"What do you think were the effects of the communication on the others?"); -insert into question_group(sequence_no) values(21,"Did the communication lead to some sort of coordination of the fishing?"); -insert into question_group(sequence_no) values(22,"What is your opinion about the rule that emerged from communication?"); -insert into question_group(sequence_no) values(23,"What will be the effects of the rule?"); -insert into question_group(sequence_no) values(24,"Lessons learned"); -insert into question_group(sequence_no) values(25,"Some final questions about the experiment"); -insert into question_group(sequence_no) values(26,"Some final questions about you"); -insert into question_group(sequence_no) values(27,"The end"); +insert into question_group(sequence_no,header_question) values(2,"Explain the strategy in your own words"); +insert into question_group(sequence_no,header_question) values(3,"What goals did you follow when designing your strategy?"); +insert into question_group(sequence_no,header_question) values(4,"What goals do you think the others follow?"); +insert into question_group(sequence_no,header_question) values(5,"How do you perceive your group?"); +insert into question_group(sequence_no,header_question) values(6,"How much do you count on others and how much can they count on you?"); +insert into question_group(sequence_no,header_question) values(7,"What else influenced your strategy design?"); +insert into question_group(sequence_no,header_question) values(8,"How confident are you in reaching the outcomes you are expecting?"); +insert into question_group(sequence_no,header_question) values(9,"What are you expecting the others will do?"); +insert into question_group(sequence_no,header_question) values(10,"What are you expecting how the fish population will develop?"); +insert into question_group(sequence_no,header_question) values(11,"Leaving strategy design"); +insert into question_group(sequence_no,header_question) values(12,"What are your emotional reactions to the outcomes?"); +insert into question_group(sequence_no,header_question) values(13,"What is your evaluation of the outcomes?"); +insert into question_group(sequence_no,header_question) values(14,"What might be the causes for the outcomes?"); +insert into question_group(sequence_no,header_question) values(15,"Comparing your day-by-day decisions with the strategy"); +insert into question_group(sequence_no,header_question) values(16,"Lessons learned"); +insert into question_group(sequence_no,header_question) values(17,"Explain the strategy in your own words"); +insert into question_group(sequence_no,header_question) values(18,"Leaving strategy design"); +insert into question_group(sequence_no,header_question) values(19,"Did the communication have any effect on you?"); +insert into question_group(sequence_no,header_question) values(20,"What do you think were the effects of the communication on the others?"); +insert into question_group(sequence_no,header_question) values(21,"Did the communication lead to some sort of coordination of the fishing?"); +insert into question_group(sequence_no,header_question) values(22,"What is your opinion about the rule that emerged from communication?"); +insert into question_group(sequence_no,header_question) values(23,"What will be the effects of the rule?"); +insert into question_group(sequence_no,header_question) values(24,"Lessons learned"); +insert into question_group(sequence_no,header_question) values(25,"Some final questions about the experiment"); +insert into question_group(sequence_no,header_question) values(26,"Some final questions about you"); +insert into question_group(sequence_no,header_question) values(27,"The end"); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-17 23:06:33
|
Revision: 104 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=104&view=rev Author: alllee Date: 2009-04-17 23:06:15 +0000 (Fri, 17 Apr 2009) Log Message: ----------- fixing application context errors and adding flex configuration, still need to add more dependencies Modified Paths: -------------- mentalmodels/trunk/pom.xml mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml Added Paths: ----------- mentalmodels/trunk/src/main/webapp/WEB-INF/flex/ mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml mentalmodels/trunk/src/main/webapp/WEB-INF/flex/proxy-config.xml mentalmodels/trunk/src/main/webapp/WEB-INF/flex/remoting-config.xml mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml Modified: mentalmodels/trunk/pom.xml =================================================================== --- mentalmodels/trunk/pom.xml 2009-04-17 22:40:37 UTC (rev 103) +++ mentalmodels/trunk/pom.xml 2009-04-17 23:06:15 UTC (rev 104) @@ -1,4 +1,7 @@ <?xml version="1.0" encoding="UTF-8"?> +<!-- +vim:sts=2:sw=2 +--> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <organization> <name>The Virtual Commons</name> @@ -33,10 +36,15 @@ <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> - <version>2.5.5</version> + <version>2.5.6</version> </dependency> <dependency> <groupId>org.springframework</groupId> + <artifactId>spring-webmvc</artifactId> + <version>2.5.6</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> <artifactId>spring-flex</artifactId> <version>1.0.0.M2</version> </dependency> @@ -72,6 +80,28 @@ <version>1.5.2</version> </dependency> <dependency> + <groupId>commons-httpclient</groupId> + <artifactId>commons-httpclient</artifactId> + <version>3.1</version> + </dependency> + <dependency> + <groupId>commons-dbcp</groupId> + <artifactId>commons-dbcp</artifactId> + <version>1.2.2</version> + </dependency> + <dependency> + <groupId>javassist</groupId> + <artifactId>javassist</artifactId> + <version>3.8.0.GA</version> + </dependency> + <!-- + <dependency> + <groupId>org.apache.httpcomponents</groupId> + <artifactId>httpclient</artifactId> + <version>4.0-beta2</version> + </dependency> + --> + <dependency> <groupId>com.adobe.blazeds</groupId> <artifactId>blazeds-core</artifactId> <version>3.2.0.3978</version> @@ -96,6 +126,11 @@ <artifactId>blazeds-opt</artifactId> <version>3.2.0.3978</version> </dependency> + <dependency> + <groupId>xalan</groupId> + <artifactId>xalan</artifactId> + <version>2.7.1</version> + </dependency> </dependencies> <build> <finalName>mme</finalName> Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-17 22:40:37 UTC (rev 103) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-17 23:06:15 UTC (rev 104) @@ -5,37 +5,42 @@ <!-- $Id: applicationContext.xml 617 2008-03-28 17:27:23Z alllee $ --> -<beans xmlns="http://www.springframework.org/schema/beans" - xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:flex="http://www.springframework.org/schema/flex" + xmlns:security="http://www.springframework.org/schema/security" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" - xmlns:flex="http://www.springframework.org/schema/flex" - xmlns:security="http://www.springframework.org/schema/security" + xsi:schemaLocation=" + http://www.springframework.org/schema/tx + http://www.springframework.org/schema/tx/spring-tx-2.0.xsd + http://www.springframework.org/schema/aop + http://www.springframework.org/schema/aop/spring-aop-2.0.xsd + http://www.springframework.org/schema/beans + http://www.springframework.org/schema/beans/spring-beans-2.5.xsd + http://www.springframework.org/schema/flex + http://www.springframework.org/schema/flex/spring-flex-1.0.xsd + http://www.springframework.org/schema/security + http://www.springframework.org/schema/security/spring-security-2.0.4.xsd"> - xsi:schemaLocation=" - http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd - http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd - http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd - http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd - http://www.springframework.org/schema/security/spring-security-2.0.4.xsd - http://www.springframework.org/schema/flex http://www.springframework.org/schema/flex/spring-flex-1.0.xsd - "> <!-- Flex related information started --> -<flex:message-broker /> + <flex:message-broker > + <flex:secured /> + </flex:message-broker> -/<!-- XXX: Split these out into separate XML files and import them if this file gets too large --> +<!-- XXX: Split these out into separate XML files and import them if this file gets too large --> <!-- spring managed daos --> -<bean id='studentDao' class='edu.asu.commons.mme.dao.HibernateStudentDao'> - <property name='sessionFactory' ref='sessionFactory'/> -</bean> + <bean id='studentDao' class='edu.asu.commons.mme.dao.HibernateStudentDao'> + <property name='sessionFactory' ref='sessionFactory'/> + </bean> <!-- spring managed service layer --> -<bean id='studentService' class='edu.asu.commons.mme.service.StudentService'> - <property name='dao' ref='studentDao'/> -</bean> + <bean id='studentService' class='edu.asu.commons.mme.service.StudentService'> + <property name='dao' ref='studentDao'/> + </bean> <!-- Expose services for BlazeDS remoting --> -<flex:remote-service ref="studentService" /> + <flex:remote-service ref="studentService" /> <!-- Flex related information ended--> Added: mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml (rev 0) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/flex/messaging-config.xml 2009-04-17 23:06:15 UTC (rev 104) @@ -0,0 +1,14 @@ +<?xml version="1.0" encoding="UTF-8"?> +<service id="message-service" + class="flex.messaging.services.MessageService"> + + <adapters> + <adapter-definition id="actionscript" class="flex.messaging.services.messaging.adapters.ActionScriptAdapter" default="true" /> + <!-- <adapter-definition id="jms" class="flex.messaging.services.messaging.adapters.JMSAdapter"/> --> + </adapters> + + <default-channels> + <channel ref="my-polling-amf"/> + </default-channels> + +</service> Added: mentalmodels/trunk/src/main/webapp/WEB-INF/flex/proxy-config.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/flex/proxy-config.xml (rev 0) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/flex/proxy-config.xml 2009-04-17 23:06:15 UTC (rev 104) @@ -0,0 +1,25 @@ +<?xml version="1.0" encoding="UTF-8"?> +<service id="proxy-service" + class="flex.messaging.services.HTTPProxyService"> + + <properties> + <connection-manager> + <max-total-connections>100</max-total-connections> + <default-max-connections-per-host>2</default-max-connections-per-host> + </connection-manager> + <allow-lax-ssl>true</allow-lax-ssl> + </properties> + + <adapters> + <adapter-definition id="http-proxy" class="flex.messaging.services.http.HTTPProxyAdapter" default="true"/> + <adapter-definition id="soap-proxy" class="flex.messaging.services.http.SOAPProxyAdapter"/> + </adapters> + + <default-channels> + <channel ref="my-amf"/> + </default-channels> + + <destination id="DefaultHTTP"> + </destination> + +</service> Added: mentalmodels/trunk/src/main/webapp/WEB-INF/flex/remoting-config.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/flex/remoting-config.xml (rev 0) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/flex/remoting-config.xml 2009-04-17 23:06:15 UTC (rev 104) @@ -0,0 +1,13 @@ +<?xml version="1.0" encoding="UTF-8"?> +<service id="remoting-service" + class="flex.messaging.services.RemotingService"> + + <adapters> + <adapter-definition id="java-object" class="flex.messaging.services.remoting.adapters.JavaAdapter" default="true"/> + </adapters> + + <default-channels> + <channel ref="my-amf"/> + </default-channels> + +</service> \ No newline at end of file Added: mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml (rev 0) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml 2009-04-17 23:06:15 UTC (rev 104) @@ -0,0 +1,105 @@ +<?xml version="1.0" encoding="UTF-8"?> +<services-config> + + <services> + <service-include file-path="remoting-config.xml" /> + <service-include file-path="proxy-config.xml" /> + <service-include file-path="messaging-config.xml" /> + + <default-channels> + <channel ref="my-amf"/> + </default-channels> + + </services> + + + <security> + <login-command class="flex.messaging.security.TomcatLoginCommand" server="Tomcat"/> + <!-- Uncomment the correct app server + <login-command class="flex.messaging.security.TomcatLoginCommand" server="JBoss"> + <login-command class="flex.messaging.security.JRunLoginCommand" server="JRun"/> + <login-command class="flex.messaging.security.WeblogicLoginCommand" server="Weblogic"/> + <login-command class="flex.messaging.security.WebSphereLoginCommand" server="WebSphere"/> + --> + + <!-- + <security-constraint id="basic-read-access"> + <auth-method>Basic</auth-method> + <roles> + <role>guests</role> + <role>accountants</role> + <role>employees</role> + <role>managers</role> + </roles> + </security-constraint> + --> + </security> + + <channels> + + <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel"> + <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> + </channel-definition> + + <channel-definition id="my-secure-amf" class="mx.messaging.channels.SecureAMFChannel"> + <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/amfsecure" class="flex.messaging.endpoints.SecureAMFEndpoint"/> + <properties> + <add-no-cache-headers>false</add-no-cache-headers> + </properties> + </channel-definition> + + <channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel"> + <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/amfpolling" class="flex.messaging.endpoints.AMFEndpoint"/> + <properties> + <polling-enabled>true</polling-enabled> + <polling-interval-seconds>4</polling-interval-seconds> + </properties> + </channel-definition> + + <!-- + <channel-definition id="my-http" class="mx.messaging.channels.HTTPChannel"> + <endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/http" class="flex.messaging.endpoints.HTTPEndpoint"/> + </channel-definition> + + <channel-definition id="my-secure-http" class="mx.messaging.channels.SecureHTTPChannel"> + <endpoint url="https://{server.name}:{server.port}/{context.root}/messagebroker/httpsecure" class="flex.messaging.endpoints.SecureHTTPEndpoint"/> + <properties> + <add-no-cache-headers>false</add-no-cache-headers> + </properties> + </channel-definition> + --> + </channels> + + <logging> + <target class="flex.messaging.log.ConsoleTarget" level="Error"> + <properties> + <prefix>[BlazeDS] </prefix> + <includeDate>false</includeDate> + <includeTime>false</includeTime> + <includeLevel>false</includeLevel> + <includeCategory>false</includeCategory> + </properties> + <filters> + <pattern>Endpoint.*</pattern> + <pattern>Service.*</pattern> + <pattern>Configuration</pattern> + </filters> + </target> + </logging> + + <system> + <redeploy> + <enabled>false</enabled> + <!-- + <watch-interval>20</watch-interval> + <watch-file>{context.root}/WEB-INF/flex/services-config.xml</watch-file> + <watch-file>{context.root}/WEB-INF/flex/proxy-config.xml</watch-file> + <watch-file>{context.root}/WEB-INF/flex/remoting-config.xml</watch-file> + <watch-file>{context.root}/WEB-INF/flex/messaging-config.xml</watch-file> + <watch-file>{context.root}/WEB-INF/flex/data-management-config.xml</watch-file> + <touch-file>{context.root}/WEB-INF/web.xml</touch-file> + --> + </redeploy> + </system> + +</services-config> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kj...@us...> - 2009-04-17 22:40:48
|
Revision: 103 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=103&view=rev Author: kjonas Date: 2009-04-17 22:40:37 +0000 (Fri, 17 Apr 2009) Log Message: ----------- Stub InstructionPageLoader created Modified Paths: -------------- mentalmodels/trunk/flex/src/TableTest.mxml mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml Added Paths: ----------- mentalmodels/trunk/flex/src/actionscript/InstructionPageLoader.as Modified: mentalmodels/trunk/flex/src/TableTest.mxml =================================================================== --- mentalmodels/trunk/flex/src/TableTest.mxml 2009-04-17 22:32:45 UTC (rev 102) +++ mentalmodels/trunk/flex/src/TableTest.mxml 2009-04-17 22:40:37 UTC (rev 103) @@ -2,6 +2,7 @@ <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="customComponents.*" layout="absolute"> <mx:VBox> + <comp:InstructionPage id="instructionPage"/> <mx:HBox id="cast"> <!--<comp:Forecast id="legacy" numColumns="10"/>--> <comp:Forecast1 id="forecastPeople" numColumns="15" minValue="0" maxValue="30" initialize="init()"/> @@ -18,7 +19,8 @@ public function init():void { - for(var x:Number=0;x<4;x++)for(var y:Number=0;y<15;y++)forecastPeople.setItem(x,y,7.5); +instructionPage.txt.htmlText = "this is a test <img src=\"http://www.google.com/intl/en_ALL/images/logo.gif\"><br>asdfghjkl;"; +//for(var x:Number=0;x<4;x++)for(var y:Number=0;y<15;y++)forecastPeople.setItem(x,y,7.5); } public function testNext(evt:Event=null):void Added: mentalmodels/trunk/flex/src/actionscript/InstructionPageLoader.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/InstructionPageLoader.as (rev 0) +++ mentalmodels/trunk/flex/src/actionscript/InstructionPageLoader.as 2009-04-17 22:40:37 UTC (rev 103) @@ -0,0 +1,10 @@ +package actionscript +{ + public class InstructionPageLoader + { + public function InstructionPageLoader() + { + } + + } +} \ No newline at end of file Modified: mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml =================================================================== --- mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml 2009-04-17 22:32:45 UTC (rev 102) +++ mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml 2009-04-17 22:40:37 UTC (rev 103) @@ -1,6 +1,10 @@ <?xml version="1.0" encoding="utf-8"?> <mx:VBox xmlns:mx="http://www.adobe.com/2006/mxml" xmlns:comp="customComponents.*" initialize="init()"> + <mx:Text width="800" height="300" id="html"> + <mx:htmlText/> + </mx:Text> + <mx:Script> <![CDATA[ import mx.collections.ArrayCollection; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-17 22:32:54
|
Revision: 102 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=102&view=rev Author: alllee Date: 2009-04-17 22:32:45 +0000 (Fri, 17 Apr 2009) Log Message: ----------- adding blazeds dependencies Modified Paths: -------------- mentalmodels/trunk/pom.xml mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml mentalmodels/trunk/src/main/webapp/WEB-INF/web.xml Modified: mentalmodels/trunk/pom.xml =================================================================== --- mentalmodels/trunk/pom.xml 2009-04-15 00:30:17 UTC (rev 101) +++ mentalmodels/trunk/pom.xml 2009-04-17 22:32:45 UTC (rev 102) @@ -71,7 +71,31 @@ <artifactId>slf4j-log4j12</artifactId> <version>1.5.2</version> </dependency> - + <dependency> + <groupId>com.adobe.blazeds</groupId> + <artifactId>blazeds-core</artifactId> + <version>3.2.0.3978</version> + </dependency> + <dependency> + <groupId>com.adobe.blazeds</groupId> + <artifactId>blazeds-remoting</artifactId> + <version>3.2.0.3978</version> + </dependency> + <dependency> + <groupId>com.adobe.blazeds</groupId> + <artifactId>blazeds-common</artifactId> + <version>3.2.0.3978</version> + </dependency> + <dependency> + <groupId>com.adobe.blazeds</groupId> + <artifactId>blazeds-proxy</artifactId> + <version>3.2.0.3978</version> + </dependency> + <dependency> + <groupId>com.adobe.blazeds</groupId> + <artifactId>blazeds-opt</artifactId> + <version>3.2.0.3978</version> + </dependency> </dependencies> <build> <finalName>mme</finalName> @@ -127,12 +151,12 @@ can be invoked via mvn -P ant -D target=initialize-data --> - <property name="compile.classpath" refid="maven.compile.classpath" /> - <property name="runtime.classpath" refid="maven.runtime.classpath" /> - <property name="test.classpath" refid="maven.test.classpath" /> - <property name="plugin.classpath" refid="maven.plugin.classpath" /> + <property name="compile.classpath" refid="maven.compile.classpath"/> + <property name="runtime.classpath" refid="maven.runtime.classpath"/> + <property name="test.classpath" refid="maven.test.classpath"/> + <property name="plugin.classpath" refid="maven.plugin.classpath"/> <ant antfile="${basedir}/init-db.ant.xml" inheritRefs="true" inheritAll="true"> - <target name="${target}" /> + <target name="${target}"/> </ant> </tasks> </configuration> @@ -148,5 +172,4 @@ </dependencies> </profile> </profiles> - </project> Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-15 00:30:17 UTC (rev 101) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-17 22:32:45 UTC (rev 102) @@ -9,22 +9,19 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" - xmlns:flex="http://www.springframework.org/schema/flex" - xmlns:security="http://www.springframework.org/schema/security" + xmlns:flex="http://www.springframework.org/schema/flex" + xmlns:security="http://www.springframework.org/schema/security" xsi:schemaLocation=" http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-2.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.0.xsd - http://www.springframework.org/schema/tx - http://www.springframework.org/schema/tx/spring-tx.xsd - http://www.springframework.org/schema/security/spring-security-2.0.4.xsd - http://www.springframework.org/schema/flex http://www.springframework.org/schema/flex/spring-flex-1.0.xsd + http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx.xsd + http://www.springframework.org/schema/security/spring-security-2.0.4.xsd + http://www.springframework.org/schema/flex http://www.springframework.org/schema/flex/spring-flex-1.0.xsd "> <!-- Flex related information started --> -<flex:message-broker> - <flex:secured /> -</flex:message-broker> +<flex:message-broker /> /<!-- XXX: Split these out into separate XML files and import them if this file gets too large --> <!-- spring managed daos --> @@ -40,7 +37,6 @@ <!-- Expose services for BlazeDS remoting --> <flex:remote-service ref="studentService" /> - <!-- Flex related information ended--> <bean id="mmeDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> @@ -60,7 +56,6 @@ <property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration"/> <property name="hibernateProperties"> <props> - <prop key="hibernate.cglib.use_reflection_optimizer">false</prop> <prop key="hibernate.dialect">org.hibernate.dialect.MySQLInnoDBDialect</prop> <prop key="hibernate.show_sql">false</prop> </props> Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/web.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/web.xml 2009-04-15 00:30:17 UTC (rev 101) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/web.xml 2009-04-17 22:32:45 UTC (rev 102) @@ -4,13 +4,7 @@ --> <web-app> <display-name>Mental Models Experiment</display-name> - <context-param> - <param-name>contextConfigLocation</param-name> - <param-value> - /WEB-INF/applicationContext.xml - </param-value> - </context-param> - + <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> @@ -26,13 +20,13 @@ </listener> <servlet> - <servlet-name>testdrive</servlet-name> + <servlet-name>mme</servlet-name> <servlet-class>org.springframework.web.servlet.DispatcherServlet</servlet-class> <load-on-startup>1</load-on-startup> </servlet> <servlet-mapping> - <servlet-name>testdrive</servlet-name> + <servlet-name>mme</servlet-name> <url-pattern>/messagebroker/*</url-pattern> </servlet-mapping> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-04-15 00:30:27
|
Revision: 101 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=101&view=rev Author: seematalele Date: 2009-04-15 00:30:17 +0000 (Wed, 15 Apr 2009) Log Message: ----------- cleaned the init-mme.sql Modified Paths: -------------- mentalmodels/trunk/src/main/db/init-mme.sql Modified: mentalmodels/trunk/src/main/db/init-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-15 00:26:54 UTC (rev 100) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-15 00:30:17 UTC (rev 101) @@ -49,311 +49,3 @@ insert into question_group(sequence_no) values(25,"Some final questions about the experiment"); insert into question_group(sequence_no) values(26,"Some final questions about you"); insert into question_group(sequence_no) values(27,"The end"); - - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Leaving strategy design -During a quick check of your strategy the following possible errors were found",1,0,1) - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Explain the strategy in your own words.Please explain your strategy with a few sentences. Particularly consider the following aspects: -\x95 Why did you design the strategy the way you did? What did you consider and why do you think your strategy is an adequate solution? -\x95 What actions do you expect from the other fishermen in your group? Why do you think, they might act this way? -\x95 How do you think your strategy will work? Will the fish population grow or shrink in the different bays? What earnings do you expect? -",1,0,2) - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"What goals did you follow when designing your strategy? -Please specify three goals that most influenced the design of your strategy. You can select from 18 different goals grouped in three categories (foci). -First select the focus of the goal (earnings, fish population or the other fishermen). Based on this selection, the list on the right hand sight will be filled and you can select one of these goals. For the second and third most important goal, also state, how much less important they are in relation to the most important goal. -The information you write into these fields will be available the next time you edit your strategy. -",1,0,3) - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Most important goal:",2,0,3); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Second most important goal:",3,0,3); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Third most important goal:",4,0,3); - - -//Catergorial -insert into categorial(id) values(4); -insert into categorial(id) values(5); -insert into categorial(id) values(6); - -insert into categorial_choices(categorial_id,element,choices) values(4,); -insert into categorial_choices(categorial_id,element,choices) values(5); -insert into categorial_choices(categorial_id,element,choices) values(6); - - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"What goals do you think the others follow? -Specify the three goals that you think most influenced the design of the strategy of the other fishermen in your group. You can select from 18 different goals grouped in three categories (foci). -First select the focus of the goal (earnings, fish population or the other fishermen). Based on this selection, the list on the right hand sight will be filled and you can select one of these goals. For the second and third most important goal, also state, how much less important they are in relation to the most important goal. -",1,0,4); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Most important goal:",2,0,4); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Second most important goal:",3,0,4); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Third most important goal:",4,0,4); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How do you perceive your group?",1,0,5); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Over all, how much do like your group (i.e. the other players)?",2,0,5); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How important is it for you what the others think about you and your behavior (i.e. your reputation in the group)?",3,0,5); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How important is it for you that the others can reach their goals (i.e. the outcomes are fair)?",4,0,5); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"What do you think, how important is it for the others that you can reach your goals (i.e. the outcomes are fair)?",5,0,5); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Do you perceive the group as a team or as competing players?",6,0,5); - - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How much do you count on others and how much can they count on you?",1,0,6); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How much do you trust the others in your group?",2,0,6); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How important is it for you that the others in your group can and do trust you?",3,0,6); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How much do you think your group trying to coordinate their actions to reach better outcomes for all?",4,0,6); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How much are you trying to follow rules or agreements that emerged from the communication?",5,0,6); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How much do you think the others are trying to follow rules or agreements that emerged from the communication?",6,0,6); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"What else influenced your strategy design?",1,0,7); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Do you feel a sense of \x91commitment\x92 to act in the way you specified in your strategy?",2,0,7); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Would you feel any discomfort or tension if you would act differently than you specified in your strategy?",3,0,7); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Do you feel any sort of \x91social pressure\x92 to act in the way you specified in your strategy?",4,0,7); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Would you feel guilt or shame if you had acted differently than you specified in your strategy?",5,0,7); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Are you afraid of some sort of \x91punishment\x92 if you had acted differently as specified in your strategy?",6,0,7); - - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How confident are you in reaching the outcomes you are expecting?",1,0,8); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How well did you understand the dynamics of the fish population?",2,0,8); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Did the others in your group understand the dynamics better or worse than you?",3,0,8); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How confident are you in having developed a strategy that leads to \x91good\x92 outcomes regarding your goals?",4,0,8); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How much does your strategy depend on how the others in the group will act to reach the desired outcomes?",5,0,8); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Would you classify your strategy as \x91safe\x92 in the sense of having acceptable but suboptimal results for sure, or rather as \x91risky\x92 in the sense of having the optimal results if everything runs like expected or very poor results otherwise?",6,0,8); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Leaving strategy design -During a quick check of your strategy the following possible errors were found: -",1,0,9); - - - -Page 2-5-02 -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"What are your emotional reactions to the outcomes?",1,0,10); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"First we want to know your emotional reactions to the results:",2,0,10); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"I feel the outcomes are\x85 ",3,0,10); - -Page 2-5-03 - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"What is your evaluation of the outcomes?",1,0,11); - - -Page 2-5-04 -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"What might be the causes for the outcomes?",1,0,12); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"I did not understand well enough the dynamics of the fish population. ",2,0,12); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Some of the other fishermen did not understand well enough the dynamics of the fish population.",3,0,12); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"The others in my group acted differently then would have been necessary for my strategy to work out well.",4,0,12); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Some of the other fishermen acted too reluctantly (harvested too few).",5,0,12); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Some of the other fishermen acted too aggressively (harvested too much).",6,0,12); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"The group acted too uncoordinated. ",7,0,12); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"The group did not follow enough the rules or agreements that emerged from the communication.",8,0,12); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"The rules or agreements that emerged from the communication did not work out well.",9,0,12); - -Page 3-1-02 - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Did the communication have any effect on you?",1,0,13); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Due to the conversation, I now better understand the dynamics of the fish population. -",2,0,13); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Due to the conversation, I now better understand the other fishermen in my group.",3,0,13); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Due to the conversation, I now better understand how to design the strategy.",4,0,13); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Due to the conversation, I now feel a \x91team spirit\x92 in the group.",5,0,13); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Due to the conversation, I now appraise the other fishermen in my group differently. Now I think about the others",6,0,13); - -Page 3-1-03 - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"What do you think were the effects of the communication on the others?",1,0,13); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Due to the conversation, the other fishermen in my group better understand the dynamics of the fish population.",2,0,13); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Due to the conversation, the other fishermen in my group better understand the other fishermen in my group.",3,0,13); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Due to the conversation, the other fishermen in my group better understand how to design the strategy.",4,0,13); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Due to the conversation, the other fishermen in my group feel a \x91team spirit\x92 in the group.",5,0,13); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Due to the conversation, the other fishermen in my group appraise the other fishermen in my group differently. Now I think about the others",6,0,13); - -Page 3-1-04 -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Did the communication lead to some sort of coordination of the fishing?",1,0,13); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Did the communication have any form of reference to how to fish or design the strategy?",2,0,13); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Describe in your own words what the (maybe unclear) rule, agreement or other coordination attempt states. - De-scribe how you and the others should act and what would happen, if one does not act in this way. -If you cannot identify any sort of coordination attempt in the communication write \x93no coordination\x94 in the field below. -",3,0,13); - - -Page 3-1-5 - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"What is your opinion about the rule that emerged from communication?",1,0,14); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"The rule, agreement or coordination attempt is",2,0,14); - - -Page 3-1-06 -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"What will be the effects of the rule?",1,0,15); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How clear is it to you, that you have to fish conforming to this rule, agreement or coordination attempt?",2,0,15); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Do you think the other fishermen understood how they have to act according to this rule? -I think the others",3,0,15); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Will you follow the rule, agreement, or coordination attempt that emerged from communication?",4,0,15); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Do you think, the other fishermen in you group will follow the rule, agreement, or coordination attempt? -I think, the others will",5,0,15); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Considering the effects you expect for following the rule and your expectations of how the -group will follow the rule, do you think the group will do better or worse due to the rule?",6,0,15); - - -Page 3-1-07 -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Lessons Learned",1,0,16); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"New understanding of fish dynamics",2,0,16); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"New expectations on how the others of the group will act",3,0,16); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Ideas for improving your strategy",4,0,16); - -Page 4-1-01 -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Some final questions about the experiment.Congratulations! You finished the actual experiment. We want to ask you some final questions.",1,0,17); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How interesting was the experiment for you?",2,0,17); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How would you rate the effort you invested to design your strategy?",3,0,17); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How difficult was it to understand the problem?",4,0,17); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How difficult was it to find a good strategy?",5,0,17); - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"How clear was it what you have to do?",6,0,17); - - -Page 4-2-1 - -insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Would you have acted similarly in these real-world situations as you did in this experiment?",1,0,18); - - - - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-04-15 00:27:02
|
Revision: 100 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=100&view=rev Author: seematalele Date: 2009-04-15 00:26:54 +0000 (Wed, 15 Apr 2009) Log Message: ----------- Written insert statements for questiongroup table into the init-mme.sql; Modified Paths: -------------- mentalmodels/trunk/src/main/db/init-mme.sql mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java Modified: mentalmodels/trunk/src/main/db/init-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-14 22:18:17 UTC (rev 99) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-15 00:26:54 UTC (rev 100) @@ -21,24 +21,34 @@ insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,3); insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,4); -insert into question_group(sequence_no) values(1); -insert into question_group(sequence_no) values(2); -insert into question_group(sequence_no) values(3); -insert into question_group(sequence_no) values(4); -insert into question_group(sequence_no) values(5); -insert into question_group(sequence_no) values(6); -insert into question_group(sequence_no) values(7); -insert into question_group(sequence_no) values(8); -insert into question_group(sequence_no) values(9); -insert into question_group(sequence_no) values(10); -insert into question_group(sequence_no) values(11); -insert into question_group(sequence_no) values(12); -insert into question_group(sequence_no) values(13); -insert into question_group(sequence_no) values(14); -insert into question_group(sequence_no) values(15); -insert into question_group(sequence_no) values(16); -insert into question_group(sequence_no) values(17); -insert into question_group(sequence_no) values(18); +insert into question_group(sequence_no,header_question) values(1,"Leaving strategy design +During a quick check of your strategy the following possible errors were found"); +insert into question_group(sequence_no) values(2,"Explain the strategy in your own words"); +insert into question_group(sequence_no) values(3,"What goals did you follow when designing your strategy?"); +insert into question_group(sequence_no) values(4,"What goals do you think the others follow?"); +insert into question_group(sequence_no) values(5,"How do you perceive your group?"); +insert into question_group(sequence_no) values(6,"How much do you count on others and how much can they count on you?"); +insert into question_group(sequence_no) values(7,"What else influenced your strategy design?"); +insert into question_group(sequence_no) values(8,"How confident are you in reaching the outcomes you are expecting?"); +insert into question_group(sequence_no) values(9,"What are you expecting the others will do?"); +insert into question_group(sequence_no) values(10,"What are you expecting how the fish population will develop?"); +insert into question_group(sequence_no) values(11,"Leaving strategy design"); +insert into question_group(sequence_no) values(12,"What are your emotional reactions to the outcomes?"); +insert into question_group(sequence_no) values(13,"What is your evaluation of the outcomes?"); +insert into question_group(sequence_no) values(14,"What might be the causes for the outcomes?"); +insert into question_group(sequence_no) values(15,"Comparing your day-by-day decisions with the strategy"); +insert into question_group(sequence_no) values(16,"Lessons learned"); +insert into question_group(sequence_no) values(17,"Explain the strategy in your own words"); +insert into question_group(sequence_no) values(18,"Leaving strategy design"); +insert into question_group(sequence_no) values(19,"Did the communication have any effect on you?"); +insert into question_group(sequence_no) values(20,"What do you think were the effects of the communication on the others?"); +insert into question_group(sequence_no) values(21,"Did the communication lead to some sort of coordination of the fishing?"); +insert into question_group(sequence_no) values(22,"What is your opinion about the rule that emerged from communication?"); +insert into question_group(sequence_no) values(23,"What will be the effects of the rule?"); +insert into question_group(sequence_no) values(24,"Lessons learned"); +insert into question_group(sequence_no) values(25,"Some final questions about the experiment"); +insert into question_group(sequence_no) values(26,"Some final questions about you"); +insert into question_group(sequence_no) values(27,"The end"); insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) @@ -46,8 +56,7 @@ During a quick check of your strategy the following possible errors were found",1,0,1) insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) -values(0,1,"Explain the strategy in your own words -Please explain your strategy with a few sentences. Particularly consider the following aspects: +values(0,1,"Explain the strategy in your own words.Please explain your strategy with a few sentences. Particularly consider the following aspects: \x95 Why did you design the strategy the way you did? What did you consider and why do you think your strategy is an adequate solution? \x95 What actions do you expect from the other fishermen in your group? Why do you think, they might act this way? \x95 How do you think your strategy will work? Will the fish population grow or shrink in the different bays? What earnings do you expect? Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-14 22:18:17 UTC (rev 99) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-15 00:26:54 UTC (rev 100) @@ -20,9 +20,9 @@ private Long id; - @ManyToMany(mappedBy = "questiongroup") + @ManyToMany(mappedBy = "questionGroup") @JoinColumn(nullable=false) - private Set<RoundConfig>roundconfig; + private Set<RoundConfig>roundConfig; @Column(name = "sequence_no",nullable=false) private Integer sequenceNo; @@ -43,17 +43,17 @@ public Integer getSequenceNo() { return sequenceNo; } - public void setRoundConfig(Set<RoundConfig> roundconfig) { - this.roundconfig = roundconfig; - } - public Set<RoundConfig> getRoundConfig() { - return roundconfig; - } public void setHeader_question(String header_question) { this.header_question = header_question; } public String getHeader_question() { return header_question; } + public void setRoundconfig(Set<RoundConfig> roundconfig) { + this.roundConfig = roundconfig; + } + public Set<RoundConfig> getRoundconfig() { + return roundConfig; + } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kj...@us...> - 2009-04-14 22:18:35
|
Revision: 99 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=99&view=rev Author: kjonas Date: 2009-04-14 22:18:17 +0000 (Tue, 14 Apr 2009) Log Message: ----------- resolved some of the conflicts Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-14 20:08:16 UTC (rev 98) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-14 22:18:17 UTC (rev 99) @@ -5,27 +5,13 @@ import java.util.List; import javax.persistence.Column; -import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Lob; import javax.persistence.OneToMany; import javax.persistence.Table; -import javax.persistence.Temporal; -import javax.persistence.TemporalType; -<<<<<<< .mine -import java.sql.Timestamp; -======= ->>>>>>> .r97 - -<<<<<<< .mine - -======= - - ->>>>>>> .r97 @Entity @Table(name="game") public class GameConfig { Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-14 20:08:16 UTC (rev 98) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-14 22:18:17 UTC (rev 99) @@ -14,8 +14,8 @@ @Table(name="psychometric") public class Psychometric extends Question { + @Column(nullable=false) - @Column(nullable=false) private String scale; @Column(name="no_of_intervals",nullable=false) Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-14 20:08:16 UTC (rev 98) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-14 22:18:17 UTC (rev 99) @@ -44,10 +44,10 @@ return sequenceNo; } public void setRoundConfig(Set<RoundConfig> roundconfig) { - this.roundConfig = roundconfig; + this.roundconfig = roundconfig; } public Set<RoundConfig> getRoundConfig() { - return roundConfig; + return roundconfig; } public void setHeader_question(String header_question) { this.header_question = header_question; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-04-14 20:08:21
|
Revision: 98 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=98&view=rev Author: seematalele Date: 2009-04-14 20:08:16 +0000 (Tue, 14 Apr 2009) Log Message: ----------- resolved conflicts in some files. Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-04-14 19:57:10 UTC (rev 97) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-04-14 20:08:16 UTC (rev 98) @@ -2,6 +2,7 @@ import java.util.List; +import java.util.Map; import javax.persistence.Entity; import javax.persistence.Table; @@ -15,18 +16,32 @@ public class Categorical extends Question { +/* @CollectionOfElements + @IndexColumn(name = "choices", base=1, nullable=false) +*/ + @CollectionOfElements - @IndexColumn(name = "choices", base=1) - private List<String> choices; + @org.hibernate.annotations.MapKey + private Map<String,java.util.ArrayList<String>> choices; - public void setChoices(List<String> choices) { + public void setChoices(Map<String,java.util.ArrayList<String>> choices) { this.choices = choices; } + public Map<String,java.util.ArrayList<String>> getChoices() { + return choices; + } + + /*public void setChoices(List<String> choices) { + this.choices = choices; + } + public List<String> getChoices() { return choices; } +*/ + } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-14 19:57:10 UTC (rev 97) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-14 20:08:16 UTC (rev 98) @@ -1,8 +1,9 @@ package edu.asu.commons.mme.entity; + import java.sql.Timestamp; - - +import java.util.Date; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-14 19:57:10 UTC (rev 97) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-14 20:08:16 UTC (rev 98) @@ -2,7 +2,6 @@ import java.sql.Timestamp; import java.util.ArrayList; -import java.util.Date; import java.util.List; import javax.persistence.Column; @@ -15,10 +14,18 @@ import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; +<<<<<<< .mine +import java.sql.Timestamp; +======= +>>>>>>> .r97 +<<<<<<< .mine +======= + +>>>>>>> .r97 @Entity @Table(name="game") public class GameConfig { Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-14 19:57:10 UTC (rev 97) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-14 20:08:16 UTC (rev 98) @@ -15,6 +15,7 @@ public class Psychometric extends Question { @Column(nullable=false) + @Column(nullable=false) private String scale; @Column(name="no_of_intervals",nullable=false) Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-14 19:57:10 UTC (rev 97) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-14 20:08:16 UTC (rev 98) @@ -4,12 +4,12 @@ import java.util.Set; import javax.persistence.CascadeType; - import javax.persistence.Column; import javax.persistence.JoinColumn; import javax.persistence.Column; + import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; @@ -28,6 +28,7 @@ @Column(name="round_no",nullable=false) private Integer roundNo; + @ManyToOne @JoinColumn(nullable=false) @@ -37,6 +38,7 @@ @Column(name="communication_flag",nullable=false,columnDefinition= "Boolean") private boolean communicationFlag; + @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) private Set<QuestionGroup> questionGroup; Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-14 19:57:10 UTC (rev 97) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-14 20:08:16 UTC (rev 98) @@ -23,6 +23,7 @@ <mapping class='edu.asu.commons.mme.entity.Question'/> + <mapping class='edu.asu.commons.mme.entity.Categorical'/> <mapping class='edu.asu.commons.mme.entity.Psychometric'/> <mapping class='edu.asu.commons.mme.entity.StudentResponse'/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-04-14 19:57:16
|
Revision: 97 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=97&view=rev Author: seematalele Date: 2009-04-14 19:57:10 +0000 (Tue, 14 Apr 2009) Log Message: ----------- created Forecasting, StudentResponse classes Changed the Categorical, Psychometric schema created and written insert statements into init-mmme.sql but needs to revise survey part. Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml Added Paths: ----------- mentalmodels/trunk/src/main/db/init-mme.sql mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentResponse.java Added: mentalmodels/trunk/src/main/db/init-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/init-mme.sql (rev 0) +++ mentalmodels/trunk/src/main/db/init-mme.sql 2009-04-14 19:57:10 UTC (rev 97) @@ -0,0 +1,350 @@ +insert into game (description,img_address,max_days,max_fish_harvest,money,no_of_location,no_of_rounds,timestamp,title) +values("First game","island.jpg",30,5,0.0,4,3,NOW(),"Mental Model Experiment"); + +insert into round_config (communication_flag,round_no,game_id) values(false,1,1); +insert into round_config (communication_flag,round_no,game_id) values(true,2,1); + +insert into game_round_config(game_id,roundconfig_id) values(1,1); +insert into game_round_config(game_id,roundconfig_id) values(1,2); + +insert into location_config(growth_rate,location_name,max_capacity,start_population) values(0.5,"Bay1",10,5); +insert into location_config(growth_rate,location_name,max_capacity,start_population) values(0.15,"Bay2",20,10); +insert into location_config(growth_rate,location_name,max_capacity,start_population) values(0.05,"Bay3",30,15); +insert into location_config(growth_rate,location_name,max_capacity,start_population) values(0.0,"Harbor",0,0); + +insert into round_config_location_config(roundconfig_id,locationconfig_id) values(1,1); +insert into round_config_location_config(roundconfig_id,locationconfig_id) values(1,2); +insert into round_config_location_config(roundconfig_id,locationconfig_id) values(1,3); +insert into round_config_location_config(roundconfig_id,locationconfig_id) values(1,4); +insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,1); +insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,2); +insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,3); +insert into round_config_location_config(roundconfig_id,locationconfig_id) values(2,4); + +insert into question_group(sequence_no) values(1); +insert into question_group(sequence_no) values(2); +insert into question_group(sequence_no) values(3); +insert into question_group(sequence_no) values(4); +insert into question_group(sequence_no) values(5); +insert into question_group(sequence_no) values(6); +insert into question_group(sequence_no) values(7); +insert into question_group(sequence_no) values(8); +insert into question_group(sequence_no) values(9); +insert into question_group(sequence_no) values(10); +insert into question_group(sequence_no) values(11); +insert into question_group(sequence_no) values(12); +insert into question_group(sequence_no) values(13); +insert into question_group(sequence_no) values(14); +insert into question_group(sequence_no) values(15); +insert into question_group(sequence_no) values(16); +insert into question_group(sequence_no) values(17); +insert into question_group(sequence_no) values(18); + + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Leaving strategy design +During a quick check of your strategy the following possible errors were found",1,0,1) + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Explain the strategy in your own words +Please explain your strategy with a few sentences. Particularly consider the following aspects: +\x95 Why did you design the strategy the way you did? What did you consider and why do you think your strategy is an adequate solution? +\x95 What actions do you expect from the other fishermen in your group? Why do you think, they might act this way? +\x95 How do you think your strategy will work? Will the fish population grow or shrink in the different bays? What earnings do you expect? +",1,0,2) + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"What goals did you follow when designing your strategy? +Please specify three goals that most influenced the design of your strategy. You can select from 18 different goals grouped in three categories (foci). +First select the focus of the goal (earnings, fish population or the other fishermen). Based on this selection, the list on the right hand sight will be filled and you can select one of these goals. For the second and third most important goal, also state, how much less important they are in relation to the most important goal. +The information you write into these fields will be available the next time you edit your strategy. +",1,0,3) + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Most important goal:",2,0,3); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Second most important goal:",3,0,3); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Third most important goal:",4,0,3); + + +//Catergorial +insert into categorial(id) values(4); +insert into categorial(id) values(5); +insert into categorial(id) values(6); + +insert into categorial_choices(categorial_id,element,choices) values(4,); +insert into categorial_choices(categorial_id,element,choices) values(5); +insert into categorial_choices(categorial_id,element,choices) values(6); + + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"What goals do you think the others follow? +Specify the three goals that you think most influenced the design of the strategy of the other fishermen in your group. You can select from 18 different goals grouped in three categories (foci). +First select the focus of the goal (earnings, fish population or the other fishermen). Based on this selection, the list on the right hand sight will be filled and you can select one of these goals. For the second and third most important goal, also state, how much less important they are in relation to the most important goal. +",1,0,4); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Most important goal:",2,0,4); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Second most important goal:",3,0,4); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Third most important goal:",4,0,4); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How do you perceive your group?",1,0,5); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Over all, how much do like your group (i.e. the other players)?",2,0,5); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How important is it for you what the others think about you and your behavior (i.e. your reputation in the group)?",3,0,5); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How important is it for you that the others can reach their goals (i.e. the outcomes are fair)?",4,0,5); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"What do you think, how important is it for the others that you can reach your goals (i.e. the outcomes are fair)?",5,0,5); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Do you perceive the group as a team or as competing players?",6,0,5); + + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How much do you count on others and how much can they count on you?",1,0,6); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How much do you trust the others in your group?",2,0,6); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How important is it for you that the others in your group can and do trust you?",3,0,6); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How much do you think your group trying to coordinate their actions to reach better outcomes for all?",4,0,6); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How much are you trying to follow rules or agreements that emerged from the communication?",5,0,6); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How much do you think the others are trying to follow rules or agreements that emerged from the communication?",6,0,6); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"What else influenced your strategy design?",1,0,7); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Do you feel a sense of \x91commitment\x92 to act in the way you specified in your strategy?",2,0,7); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Would you feel any discomfort or tension if you would act differently than you specified in your strategy?",3,0,7); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Do you feel any sort of \x91social pressure\x92 to act in the way you specified in your strategy?",4,0,7); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Would you feel guilt or shame if you had acted differently than you specified in your strategy?",5,0,7); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Are you afraid of some sort of \x91punishment\x92 if you had acted differently as specified in your strategy?",6,0,7); + + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How confident are you in reaching the outcomes you are expecting?",1,0,8); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How well did you understand the dynamics of the fish population?",2,0,8); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Did the others in your group understand the dynamics better or worse than you?",3,0,8); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How confident are you in having developed a strategy that leads to \x91good\x92 outcomes regarding your goals?",4,0,8); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How much does your strategy depend on how the others in the group will act to reach the desired outcomes?",5,0,8); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Would you classify your strategy as \x91safe\x92 in the sense of having acceptable but suboptimal results for sure, or rather as \x91risky\x92 in the sense of having the optimal results if everything runs like expected or very poor results otherwise?",6,0,8); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Leaving strategy design +During a quick check of your strategy the following possible errors were found: +",1,0,9); + + + +Page 2-5-02 +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"What are your emotional reactions to the outcomes?",1,0,10); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"First we want to know your emotional reactions to the results:",2,0,10); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"I feel the outcomes are\x85 ",3,0,10); + +Page 2-5-03 + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"What is your evaluation of the outcomes?",1,0,11); + + +Page 2-5-04 +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"What might be the causes for the outcomes?",1,0,12); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"I did not understand well enough the dynamics of the fish population. ",2,0,12); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Some of the other fishermen did not understand well enough the dynamics of the fish population.",3,0,12); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"The others in my group acted differently then would have been necessary for my strategy to work out well.",4,0,12); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Some of the other fishermen acted too reluctantly (harvested too few).",5,0,12); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Some of the other fishermen acted too aggressively (harvested too much).",6,0,12); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"The group acted too uncoordinated. ",7,0,12); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"The group did not follow enough the rules or agreements that emerged from the communication.",8,0,12); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"The rules or agreements that emerged from the communication did not work out well.",9,0,12); + +Page 3-1-02 + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Did the communication have any effect on you?",1,0,13); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Due to the conversation, I now better understand the dynamics of the fish population. +",2,0,13); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Due to the conversation, I now better understand the other fishermen in my group.",3,0,13); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Due to the conversation, I now better understand how to design the strategy.",4,0,13); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Due to the conversation, I now feel a \x91team spirit\x92 in the group.",5,0,13); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Due to the conversation, I now appraise the other fishermen in my group differently. Now I think about the others",6,0,13); + +Page 3-1-03 + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"What do you think were the effects of the communication on the others?",1,0,13); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Due to the conversation, the other fishermen in my group better understand the dynamics of the fish population.",2,0,13); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Due to the conversation, the other fishermen in my group better understand the other fishermen in my group.",3,0,13); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Due to the conversation, the other fishermen in my group better understand how to design the strategy.",4,0,13); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Due to the conversation, the other fishermen in my group feel a \x91team spirit\x92 in the group.",5,0,13); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Due to the conversation, the other fishermen in my group appraise the other fishermen in my group differently. Now I think about the others",6,0,13); + +Page 3-1-04 +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Did the communication lead to some sort of coordination of the fishing?",1,0,13); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Did the communication have any form of reference to how to fish or design the strategy?",2,0,13); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Describe in your own words what the (maybe unclear) rule, agreement or other coordination attempt states. + De-scribe how you and the others should act and what would happen, if one does not act in this way. +If you cannot identify any sort of coordination attempt in the communication write \x93no coordination\x94 in the field below. +",3,0,13); + + +Page 3-1-5 + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"What is your opinion about the rule that emerged from communication?",1,0,14); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"The rule, agreement or coordination attempt is",2,0,14); + + +Page 3-1-06 +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"What will be the effects of the rule?",1,0,15); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How clear is it to you, that you have to fish conforming to this rule, agreement or coordination attempt?",2,0,15); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Do you think the other fishermen understood how they have to act according to this rule? +I think the others",3,0,15); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Will you follow the rule, agreement, or coordination attempt that emerged from communication?",4,0,15); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Do you think, the other fishermen in you group will follow the rule, agreement, or coordination attempt? +I think, the others will",5,0,15); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Considering the effects you expect for following the rule and your expectations of how the +group will follow the rule, do you think the group will do better or worse due to the rule?",6,0,15); + + +Page 3-1-07 +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Lessons Learned",1,0,16); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"New understanding of fish dynamics",2,0,16); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"New expectations on how the others of the group will act",3,0,16); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Ideas for improving your strategy",4,0,16); + +Page 4-1-01 +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Some final questions about the experiment.Congratulations! You finished the actual experiment. We want to ask you some final questions.",1,0,17); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How interesting was the experiment for you?",2,0,17); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How would you rate the effort you invested to design your strategy?",3,0,17); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How difficult was it to understand the problem?",4,0,17); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How difficult was it to find a good strategy?",5,0,17); + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"How clear was it what you have to do?",6,0,17); + + +Page 4-2-1 + +insert into question(misc_location,multi_location,question,sequence_no,single_location,question_group_id) +values(0,1,"Would you have acted similarly in these real-world situations as you did in this experiment?",1,0,18); + + + + Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-10 21:44:32 UTC (rev 96) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-14 19:57:10 UTC (rev 97) @@ -1,10 +1,12 @@ package edu.asu.commons.mme.entity; -import java.util.Date; +import java.sql.Timestamp; + import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.JoinColumn; import javax.persistence.Lob; import javax.persistence.ManyToOne; import javax.persistence.Table; @@ -12,6 +14,7 @@ import javax.persistence.TemporalType; + @Entity @Table(name="communication") public class Communication { @@ -23,13 +26,15 @@ @Lob private String message; - @Temporal(TemporalType.TIMESTAMP) - private Date timestamp; + private Timestamp timestamp; + @ManyToOne + @JoinColumn(nullable = false) private Student student; @ManyToOne + @JoinColumn(nullable = false) private RoundConfig roundconfig; public void setId(Long id) { @@ -48,11 +53,11 @@ return message; } - public void setTimestamp(Date timestamp) { + public void setTimestamp(Timestamp timestamp) { this.timestamp = timestamp; } - public Date getTimestamp() { + public Timestamp getTimestamp() { return timestamp; } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java 2009-04-10 21:44:32 UTC (rev 96) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java 2009-04-14 19:57:10 UTC (rev 97) @@ -1,9 +1,11 @@ package edu.asu.commons.mme.entity; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @@ -16,10 +18,13 @@ private Long id; @ManyToOne + @JoinColumn(nullable=false) private StudentStrategy strategy; + @Column(nullable=false) private Integer day; + @Column(nullable=false) private Float earnings; public void setId(Long id) { Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Forecasting.java 2009-04-14 19:57:10 UTC (rev 97) @@ -0,0 +1,25 @@ +package edu.asu.commons.mme.entity; + + +import javax.persistence.Entity; +import javax.persistence.Table; +import javax.persistence.Column; + +@Entity +@Table(name="forecasting") + +public class Forecasting extends Question { + @Column(name="day_no",nullable=false) + private Integer dayNo; + + public void setDayNo(Integer dayNo) { + this.dayNo = dayNo; + } + + public Integer getDayNo() { + return dayNo; + } + + + +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-10 21:44:32 UTC (rev 96) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-14 19:57:10 UTC (rev 97) @@ -1,10 +1,12 @@ package edu.asu.commons.mme.entity; +import java.sql.Timestamp; import java.util.ArrayList; import java.util.Date; import java.util.List; import javax.persistence.Column; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @@ -15,6 +17,8 @@ import javax.persistence.TemporalType; + + @Entity @Table(name="game") public class GameConfig { @@ -23,14 +27,23 @@ @GeneratedValue private Long id; + @Column(name="no_of_rounds",nullable = false) private Integer noOfRounds; + + @Column(name="no_of_location",nullable = false) private Integer noOfLocation; + + @Column(name="max_days",nullable = false) private Integer maxDays; + + @Column(name="max_fish_harvest",nullable = false) private Integer maxFishHarvest; - @Temporal(TemporalType.DATE) - private Date timestamp; + @Column(nullable=false) + private Timestamp timestamp; + + @Column(nullable=false) private String title; @Lob @@ -74,12 +87,7 @@ public Integer getMax_no_of_days() { return maxDays; } - public void setTimestamp(Date timestamp) { - this.timestamp = timestamp; - } - public Date getTimestamp() { - return timestamp; - } + public void setTitle(String title) { this.title = title; } @@ -110,6 +118,13 @@ public List<RoundConfig> getRoundconfig() { return roundconfig; } + public void setTimestamp(Timestamp timestamp) { + this.timestamp = timestamp; + } + public Timestamp getTimestamp() { + return timestamp; + } + } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java 2009-04-10 21:44:32 UTC (rev 96) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java 2009-04-14 19:57:10 UTC (rev 97) @@ -5,6 +5,7 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @@ -22,10 +23,11 @@ @GeneratedValue private Long id; - @Column(name="grp_no") + @Column(name="grp_no",nullable=false) private Integer no; @ManyToOne + @JoinColumn(nullable = false) private GameConfig game; public Long getId() { Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java 2009-04-10 21:44:32 UTC (rev 96) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java 2009-04-14 19:57:10 UTC (rev 97) @@ -1,9 +1,13 @@ package edu.asu.commons.mme.entity; +import java.util.Set; + +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; -import javax.persistence.ManyToOne; +import javax.persistence.JoinColumn; +import javax.persistence.ManyToMany; import javax.persistence.Table; @Entity @@ -14,12 +18,21 @@ @GeneratedValue private Long id; - @ManyToOne - private RoundConfig roundconfig; + @ManyToMany(mappedBy = "locationconfig") + @JoinColumn(nullable =false) + private Set<RoundConfig> roundconfig; + + @Column(nullable =false,name="location_name") private String locationName; + + @Column(nullable =false,name="max_capacity") private Integer maxCapacity; + + @Column(nullable =false,name="growth_Rate", scale=2) private Float growthRate; + + @Column(nullable =false,name="start_population") private Integer startPopulation; public void setId(Long id) { @@ -53,10 +66,10 @@ public Integer getStart_population() { return startPopulation; } - public void setRoundconfig(RoundConfig roundconfig) { + public void setRoundconfig(Set<RoundConfig> roundconfig) { this.roundconfig = roundconfig; } - public RoundConfig getRoundconfig() { + public Set<RoundConfig> getRoundconfig() { return roundconfig; } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-10 21:44:32 UTC (rev 96) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-14 19:57:10 UTC (rev 97) @@ -9,19 +9,18 @@ import javax.persistence.Table; import org.hibernate.annotations.CollectionOfElements; -import org.hibernate.annotations.IndexColumn; @Entity @Table(name="psychometric") public class Psychometric extends Question { + @Column(nullable=false) private String scale; - @Column(name="no_of_intervals") + @Column(name="no_of_intervals",nullable=false) private String intervals; @CollectionOfElements - @IndexColumn(name = "choices", base=1) private List<String> choices; public void setChoices(List<String> choices) { @@ -48,11 +47,4 @@ return scale; } - /*public void setId(Long id) { - this.id = id; - } - - public Long getId() { - return id; - }*/ } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-10 21:44:32 UTC (rev 96) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-14 19:57:10 UTC (rev 97) @@ -1,6 +1,8 @@ package edu.asu.commons.mme.entity; +import java.util.Set; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; @@ -10,6 +12,7 @@ import javax.persistence.JoinColumn; import javax.persistence.Lob; import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; import javax.persistence.Table; @Entity @@ -21,25 +24,26 @@ private Long id; @ManyToOne - @JoinColumn(name="question_group_id", insertable=false, updatable=false) + @JoinColumn(name="question_group_id",nullable=false) private QuestionGroup questionGroup; @Lob + @Column(nullable=false) private String question; - @Column (name="single_location" ) + @Column (name="single_location",nullable=false,columnDefinition="Boolean") private boolean singleLocation; - @Column (name="multi_location" ) + @Column (name="multi_location",nullable=false,columnDefinition="Boolean") private boolean multiLocation; - @Column (name="misc_location" ) + @Column (name="misc_location",nullable=false,columnDefinition="Boolean") private boolean miscLocation; - @Column(name = "sequence_no") + @Column(name = "sequence_no",nullable=false) private Integer sequenceNo; - + public void setId(Long id) { this.id = id; } @@ -96,6 +100,7 @@ public QuestionGroup getQuestionGroup() { return questionGroup; } - + + } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-10 21:44:32 UTC (rev 96) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-14 19:57:10 UTC (rev 97) @@ -7,6 +7,8 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; import javax.persistence.ManyToMany; import javax.persistence.Table; @@ -17,12 +19,16 @@ @GeneratedValue private Long id; - @ManyToMany(mappedBy = "questionGroup") - private Set<RoundConfig> roundConfig; + + @ManyToMany(mappedBy = "questiongroup") + @JoinColumn(nullable=false) + private Set<RoundConfig>roundconfig; - @Column(name = "sequence_no") + @Column(name = "sequence_no",nullable=false) private Integer sequenceNo; + @Lob + private String header_question; public void setId(Long id) { this.id = id; @@ -43,5 +49,11 @@ public Set<RoundConfig> getRoundConfig() { return roundConfig; } + public void setHeader_question(String header_question) { + this.header_question = header_question; + } + public String getHeader_question() { + return header_question; + } } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-10 21:44:32 UTC (rev 96) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-14 19:57:10 UTC (rev 97) @@ -4,7 +4,12 @@ import java.util.Set; import javax.persistence.CascadeType; + import javax.persistence.Column; +import javax.persistence.JoinColumn; + +import javax.persistence.Column; + import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; @@ -20,18 +25,25 @@ @GeneratedValue(strategy = GenerationType.AUTO) private Long id; - @Column(name="round_no") + @Column(name="round_no",nullable=false) private Integer roundNo; + @ManyToOne + @JoinColumn(nullable=false) private GameConfig game; - @Column(name="communication_flag") - private Boolean communicationFlag; + + @Column(name="communication_flag",nullable=false,columnDefinition= "Boolean") + private boolean communicationFlag; + @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) private Set<QuestionGroup> questionGroup; + @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) + private Set<LocationConfig> locationconfig; + public void setId(Long id) { this.id = id; } @@ -63,6 +75,12 @@ public Set<QuestionGroup> getQuestionGroup() { return questionGroup; } + public void setLocationconfig(Set<LocationConfig> locationconfig) { + this.locationconfig = locationconfig; + } + public Set<LocationConfig> getLocationconfig() { + return locationconfig; + } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-10 21:44:32 UTC (rev 96) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-14 19:57:10 UTC (rev 97) @@ -6,6 +6,7 @@ import javax.persistence.Enumerated; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @@ -20,9 +21,10 @@ private Long id; @ManyToOne + @JoinColumn(nullable=false) private Group group; - @Column(name="student_no") + @Column(name="student_no",nullable = false) private Integer studentNo; @Column(name="year_birth",length = 4) Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentResponse.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentResponse.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentResponse.java 2009-04-14 19:57:10 UTC (rev 97) @@ -0,0 +1,63 @@ +package edu.asu.commons.mme.entity; + + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name="student_response") +public class StudentResponse { + + @Id + @GeneratedValue + private Long id; + + @ManyToOne + @JoinColumn(nullable=false, name="student_id") + private Student student; + + @ManyToOne + @JoinColumn(nullable=false) + private Question question; + + @Lob + private String response; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setStudent(Student student) { + this.student = student; + } + + public Student getStudent() { + return student; + } + + public void setQuestion(Question question) { + this.question = question; + } + + public Question getQuestion() { + return question; + } + + public void setResponse(String response) { + this.response = response; + } + + public String getResponse() { + return response; + } + +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java 2009-04-10 21:44:32 UTC (rev 96) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java 2009-04-14 19:57:10 UTC (rev 97) @@ -4,6 +4,7 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @@ -20,15 +21,17 @@ private Long id; @ManyToOne + @JoinColumn(nullable = false) private Student student; @ManyToOne + @JoinColumn(nullable = false) private RoundConfig roundconfig; - @Column(name="current_allocation_no") + @Column(name="current_allocation_no", nullable=false) private Integer currentAllocationNo; - @Column(name="current_day_no") + @Column(name="current_day_no",nullable=false) private Integer currentDayNo; public void setId(Long id) { Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java 2009-04-10 21:44:32 UTC (rev 96) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java 2009-04-14 19:57:10 UTC (rev 97) @@ -7,6 +7,7 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; import javax.persistence.Table; @@ -24,23 +25,28 @@ @ManyToOne + @JoinColumn(nullable=false) private RoundConfig roundconfig; - @Column(name = "allocation_sequence_no") + @Column(name = "allocation_sequence_no",nullable=false) private Integer allocationSeqNo; + @Column(nullable=false) private Integer days; + @Column(nullable=false) private Float threshold; @ManyToOne + @JoinColumn(nullable=false) private LocationConfig location; - @Column (name="repeated_decisions") + @Column (name="repeated_decisions",columnDefinition="Boolean", nullable=false) private boolean repeatedDecisions; @OneToMany + @JoinColumn(nullable=false) private List<DayOutput> dayOutput; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java 2009-04-10 21:44:32 UTC (rev 96) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java 2009-04-14 19:57:10 UTC (rev 97) @@ -5,6 +5,7 @@ import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; +import javax.persistence.JoinColumn; import javax.persistence.ManyToOne; import javax.persistence.Table; @@ -18,15 +19,17 @@ @ManyToOne + @JoinColumn(nullable=false) private RoundConfig roundconfig; @ManyToOne + @JoinColumn(nullable=false) private Student student; - @Column(name="harbor_days") + @Column(name="harbor_days",nullable=false) private Integer harborDays; - @Column(name="fishing_threshold") + @Column(name="fishing_threshold",nullable=false) private Float fishingThreshold; public void setId(Long id) { Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-10 21:44:32 UTC (rev 96) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-14 19:57:10 UTC (rev 97) @@ -21,12 +21,15 @@ <mapping class='edu.asu.commons.mme.entity.QuestionGroup'/> <mapping class='edu.asu.commons.mme.entity.Question'/> - <mapping class='edu.asu.commons.mme.entity.Psychometric'/> + + <mapping class='edu.asu.commons.mme.entity.Categorical'/> + <mapping class='edu.asu.commons.mme.entity.Psychometric'/> + <mapping class='edu.asu.commons.mme.entity.StudentResponse'/> + - This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <kj...@us...> - 2009-04-10 21:44:41
|
Revision: 96 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=96&view=rev Author: kjonas Date: 2009-04-10 21:44:32 +0000 (Fri, 10 Apr 2009) Log Message: ----------- DataGridHandler actionscript integration complete DataGrids seem to be functioning adequately Modified Paths: -------------- mentalmodels/trunk/flex/src/TableTest.mxml mentalmodels/trunk/flex/src/actionscript/DataGridHandler.as mentalmodels/trunk/flex/src/customComponents/Forecast2.mxml Modified: mentalmodels/trunk/flex/src/TableTest.mxml =================================================================== --- mentalmodels/trunk/flex/src/TableTest.mxml 2009-04-10 20:28:29 UTC (rev 95) +++ mentalmodels/trunk/flex/src/TableTest.mxml 2009-04-10 21:44:32 UTC (rev 96) @@ -3,9 +3,8 @@ <mx:VBox> <mx:HBox id="cast"> - <comp:Forecast id="legacy" numColumns="10"/> + <!--<comp:Forecast id="legacy" numColumns="10"/>--> <comp:Forecast1 id="forecastPeople" numColumns="15" minValue="0" maxValue="30" initialize="init()"/> - <!--<comp:Forecast2 id="forecastFull" numColumns="6" oldForecast1="{this.forecastPeople}"/>--> </mx:HBox> <mx:Label initialize="init()"/> <mx:Button id="next" label="Next" click="testNext()"/> @@ -19,10 +18,7 @@ public function init():void { - var X:String="X"; - forecastPeople.setItem(0,0,X); - forecastPeople.setItem(1,1,X); - forecastPeople.setItem(2,2,X); + for(var x:Number=0;x<4;x++)for(var y:Number=0;y<15;y++)forecastPeople.setItem(x,y,7.5); } public function testNext(evt:Event=null):void Modified: mentalmodels/trunk/flex/src/actionscript/DataGridHandler.as =================================================================== --- mentalmodels/trunk/flex/src/actionscript/DataGridHandler.as 2009-04-10 20:28:29 UTC (rev 95) +++ mentalmodels/trunk/flex/src/actionscript/DataGridHandler.as 2009-04-10 21:44:32 UTC (rev 96) @@ -11,6 +11,7 @@ [Bindable] public class DataGridHandler { + public var enabled:Boolean = true; private var _myDataGrid:DataGrid; private var _myProvider:ArrayCollection; @@ -111,7 +112,7 @@ temp.headerText = ""+(i+1); temp.dataField = "day"+(i+1); - temp.editable = true; + temp.editable = enabled; temp.draggable = false; temp.sortable = false; temp.resizable = false; @@ -131,7 +132,7 @@ grid.dataProvider = dataProvider; grid.height = (23)*(_numFields+1)+2; - grid.editable = true; + grid.editable = enabled; debug += ""; } Modified: mentalmodels/trunk/flex/src/customComponents/Forecast2.mxml =================================================================== --- mentalmodels/trunk/flex/src/customComponents/Forecast2.mxml 2009-04-10 20:28:29 UTC (rev 95) +++ mentalmodels/trunk/flex/src/customComponents/Forecast2.mxml 2009-04-10 21:44:32 UTC (rev 96) @@ -28,10 +28,10 @@ </mx:HBox> <mx:HBox id="dgRow3"> - <mx:DataGrid id="dgCalculated" headerHeight="1" + <!--<mx:DataGrid id="dgCalculated" headerHeight="1" editable="false" textAlign="right" dataProvider="{calculated}" width="300" horizontalScrollPolicy="off" - verticalScrollPolicy="off"/> + verticalScrollPolicy="off"/>--> </mx:HBox> </mx:VBox> </mx:HBox> @@ -41,6 +41,7 @@ <mx:Script> <![CDATA[ + import actionscript.DataGridHandler; import mx.controls.Button; import mx.utils.StringUtil; import mx.controls.dataGridClasses.DataGridColumn; @@ -56,6 +57,8 @@ [Bindable] public var oldForecast1:Forecast1 = null; + private var dgCalculated:DataGridHandler = new DataGridHandler(numFields+3,numColumns); + private var errorMessage:String = null; private var colIndex:Number=0; private var finished:Boolean = false; @@ -68,6 +71,9 @@ setItem(0,0,5); setItem(1,0,10); setItem(2,0,15); + + dgCalculated.enabled = false; + dgRow3.addChild(dgCalculated.grid); } private function createColumns():void { @@ -111,15 +117,11 @@ { if(oldForecast1 == null) { - setItem(0,1,1); dgRow2.addChild(newForecast1.dgh.grid); - setItem(1,1,2); } else { - setItem(0,2,3); dgRow2.addChild(oldForecast1.clone()); - setItem(1,2,4); } } @@ -134,6 +136,8 @@ public function changed():void { + calculateValues(); + markNoError(); var error:Boolean = false; @@ -173,6 +177,7 @@ { lbl.text = "Complete."; } + } private function invalidNum(n:Object):Boolean { @@ -205,6 +210,57 @@ dgMain.selectedIndex = -1; } + public function calculateValues():void + { + for(var col:Number=0; col < numColumns; col++) + { + var t_location:Number = 0; // get thru Planner, -1=harbor + + var t_capacity:Array = [10, 20, 30]; + var t_population:Array = new Array(3); + var t_people:Array = new Array(3); + + var t_fish_mined:Number = 0; + var t_fish_mined_total:Number = 0; + + //lbs in bay 1...N + for(var x:Number = 0; x < numFields; x++) + { + t_population[x] = getItem(x, col); //update fishies + t_people[x] = oldForecast1.getItem(x+1,col); //update fishers + if(x == t_location) + { + t_people[x]++; //add this player + } + + var t_fish_each:Number = 5*t_population[x]/t_capacity[x]; + var t_fish_mined_this:Number = t_people[x] * t_fish_each; + if(t_fish_mined_this > t_population[x]) + { + t_fish_each = t_population[x] / t_people[x]; + } + + if(x == t_location) + { + t_fish_mined = t_fish_each; + } + + dgCalculated.setItem(3+x,col,t_population[x]); + } + + //location + dgCalculated.setItem(0,col,t_location); + + //you get + dgCalculated.setItem(1,col, 5* t_fish_mined); // in USD$ + + //others get + dgCalculated.setItem(2,col, 5* (t_fish_mined_total - t_fish_mined)); + + + } + } + ]]> </mx:Script> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-10 20:28:41
|
Revision: 95 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=95&view=rev Author: alllee Date: 2009-04-10 20:28:29 +0000 (Fri, 10 Apr 2009) Log Message: ----------- Fixed a speling error in hibernate.cfg.xml (categorial => categorical) and providing example version of StudentService / HibernateStudentDao for Seema. Modified Paths: -------------- mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml Added Paths: ----------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateStudentDao.java 2009-04-10 20:28:29 UTC (rev 95) @@ -0,0 +1,20 @@ +package edu.asu.commons.mme.dao; + +import edu.asu.commons.mme.entity.Student; + +/** + * $Id$ + * + * Provides hibernate DAO functionality for persistent Student entities. + * + * + * @author <a href='mailto:All...@as...'>Allen Lee</a> + * @version $Rev$ + */ +public class HibernateStudentDao extends HibernateDao<Student> { + + public HibernateStudentDao() { + super(Student.class); + } + +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/StudentService.java 2009-04-10 20:28:29 UTC (rev 95) @@ -0,0 +1,16 @@ +package edu.asu.commons.mme.service; + +import edu.asu.commons.mme.dao.HibernateStudentDao; +import edu.asu.commons.mme.entity.Student; + +/** + * + * $Id$ + * + * + * @author <a href='mailto:All...@as...'>Allen Lee</a> + * @version $Rev$ + */ +public class StudentService extends Service.Base<Student, HibernateStudentDao> { + +} Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-10 20:16:27 UTC (rev 94) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/applicationContext.xml 2009-04-10 20:28:29 UTC (rev 95) @@ -26,35 +26,35 @@ <flex:secured /> </flex:message-broker> -<!-- Implementation of StudentImpl --> +/<!-- XXX: Split these out into separate XML files and import them if this file gets too large --> +<!-- spring managed daos --> +<bean id='studentDao' class='edu.asu.commons.mme.dao.HibernateStudentDao'> + <property name='sessionFactory' ref='sessionFactory'/> +</bean> -<bean id="studentservice" class="student.StudentDAO"> - <constructor-arg ref="mySessionFactory" /> +<!-- spring managed service layer --> +<bean id='studentService' class='edu.asu.commons.mme.service.StudentService'> + <property name='dao' ref='studentDao'/> </bean> -<!-- Expose the productDAO bean for BlazeDS remoting --> -<flex:remote-service ref="studentservice" /> +<!-- Expose services for BlazeDS remoting --> +<flex:remote-service ref="studentService" /> <!-- Flex related information ended--> - - <bean id="mmeDataSource" class="org.apache.commons.dbcp.BasicDataSource" destroy-method="close"> - <property name="driverClassName" value="com.mysql.jdbc.Driver"/> - <property name="url" value="jdbc:mysql://localhost/mme"/> - <property name="username" value="mme"/> - <property name="password" value=""/> + <property name="driverClassName" value="${hibernate.connection.driver_class}"/> + <property name="url" value="${hibernate.connection.url}"/> + <property name="username" value="${hibernate.connection.user}"/> + <property name="password" value="${hibernate.connection.password}"/> </bean> - - <bean id="propertyConfigurer" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> <property name="location" value="/WEB-INF/hibernate.properties"/> <property name="beanName" value="mmeDataSource"/> </bean> - <bean id="sessionFactory" class="org.springframework.orm.hibernate3.LocalSessionFactoryBean"> <property name="configLocation" value="/WEB-INF/hibernate.cfg.xml"/> <property name="configurationClass" value="org.hibernate.cfg.AnnotationConfiguration"/> @@ -71,7 +71,7 @@ <bean id="transactionManager" class="org.springframework.orm.hibernate3.HibernateTransactionManager"> <property name="sessionFactory" ref="sessionFactory"/> </bean> - <!-- XXX: don't need proxy-target-class if services are interfaces instead..? --> + <!-- XXX: don't need proxy-target-class if services are interfaces instead --> <tx:annotation-driven proxy-target-class='true'/> </beans> Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-10 20:16:27 UTC (rev 94) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-10 20:28:29 UTC (rev 95) @@ -22,7 +22,7 @@ <mapping class='edu.asu.commons.mme.entity.QuestionGroup'/> <mapping class='edu.asu.commons.mme.entity.Question'/> <mapping class='edu.asu.commons.mme.entity.Psychometric'/> - <mapping class='edu.asu.commons.mme.entity.Categorial'/> + <mapping class='edu.asu.commons.mme.entity.Categorical'/> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-10 20:16:31
|
Revision: 94 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=94&view=rev Author: alllee Date: 2009-04-10 20:16:27 +0000 (Fri, 10 Apr 2009) Log Message: ----------- adding base classes for DAO and services. Will wire up an example for Student next. Modified Paths: -------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java Added Paths: ----------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/Dao.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateDao.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/JdbcDao.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Service.java Removed Paths: ------------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorial.java Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/Dao.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/Dao.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/Dao.java 2009-04-10 20:16:27 UTC (rev 94) @@ -0,0 +1,39 @@ +package edu.asu.commons.mme.dao; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + + +/** + * $Id: Dao.java 236 2009-03-18 23:42:53Z alllee $ + * + * TDAR interface used to mark Data Access Objects. Provides two base classes for + * hibernate and jdbc support to remove much of the basic boilerplate code necessary to + * create a hibernate DAO over some persistent bean or make JDBC queries, respectively. + * + * @author <a href='mailto:All...@as...'>Allen Lee</a> + * @version $Revision: 236 $ + * @param <T> the persistent Entity to which this DAO is providing access + * (FIXME: should type parameter extend Persistable or be more relaxed?) + */ +public interface Dao<T> { + + public T find(Number id); + + public List<T> findAll(); + + public List<T> findAllSorted(); + + public Number count(); + + public void save(Object o); + + public void merge(Object o); + + public void delete(Object o); + + public void delete(Collection<?> persistentCollection); + + public List<T> findByEqCriteria(Map<String, ?> criteria); +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateDao.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateDao.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/HibernateDao.java 2009-04-10 20:16:27 UTC (rev 94) @@ -0,0 +1,212 @@ +package edu.asu.commons.mme.dao; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; +import org.hibernate.Criteria; +import org.hibernate.Session; +import org.hibernate.SessionFactory; +import org.hibernate.criterion.DetachedCriteria; +import org.hibernate.criterion.Example; +import org.hibernate.criterion.MatchMode; +import org.hibernate.criterion.Order; +import org.hibernate.criterion.Projections; +import org.hibernate.criterion.Restrictions; + +/** + * Subclasses receive boilerplate save/delete/find functionality for free. You + * must pass the class being persisted into the constructor, which is redundant + * with the generic type information also passed in at compile-time, but this + * appears to be the best that Java generics can give us at this point. + */ +public abstract class HibernateDao<E> implements Dao<E> { + + protected final Logger logger = Logger.getLogger(getClass()); + protected final Class<E> persistentClass; + protected final ThreadLocal<String> orderingProperty = new ThreadLocal<String>() { + protected String initialValue() { + return getDefaultOrderingProperty(); + } + }; + private SessionFactory sessionFactory; + + // private EntityManager entityManager; + + /** + * Subclasses must super to this constructor with the persistent entity + * class under the DAO. + * + * @param persistentClass + * the class to which this DAO provides persistent access. + */ + public HibernateDao(Class<E> persistentClass) { + this.persistentClass = persistentClass; + } + + // @PersistenceContext + // public void setEntityManager(EntityManager entityManager) { + // this.entityManager = entityManager; + // } + + // protected EntityManager getEntityManager() { + // return entityManager; + // } + + public void setSessionFactory(SessionFactory sessionFactory) { + this.sessionFactory = sessionFactory; + } + + protected SessionFactory getSessionFactory() { + return sessionFactory; + } + + public void save(Object persistentBean) { + Session session = getCurrentSession(); + session.saveOrUpdate(persistentBean); + session.flush(); + } + + public void merge(Object persistentBean) { + Session session = getCurrentSession(); + session.merge(persistentBean); + session.flush(); + } + + public void delete(Object persistentBean) { + Session session = getCurrentSession(); + session.delete(persistentBean); + session.flush(); + } + + public void delete(Collection<?> persistentBeans) { + Session session = getCurrentSession(); + for (Object o : persistentBeans) { + session.delete(o); + } + persistentBeans.clear(); + session.flush(); + } + + public List<E> findByEqCriteria(Map<String, ?> map) { + return findByCriteria(getDetachedCriteria() + .add(Restrictions.allEq(map))); + } + + @SuppressWarnings("unchecked") + public List<E> findByCriteria(DetachedCriteria criteria) { + Session session = getSessionFactory().getCurrentSession(); + return (List<E>) criteria.getExecutableCriteria(session).list(); + } + + public Number count() { + // FIXME: EntityManager route vs. Hibernate route + // return (Number) + // getEntityManager().createQuery("SELECT COUNT(entity) FROM " + + // persistentClass + " entity").getSingleResult(); + return (Number) getCriteria().setProjection(Projections.rowCount()) + .uniqueResult(); + } + + /* + * (non-Javadoc) + * + * @see org.tdar.core.dao.ProjectDao#find(java.lang.Long) + */ + public E find(Number id) { + return persistentClass.cast(getCurrentSession() + .get(persistentClass, id)); + // return entityManager.find(persistentClass, id); + } + + public E find(String id) { + throw new UnsupportedOperationException( + "FIXME: unimplemented, reliably convert String into arbitrary subtypes of Number."); + } + + /* + * (non-Javadoc) + * + * @see org.tdar.core.dao.ProjectDao#findAll() + */ + public List<E> findAll() { + return findByCriteria(getDetachedCriteria()); + } + + public List<E> findAllSorted() { + DetachedCriteria criteria = getOrderedDetachedCriteria(); + return findByCriteria(criteria); + } + + protected DetachedCriteria getOrderedDetachedCriteria() { + return getDetachedCriteria().addOrder(Order.asc(orderingProperty.get())); + } + + public final void setOrderingProperty(String orderingProperty) { + this.orderingProperty.set(orderingProperty); + } + + protected String getDefaultOrderingProperty() { + throw new UnsupportedOperationException( + "Did not @Override getDefaultOrderingProperty()"); + } + + protected DetachedCriteria getDetachedCriteria() { + return DetachedCriteria.forClass(persistentClass).setResultTransformer( + Criteria.DISTINCT_ROOT_ENTITY); + } + + protected Criteria getCriteria() { + return getCurrentSession().createCriteria(persistentClass) + .setResultTransformer(Criteria.DISTINCT_ROOT_ENTITY); + } + + protected Class<E> getPersistentClass() { + return persistentClass; + } + + protected Logger getLogger() { + return logger; + } + + protected Session getCurrentSession() { + return getSessionFactory().getCurrentSession(); + } + + public E findByProperty(String propertyName, Object propertyValue) { + return persistentClass.cast(getCriteria().add( + Restrictions.eq(propertyName, propertyValue)).uniqueResult()); + } + + @SuppressWarnings("unchecked") + public List<E> findAllByProperty(String propertyName, Object propertyValue) { + return getCriteria().add(Restrictions.eq(propertyName, propertyValue)) + .list(); + } + + protected String addWildCards(String value) { + if (value.charAt(0) == '%' || value.charAt(value.length() - 1) == '%') { + // no-op if any wildcards are already present. + return value; + } + return String.format("%%%s%%", value); + } + + public List<E> findByExample(E entity) { + Example example = Example.create(entity); + return findByExample(example); + } + + public List<E> findByExampleLike(E entity, MatchMode matchMode) { + Example example = Example.create(entity); + example.enableLike(matchMode); + return findByExample(example); + } + + @SuppressWarnings("unchecked") + public List<E> findByExample(Example example) { + Criteria criteria = getCriteria().add(example); + return (List<E>) criteria.list(); + } +} \ No newline at end of file Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/JdbcDao.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/JdbcDao.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/dao/JdbcDao.java 2009-04-10 20:16:27 UTC (rev 94) @@ -0,0 +1,75 @@ +/** + * + */ +package edu.asu.commons.mme.dao; + +import java.sql.Connection; +import java.sql.PreparedStatement; +import java.sql.ResultSet; +import java.sql.SQLException; + +import org.apache.log4j.Logger; +import org.springframework.jdbc.core.PreparedStatementCreator; +import org.springframework.jdbc.core.ResultSetExtractor; +import org.springframework.jdbc.core.support.JdbcDaoSupport; + +public abstract class JdbcDao<E> extends JdbcDaoSupport +implements Dao<E> { + + protected final Logger logger = Logger.getLogger(getClass()); + + private final Class<E> persistentClass; + + public JdbcDao(Class<E> persistentClass) { + this.persistentClass = persistentClass; + } + public E find(final Number id) { + return persistentClass.cast( + getJdbcTemplate().query(new PreparedStatementCreator() { + public PreparedStatement createPreparedStatement( + Connection connection) throws SQLException { + PreparedStatement statement = connection + .prepareStatement(getFindSql()); + if (id instanceof Long) { + statement.setLong(1, (Long) id); + } + else if (id instanceof Integer) { + statement.setInt(1, (Integer) id); + } + else if (id instanceof Byte) { + statement.setByte(1, (Byte) id); + } + else if (id instanceof Short) { + statement.setShort(1, (Short) id); + } + return statement; + } + }, + new ResultSetExtractor() { + public Object extractData(ResultSet set) throws SQLException { + if (!set.next()) { + // got an empty result set. + logger + .warn("Received empty result set from ResultSetExtractor."); + return null; + } + return createObject(set); + } + })); + } + + /** + * Template method to provide the SQL used to retrieve the data needed + * to populate the persistent bean. + * + * @return + */ + protected abstract String getFindSql(); + + /** + * Template method implement by subclasses to populate the bean given a JDBC ResultSet; + * @param set + * @return + */ + protected abstract E createObject(ResultSet set); +} \ No newline at end of file Deleted: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorial.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorial.java 2009-04-09 01:27:37 UTC (rev 93) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorial.java 2009-04-10 20:16:27 UTC (rev 94) @@ -1,34 +0,0 @@ -package edu.asu.commons.mme.entity; - - -import java.util.List; - -import javax.persistence.Entity; - -import javax.persistence.Table; - -import org.hibernate.annotations.CollectionOfElements; -import org.hibernate.annotations.IndexColumn; - - -@Entity -@Table(name="categorial") -public class Categorial extends Question { - - - - @CollectionOfElements - @IndexColumn(name = "choices", base=1) - private List<String> choices; - - public void setChoices(List<String> choices) { - this.choices = choices; - } - - public List<String> getChoices() { - return choices; - } - - - -} Copied: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java (from rev 93, mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorial.java) =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorical.java 2009-04-10 20:16:27 UTC (rev 94) @@ -0,0 +1,32 @@ +package edu.asu.commons.mme.entity; + + +import java.util.List; + +import javax.persistence.Entity; +import javax.persistence.Table; + +import org.hibernate.annotations.CollectionOfElements; +import org.hibernate.annotations.IndexColumn; + + +@Entity +@Table(name="categorical") +public class Categorical extends Question { + + + @CollectionOfElements + @IndexColumn(name = "choices", base=1) + private List<String> choices; + + public void setChoices(List<String> choices) { + this.choices = choices; + } + + public List<String> getChoices() { + return choices; + } + + + +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-09 01:27:37 UTC (rev 93) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-10 20:16:27 UTC (rev 94) @@ -1,14 +1,15 @@ package edu.asu.commons.mme.entity; import java.util.Date; + import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Lob; import javax.persistence.ManyToOne; +import javax.persistence.Table; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import javax.persistence.Table; @Entity Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java 2009-04-09 01:27:37 UTC (rev 93) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java 2009-04-10 20:16:27 UTC (rev 94) @@ -1,7 +1,6 @@ package edu.asu.commons.mme.entity; -import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; @@ -16,7 +15,6 @@ @GeneratedValue private Long id; - @ManyToOne private StudentStrategy strategy; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-09 01:27:37 UTC (rev 93) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-10 20:16:27 UTC (rev 94) @@ -1,17 +1,18 @@ package edu.asu.commons.mme.entity; import java.util.ArrayList; +import java.util.Date; import java.util.List; + +import javax.persistence.Column; import javax.persistence.Entity; +import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.Lob; import javax.persistence.OneToMany; import javax.persistence.Table; -import javax.persistence.Column; -import javax.persistence.GeneratedValue; import javax.persistence.Temporal; import javax.persistence.TemporalType; -import java.util.Date; @Entity Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java 2009-04-09 01:27:37 UTC (rev 93) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java 2009-04-10 20:16:27 UTC (rev 94) @@ -1,5 +1,5 @@ package edu.asu.commons.mme.entity; public enum Gender { -Female, Male +FEMALE, MALE } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-09 01:27:37 UTC (rev 93) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-10 20:16:27 UTC (rev 94) @@ -2,20 +2,10 @@ -import java.util.ArrayList; import java.util.List; -import javax.persistence.CascadeType; import javax.persistence.Column; -import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; -import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; -import javax.persistence.Id; -import javax.persistence.JoinColumn; -import javax.persistence.Lob; -import javax.persistence.ManyToOne; -import javax.persistence.OneToMany; import javax.persistence.Table; import org.hibernate.annotations.CollectionOfElements; @@ -23,10 +13,8 @@ @Entity @Table(name="psychometric") +public class Psychometric extends Question { - -public class Psychometric extends Question{ - private String scale; @Column(name="no_of_intervals") Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-09 01:27:37 UTC (rev 93) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-10 20:16:27 UTC (rev 94) @@ -2,12 +2,8 @@ import javax.persistence.Column; -import javax.persistence.DiscriminatorColumn; -import javax.persistence.DiscriminatorType; -import javax.persistence.DiscriminatorValue; import javax.persistence.Entity; import javax.persistence.GeneratedValue; -import javax.persistence.GenerationType; import javax.persistence.Id; import javax.persistence.Inheritance; import javax.persistence.InheritanceType; @@ -19,8 +15,6 @@ @Entity @Table(name="question") @Inheritance(strategy = InheritanceType.JOINED) - - public class Question { @Id @GeneratedValue Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-09 01:27:37 UTC (rev 93) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-10 20:16:27 UTC (rev 94) @@ -17,8 +17,8 @@ @GeneratedValue private Long id; - @ManyToMany(mappedBy = "questiongroup") - private Set<RoundConfig>roundconfig; + @ManyToMany(mappedBy = "questionGroup") + private Set<RoundConfig> roundConfig; @Column(name = "sequence_no") private Integer sequenceNo; @@ -37,11 +37,11 @@ public Integer getSequenceNo() { return sequenceNo; } - public void setRoundconfig(Set<RoundConfig> roundconfig) { - this.roundconfig = roundconfig; + public void setRoundConfig(Set<RoundConfig> roundconfig) { + this.roundConfig = roundconfig; } - public Set<RoundConfig> getRoundconfig() { - return roundconfig; + public Set<RoundConfig> getRoundConfig() { + return roundConfig; } } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-09 01:27:37 UTC (rev 93) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-10 20:16:27 UTC (rev 94) @@ -4,6 +4,7 @@ import java.util.Set; import javax.persistence.CascadeType; +import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.GenerationType; @@ -19,15 +20,17 @@ @GeneratedValue(strategy = GenerationType.AUTO) private Long id; - private Integer round_no; + @Column(name="round_no") + private Integer roundNo; @ManyToOne private GameConfig game; - private Boolean communication_flag; + @Column(name="communication_flag") + private Boolean communicationFlag; @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) - private Set<QuestionGroup> questiongroup; + private Set<QuestionGroup> questionGroup; public void setId(Long id) { this.id = id; @@ -35,18 +38,18 @@ public Long getId() { return id; } - public void setRound_no(Integer round_no) { - this.round_no = round_no; + public void setRoundNo(Integer round_no) { + this.roundNo = round_no; } - public Integer getRound_no() { - return round_no; + public Integer getRoundNo() { + return roundNo; } - public void setCommunication_flag(Boolean communication_flag) { - this.communication_flag = communication_flag; + public void setCommunicationFlag(Boolean communication_flag) { + this.communicationFlag = communication_flag; } - public Boolean getCommunication_flag() { - return communication_flag; + public Boolean getCommunicationFlag() { + return communicationFlag; } public void setGame(GameConfig game) { this.game = game; @@ -54,11 +57,11 @@ public GameConfig getGame() { return game; } - public void setQuestiongroup(Set<QuestionGroup> questiongroup) { - this.questiongroup = questiongroup; + public void setQuestionGroup(Set<QuestionGroup> questiongroup) { + this.questionGroup = questiongroup; } - public Set<QuestionGroup> getQuestiongroup() { - return questiongroup; + public Set<QuestionGroup> getQuestionGroup() { + return questionGroup; } Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-09 01:27:37 UTC (rev 93) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-10 20:16:27 UTC (rev 94) @@ -30,7 +30,7 @@ private String major; - private String enthnicity; + private String ethnicity; @Enumerated(EnumType.STRING) private Gender gender; @@ -75,12 +75,12 @@ return major; } - public void setEnthnicity(String enthnicity) { - this.enthnicity = enthnicity; + public void setEthnicity(String enthnicity) { + this.ethnicity = enthnicity; } - public String getEnthnicity() { - return enthnicity; + public String getEthnicity() { + return ethnicity; } public void setGender(Gender gender) { Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java 2009-04-09 01:27:37 UTC (rev 93) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java 2009-04-10 20:16:27 UTC (rev 94) @@ -2,13 +2,13 @@ import java.util.List; + import javax.persistence.Column; import javax.persistence.Entity; import javax.persistence.GeneratedValue; import javax.persistence.Id; import javax.persistence.ManyToOne; import javax.persistence.OneToMany; - import javax.persistence.Table; Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Service.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Service.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Service.java 2009-04-10 20:16:27 UTC (rev 94) @@ -0,0 +1,109 @@ +package edu.asu.commons.mme.service; + +import java.util.Collection; +import java.util.List; +import java.util.Map; + +import org.apache.log4j.Logger; + +import edu.asu.commons.mme.dao.Dao; + +/** + * $Id: Service.java 186 2009-02-06 20:22:36Z alllee $ + * + * This interface provides utility base classes, Service.Base, and + * Service.TypedDaoBase that eases most of the boilerplate implementation for + * delegating various Service methods to a DAO. Use the TypedDaoBase when you + * want to use specific DAO methods on a custom DAO type besides the ones + * specified on the Dao interface (e.g., if SomeCustomTypeDao has a method + * findAllCustomTypes() you should extend and parameterize Service.TypedDaoBase + * with SomeCustomTypeDao so that getDao() will return the SomeCustomTypeDao + * subtype. + * + * @author <a href='All...@as...'>Allen Lee</a> + * @version $Revision: 186 $ + * + * @param <T> + */ + +public interface Service<T, S extends Dao<T>> { + + public T find(Number id); + + public List<T> findAll(); + + public List<T> findAllSorted(); + + public void save(Object persistentBean); + + public void merge(Object persistentBean); + + public void delete(Object persistentBean); + + public void delete(Collection<?> persistentCollection); + + public S getDao(); + + public void setDao(S dao); + + public Number count(); + + public static abstract class Base<E, D extends Dao<E>> implements Service<E, D> { + private final Logger logger = Logger.getLogger(getClass()); + + private D dao; + + public E find(Number id) { + return dao.find(id); + } + + public List<E> findAll() { + return dao.findAll(); + } + + public List<E> findAllSorted() { + return dao.findAllSorted(); + } + public List<E> findByEqCriteria(Map<String, ?> propertyMap) { + return dao.findByEqCriteria(propertyMap); + } + + public void save(Object persistentBean) { + dao.save(persistentBean); + } + + public void merge(Object persistentBean) { + dao.merge(persistentBean); + } + + public void delete(Object persistentBean) { + dao.delete(persistentBean); + } + + public void delete(Collection<?> persistentCollection) { + if (persistentCollection == null || persistentCollection.isEmpty()) { + // no-op + logger.warn("Trying to delete a null or empty collection, performing no-op"); + return; + } + dao.delete(persistentCollection); + } + + public Number count() { + return dao.count(); + } + + public D getDao() { + return dao; + } + + public void setDao(D dao) { + this.dao = dao; + } + + protected Logger getLogger() { + return logger; + } + } + +} This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-04-09 01:27:48
|
Revision: 93 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=93&view=rev Author: seematalele Date: 2009-04-09 01:27:37 +0000 (Thu, 09 Apr 2009) Log Message: ----------- Created the POJO's. Schema can be created successfully using POJO. Modified Paths: -------------- mentalmodels/trunk/init-db.ant.xml mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml Added Paths: ----------- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorial.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java Removed Paths: ------------- mentalmodels/trunk/src/main/java/game/ Modified: mentalmodels/trunk/init-db.ant.xml =================================================================== --- mentalmodels/trunk/init-db.ant.xml 2009-04-07 02:18:30 UTC (rev 92) +++ mentalmodels/trunk/init-db.ant.xml 2009-04-09 01:27:37 UTC (rev 93) @@ -1,65 +1,65 @@ <?xml version="1.0"?> -<!-- -vim:sts=2:sw=2 -$Id: init-db.ant.xml 239 2009-03-20 17:49:19Z alllee $ -$Revision: 239 $ -Master build file for MME deployment. ---> -<project name="mme" default="help"> - <!-- where the applicationContext.xml and hibernate.cfg.xml are currently located, this may change --> - <property name='web.inf.dir' value='src/main/webapp/WEB-INF'/> - <property name='db.dir' value='src/main/db'/> - <property name='db.generated.dir' value='${db.dir}/generated'/> - <property name='hibernate.properties.file' value='${web.inf.dir}/hibernate.properties'/> - <!-- first load environment vars from hibernate directly--> - <property file="${hibernate.properties.file}"/> - - <!-- - define some sane default values for db connection if undefined in - build.properties - --> - <property name='db.name' value='mme'/> - - <property name='hibernate.connection.url' value='jdbc:mysql://localhost/${db.name}'/> - <property name='hibernate.connection.username' value='mme'/> - - <property name='hibernate.connection.password' value='mme.mme'/> - <property name='hibernate.connection.driver_class' value='com.mysql.jdbc.Driver'/> - <property name='hibernate.dialect' value='org.hibernate.dialect.MySQLInnoDBDialect'/> - - <!-- - this should always be available, connect to this if we need to create - the mmedev database - --> - - <echo message='compile classpath: ${compile.classpath}'/> - - <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpath="${compile.classpath}"/> - <target name="init-db" depends="create-db-schema"/> - <target name='create-db-schema'> - <mkdir dir='${db.generated.dir}'/> - <echo message="You must have valid database connection information within hibernate.properties for this task to succeed."/> - <hibernatetool destdir='${db.generated.dir}'> - <!-- annotated class/packages are specified in the hibernate.cfg.xml --> - - <annotationconfiguration propertyFile="${hibernate.properties.file}" configurationfile="${web.inf.dir}/hibernate.cfg.xml"/> - <hbm2ddl export="true" drop="true" outputfilename="mme.sql"/> - - </hibernatetool> - </target> - <target name='create-indexes'> - <sql onerror='continue' autocommit='true' driver="${hibernate.connection.driver_class}" url="${hibernate.connection.url}" userid="${hibernate.connection.username}" password="${hibernate.connection.password}" classpath="${compile.classpath}"> - <transaction src="${db.dir}/create-indexes.sql"/> - </sql> - </target> - <target name="initialize-data" depends="init-db"> - <sql driver="${hibernate.connection.driver_class}" - url="${hibernate.connection.url}" - userid="${hibernate.connection.username}" - password="${hibernate.connection.password}" - classpath="${compile.classpath}" - - src="${db.dir}/init-mme.sql"/> - - </target> -</project> + <!-- + vim:sts=2:sw=2 + $Id: init-db.ant.xml 239 2009-03-20 17:49:19Z alllee $ + $Revision: 239 $ + Master build file for MME deployment. + --> + <project name="mme" default="help"> + <!-- where the applicationContext.xml and hibernate.cfg.xml are currently located, this may change --> + <property name='web.inf.dir' value='src/main/webapp/WEB-INF'/> + <property name='db.dir' value='src/main/db'/> + <property name='db.generated.dir' value='${db.dir}/generated'/> + <property name='hibernate.properties.file' value='${web.inf.dir}/hibernate.properties'/> + <!-- first load environment vars from hibernate directly--> + <property file="${hibernate.properties.file}"/> + + <!-- + define some sane default values for db connection if undefined in + build.properties + --> + <property name='db.name' value='mme'/> + + <property name='hibernate.connection.url' value='jdbc:mysql://localhost/${db.name}'/> + <property name='hibernate.connection.username' value='mme'/> + + <property name='hibernate.connection.password' value='mme.mme'/> + <property name='hibernate.connection.driver_class' value='com.mysql.jdbc.Driver'/> + <property name='hibernate.dialect' value='org.hibernate.dialect.MySQLInnoDBDialect'/> + + <!-- + this should always be available, connect to this if we need to create + the mmedev database + --> + + <echo message='compile classpath: ${compile.classpath}'/> + + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpath="${compile.classpath}"/> + <target name="init-db" depends="create-db-schema"/> + <target name='create-db-schema'> + <mkdir dir='${db.generated.dir}'/> + <echo message="You must have valid database connection information within hibernate.properties for this task to succeed."/> + <hibernatetool destdir='${db.generated.dir}'> + <!-- annotated class/packages are specified in the hibernate.cfg.xml --> + + <annotationconfiguration propertyFile="${hibernate.properties.file}" configurationfile="${web.inf.dir}/hibernate.cfg.xml"/> + <hbm2ddl export="true" drop="true" outputfilename="mme.sql"/> + + </hibernatetool> + </target> + <target name='create-indexes'> + <sql onerror='continue' autocommit='true' driver="${hibernate.connection.driver_class}" url="${hibernate.connection.url}" userid="${hibernate.connection.username}" password="${hibernate.connection.password}" classpath="${compile.classpath}"> + <transaction src="${db.dir}/create-indexes.sql"/> + </sql> + </target> + <target name="initialize-data" depends="init-db"> + <sql driver="${hibernate.connection.driver_class}" + url="${hibernate.connection.url}" + userid="${hibernate.connection.username}" + password="${hibernate.connection.password}" + classpath="${compile.classpath}" + + src="${db.dir}/init-mme.sql"/> + + </target> + </project> Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorial.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorial.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Categorial.java 2009-04-09 01:27:37 UTC (rev 93) @@ -0,0 +1,34 @@ +package edu.asu.commons.mme.entity; + + +import java.util.List; + +import javax.persistence.Entity; + +import javax.persistence.Table; + +import org.hibernate.annotations.CollectionOfElements; +import org.hibernate.annotations.IndexColumn; + + +@Entity +@Table(name="categorial") +public class Categorial extends Question { + + + + @CollectionOfElements + @IndexColumn(name = "choices", base=1) + private List<String> choices; + + public void setChoices(List<String> choices) { + this.choices = choices; + } + + public List<String> getChoices() { + return choices; + } + + + +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Communication.java 2009-04-09 01:27:37 UTC (rev 93) @@ -0,0 +1,74 @@ +package edu.asu.commons.mme.entity; + +import java.util.Date; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import javax.persistence.Table; + + +@Entity +@Table(name="communication") +public class Communication { + + @Id + @GeneratedValue + private Long id; + + @Lob + private String message; + + @Temporal(TemporalType.TIMESTAMP) + private Date timestamp; + + @ManyToOne + private Student student; + + @ManyToOne + private RoundConfig roundconfig; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setMessage(String message) { + this.message = message; + } + + public String getMessage() { + return message; + } + + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + + public Date getTimestamp() { + return timestamp; + } + + public void setRoundconfig(RoundConfig roundconfig) { + this.roundconfig = roundconfig; + } + + public RoundConfig getRoundconfig() { + return roundconfig; + } + + public void setStudent(Student student) { + this.student = student; + } + + public Student getStudent() { + return student; + } + +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/DayOutput.java 2009-04-09 01:27:37 UTC (rev 93) @@ -0,0 +1,59 @@ +package edu.asu.commons.mme.entity; + + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name="student_day_output") +public class DayOutput { + + @Id + @GeneratedValue + private Long id; + + + @ManyToOne + private StudentStrategy strategy; + + private Integer day; + + private Float earnings; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setDay(Integer day) { + this.day = day; + } + + public Integer getDay() { + return day; + } + + public void setEarnings(Float earnings) { + this.earnings = earnings; + } + + public Float getEarnings() { + return earnings; + } + + public void setStrategy(StudentStrategy strategy) { + this.strategy = strategy; + } + + public StudentStrategy getStrategy() { + return strategy; + } + +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-09 01:27:37 UTC (rev 93) @@ -0,0 +1,114 @@ +package edu.asu.commons.mme.entity; + +import java.util.ArrayList; +import java.util.List; +import javax.persistence.Entity; +import javax.persistence.Id; +import javax.persistence.Lob; +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import java.util.Date; + + +@Entity +@Table(name="game") +public class GameConfig { + + @Id + @GeneratedValue + private Long id; + + private Integer noOfRounds; + private Integer noOfLocation; + private Integer maxDays; + private Integer maxFishHarvest; + + @Temporal(TemporalType.DATE) + private Date timestamp; + + private String title; + + @Lob + private String description; + + @Column(scale=2) + private Float money; + private String img_address; + + @OneToMany + private List<RoundConfig> roundconfig= new ArrayList<RoundConfig>(); + + + public void setId(Long id) { + this.id = id; + } + public Long getId() { + return id; + } + public void setNo_of_rounds(Integer no_of_rounds) { + this.noOfRounds = no_of_rounds; + } + public Integer getNo_of_rounds() { + return noOfRounds; + } + public void setNo_of_location(Integer no_of_location) { + this.noOfLocation = no_of_location; + } + public Integer getNo_of_location() { + return noOfLocation; + } + public void setMax_fish_harvest(Integer max_fish_harvest) { + this.maxFishHarvest = max_fish_harvest; + } + public Integer getMax_fish_harvest() { + return maxFishHarvest; + } + public void setMax_no_of_days(Integer max_no_of_days) { + this.maxDays = max_no_of_days; + } + public Integer getMax_no_of_days() { + return maxDays; + } + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + public Date getTimestamp() { + return timestamp; + } + public void setTitle(String title) { + this.title = title; + } + public String getTitle() { + return title; + } + public void setDescription(String description) { + this.description = description; + } + public String getDescription() { + return description; + } + public void setMoney(Float money) { + this.money = money; + } + public Float getMoney() { + return money; + } + public void setImg_address(String img_address) { + this.img_address = img_address; + } + public String getImg_address() { + return img_address; + } + public void setRoundconfig(List<RoundConfig> roundconfig) { + this.roundconfig = roundconfig; + } + public List<RoundConfig> getRoundconfig() { + return roundconfig; + } + +} + Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Gender.java 2009-04-09 01:27:37 UTC (rev 93) @@ -0,0 +1,5 @@ +package edu.asu.commons.mme.entity; + +public enum Gender { +Female, Male +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Group.java 2009-04-09 01:27:37 UTC (rev 93) @@ -0,0 +1,55 @@ +package edu.asu.commons.mme.entity; + + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + + +/** + * Entity implementation class for Entity: Group + * @param <Student> + * + */ +@Entity +@Table(name="grp") +public class Group { + + @Id + @GeneratedValue + private Long id; + + @Column(name="grp_no") + private Integer no; + + @ManyToOne + private GameConfig game; + + public Long getId() { + return this.id; + } + + public void setId(Long id) { + this.id = id; + } + public Integer getNo() { + return this.no; + } + + public void setNo(Integer no) { + this.no = no; + } + + + public void setGame(GameConfig game) { + this.game = game; + } + + public GameConfig getGame() { + return game; + } + +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/LocationConfig.java 2009-04-09 01:27:37 UTC (rev 93) @@ -0,0 +1,63 @@ +package edu.asu.commons.mme.entity; + +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name = "location_config") +public class LocationConfig { + + @Id + @GeneratedValue + private Long id; + + @ManyToOne + private RoundConfig roundconfig; + + private String locationName; + private Integer maxCapacity; + private Float growthRate; + private Integer startPopulation; + + public void setId(Long id) { + this.id = id; + } + public Long getId() { + return id; + } + + public void setLocation_name(String location_name) { + this.locationName = location_name; + } + public String getLocation_name() { + return locationName; + } + public void setMax_capacity(Integer max_capacity) { + this.maxCapacity = max_capacity; + } + public Integer getMax_capacity() { + return maxCapacity; + } + public void setGrowth_rate(Float growth_rate) { + this.growthRate = growth_rate; + } + public Float getGrowth_rate() { + return growthRate; + } + public void setStart_population(Integer start_population) { + this.startPopulation = start_population; + } + public Integer getStart_population() { + return startPopulation; + } + public void setRoundconfig(RoundConfig roundconfig) { + this.roundconfig = roundconfig; + } + public RoundConfig getRoundconfig() { + return roundconfig; + } + +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Psychometric.java 2009-04-09 01:27:37 UTC (rev 93) @@ -0,0 +1,70 @@ +package edu.asu.commons.mme.entity; + + + +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Column; +import javax.persistence.DiscriminatorValue; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +import org.hibernate.annotations.CollectionOfElements; +import org.hibernate.annotations.IndexColumn; + +@Entity +@Table(name="psychometric") + + +public class Psychometric extends Question{ + + private String scale; + + @Column(name="no_of_intervals") + private String intervals; + + @CollectionOfElements + @IndexColumn(name = "choices", base=1) + private List<String> choices; + + public void setChoices(List<String> choices) { + this.choices = choices; + } + + public List<String> getChoices() { + return choices; + } + + public void setIntervals(String intervals) { + this.intervals = intervals; + } + + public String getIntervals() { + return intervals; + } + + public void setScale(String scale) { + this.scale = scale; + } + + public String getScale() { + return scale; + } + + /*public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + }*/ +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Question.java 2009-04-09 01:27:37 UTC (rev 93) @@ -0,0 +1,107 @@ +package edu.asu.commons.mme.entity; + + +import javax.persistence.Column; +import javax.persistence.DiscriminatorColumn; +import javax.persistence.DiscriminatorType; +import javax.persistence.DiscriminatorValue; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.Inheritance; +import javax.persistence.InheritanceType; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name="question") +@Inheritance(strategy = InheritanceType.JOINED) + + +public class Question { + @Id + @GeneratedValue + private Long id; + + @ManyToOne + @JoinColumn(name="question_group_id", insertable=false, updatable=false) + private QuestionGroup questionGroup; + + @Lob + private String question; + + @Column (name="single_location" ) + private boolean singleLocation; + + @Column (name="multi_location" ) + private boolean multiLocation; + + @Column (name="misc_location" ) + private boolean miscLocation; + + @Column(name = "sequence_no") + private Integer sequenceNo; + + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + + public void setQuestion(String question) { + this.question = question; + } + + public String getQuestion() { + return question; + } + + public void setSingleLocation(boolean singleLocation) { + this.singleLocation = singleLocation; + } + + public boolean isSingleLocation() { + return singleLocation; + } + + public void setMultiLocation(boolean multiLocation) { + this.multiLocation = multiLocation; + } + + public boolean isMultiLocation() { + return multiLocation; + } + + public void setMiscLocation(boolean miscLocation) { + this.miscLocation = miscLocation; + } + + public boolean isMiscLocation() { + return miscLocation; + } + + public void setSequenceNo(Integer sequenceNo) { + this.sequenceNo = sequenceNo; + } + + public Integer getSequenceNo() { + return sequenceNo; + } + + public void setQuestionGroup(QuestionGroup questionGroup) { + this.questionGroup = questionGroup; + } + + public QuestionGroup getQuestionGroup() { + return questionGroup; + } + + +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/QuestionGroup.java 2009-04-09 01:27:37 UTC (rev 93) @@ -0,0 +1,47 @@ +package edu.asu.commons.mme.entity; + + +import java.util.Set; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.Table; + +@Entity +@Table(name="question_group") +public class QuestionGroup { + @Id + @GeneratedValue + private Long id; + + @ManyToMany(mappedBy = "questiongroup") + private Set<RoundConfig>roundconfig; + + @Column(name = "sequence_no") + private Integer sequenceNo; + + + public void setId(Long id) { + this.id = id; + } + public Long getId() { + return id; + } + + public void setSequenceNo(Integer sequenceNo) { + this.sequenceNo = sequenceNo; + } + public Integer getSequenceNo() { + return sequenceNo; + } + public void setRoundconfig(Set<RoundConfig> roundconfig) { + this.roundconfig = roundconfig; + } + public Set<RoundConfig> getRoundconfig() { + return roundconfig; + } + +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/RoundConfig.java 2009-04-09 01:27:37 UTC (rev 93) @@ -0,0 +1,66 @@ +package edu.asu.commons.mme.entity; + + +import java.util.Set; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name="round_config") +public class RoundConfig { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + private Integer round_no; + + @ManyToOne + private GameConfig game; + + private Boolean communication_flag; + + @ManyToMany(cascade = {CascadeType.PERSIST, CascadeType.MERGE}) + private Set<QuestionGroup> questiongroup; + + public void setId(Long id) { + this.id = id; + } + public Long getId() { + return id; + } + public void setRound_no(Integer round_no) { + this.round_no = round_no; + } + public Integer getRound_no() { + return round_no; + } + + public void setCommunication_flag(Boolean communication_flag) { + this.communication_flag = communication_flag; + } + public Boolean getCommunication_flag() { + return communication_flag; + } + public void setGame(GameConfig game) { + this.game = game; + } + public GameConfig getGame() { + return game; + } + public void setQuestiongroup(Set<QuestionGroup> questiongroup) { + this.questiongroup = questiongroup; + } + public Set<QuestionGroup> getQuestiongroup() { + return questiongroup; + } + + + +} Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-07 02:18:30 UTC (rev 92) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-09 01:27:37 UTC (rev 93) @@ -1,25 +1,40 @@ package edu.asu.commons.mme.entity; -import javax.persistence.*; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.EnumType; +import javax.persistence.Enumerated; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + + @Entity @Table(name="student") public class Student { - private String name; - - @Id @GeneratedValue + @Id + @GeneratedValue private Long id; - - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - + + @ManyToOne + private Group group; + + @Column(name="student_no") + private Integer studentNo; + + @Column(name="year_birth",length = 4) + private Integer birthYear; + + private String major; + + private String enthnicity; + + @Enumerated(EnumType.STRING) + private Gender gender; + public Long getId() { return id; } @@ -28,4 +43,52 @@ this.id = id; } + public void setGroup(Group group) { + this.group = group; + } + + public Group getGroup() { + return group; + } + + public void setStudentNo(Integer studentNo) { + this.studentNo = studentNo; + } + + public Integer getStudentNo() { + return studentNo; + } + + public void setBirthYear(Integer birthYear) { + this.birthYear = birthYear; + } + + public Integer getBirthYear() { + return birthYear; + } + + public void setMajor(String major) { + this.major = major; + } + + public String getMajor() { + return major; + } + + public void setEnthnicity(String enthnicity) { + this.enthnicity = enthnicity; + } + + public String getEnthnicity() { + return enthnicity; + } + + public void setGender(Gender gender) { + this.gender = gender; + } + + public Gender getGender() { + return gender; + } + } Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentRoundConfig.java 2009-04-09 01:27:37 UTC (rev 93) @@ -0,0 +1,74 @@ +package edu.asu.commons.mme.entity; + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + + + +@Entity +@Table(name="student_round_config") + +public class StudentRoundConfig { + + + @Id + @GeneratedValue + private Long id; + + @ManyToOne + private Student student; + + @ManyToOne + private RoundConfig roundconfig; + + @Column(name="current_allocation_no") + private Integer currentAllocationNo; + + @Column(name="current_day_no") + private Integer currentDayNo; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setStudent(Student student) { + this.student = student; + } + + public Student getStudent() { + return student; + } + + public void setRoundconfig(RoundConfig roundconfig) { + this.roundconfig = roundconfig; + } + + public RoundConfig getRoundconfig() { + return roundconfig; + } + + public void setCurrentAllocationNo(Integer currentAllocationNo) { + this.currentAllocationNo = currentAllocationNo; + } + + public Integer getCurrentAllocationNo() { + return currentAllocationNo; + } + + public void setCurrentDayNo(Integer currentDayNo) { + this.currentDayNo = currentDayNo; + } + + public Integer getCurrentDayNo() { + return currentDayNo; + } + +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/StudentStrategy.java 2009-04-09 01:27:37 UTC (rev 93) @@ -0,0 +1,113 @@ +package edu.asu.commons.mme.entity; + + +import java.util.List; +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.OneToMany; + +import javax.persistence.Table; + + + +@Entity +@Table(name="student_strategy") + +public class StudentStrategy { + + @Id + @GeneratedValue + private Long id; + + + @ManyToOne + private RoundConfig roundconfig; + + @Column(name = "allocation_sequence_no") + private Integer allocationSeqNo; + + private Integer days; + + private Float threshold; + + @ManyToOne + private LocationConfig location; + + @Column (name="repeated_decisions") + private boolean repeatedDecisions; + + + @OneToMany + private List<DayOutput> dayOutput; + + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setAllocationSeqNo(Integer allocationSeqNo) { + this.allocationSeqNo = allocationSeqNo; + } + + public Integer getAllocationSeqNo() { + return allocationSeqNo; + } + + public void setDays(Integer days) { + this.days = days; + } + + public Integer getDays() { + return days; + } + + public void setThreshold(Float threshold) { + this.threshold = threshold; + } + + public Float getThreshold() { + return threshold; + } + + public void setRepeatedDecisions(boolean repeatedDecisions) { + this.repeatedDecisions = repeatedDecisions; + } + + public boolean isRepeatedDecisions() { + return repeatedDecisions; + } + + public void setRoundConfig(RoundConfig roundConfig) { + this.roundconfig = roundConfig; + } + + public RoundConfig getRoundConfig() { + return roundconfig; + } + + public void setLocation(LocationConfig location) { + this.location = location; + } + + public LocationConfig getLocation() { + return location; + } + + public void setDayOutput(List<DayOutput> dayOutput) { + this.dayOutput = dayOutput; + } + + public List<DayOutput> getDayOutput() { + return dayOutput; + } + + + +} Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/SuspendRepetition.java 2009-04-09 01:27:37 UTC (rev 93) @@ -0,0 +1,74 @@ +package edu.asu.commons.mme.entity; + + +import javax.persistence.Column; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.Id; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name="suspend_repetition") +public class SuspendRepetition { + + @Id + @GeneratedValue + private Long id; + + + @ManyToOne + private RoundConfig roundconfig; + + @ManyToOne + private Student student; + + @Column(name="harbor_days") + private Integer harborDays; + + @Column(name="fishing_threshold") + private Float fishingThreshold; + + public void setId(Long id) { + this.id = id; + } + + public Long getId() { + return id; + } + + public void setHarborDays(Integer harborDays) { + this.harborDays = harborDays; + } + + public Integer getHarborDays() { + return harborDays; + } + + public void setFishingThreshold(Float fishingThreshold) { + this.fishingThreshold = fishingThreshold; + } + + public Float getFishingThreshold() { + return fishingThreshold; + } + + public void setRoundconfig(RoundConfig roundconfig) { + this.roundconfig = roundconfig; + } + + public RoundConfig getRoundconfig() { + return roundconfig; + } + + public void setStudent(Student student) { + this.student = student; + } + + public Student getStudent() { + return student; + } + + + +} Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-07 02:18:30 UTC (rev 92) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-09 01:27:37 UTC (rev 93) @@ -7,7 +7,29 @@ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> + <mapping class='edu.asu.commons.mme.entity.GameConfig'/> + <mapping class='edu.asu.commons.mme.entity.RoundConfig'/> + <mapping class='edu.asu.commons.mme.entity.LocationConfig'/> + <mapping class='edu.asu.commons.mme.entity.Communication'/> + <mapping class='edu.asu.commons.mme.entity.Group'/> <mapping class='edu.asu.commons.mme.entity.Student'/> + + <mapping class='edu.asu.commons.mme.entity.StudentRoundConfig'/> + <mapping class='edu.asu.commons.mme.entity.StudentStrategy'/> + <mapping class='edu.asu.commons.mme.entity.DayOutput'/> + <mapping class='edu.asu.commons.mme.entity.SuspendRepetition'/> + + <mapping class='edu.asu.commons.mme.entity.QuestionGroup'/> + <mapping class='edu.asu.commons.mme.entity.Question'/> + <mapping class='edu.asu.commons.mme.entity.Psychometric'/> + <mapping class='edu.asu.commons.mme.entity.Categorial'/> + + + + + + + </session-factory> </hibernate-configuration> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-07 02:18:40
|
Revision: 92 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=92&view=rev Author: alllee Date: 2009-04-07 02:18:30 +0000 (Tue, 07 Apr 2009) Log Message: ----------- basic test class for generating schema via hibernate tools Modified Paths: -------------- mentalmodels/trunk/init-db.ant.xml mentalmodels/trunk/pom.xml mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml Added Paths: ----------- mentalmodels/trunk/src/main/java/edu/ mentalmodels/trunk/src/main/java/edu/asu/ mentalmodels/trunk/src/main/java/edu/asu/commons/ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java Modified: mentalmodels/trunk/init-db.ant.xml =================================================================== --- mentalmodels/trunk/init-db.ant.xml 2009-04-07 01:51:17 UTC (rev 91) +++ mentalmodels/trunk/init-db.ant.xml 2009-04-07 02:18:30 UTC (rev 92) @@ -32,6 +32,8 @@ the mmedev database --> + <echo message='compile classpath: ${compile.classpath}'/> + <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpath="${compile.classpath}"/> <target name="init-db" depends="create-db-schema"/> <target name='create-db-schema'> Modified: mentalmodels/trunk/pom.xml =================================================================== --- mentalmodels/trunk/pom.xml 2009-04-07 01:51:17 UTC (rev 91) +++ mentalmodels/trunk/pom.xml 2009-04-07 02:18:30 UTC (rev 92) @@ -43,7 +43,7 @@ <dependency> <groupId>org.springframework</groupId> <artifactId>spring-hibernate3</artifactId> - <version>2.0-m4</version> + <version>2.0-m3</version> </dependency> <!-- hibernate and JPA persistence --> <dependency> @@ -53,16 +53,6 @@ </dependency> <dependency> <groupId>org.hibernate</groupId> - <artifactId>hibernate-core</artifactId> - <version>3.3.1.GA</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> - <artifactId>hibernate-entitymanager</artifactId> - <version>3.3.2.GA</version> - </dependency> - <dependency> - <groupId>org.hibernate</groupId> <artifactId>hibernate-annotations</artifactId> <version>3.4.0.GA</version> </dependency> Added: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java (rev 0) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/Student.java 2009-04-07 02:18:30 UTC (rev 92) @@ -0,0 +1,31 @@ +package edu.asu.commons.mme.entity; + +import javax.persistence.*; + +@Entity +@Table(name="student") +public class Student { + + private String name; + + @Id @GeneratedValue + private Long id; + + + public String getName() { + return name; + } + + public void setName(String name) { + this.name = name; + } + + public Long getId() { + return id; + } + + public void setId(Long id) { + this.id = id; + } + +} Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-07 01:51:17 UTC (rev 91) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-07 02:18:30 UTC (rev 92) @@ -7,10 +7,7 @@ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> -<!-- <mapping class='edu.asu.commons.mme.entity.Student'/>--> -<mapping class='game.GameConfig'/> -<mapping class='game.RoundConfig'/> - + <mapping class='edu.asu.commons.mme.entity.Student'/> </session-factory> </hibernate-configuration> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <see...@us...> - 2009-04-07 01:51:28
|
Revision: 91 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=91&view=rev Author: seematalele Date: 2009-04-07 01:51:17 +0000 (Tue, 07 Apr 2009) Log Message: ----------- added game package which contains GameConfig.java, LocationConfig.java, RoundConfig.java. LocationConfig.java is not correct that needs to be corrected but I have not mention in the hibernate.cfg.xml file. Modified Paths: -------------- mentalmodels/trunk/init-db.ant.xml mentalmodels/trunk/pom.xml mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml Added Paths: ----------- mentalmodels/trunk/src/main/java/game/ mentalmodels/trunk/src/main/java/game/GameConfig.java mentalmodels/trunk/src/main/java/game/LocationConfig.java mentalmodels/trunk/src/main/java/game/RoundConfig.java Modified: mentalmodels/trunk/init-db.ant.xml =================================================================== --- mentalmodels/trunk/init-db.ant.xml 2009-04-07 01:00:46 UTC (rev 90) +++ mentalmodels/trunk/init-db.ant.xml 2009-04-07 01:51:17 UTC (rev 91) @@ -3,30 +3,33 @@ vim:sts=2:sw=2 $Id: init-db.ant.xml 239 2009-03-20 17:49:19Z alllee $ $Revision: 239 $ -Master build file for TDAR deployment. +Master build file for MME deployment. --> -<project name="tdar" default="help"> +<project name="mme" default="help"> <!-- where the applicationContext.xml and hibernate.cfg.xml are currently located, this may change --> <property name='web.inf.dir' value='src/main/webapp/WEB-INF'/> <property name='db.dir' value='src/main/db'/> <property name='db.generated.dir' value='${db.dir}/generated'/> + <property name='hibernate.properties.file' value='${web.inf.dir}/hibernate.properties'/> + <!-- first load environment vars from hibernate directly--> + <property file="${hibernate.properties.file}"/> - <!-- first load environment vars from hibernate directly--> - <property file="${web.inf.dir}/hibernate.properties"/> <!-- define some sane default values for db connection if undefined in build.properties --> <property name='db.name' value='mme'/> + <property name='hibernate.connection.url' value='jdbc:mysql://localhost/${db.name}'/> <property name='hibernate.connection.username' value='mme'/> + <property name='hibernate.connection.password' value='mme.mme'/> <property name='hibernate.connection.driver_class' value='com.mysql.jdbc.Driver'/> <property name='hibernate.dialect' value='org.hibernate.dialect.MySQLInnoDBDialect'/> <!-- this should always be available, connect to this if we need to create - the tdardev database + the mmedev database --> <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpath="${compile.classpath}"/> @@ -36,8 +39,10 @@ <echo message="You must have valid database connection information within hibernate.properties for this task to succeed."/> <hibernatetool destdir='${db.generated.dir}'> <!-- annotated class/packages are specified in the hibernate.cfg.xml --> - <annotationconfiguration propertyFile="${web.inf.dir}/hibernate.properties" configurationfile="${web.inf.dir}/hibernate.cfg.xml"/> - <hbm2ddl export="true" drop="true" outputfilename="mme-db.sql"/> + + <annotationconfiguration propertyFile="${hibernate.properties.file}" configurationfile="${web.inf.dir}/hibernate.cfg.xml"/> + <hbm2ddl export="true" drop="true" outputfilename="mme.sql"/> + </hibernatetool> </target> <target name='create-indexes'> @@ -51,6 +56,8 @@ userid="${hibernate.connection.username}" password="${hibernate.connection.password}" classpath="${compile.classpath}" - src="${db.dir}/init-db.sql"/> + + src="${db.dir}/init-mme.sql"/> + </target> </project> Modified: mentalmodels/trunk/pom.xml =================================================================== --- mentalmodels/trunk/pom.xml 2009-04-07 01:00:46 UTC (rev 90) +++ mentalmodels/trunk/pom.xml 2009-04-07 01:51:17 UTC (rev 91) @@ -33,7 +33,7 @@ <dependency> <groupId>org.springframework</groupId> <artifactId>spring</artifactId> - <version>2.5.6</version> + <version>2.5.5</version> </dependency> <dependency> <groupId>org.springframework</groupId> Added: mentalmodels/trunk/src/main/java/game/GameConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/game/GameConfig.java (rev 0) +++ mentalmodels/trunk/src/main/java/game/GameConfig.java 2009-04-07 01:51:17 UTC (rev 91) @@ -0,0 +1,119 @@ +package game; + +import java.util.ArrayList; +import java.util.List; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.Lob; + +import javax.persistence.OneToMany; +import javax.persistence.Table; +import javax.persistence.Column; +import javax.persistence.GeneratedValue; +import javax.persistence.Temporal; +import javax.persistence.TemporalType; +import java.util.Date; + + +@Entity +@Table(name="game") +public class GameConfig { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + private Integer no_of_rounds; + private Integer no_of_location; + private Integer max_no_of_days; + private Integer max_fish_harvest; + + @Temporal(TemporalType.DATE) + private Date timestamp; + + private String title; + + @Lob + private String description; + + @Column(scale=2) + private Float money; + private String img_address; + + @OneToMany(cascade=CascadeType.ALL) + private List<RoundConfig> roundconfig= new ArrayList<RoundConfig>(); + + + public void setId(Long id) { + this.id = id; + } + public Long getId() { + return id; + } + public void setNo_of_rounds(Integer no_of_rounds) { + this.no_of_rounds = no_of_rounds; + } + public Integer getNo_of_rounds() { + return no_of_rounds; + } + public void setNo_of_location(Integer no_of_location) { + this.no_of_location = no_of_location; + } + public Integer getNo_of_location() { + return no_of_location; + } + public void setMax_fish_harvest(Integer max_fish_harvest) { + this.max_fish_harvest = max_fish_harvest; + } + public Integer getMax_fish_harvest() { + return max_fish_harvest; + } + public void setMax_no_of_days(Integer max_no_of_days) { + this.max_no_of_days = max_no_of_days; + } + public Integer getMax_no_of_days() { + return max_no_of_days; + } + public void setTimestamp(Date timestamp) { + this.timestamp = timestamp; + } + public Date getTimestamp() { + return timestamp; + } + public void setTitle(String title) { + this.title = title; + } + public String getTitle() { + return title; + } + public void setDescription(String description) { + this.description = description; + } + public String getDescription() { + return description; + } + public void setMoney(Float money) { + this.money = money; + } + public Float getMoney() { + return money; + } + public void setImg_address(String img_address) { + this.img_address = img_address; + } + public String getImg_address() { + return img_address; + } + public void setRoundconfig(List<RoundConfig> roundconfig) { + this.roundconfig = roundconfig; + } + public List<RoundConfig> getRoundconfig() { + return roundconfig; + } + + +} Added: mentalmodels/trunk/src/main/java/game/LocationConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/game/LocationConfig.java (rev 0) +++ mentalmodels/trunk/src/main/java/game/LocationConfig.java 2009-04-07 01:51:17 UTC (rev 91) @@ -0,0 +1,65 @@ +package game; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.JoinColumn; +import javax.persistence.OneToMany; +import javax.persistence.Table; + +@Entity +@Table(name = "location_config") +public class LocationConfig { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + @OneToMany(cascade=CascadeType.ALL) + private Long id; + + + private Long round_config_id; + private String location_name; + private Integer max_capacity; + private Float growth_rate; + private Integer start_population; + + public void setId(Long id) { + this.id = id; + } + public Long getId() { + return id; + } + public void setRound_config_id(Long round_config_id) { + this.round_config_id = round_config_id; + } + public Long getRound_config_id() { + return round_config_id; + } + public void setLocation_name(String location_name) { + this.location_name = location_name; + } + public String getLocation_name() { + return location_name; + } + public void setMax_capacity(Integer max_capacity) { + this.max_capacity = max_capacity; + } + public Integer getMax_capacity() { + return max_capacity; + } + public void setGrowth_rate(Float growth_rate) { + this.growth_rate = growth_rate; + } + public Float getGrowth_rate() { + return growth_rate; + } + public void setStart_population(Integer start_population) { + this.start_population = start_population; + } + public Integer getStart_population() { + return start_population; + } + +} Added: mentalmodels/trunk/src/main/java/game/RoundConfig.java =================================================================== --- mentalmodels/trunk/src/main/java/game/RoundConfig.java (rev 0) +++ mentalmodels/trunk/src/main/java/game/RoundConfig.java 2009-04-07 01:51:17 UTC (rev 91) @@ -0,0 +1,66 @@ +package game; + +import java.util.HashSet; +import java.util.Set; + +import javax.persistence.CascadeType; +import javax.persistence.Entity; +import javax.persistence.GeneratedValue; +import javax.persistence.GenerationType; +import javax.persistence.Id; +import javax.persistence.ManyToMany; +import javax.persistence.ManyToOne; +import javax.persistence.Table; + +@Entity +@Table(name="round_config") +public class RoundConfig { + @Id + @GeneratedValue(strategy = GenerationType.AUTO) + private Long id; + + private Integer round_no; + + @ManyToOne(cascade=CascadeType.ALL) + private GameConfig game; + + private Boolean communication_flag; + + /*@ManyToMany (mappedBy= "question_group_id")*/ + private Set<Long> questionGroupId = new HashSet<Long>(); + + public void setId(Long id) { + this.id = id; + } + public Long getId() { + return id; + } + public void setRound_no(Integer round_no) { + this.round_no = round_no; + } + public Integer getRound_no() { + return round_no; + } + + public void setCommunication_flag(Boolean communication_flag) { + this.communication_flag = communication_flag; + } + public Boolean getCommunication_flag() { + return communication_flag; + } + public void setQuestionGroupId(Set<Long> questionGroupId) { + this.questionGroupId = questionGroupId; + } + public Set<Long> getQuestionGroupId() { + return questionGroupId; + } + public void setGame(GameConfig game) { + this.game = game; + } + public GameConfig getGame() { + return game; + } + + + +} Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-07 01:00:46 UTC (rev 90) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-07 01:51:17 UTC (rev 91) @@ -7,7 +7,10 @@ "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd"> <hibernate-configuration> <session-factory> - <mapping class='edu.asu.commons.mme.entity.Student'/> +<!-- <mapping class='edu.asu.commons.mme.entity.Student'/>--> +<mapping class='game.GameConfig'/> +<mapping class='game.RoundConfig'/> + </session-factory> </hibernate-configuration> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <al...@us...> - 2009-04-07 01:00:56
|
Revision: 90 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=90&view=rev Author: alllee Date: 2009-04-07 01:00:46 +0000 (Tue, 07 Apr 2009) Log Message: ----------- adding dependency for slf4j (still not sure why it's needed) and adding hibernate.properties.template in /WEB-INF. Modified Paths: -------------- mentalmodels/trunk/init-db.ant.xml mentalmodels/trunk/pom.xml Added Paths: ----------- mentalmodels/trunk/src/main/db/ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.properties.template Modified: mentalmodels/trunk/init-db.ant.xml =================================================================== --- mentalmodels/trunk/init-db.ant.xml 2009-04-02 23:53:20 UTC (rev 89) +++ mentalmodels/trunk/init-db.ant.xml 2009-04-07 01:00:46 UTC (rev 90) @@ -6,38 +6,38 @@ Master build file for TDAR deployment. --> <project name="tdar" default="help"> - <!-- get environment vars --> - <property file="hibernate.properties"/> + <!-- where the applicationContext.xml and hibernate.cfg.xml are currently located, this may change --> + <property name='web.inf.dir' value='src/main/webapp/WEB-INF'/> + <property name='db.dir' value='src/main/db'/> + <property name='db.generated.dir' value='${db.dir}/generated'/> + + <!-- first load environment vars from hibernate directly--> + <property file="${web.inf.dir}/hibernate.properties"/> <!-- define some sane default values for db connection if undefined in build.properties --> <property name='db.name' value='mme'/> - <property name='hibernate.connection.url' value='jdbc:postgresql://localhost/${db.name}'/> + <property name='hibernate.connection.url' value='jdbc:mysql://localhost/${db.name}'/> <property name='hibernate.connection.username' value='mme'/> - <property name='hibernate.connection.password' value=''/> + <property name='hibernate.connection.password' value='mme.mme'/> <property name='hibernate.connection.driver_class' value='com.mysql.jdbc.Driver'/> <property name='hibernate.dialect' value='org.hibernate.dialect.MySQLInnoDBDialect'/> - <property name='createdb.url' value='jdbc:postgresql://localhost/template1'/> - <!-- where the applicationContext.xml and hibernate.cfg.xml are currently located, this may change --> - <property name='web.inf.dir' value='src/main/webapp/WEB-INF'/> - <property name='db.dir' value='src/main/db'/> - <property name='db.generated.dir' value='${db.dir}/generated'/> <!-- this should always be available, connect to this if we need to create the tdardev database --> <taskdef name="hibernatetool" classname="org.hibernate.tool.ant.HibernateToolTask" classpath="${compile.classpath}"/> - <target name="init-db" depends="create-db-schema, create-indexes"/> + <target name="init-db" depends="create-db-schema"/> <target name='create-db-schema'> <mkdir dir='${db.generated.dir}'/> <echo message="You must have valid database connection information within hibernate.properties for this task to succeed."/> <hibernatetool destdir='${db.generated.dir}'> <!-- annotated class/packages are specified in the hibernate.cfg.xml --> - <annotationconfiguration propertyFile="hibernate.properties" configurationfile="${web.inf.dir}/hibernate.cfg.xml"/> - <hbm2ddl export="true" drop="true" outputfilename="tdar.sql"/> + <annotationconfiguration propertyFile="${web.inf.dir}/hibernate.properties" configurationfile="${web.inf.dir}/hibernate.cfg.xml"/> + <hbm2ddl export="true" drop="true" outputfilename="mme-db.sql"/> </hibernatetool> </target> <target name='create-indexes'> @@ -51,32 +51,6 @@ userid="${hibernate.connection.username}" password="${hibernate.connection.password}" classpath="${compile.classpath}" - src="${db.dir}/init-tdar.sql"/> + src="${db.dir}/init-db.sql"/> </target> - - <target name='create-db'> - <sql driver='${hibernate.connection.driver_class}' - url='${createdb.url}' - userid='${hibernate.connection.username}' - password='${hibernate.connection.password}' - onerror='continue' - classpath='${compile.classpath}' autocommit='true'> - DROP DATABASE ${db.name}; - CREATE DATABASE ${db.name} WITH ENCODING 'UTF8'; - </sql> - </target> - - <!-- not needed here. - <target name='load-data' depends='create-db'> - <bunzip2 src='${db.dir}/tdar-data.sql.bz2' dest='${db.dir}/tdar-data.sql'/> - <sql driver='${hibernate.connection.driver_class}' - url='${hibernate.connection.url}' - userid='${hibernate.connection.username}' - password='${hibernate.connection.password}' - classpath='${compile.classpath}'> - <transaction src='${db.dir}/tdar-data.sql'/> - <transaction src='${db.dir}/upgrade-db-tdar.struts.sql'/> - </sql> - </target> - --> </project> Modified: mentalmodels/trunk/pom.xml =================================================================== --- mentalmodels/trunk/pom.xml 2009-04-02 23:53:20 UTC (rev 89) +++ mentalmodels/trunk/pom.xml 2009-04-07 01:00:46 UTC (rev 90) @@ -76,6 +76,12 @@ <artifactId>hibernate-tools</artifactId> <version>3.2.3.GA</version> </dependency> + <dependency> + <groupId>org.slf4j</groupId> + <artifactId>slf4j-log4j12</artifactId> + <version>1.5.2</version> + </dependency> + </dependencies> <build> <finalName>mme</finalName> Added: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.properties.template =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.properties.template (rev 0) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.properties.template 2009-04-07 01:00:46 UTC (rev 90) @@ -0,0 +1,5 @@ +hibernate.connection.user=mme +hibernate.connection.password= +hibernate.connection.url=jdbc:mysql://localhost/mme +hibernate.connection.driver_class=com.mysql.jdbc.Driver +hibernate.dialect=org.hibernate.dialect.MySQLInnoDBDialect This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |