Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

almost ready for release

git-svn-id: https://flexapps.svn.sourceforge.net/svnroot/flexapps/census2@632 381d3abc-5231-0410-a0e4-b068e20cbb11
  • Loading branch information...
commit b65119cb77b3631d5e0486111c663435e55e0aaa 1 parent 4fa7c9d
jlward4 authored
Showing with 1,141 additions and 32 deletions.
  1. +20 −0 server/WebContent/CensusDashboard.html
  2. BIN  server/WebContent/CensusDashboard.swf
  3. +1 −0  server/WebContent/WEB-INF/db/README.txt
  4. +1 −1  server/WebContent/WEB-INF/flex/messaging-config.xml
  5. +18 −0 server/WebContent/WEB-INF/flex/remoting-config.xml
  6. +9 −3 server/WebContent/WEB-INF/flex/services-config.xml
  7. BIN  server/WebContent/WEB-INF/lib/db4o-7.12.132.14217-all-java5.jar
  8. +11 −0 server/WebContent/WEB-INF/web.xml
  9. BIN  server/WebContent/assets/rightIcon.png
  10. +1 −1  server/WebContent/blazeds_config.xml
  11. BIN  server/WebContent/census2.swf
  12. +1 −1  server/WebContent/index.html
  13. +30 −6 server/WebContent/index_results.html
  14. +43 −0 server/WebContent/querystring.js
  15. +279 −0 server/WebContent/readable.css
  16. BIN  server/WebContent/readable.swf
  17. +279 −0 server/WebContent/sexy.css
  18. BIN  server/WebContent/sexy.swf
  19. +9 −3 server/WebContent/tests.xml
  20. +220 −0 server/src/com/jamesward/census2/CensusResult.java
  21. +141 −0 server/src/com/jamesward/census2/CensusResultService.java
  22. +43 −0 server/src/com/jamesward/census2/Db4oServletContextListener.java
  23. +35 −17 server/src/com/jamesward/census2/SendCensusResult.java
View
20 server/WebContent/CensusDashboard.html
@@ -0,0 +1,20 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
+<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
+ <head>
+ <title>Census - RIA Experience Test</title>
+ <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
+ <script type="text/javascript" src="swfobject.js"></script>
+ <script type="text/javascript">
+ swfobject.embedSWF("CensusDashboard.swf", "myContent", "100%", "100%", "9.0.0");
+ </script>
+ <style type="text/css" media="screen">
+ html, body, #myContent { height:100%; }
+ body { margin:0; padding:0; overflow:hidden; }
+ </style>
+ </head>
+ <body>
+ <div id="myContent">
+ <p>The Census RIA Benchmark requires Flash Player 9 or newer.</p>
+ </div>
+ </body>
+</html>
View
BIN  server/WebContent/CensusDashboard.swf
Binary file not shown
View
1  server/WebContent/WEB-INF/db/README.txt
@@ -0,0 +1 @@
+This directory must be here for the db4o database file.
View
2  server/WebContent/WEB-INF/flex/messaging-config.xml
@@ -10,7 +10,7 @@
<channel ref="my-polling-amf"/>
</default-channels>
- <destination id="censusResultsDestination">
+ <destination id="CensusResultsDestination">
<properties>
<server>
<allow-subtopics>true</allow-subtopics>
View
18 server/WebContent/WEB-INF/flex/remoting-config.xml
@@ -0,0 +1,18 @@
+<?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>
+
+ <destination id="CensusResultService">
+ <properties>
+ <source>com.jamesward.census2.CensusResultService</source>
+ </properties>
+ </destination>
+
+</service>
View
12 server/WebContent/WEB-INF/flex/services-config.xml
@@ -2,14 +2,21 @@
<services-config>
<services>
- <service-include file-path="messaging-config.xml" />
+ <service-include file-path="remoting-config.xml"/>
+ <service-include file-path="messaging-config.xml"/>
</services>
<security>
</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"/>
+ <properties>
+ <polling-enabled>false</polling-enabled>
+ </properties>
+ </channel-definition>
+
<channel-definition id="my-polling-amf" class="mx.messaging.channels.AMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/pollingamf" class="flex.messaging.endpoints.AMFEndpoint"/>
<properties>
@@ -22,7 +29,6 @@
<channel-definition id="my-streaming-amf" class="mx.messaging.channels.StreamingAMFChannel">
<endpoint url="http://{server.name}:{server.port}/{context.root}/messagebroker/streamingamf" class="flex.messaging.endpoints.StreamingAMFEndpoint"/>
</channel-definition>
-
</channels>
<logging>
View
BIN  server/WebContent/WEB-INF/lib/db4o-7.12.132.14217-all-java5.jar
Binary file not shown
View
11 server/WebContent/WEB-INF/web.xml
@@ -1,12 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/dtd/web-app_2_3.dtd">
<web-app>
+
<display-name>Census2</display-name>
<description>Census2 Application</description>
+
+ <context-param>
+ <param-name>db4oFileName</param-name>
+ <param-value>census.db4o</param-value>
+ </context-param>
+
<listener>
<listener-class>flex.messaging.HttpFlexSession</listener-class>
</listener>
+ <listener>
+ <listener-class>com.jamesward.census2.Db4oServletContextListener</listener-class>
+ </listener>
+
<servlet>
<servlet-name>MessageBrokerServlet</servlet-name>
<display-name>MessageBrokerServlet</display-name>
View
BIN  server/WebContent/assets/rightIcon.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
2  server/WebContent/blazeds_config.xml
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
-<config sendCensusResultURL="http://localhost:8080/census2/SendCensusResult">
+<config sendCensusResultURL="http://localhost:8080/census2/SendCensusResult" remotingEndpoint="http://localhost:8080/census2/messagebroker/amf">
<channels>
<channel id="streaming-amf" endpoint="http://localhost:8080/census2/messagebroker/streamingamf" type="StreamingAMF"/>
<channel id="polling-amf" endpoint="http://localhost:8080/census2/messagebroker/pollingamf" type="PollingAMF"
View
BIN  server/WebContent/census2.swf
Binary file not shown
View
2  server/WebContent/index.html
@@ -14,7 +14,7 @@
</head>
<body>
<div id="myContent">
- <p>Alternative content</p>
+ <p>The Census RIA Benchmark requires Flash Player 9 or newer.</p>
</div>
</body>
</html>
View
36 server/WebContent/index_results.html
@@ -17,10 +17,34 @@
51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
-->
<html>
- <link rel="stylesheet" href="main.css" type="text/css">
- <center>
- <table height="100%">
- <tr><td valign="middle"><h2>Test output will display here</h2></td></tr>
- </table>
- </center>
+ <head>
+ <script type="text/javascript" src="querystring.js"></script>
+ <style>
+ html, body
+ {
+ font-family: Verdana, Arial, Helvetica, sans-serif;
+ font-size: 16px;
+ margin: 0px;
+ overflow: hidden;
+ }
+ </style>
+ </head>
+ <script type="text/javascript">
+ var qs = new Querystring();
+
+ var headID = document.getElementsByTagName("head")[0];
+ var cssNode = document.createElement('link');
+ cssNode.type = 'text/css';
+ cssNode.rel = 'stylesheet';
+ cssNode.href = qs.get("theme") + ".css";
+ cssNode.media = 'screen';
+ headID.appendChild(cssNode);
+ </script>
+ <body class="leftInnerContainer">
+ <center>
+ <table height="100%">
+ <tr><td valign="middle"><h2 class="headerLabel">Test output will display here</h2></td></tr>
+ </table>
+ </center>
+ </body>
</html>
View
43 server/WebContent/querystring.js
@@ -0,0 +1,43 @@
+/* Client-side access to querystring name=value pairs
+ Version 1.2.3
+ 22 Jun 2005
+ Adam Vandenberg
+*/
+function Querystring(qs) { // optionally pass a querystring to parse
+ this.params = new Object()
+ this.get=Querystring_get
+
+ if (qs == null)
+ qs=location.search.substring(1,location.search.length)
+
+ if (qs.length == 0) return
+
+// Turn <plus> back to <space>
+// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
+ qs = qs.replace(/\+/g, ' ')
+ var args = qs.split('&') // parse out name/value pairs separated via &
+
+// split out each name=value pair
+ for (var i=0;i<args.length;i++) {
+ var value;
+ var pair = args[i].split('=')
+ var name = unescape(pair[0])
+
+ if (pair.length == 2)
+ value = unescape(pair[1])
+ else
+ value = name
+
+ this.params[name] = value
+ }
+}
+
+function Querystring_get(key, default_) {
+ // This silly looking line changes UNDEFINED to NULL
+ if (default_ == null) default_ = null;
+
+ var value=this.params[key]
+ if (value==null) value=default_;
+
+ return value
+}
View
279 server/WebContent/readable.css
@@ -0,0 +1,279 @@
+/*
+Copyright (C) 2007 James Ward
+http://www.jamesward.org
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+global
+{
+ themeColor: #d6d6d6;
+ color: #444444;
+}
+
+Application
+{
+ backgroundColor: #ffffff;
+ backgroundGradientAlphas: 1.0, 1.0;
+ backgroundGradientColors: #ffffff, #ffffff;
+}
+
+.headerLabel
+{
+ fontWeight: bold;
+ fontSize: 12;
+ color: #444444;
+}
+
+.innerBackground
+{
+ backgroundColor: #e5e5e5;
+ borderThickness: 1;
+ borderColor: #d4d4d4;
+ borderStyle: solid;
+}
+
+.leftInnerContainer
+{
+ background-color: #eaeaea;
+ borderColor: #dadada;
+ borderThickness: 1;
+ borderStyle: solid;
+}
+
+.leftInnerContainerNoTopBorder
+{
+ backgroundColor: #eaeaea;
+ borderColor: #dadada;
+ borderThickness: 1;
+ borderStyle: solid;
+ borderSides: left,right,bottom;
+}
+
+.listItem
+{
+ color: #333333;
+}
+
+LabelLink
+{
+ linkColor: #444444;
+ linkHoverColor: #333333;
+}
+
+HRule
+{
+ strokeColor: #cecece;
+ strokeWidth: 1;
+}
+
+Button
+{
+ fontSize: 10;
+ fontWeight: bold;
+ textRollOverColor: #222222;
+ textSelectedColor: #222222;
+ disabledColor: #d7d7d7;
+ skin: ClassReference("com.jamesward.census2.skins.ButtonSkin");
+ upBorderColor: #dadada;
+ upInnerBorderGradientColors: #ebebeb, #f4f4f4;
+ upBackgroundGradientColors: #c6c6c6, #ececec;
+ overBorderColor: #dadada;
+ overInnerBorderGradientColors: #ebebeb, #f4f4f4;
+ overBackgroundGradientColors: #e9e9e9;
+ disabledBorderColor: #dadada;
+ disabledInnerBorderGradientColors: #ebebeb, #f4f4f4;
+ disabledBackgroundGradientColors: #d6d6d6, #fcfcfc;
+}
+
+CheckBox
+{
+ checkColor: #444444;
+ selectedCheckColor: #222222;
+ disabledCheckColor: #d7d7d7;
+ borderColor: #dadada;
+ innerBorderGradientColors: #ebebeb, #f4f4f4;
+ upBackgroundGradientColors: #c6c6c6, #ececec;
+ overBackgroundGradientColors: #e9e9e9;
+ downBackgroundGradientColors: #e9e9e9;
+ disabledBackgroundGradientColors: #c6c6c6, #ececec;
+ textRollOverColor: #444444;
+ textSelectedColor: #444444;
+ icon: ClassReference("com.jamesward.census2.skins.CheckBoxIcon");
+ leading: -1;
+}
+
+ScrollBar
+{
+ trackColors: #ececec, #efefef;
+ borderColor: #eeeeee;
+ backgroundColor: #eeeeee;
+ fillColors: #d6d6d6, #ececec;
+ fillAlphas: 1,1;
+ themeColor: #d6d6d6;
+ skin: ClassReference("com.jamesward.census2.skins.ScrollArrowSkin");
+}
+
+Alert
+{
+ backgroundColor: #c6c6c6;
+ borderColor: #c6c6c6;
+}
+
+.alertButtonStyle
+{
+ color: #444444;
+ textRollOverColor: #222222;
+ textSelectedColor: #222222;
+}
+
+TitleWindow
+{
+ backgroundColor: #c6c6c6;
+ borderColor: #c6c6c6;
+}
+
+ToolTip
+{
+ backgroundColor: #c6c6c6;
+}
+
+DataTip
+{
+ color: #444444;
+ paddingLeft: 4;
+ paddingRight: 4;
+ paddingBottom: 4;
+ backgroundColor: #c6c6c6;
+ fontSize: 12;
+}
+
+NumericStepper
+{
+ cornerRadius: 3;
+ backgroundColor: #eaeaea;
+ borderColor: #eeeeee;
+ disabledColor: #d7d7d7;
+ textRollOverColor: #222222;
+ textSelectedColor: #222222;
+ focusAlpha: 0;
+ focusThickness: 0;
+ borderThickness: 2;
+ borderColor: #dadada;
+ innerBorderColor: #f5f5f5;
+ backgroundGradientColors: #ebebeb, #f3f3f3;
+ upArrowBorderColor: #efefef;
+ upArrowUpHighlightColor: #c6c6c6;
+ upArrowPixelColor: #e6e6e6;
+ upArrowUpFillGradientColors: #d6d6d6, #dedede;
+ upArrowNotUpFillGradientColors: #eaeaea, #eeeeee;
+ downArrowBorderColor: #f5f5f5;
+ downArrowUpHighlightColor: #d0d0d0;
+ downArrowUpFillGradientColors: #e3e3e3, #ececec;
+ downArrowDownHighlightColor: #e1e1e1;
+ downArrowDownFillGradientColors: #eaeaea, #eeeeee;
+ downArrowSkin: ClassReference("com.jamesward.census2.skins.NumericStepperDownSkin");
+ upArrowSkin: ClassReference("com.jamesward.census2.skins.NumericStepperUpSkin");
+ borderSkin: ClassReference("com.jamesward.census2.skins.NumericStepperBorderSkin");
+}
+
+LegendItem
+{
+ fontWeight: bold;
+ fontSize: 10;
+}
+
+LinkBar
+{
+ color: #484848;
+ fontWeight: bold;
+ fontSize: 12;
+ separatorWidth: 0;
+ rollOverColor: #1a1a1a;
+ selectionColor: #1a1a1a;
+ textRollOverColor: #444444;
+ textSelectedColor: #444444;
+}
+
+LinkButton
+{
+ disabledColor: #444444;
+}
+
+List
+{
+ rollOverColor: #c9c9c9;
+ selectionColor: #c9c9c9;
+ textRollOverColor: #444444;
+ textSelectedColor: #444444;
+ themeColor: #d6d6d6;
+}
+
+TextInput
+{
+ cornerRadius: 3;
+ borderStyle: solid;
+}
+
+TabBar
+{
+ tabStyleName: "myTabs";
+ firstTabStyleName: "myTabs";
+ lastTabStyleName: "myTabs";
+}
+
+.myTabs
+{
+ fontSize: 10;
+ fontWeight: bold;
+ textRollOverColor: #222222;
+ textSelectedColor: #222222;
+ disabledColor: #d7d7d7;
+ skin: ClassReference("com.jamesward.census2.skins.ButtonSkin");
+ upBorderColor: #dadada;
+ upInnerBorderGradientColors: #ebebeb, #f4f4f4;
+ upBackgroundGradientColors: #c6c6c6, #ececec;
+ overBorderColor: #dadada;
+ overInnerBorderGradientColors: #ebebeb, #f4f4f4;
+ overBackgroundGradientColors: #e9e9e9;
+ disabledBorderColor: #dadada;
+ disabledInnerBorderGradientColors: #ebebeb, #f4f4f4;
+ disabledBackgroundGradientColors: #d6d6d6, #fcfcfc;
+}
+
+.tabDivider
+{
+ strokeWidth: 1;
+ strokeColor: #dadada;
+}
+
+StyledAxisRenderer
+{
+ showLine: false;
+ tickStrokeColor: #d4d4d4;
+ tickStrokeWeight: 1;
+}
+
+ChartBackgroundFill
+{
+ borderFillColor: #d4d4d4;
+ fillColor: #eaeaea;
+}
+
+ChartLegendCombo
+{
+ backgroundColor: #eaeaea;
+ borderColor: #d4d4d4;
+ rollOverColor: #c9c9c9;
+}
View
BIN  server/WebContent/readable.swf
Binary file not shown
View
279 server/WebContent/sexy.css
@@ -0,0 +1,279 @@
+/*
+Copyright (C) 2009 James Ward
+http://www.jamesward.com
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along
+with this program; if not, write to the Free Software Foundation, Inc.,
+51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+*/
+global
+{
+ themeColor: #292929;
+ color: #bbbbbb;
+}
+
+Application
+{
+ backgroundColor: #000000;
+ backgroundGradientAlphas: 1.0, 1.0;
+ backgroundGradientColors: #000000, #000000;
+}
+
+.headerLabel
+{
+ fontWeight: bold;
+ fontSize: 12;
+ color: #bbbbbb;
+}
+
+.innerBackground
+{
+ backgroundColor: #1a1a1a;
+ borderThickness: 1;
+ borderColor: #2b2b2b;
+ borderStyle: solid;
+}
+
+.leftInnerContainer
+{
+ background-color: #151515;
+ borderColor: #252525;
+ borderThickness: 1;
+ borderStyle: solid;
+}
+
+.leftInnerContainerNoTopBorder
+{
+ backgroundColor: #151515;
+ borderColor: #252525;
+ borderThickness: 1;
+ borderStyle: solid;
+ borderSides: left,right,bottom;
+}
+
+.listItem
+{
+ color: #cccccc;
+}
+
+LabelLink
+{
+ linkColor: #bbbbbb;
+ linkHoverColor: #cccccc;
+}
+
+HRule
+{
+ strokeColor: #313131;
+ strokeWidth: 1;
+}
+
+Button
+{
+ fontSize: 10;
+ fontWeight: bold;
+ textRollOverColor: #dddddd;
+ textSelectedColor: #dddddd;
+ disabledColor: #282828;
+ skin: ClassReference("com.jamesward.census2.skins.ButtonSkin");
+ upBorderColor: #252525;
+ upInnerBorderGradientColors: #141414, #0b0b0b;
+ upBackgroundGradientColors: #393939, #131313;
+ overBorderColor: #252525;
+ overInnerBorderGradientColors: #141414, #0b0b0b;
+ overBackgroundGradientColors: #161616;
+ disabledBorderColor: #252525;
+ disabledInnerBorderGradientColors: #141414, #0b0b0b;
+ disabledBackgroundGradientColors: #292929, #030303;
+}
+
+CheckBox
+{
+ checkColor: #bbbbbb;
+ selectedCheckColor: #dddddd;
+ disabledCheckColor: #282828;
+ borderColor: #252525;
+ innerBorderGradientColors: #141414, #0b0b0b;
+ upBackgroundGradientColors: #393939, #131313;
+ overBackgroundGradientColors: #161616;
+ downBackgroundGradientColors: #161616;
+ disabledBackgroundGradientColors: #393939, #131313;
+ textRollOverColor: #bbbbbb;
+ textSelectedColor: #bbbbbb;
+ icon: ClassReference("com.jamesward.census2.skins.CheckBoxIcon");
+ leading: -1;
+}
+
+ScrollBar
+{
+ trackColors: #131313, #101010;
+ borderColor: #0e0e0e;
+ backgroundColor: #0e0e0e;
+ fillColors: #292929, #131313;
+ fillAlphas: 1,1;
+ themeColor: #292929;
+ skin: ClassReference("com.jamesward.census2.skins.ScrollArrowSkin");
+}
+
+Alert
+{
+ backgroundColor: #393939;
+ borderColor: #393939;
+}
+
+.alertButtonStyle
+{
+ color: #bbbbbb;
+ textRollOverColor: #dddddd;
+ textSelectedColor: #dddddd;
+}
+
+TitleWindow
+{
+ backgroundColor: #393939;
+ borderColor: #393939;
+}
+
+ToolTip
+{
+ backgroundColor: #393939;
+}
+
+DataTip
+{
+ color: #bbbbbb;
+ paddingLeft: 4;
+ paddingRight: 4;
+ paddingBottom: 4;
+ backgroundColor: #393939;
+ fontSize: 12;
+}
+
+NumericStepper
+{
+ cornerRadius: 3;
+ backgroundColor: #151515;
+ borderColor: #111111;
+ disabledColor: #282828;
+ textRollOverColor: #dddddd;
+ textSelectedColor: #dddddd;
+ focusAlpha: 0;
+ focusThickness: 0;
+ borderThickness: 2;
+ borderColor: #252525;
+ innerBorderColor: #0a0a0a;
+ backgroundGradientColors: #141414, #0c0c0c;
+ upArrowBorderColor: #101010;
+ upArrowUpHighlightColor: #393939;
+ upArrowPixelColor: #191919;
+ upArrowUpFillGradientColors: #292929, #212121;
+ upArrowNotUpFillGradientColors: #151515, #111111;
+ downArrowBorderColor: #0a0a0a;
+ downArrowUpHighlightColor: #2f2f2f;
+ downArrowUpFillGradientColors: #1c1c1c, #131313;
+ downArrowDownHighlightColor: #1e1e1e;
+ downArrowDownFillGradientColors: #151515, #111111;
+ downArrowSkin: ClassReference("com.jamesward.census2.skins.NumericStepperDownSkin");
+ upArrowSkin: ClassReference("com.jamesward.census2.skins.NumericStepperUpSkin");
+ borderSkin: ClassReference("com.jamesward.census2.skins.NumericStepperBorderSkin");
+}
+
+LegendItem
+{
+ fontWeight: bold;
+ fontSize: 10;
+}
+
+LinkBar
+{
+ color: #484848;
+ fontWeight: bold;
+ fontSize: 12;
+ separatorWidth: 0;
+ rollOverColor: #1a1a1a;
+ selectionColor: #1a1a1a;
+ textRollOverColor: #bbbbbb;
+ textSelectedColor: #bbbbbb;
+}
+
+LinkButton
+{
+ disabledColor: #bbbbbb;
+}
+
+List
+{
+ rollOverColor: #363636;
+ selectionColor: #363636;
+ textRollOverColor: #bbbbbb;
+ textSelectedColor: #bbbbbb;
+ themeColor: #292929;
+}
+
+TextInput
+{
+ cornerRadius: 3;
+ borderStyle: solid;
+}
+
+TabBar
+{
+ tabStyleName: "myTabs";
+ firstTabStyleName: "myTabs";
+ lastTabStyleName: "myTabs";
+}
+
+.myTabs
+{
+ fontSize: 10;
+ fontWeight: bold;
+ textRollOverColor: #dddddd;
+ textSelectedColor: #dddddd;
+ disabledColor: #282828;
+ skin: ClassReference("com.jamesward.census2.skins.ButtonSkin");
+ upBorderColor: #252525;
+ upInnerBorderGradientColors: #141414, #0b0b0b;
+ upBackgroundGradientColors: #393939, #131313;
+ overBorderColor: #252525;
+ overInnerBorderGradientColors: #141414, #0b0b0b;
+ overBackgroundGradientColors: #161616;
+ disabledBorderColor: #252525;
+ disabledInnerBorderGradientColors: #141414, #0b0b0b;
+ disabledBackgroundGradientColors: #292929, #030303;
+}
+
+.tabDivider
+{
+ strokeWidth: 1;
+ strokeColor: #252525;
+}
+
+StyledAxisRenderer
+{
+ showLine: false;
+ tickStrokeColor: #2b2b2b;
+ tickStrokeWeight: 1;
+}
+
+ChartBackgroundFill
+{
+ borderFillColor: #2b2b2b;
+ fillColor: #151515;
+}
+
+ChartLegendCombo
+{
+ backgroundColor: #151515;
+ borderColor: #2b2b2b;
+ rollOverColor: #363636;
+}
View
BIN  server/WebContent/sexy.swf
Binary file not shown
View
12 server/WebContent/tests.xml
@@ -3,19 +3,25 @@
<id>flex_amf3</id>
<name>Flex AMF3</name>
<url>http://localhost:8080/census2-tests/flex_amf3.html</url>
- <description>Flex with AMF3 Remoting</description>
+ <description>Flex AMF3 Remoting</description>
</test>
<test>
<id>flex_xml_as</id>
<name>Flex XML AS</name>
<url>http://localhost:8080/census2-tests/flex_xml_as.html</url>
- <description>XML to AS Objects</description>
+ <description>Flex XML to AS Objects</description>
</test>
<test>
<id>flex_soap_as</id>
<name>Flex SOAP AS</name>
<url>http://localhost:8080/census2-tests/flex_soap_as.html</url>
- <description>SOAP to AS Objects</description>
+ <description>Flex SOAP to AS Objects</description>
+ </test>
+ <test>
+ <id>flex_soap_e4x</id>
+ <name>Flex SOAP E4X</name>
+ <url>http://localhost:8080/census2-tests/flex_soap_e4x.html</url>
+ <description>Flex SOAP to E4X</description>
</test>
<test>
<id>ajax_html</id>
View
220 server/src/com/jamesward/census2/CensusResult.java
@@ -0,0 +1,220 @@
+package com.jamesward.census2;
+
+import java.util.Date;
+
+public class CensusResult
+{
+
+ public CensusResult()
+ {
+ }
+
+ public CensusResult(String ipAddress, String testId, String resultType, Integer resultData, Boolean gzip, Integer numRows)
+ {
+ setCreateDate(new Date());
+ setIpAddress(ipAddress);
+ setTestId(testId);
+ setResultType(resultType);
+ setResultData(resultData);
+ setGzip(gzip);
+ setNumRows(numRows);
+ }
+
+ @Override
+ public int hashCode()
+ {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result
+ + ((createDate == null) ? 0 : createDate.hashCode());
+ result = prime * result + ((fpVersion == null) ? 0 : fpVersion.hashCode());
+ result = prime * result + ((gzip == null) ? 0 : gzip.hashCode());
+ result = prime * result + ((ipAddress == null) ? 0 : ipAddress.hashCode());
+ result = prime * result + ((numRows == null) ? 0 : numRows.hashCode());
+ result = prime * result + ((os == null) ? 0 : os.hashCode());
+ result = prime * result
+ + ((resultData == null) ? 0 : resultData.hashCode());
+ result = prime * result
+ + ((resultType == null) ? 0 : resultType.hashCode());
+ result = prime * result + ((testId == null) ? 0 : testId.hashCode());
+ return result;
+ }
+
+ @Override
+ public boolean equals(Object obj)
+ {
+ if (this == obj)
+ return true;
+ if (obj == null)
+ return false;
+ if (getClass() != obj.getClass())
+ return false;
+ CensusResult other = (CensusResult) obj;
+ if (createDate == null)
+ {
+ if (other.createDate != null)
+ return false;
+ } else if (!createDate.equals(other.createDate))
+ return false;
+ if (fpVersion == null)
+ {
+ if (other.fpVersion != null)
+ return false;
+ } else if (!fpVersion.equals(other.fpVersion))
+ return false;
+ if (gzip == null)
+ {
+ if (other.gzip != null)
+ return false;
+ } else if (!gzip.equals(other.gzip))
+ return false;
+ if (ipAddress == null)
+ {
+ if (other.ipAddress != null)
+ return false;
+ } else if (!ipAddress.equals(other.ipAddress))
+ return false;
+ if (numRows == null)
+ {
+ if (other.numRows != null)
+ return false;
+ } else if (!numRows.equals(other.numRows))
+ return false;
+ if (os == null)
+ {
+ if (other.os != null)
+ return false;
+ } else if (!os.equals(other.os))
+ return false;
+ if (resultData == null)
+ {
+ if (other.resultData != null)
+ return false;
+ } else if (!resultData.equals(other.resultData))
+ return false;
+ if (resultType == null)
+ {
+ if (other.resultType != null)
+ return false;
+ } else if (!resultType.equals(other.resultType))
+ return false;
+ if (testId == null)
+ {
+ if (other.testId != null)
+ return false;
+ } else if (!testId.equals(other.testId))
+ return false;
+ return true;
+ }
+
+ public Date getCreateDate()
+ {
+ return createDate;
+ }
+
+ public void setCreateDate(Date createDate)
+ {
+ this.createDate = createDate;
+ }
+
+ public String getIpAddress()
+ {
+ return ipAddress;
+ }
+
+ public void setIpAddress(String ipAddress)
+ {
+ this.ipAddress = ipAddress;
+ }
+
+ public String getTestId()
+ {
+ return testId;
+ }
+
+ public void setTestId(String testId)
+ {
+ this.testId = testId;
+ }
+
+ public String getResultType()
+ {
+ return resultType;
+ }
+
+ public void setResultType(String resultType)
+ {
+ this.resultType = resultType;
+ }
+
+ public Integer getResultData()
+ {
+ return resultData;
+ }
+
+ public void setResultData(Integer resultData)
+ {
+ this.resultData = resultData;
+ }
+
+ public String getOs()
+ {
+ return os;
+ }
+
+ public void setOs(String os)
+ {
+ this.os = os;
+ }
+
+ public String getFpVersion()
+ {
+ return fpVersion;
+ }
+
+ public void setFpVersion(String fpVersion)
+ {
+ this.fpVersion = fpVersion;
+ }
+
+ public Boolean getGzip()
+ {
+ return gzip;
+ }
+
+ public void setGzip(Boolean gzip)
+ {
+ this.gzip = gzip;
+ }
+
+ public Integer getNumRows()
+ {
+ return numRows;
+ }
+
+ public void setNumRows(Integer numRows)
+ {
+ this.numRows = numRows;
+ }
+
+
+
+ private Date createDate;
+
+ private String ipAddress;
+
+ private String testId;
+
+ private String resultType;
+
+ private Integer resultData;
+
+ private String os;
+
+ private String fpVersion;
+
+ private Boolean gzip;
+
+ private Integer numRows;
+
+}
View
141 server/src/com/jamesward/census2/CensusResultService.java
@@ -0,0 +1,141 @@
+package com.jamesward.census2;
+
+import java.util.ArrayList;
+import java.util.Hashtable;
+import java.util.Iterator;
+import java.util.List;
+
+import com.db4o.ObjectContainer;
+import com.db4o.ObjectSet;
+
+import flex.messaging.FlexContext;
+
+public class CensusResultService
+{
+
+ // return the average results for a test
+ public Hashtable<String, Integer> getAverageResults(String testId, Boolean gzip, Integer numRows)
+ {
+ Hashtable<String, ArrayList<Integer>> allResults = new Hashtable<String, ArrayList<Integer>>();
+
+ ObjectContainer db4oServer = (ObjectContainer)FlexContext.getServletContext().getAttribute(Db4oServletContextListener.KEY_DB4O_SERVER);
+ CensusResult searchCensusResult = new CensusResult();
+ searchCensusResult.setTestId(testId);
+ searchCensusResult.setNumRows(numRows);
+ searchCensusResult.setGzip(gzip);
+ ObjectSet<CensusResult> results = db4oServer.queryByExample(searchCensusResult);
+
+ while (results.hasNext())
+ {
+ CensusResult result = (CensusResult)results.next();
+ if (allResults.get(result.getResultType()) == null)
+ {
+ allResults.put(result.getResultType(), new ArrayList<Integer>());
+ }
+
+ allResults.get(result.getResultType()).add(result.getResultData());
+ }
+
+ Hashtable<String, Integer> averageResults = new Hashtable<String, Integer>();
+
+ Iterator<String> keys = allResults.keySet().iterator();
+
+ while (keys.hasNext())
+ {
+ Integer total = 0;
+ String resultType = keys.next();
+ ArrayList<Integer> r = allResults.get(resultType);
+ for (int i = 0; i < r.size(); i++)
+ {
+ total += r.get(i);
+ }
+ averageResults.put(resultType, total / r.size());
+ }
+
+ return averageResults;
+ }
+
+ //get the results for each unique entry and assemble everything into a single hashmap like:
+ // {ip: 123.123.123.123; testId: flex_amf; gzip: true; numRows: 5000; transferTime: 4321; parseTime: 321 ...}
+ public List<Hashtable<String, Object>> getAllResults()
+ {
+ ArrayList<Hashtable<String, Object>> allResults = new ArrayList<Hashtable<String, Object>>();
+
+ ObjectContainer db4oServer = (ObjectContainer)FlexContext.getServletContext().getAttribute(Db4oServletContextListener.KEY_DB4O_SERVER);
+
+ ObjectSet<CensusResult> allCensusResults = db4oServer.query(CensusResult.class);
+
+ Hashtable<CensusResult, List<CensusResult>> groupedResults = new Hashtable<CensusResult, List<CensusResult>>();
+
+ // group the rows together into items that have a common ip, testId, gzip, and numRows
+ while (allCensusResults.hasNext())
+ {
+ CensusResult result = (CensusResult)allCensusResults.next();
+
+ CensusResult key = new CensusResult();
+ key.setIpAddress(result.getIpAddress());
+ key.setTestId(result.getTestId());
+ key.setGzip(result.getGzip());
+ key.setNumRows(result.getNumRows());
+
+ List<CensusResult> r = groupedResults.get(key);
+ if (r == null)
+ {
+ r = new ArrayList<CensusResult>();
+ groupedResults.put(key, r);
+ }
+
+ r.add(result);
+
+ }
+
+
+ // expand out the grouped items into an object per grouped item
+
+ Iterator<CensusResult> keys = groupedResults.keySet().iterator();
+
+ while (keys.hasNext())
+ {
+ CensusResult r = keys.next();
+
+ Hashtable<String, Object> item = new Hashtable<String, Object>();
+
+ item.put("ipAddress", r.getIpAddress());
+ item.put("testId", r.getTestId());
+ item.put("gzip", r.getGzip());
+ item.put("numRows", r.getNumRows());
+
+ List<CensusResult> ra = groupedResults.get(r);
+ Iterator <CensusResult> rai = ra.iterator();
+
+ while (rai.hasNext())
+ {
+ CensusResult cr = rai.next();
+ item.put(cr.getResultType(), cr.getResultData());
+ }
+
+ allResults.add(item);
+ }
+
+ return allResults;
+ }
+
+ public List<CensusResult> getAllRawResults()
+ {
+ ArrayList<CensusResult> allRawResults = new ArrayList<CensusResult>();
+
+ ObjectContainer db4oServer = (ObjectContainer)FlexContext.getServletContext().getAttribute(Db4oServletContextListener.KEY_DB4O_SERVER);
+
+ ObjectSet<CensusResult> allCensusResults = db4oServer.query(CensusResult.class);
+
+ while (allCensusResults.hasNext())
+ {
+ CensusResult result = (CensusResult)allCensusResults.next();
+
+ allRawResults.add(result);
+ }
+
+ return allRawResults;
+ }
+
+}
View
43 server/src/com/jamesward/census2/Db4oServletContextListener.java
@@ -0,0 +1,43 @@
+package com.jamesward.census2;
+
+import javax.servlet.ServletContext;
+import javax.servlet.ServletContextEvent;
+import javax.servlet.ServletContextListener;
+
+import com.db4o.Db4oEmbedded;
+import com.db4o.ObjectContainer;
+
+public class Db4oServletContextListener implements ServletContextListener
+{
+ public static final String KEY_DB4O_FILE_NAME = "db4oFileName";
+ public static final String KEY_DB4O_SERVER = "db4oServer";
+
+ private ObjectContainer server = null;
+
+ public void contextInitialized(ServletContextEvent event)
+ {
+ close();
+ ServletContext context = event.getServletContext();
+ String filePath = context.getRealPath("WEB-INF/db/" + context.getInitParameter(KEY_DB4O_FILE_NAME));
+ server = Db4oEmbedded.openFile(Db4oEmbedded.newConfiguration(), filePath);
+ context.setAttribute(KEY_DB4O_SERVER, server);
+ context.log("db4o startup on " + filePath);
+ }
+
+ public void contextDestroyed(ServletContextEvent event)
+ {
+ ServletContext context = event.getServletContext();
+ context.removeAttribute(KEY_DB4O_SERVER);
+ close();
+ context.log("db4o shutdown");
+ }
+
+ private void close()
+ {
+ if (server != null)
+ {
+ server.close();
+ }
+ server = null;
+ }
+}
View
52 server/src/com/jamesward/census2/SendCensusResult.java
@@ -9,6 +9,9 @@
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
+import com.db4o.ObjectContainer;
+import com.db4o.ObjectSet;
+
import flex.messaging.MessageBroker;
import flex.messaging.messages.AsyncMessage;
import flex.messaging.util.UUIDUtils;
@@ -23,36 +26,51 @@ public void doGet(HttpServletRequest request, HttpServletResponse response)
String clientId = request.getParameter("clientId");
String testId = request.getParameter("testId");
String resultType = request.getParameter("resultType");
- Integer resultData;
- String resultDataString = request.getParameter("resultData");
+ Boolean gzip = false;
- if (resultDataString.equals("true"))
- {
- resultData = 1;
- }
- else if (resultDataString.equals("false"))
- {
- resultData = 0;
- }
- else
+ if (request.getParameter("gzip").equals("true"))
{
- resultData = Integer.parseInt(resultDataString);
+ gzip = true;
}
+
+ Integer numRows = Integer.parseInt(request.getParameter("numRows"));
+ Integer resultData = Integer.parseInt(request.getParameter("resultData"));
+
- if ((clientId == null) || (testId == null) || (resultType == null)
- || (resultData == null) || (clientId.length() <= 0)
- || (testId.length() <= 0) || (resultType.length() <= 0))
+ if ((clientId == null) || (testId == null) || (resultType == null) ||
+ (resultData == null) || (gzip == null) || (numRows == null) ||
+ (clientId.length() <= 0) || (testId.length() <= 0) || (resultType.length() <= 0))
{
throw new ServletException("data not sent correctly!");
}
else
{
+ // save the results to DB
+ CensusResult newCensusResult = new CensusResult(request.getRemoteAddr(), testId, resultType, resultData, gzip, numRows);
+
+ ObjectContainer db4oServer = (ObjectContainer)getServletContext().getAttribute(Db4oServletContextListener.KEY_DB4O_SERVER);
+ // check for dups - only allow one entry per IP per testId per resultType
+ CensusResult searchCensusResult = new CensusResult();
+ searchCensusResult.setIpAddress(newCensusResult.getIpAddress());
+ searchCensusResult.setTestId(newCensusResult.getTestId());
+ searchCensusResult.setResultType(newCensusResult.getResultType());
+ searchCensusResult.setGzip(gzip);
+ searchCensusResult.setNumRows(numRows);
+ ObjectSet<CensusResult> result = db4oServer.queryByExample(searchCensusResult);
+ while (result.hasNext())
+ {
+ db4oServer.delete(result.next());
+ }
+ db4oServer.store(newCensusResult);
+ db4oServer.commit();
+
+ // send result to client
Hashtable<String, Object> body = new Hashtable<String, Object>();
body.put("testId", testId);
body.put("resultType", resultType);
body.put("resultData", resultData);
-
+
AsyncMessage msg = new AsyncMessage();
msg.setClientId(UUIDUtils.createUUID(false));
@@ -61,7 +79,7 @@ else if (resultDataString.equals("false"))
msg.setHeader(AsyncMessage.SUBTOPIC_HEADER_NAME, clientId);
- msg.setDestination("censusResultsDestination");
+ msg.setDestination("CensusResultsDestination");
msg.setTimestamp(System.currentTimeMillis());
msg.setBody(body);
Please sign in to comment.
Something went wrong with that request. Please try again.