[virtualcommons-svn] SF.net SVN: virtualcommons:[119] mentalmodels/trunk
Status: Beta
Brought to you by:
alllee
From: <see...@us...> - 2009-04-23 01:08:09
|
Revision: 119 http://virtualcommons.svn.sourceforge.net/virtualcommons/?rev=119&view=rev Author: seematalele Date: 2009-04-23 01:07:59 +0000 (Thu, 23 Apr 2009) Log Message: ----------- created module, block and item tables for storing the timing information. Changed the FisherExperiment.mxml so that it can communicate to the Spring. (Plz Note in the previous revision this file is not updated. But webapp/FisheryExperiment.swf is up to date according to the revision. This is because I forgot to copy the FisheryExperiment.mxml in the previous revisions.) Made the changes in the init-db.sql- Put new target drop-prev-schema. It drops the mme and create it also. Modified Paths: -------------- mentalmodels/trunk/flex/src/FisheryExperiment.mxml mentalmodels/trunk/flex/src/Socio_Demographic_Information.mxml mentalmodels/trunk/flex/src/Socio_demographic.mxml mentalmodels/trunk/flex/src/TableTest.mxml mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml mentalmodels/trunk/flex/src/customComponents/SocioDemographicPage.mxml mentalmodels/trunk/init-db.ant.xml mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java mentalmodels/trunk/src/main/webapp/FisheryExperiment.swf mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml mentalmodels/trunk/src/main/webapp/startfeed.jsp Added Paths: ----------- mentalmodels/trunk/src/main/db/drop-mme.sql Modified: mentalmodels/trunk/flex/src/FisheryExperiment.mxml =================================================================== --- mentalmodels/trunk/flex/src/FisheryExperiment.mxml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/flex/src/FisheryExperiment.mxml 2009-04-23 01:07:59 UTC (rev 119) @@ -26,24 +26,73 @@ <mx:State name="none"/> </mx:states> + + <mx:Canvas id="content" x="5" y="5" width="750" height="470"/> <mx:Canvas id="expiredContent" x="-100" y="-100" width="1" height="1" visible="false"/> <mx:Button id="btnBack" label="« Back" click="back()" left="8" bottom="8"/> <mx:Button id="btnAccept" label="Accept" click="accept()" left="375" bottom="10"/> <mx:Button id="btnForward" label="Forward »" click="forward()" right="8" bottom="8"/> - + <mx:RemoteObject id="ss" destination="studentService" fault="faultHandler(event)" result="resultHandler(event)"/> + <mx:Producer id="producer" destination="DataPush" acknowledge="ack(event)"/> + <mx:Consumer id="consumer" destination="DataPush" message="messageHandler(event.message)" /> <mx:Script> <![CDATA[ + import flash.sampler.getInvocationCount; import mx.controls.Label; import customComponents.*; + import mx.controls.Alert; + import mx.rpc.events.ResultEvent; + import mx.rpc.events.FaultEvent; + import mx.messaging.messages.IMessage; + import mx.messaging.events.MessageAckEvent; + import mx.messaging.events.MessageFaultEvent; + import mx.messaging.FlexClient; + import mx.messaging.messages.AsyncMessage; + private var shared:SharedObject; private var flushMessage:String; + [Bindable] + public var Id : uint; + [Bindable] + public var randomNumbers:String; + private function ack(event:MessageAckEvent):void + { + //chart.setVisible(true); + randomNumbers = event.message.body as String; + //Alert.show("in ack method" + randomNumbers); + } + private function resultHandler(event:ResultEvent):void + { + Id = event.result as uint; + + Alert.show("Student id is " + Id ); + consumer.disconnect(); + } + + private function faultHandler(event:FaultEvent):void + { + Alert.show("event fault is " + event.fault.faultDetail); + } + + private function handleFault(event:MessageFaultEvent):void + { + Alert.show("Message event fault is " + event.faultString); + } + + + private function messageHandler(message:IMessage):void + { + randomNumbers = message.body as String; + Alert.show( ""+randomNumbers); + } + public function init():void { - var sharedObjTest:Boolean = false; + /*var sharedObjTest:Boolean = false; if(sharedObjTest) { var got:Boolean = getLocal(); @@ -64,8 +113,21 @@ else getData().exists = true; this.addChild(getData().testLabel); + } - } + }*/ + + var msg:AsyncMessage = new AsyncMessage(); + var client:FlexClient = FlexClient.getInstance(); + //creating new msg with “New” to get current state. + msg.body = "New"; + + //producer.send(msg); + //Alert.show("message send is " + msg.body); + + + consumer.subscribe(); + } public function getData():Object { @@ -129,16 +191,26 @@ obj.visible = false; expiredContent.addChild(obj); currentState = "socioDemographic"; + //consumer.subscribe(); return true; } } if(obj is SocioDemographicPage) { + var Id:uint = 0; if( (SocioDemographicPage)(obj).accept() ) { obj.visible = false; expiredContent.addChild(obj); currentState = "planner"; + var info:SocioDemographicPage = SocioDemographicPage(obj); + + /* Alert.show(info.getGender()); + Alert.show(info.getMajor()); + Alert.show(info.getSemester()); + Alert.show(info.getYear());*/ + Id=ss.createStudent(info.getYear(), info.getSemester(), info.getGender(),info.getMajor()); + Alert.show("Before invoking createstudent()"); return true; } } @@ -149,6 +221,7 @@ obj.visible = false; expiredContent.addChild(obj); currentState = "none"; + return true; } } @@ -156,6 +229,8 @@ return false; } + + ]]> </mx:Script> Modified: mentalmodels/trunk/flex/src/Socio_Demographic_Information.mxml =================================================================== --- mentalmodels/trunk/flex/src/Socio_Demographic_Information.mxml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/flex/src/Socio_Demographic_Information.mxml 2009-04-23 01:07:59 UTC (rev 119) @@ -32,10 +32,10 @@ </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:RadioButton id="male" groupName="{gender}"> <mx:label>Male</mx:label> </mx:RadioButton> - <mx:RadioButton id="female" groupName="gender"> + <mx:RadioButton id="female" groupName="{gender}"> <mx:label>Female</mx:label> </mx:RadioButton> Modified: mentalmodels/trunk/flex/src/Socio_demographic.mxml =================================================================== --- mentalmodels/trunk/flex/src/Socio_demographic.mxml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/flex/src/Socio_demographic.mxml 2009-04-23 01:07:59 UTC (rev 119) @@ -1,9 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> <mx:Canvas xmlns:mx="http://www.adobe.com/2006/mxml" width="100%" height="80%"> - - - <mx:VBox height="100%" id="vboxGatherInfo" width="100%"> <mx:HBox horizontalAlign="center" verticalAlign="middle" id="hboxSocio_demographic_info"> <mx:Label text="Socio-demographic Information" id="lblHeading" enabled="true" fontSize="16" color="#230869" textAlign="center" fontWeight="bold"/> Modified: mentalmodels/trunk/flex/src/TableTest.mxml =================================================================== --- mentalmodels/trunk/flex/src/TableTest.mxml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/flex/src/TableTest.mxml 2009-04-23 01:07:59 UTC (rev 119) @@ -2,7 +2,6 @@ <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()"/> @@ -19,8 +18,7 @@ public function init():void { -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); + 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/customComponents/InstructionPage.mxml =================================================================== --- mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/flex/src/customComponents/InstructionPage.mxml 2009-04-23 01:07:59 UTC (rev 119) @@ -1,10 +1,6 @@ <?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; Modified: mentalmodels/trunk/flex/src/customComponents/SocioDemographicPage.mxml =================================================================== --- mentalmodels/trunk/flex/src/customComponents/SocioDemographicPage.mxml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/flex/src/customComponents/SocioDemographicPage.mxml 2009-04-23 01:07:59 UTC (rev 119) @@ -80,8 +80,9 @@ <mx:HBox> <mx:Label text="Gender:" fontWeight="bold" width="100" textAlign="right"/> <mx:HBox id="boxGender"> - <mx:RadioButton groupName="gender" label="M" id="radioMale"/> - <mx:RadioButton groupName="gender" label="F" id="radioFemale"/> + <mx:RadioButtonGroup id="gender"/> + <mx:RadioButton groupName="{gender}" label="M" id="radioMale"/> + <mx:RadioButton groupName="{gender}" label="F" id="radioFemale"/> </mx:HBox> </mx:HBox> Modified: mentalmodels/trunk/init-db.ant.xml =================================================================== --- mentalmodels/trunk/init-db.ant.xml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/init-db.ant.xml 2009-04-23 01:07:59 UTC (rev 119) @@ -35,8 +35,9 @@ <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'> + <target name="help"/> + <target name="init-db" depends="create-db-tables"/> + <target name='create-db-tables' depends="drop-prev-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}'> @@ -47,6 +48,16 @@ </hibernatetool> </target> + + <target name="drop-prev-schema"> + <sql driver="${hibernate.connection.driver_class}" + url="${hibernate.connection.url}" + userid="${hibernate.connection.username}" + password="${hibernate.connection.password}" + classpath="${compile.classpath}" + + src="${db.dir}/drop-mme.sql"/> + </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"/> Added: mentalmodels/trunk/src/main/db/drop-mme.sql =================================================================== --- mentalmodels/trunk/src/main/db/drop-mme.sql (rev 0) +++ mentalmodels/trunk/src/main/db/drop-mme.sql 2009-04-23 01:07:59 UTC (rev 119) @@ -0,0 +1,2 @@ +drop schema mme; +create schema mme; \ No newline at end of file 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-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/entity/GameConfig.java 2009-04-23 01:07:59 UTC (rev 119) @@ -47,7 +47,7 @@ private String img_address; @OneToMany - private List<RoundConfig> roundconfig= new ArrayList<RoundConfig>(); + private List<RoundConfig> roundConfig; public void setId(Long id) { @@ -106,10 +106,10 @@ return img_address; } public void setRoundconfig(List<RoundConfig> roundconfig) { - this.roundconfig = roundconfig; + this.roundConfig = roundconfig; } public List<RoundConfig> getRoundconfig() { - return roundconfig; + return roundConfig; } public void setTimestamp(Timestamp timestamp) { this.timestamp = timestamp; Modified: mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java =================================================================== --- mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/src/main/java/edu/asu/commons/mme/service/Feed.java 2009-04-23 01:07:59 UTC (rev 119) @@ -46,21 +46,23 @@ while (running) { + try { + Thread.sleep(50000); + running = false; + } catch (InterruptedException e) { + } AsyncMessage msg = new AsyncMessage(); msg.setDestination("DataPush"); //msg.setHeader("DSSubtopic", "hello"); msg.setClientId(clientID); msg.setMessageId(UUIDUtils.createUUID()); msg.setTimestamp(System.currentTimeMillis()); - msg.setBody("this is a server push message"); + msg.setBody("Sorry time is expired!!! You can not Login."); System.out.println("Message broker is: "+ msgBroker); System.out.println("Message is: "+ msg); msgBroker.routeMessageToService(msg, null); - try { - Thread.sleep(2000); - } catch (InterruptedException e) { - } + } } Modified: mentalmodels/trunk/src/main/webapp/FisheryExperiment.swf =================================================================== (Binary files differ) Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/flex/services-config.xml 2009-04-23 01:07:59 UTC (rev 119) @@ -49,7 +49,7 @@ </channel-definition> <channel-definition id="my-amf" class="mx.messaging.channels.AMFChannel"> - <endpoint url="http://{server.name}:{server.port}/{context.root}/msgbroker/amf" class="flex.messaging.endpoints.AMFEndpoint"/> + <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"> Modified: mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml =================================================================== --- mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/src/main/webapp/WEB-INF/hibernate.cfg.xml 2009-04-23 01:07:59 UTC (rev 119) @@ -24,9 +24,13 @@ - <mapping class='edu.asu.commons.mme.entity.Categorical'/> + <mapping class='edu.asu.commons.mme.entity.Categorical'/> <mapping class='edu.asu.commons.mme.entity.Psychometric'/> <mapping class='edu.asu.commons.mme.entity.StudentResponse'/> + + <mapping class='edu.asu.commons.mme.entity.Module'/> + <mapping class='edu.asu.commons.mme.entity.Block'/> + <mapping class='edu.asu.commons.mme.entity.Item'/> Modified: mentalmodels/trunk/src/main/webapp/startfeed.jsp =================================================================== --- mentalmodels/trunk/src/main/webapp/startfeed.jsp 2009-04-21 23:59:22 UTC (rev 118) +++ mentalmodels/trunk/src/main/webapp/startfeed.jsp 2009-04-23 01:07:59 UTC (rev 119) @@ -3,8 +3,8 @@ try { Feed feed = new Feed(); feed.start(); - out.println("Feed Started"); + out.println("Server started to accept the students."); } catch (Exception e) { - out.println("A problem occured while starting the feed: "+e.getMessage()); + out.println("A problem occured while starting the server: "+e.getMessage()); } %> \ No newline at end of file This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |