[kune-commits] r1178 - in trunk: . img/webtemplate script src/main/java/cc/kune src/main/java/cc/kune/core src/main/java/cc/kune/core/client src/main/java/cc/kune/core/client/errors src/main/java/cc/kune/core/client/i18n src/main/java/cc/kune/core/client/init src/main/java/cc/kune/core/client/notify src/main/java/cc/kune/core/client/notify/alerts src/main/java/cc/kune/core/client/notify/confirm src/main/java/cc/kune/core/client/notify/msgs src/main/java/cc/kune/core/client/notify/spiner src/main/java/cc/kune/core/client/state src/main/java/cc/kune/core/public src/main/java/cc/kune/core/public/images src/main/java/cc/kune/msgs src/main/java/cc/kune/msgs/client src/main/java/cc/kune/msgs/client/msgs src/main/java/cc/kune/msgs/client/panel src/main/java/cc/kune/msgs/client/resources src/main/java/cc/kune/msgs/public src/main/java/org/ourproject/kune/app/server src/main/java/org/ourproject/kune/app/server/wave src/main/java/org/ourproject/kune/rack src/main/java/org/ourproject/kune/rack/filters src/main/java/org/ourproject/kune/rack/filters/servlet src/main/resources src/main/webapp/WEB-INF
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Sun Jan 9 05:44:26 CET 2011
Author: vjrj_
Date: 2011-01-09 05:44:25 +0100 (Sun, 09 Jan 2011)
New Revision: 1178
Added:
trunk/src/main/java/cc/kune/core/client/i18n/I18nReadyEvent.java
trunk/src/main/java/cc/kune/core/client/init/AppStartEvent.java
trunk/src/main/java/cc/kune/core/client/init/AppStopEvent.java
trunk/src/main/java/cc/kune/core/client/notify/alerts/
trunk/src/main/java/cc/kune/core/client/notify/alerts/AlertEvent.java
trunk/src/main/java/cc/kune/core/client/notify/alerts/UserAlerterPresenter.java
trunk/src/main/java/cc/kune/core/client/notify/alerts/UserAlerterViewImpl.java
trunk/src/main/java/cc/kune/core/client/notify/confirm/
trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPresenter.java
trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmViewImpl.java
trunk/src/main/java/cc/kune/core/client/notify/msgs/
trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifierPresenter.java
trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifierViewImpl.java
trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifyEvent.java
trunk/src/main/java/cc/kune/core/client/notify/spiner/
trunk/src/main/java/cc/kune/core/client/notify/spiner/ProgressHideEvent.java
trunk/src/main/java/cc/kune/core/client/notify/spiner/ProgressShowEvent.java
trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerPresenter.java
trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerViewImpl.java
trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerViewImpl.ui.xml
trunk/src/main/java/cc/kune/core/client/state/UserSignInEvent.java
trunk/src/main/java/cc/kune/core/client/state/UserSignOutEvent.java
trunk/src/main/java/cc/kune/msgs/
trunk/src/main/java/cc/kune/msgs/KuneMsgs.gwt.xml
trunk/src/main/java/cc/kune/msgs/KuneMsgsTests.gwt.xml
trunk/src/main/java/cc/kune/msgs/client/
trunk/src/main/java/cc/kune/msgs/client/KuneMessagesSampleEntryPoint.java
trunk/src/main/java/cc/kune/msgs/client/msgs/
trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessage.java
trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessage.ui.xml
trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessageLevel.java
trunk/src/main/java/cc/kune/msgs/client/panel/
trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPanel.java
trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPanel.ui.xml
trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPresenter.java
trunk/src/main/java/cc/kune/msgs/client/resources/
trunk/src/main/java/cc/kune/msgs/client/resources/UserMessageImages.java
trunk/src/main/java/cc/kune/msgs/client/resources/error.png
trunk/src/main/java/cc/kune/msgs/client/resources/important.png
trunk/src/main/java/cc/kune/msgs/client/resources/info.png
trunk/src/main/java/cc/kune/msgs/client/resources/remove-grey.png
trunk/src/main/java/cc/kune/msgs/client/resources/remove-over.png
trunk/src/main/java/cc/kune/msgs/client/resources/remove.png
trunk/src/main/java/cc/kune/msgs/client/resources/severe.png
trunk/src/main/java/cc/kune/msgs/client/resources/warning.png
trunk/src/main/java/cc/kune/msgs/public/
trunk/src/main/java/cc/kune/msgs/public/kune-message.css
trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcControllerImpl.java
trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcProvider.java
trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcProviderSamePort.java
trunk/src/main/java/org/ourproject/kune/app/server/wave/Trio.java
trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveModule.java
trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveStarter.java
trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveStarterModule.java
Removed:
trunk/src/main/java/cc/kune/core/client/i18n/I18nReady.java
trunk/src/main/java/cc/kune/core/client/init/AppStart.java
trunk/src/main/java/cc/kune/core/client/init/AppStop.java
trunk/src/main/java/cc/kune/core/client/notify/Alert.java
trunk/src/main/java/cc/kune/core/client/notify/ProgressHide.java
trunk/src/main/java/cc/kune/core/client/notify/ProgressShow.java
trunk/src/main/java/cc/kune/core/client/notify/SpinerPresenter.java
trunk/src/main/java/cc/kune/core/client/notify/SpinerViewImpl.java
trunk/src/main/java/cc/kune/core/client/notify/SpinerViewImpl.ui.xml
trunk/src/main/java/cc/kune/core/client/notify/UserNotifierPresenter.java
trunk/src/main/java/cc/kune/core/client/notify/UserNotifierViewImpl.java
trunk/src/main/java/cc/kune/core/client/notify/UserNotify.java
trunk/src/main/java/cc/kune/core/client/state/UserSignIn.java
trunk/src/main/java/cc/kune/core/client/state/UserSignOut.java
Modified:
trunk/TODO
trunk/img/webtemplate/web_template-2011.svg
trunk/pom.xml
trunk/script/css-update.sh
trunk/script/mvn-eclipse.sh
trunk/src/main/java/cc/kune/Kune.gwt.xml
trunk/src/main/java/cc/kune/core/Core.gwt.xml
trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
trunk/src/main/java/cc/kune/core/client/CoreGinjector.java
trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java
trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java
trunk/src/main/java/cc/kune/core/client/state/ContentProviderDefault.java
trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
trunk/src/main/java/cc/kune/core/public/images/kune-logo-16px.png
trunk/src/main/java/cc/kune/core/public/ws.html
trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java
trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java
trunk/src/main/java/org/ourproject/kune/rack/filters/AbstractInjectedFilter.java
trunk/src/main/java/org/ourproject/kune/rack/filters/servlet/ServletServiceFilter.java
trunk/src/main/resources/wave-server.properties
trunk/src/main/webapp/WEB-INF/web.xml
Log:
NEW - # 10: Wave server code update
http://kune.ourproject.org/issues/ticket/10
NEW - # 11: New messages widget
http://kune.ourproject.org/issues/ticket/11
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/TODO 2011-01-09 04:44:25 UTC (rev 1178)
@@ -231,6 +231,11 @@
** vjrj <v> IconHyperlink.java and IconLabel.java to gwt1.5
* MID-TERM
+** TODO junit + guice utils:
+https://code.google.com/p/guiceberry/
+https://code.google.com/p/atunit/
+** TODO Study OSGI + guice:
+https://code.google.com/p/peaberry/
** Use hibernate cache
http://ehcache.sourceforge.net/documentation/openjpa_provider.html
http://ehcache.sourceforge.net/documentation/hibernate.html
Modified: trunk/img/webtemplate/web_template-2011.svg
===================================================================
--- trunk/img/webtemplate/web_template-2011.svg 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/img/webtemplate/web_template-2011.svg 2011-01-09 04:44:25 UTC (rev 1178)
@@ -52,15 +52,15 @@
inkscape:pageopacity="0"
inkscape:pageshadow="2"
inkscape:zoom="1"
- inkscape:cx="174.00056"
- inkscape:cy="641.30184"
+ inkscape:cx="475.0028"
+ inkscape:cy="695.87654"
inkscape:current-layer="layer1"
inkscape:document-units="px"
showgrid="false"
inkscape:window-width="1280"
- inkscape:window-height="977"
+ inkscape:window-height="745"
inkscape:window-x="0"
- inkscape:window-y="20"
+ inkscape:window-y="1024"
inkscape:window-maximized="1"
inkscape:snap-bbox="true"
inkscape:bbox-paths="true"
@@ -2209,7 +2209,7 @@
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<rect
- style="color:#000000;fill:#feb295;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ style="color:#000000;fill:#a40603;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect4635"
width="87.859406"
height="19.905512"
@@ -2305,7 +2305,7 @@
id="g5365">
<path
transform="matrix(0.102065,0,0,0.102065,387.7515,-17.05636)"
- d="m 277.35793,332.62314 a 26.82268,26.82268 0 1 1 -53.64536,0 26.82268,26.82268 0 1 1 53.64536,0 z"
+ d="m 277.35793,332.62314 c 0,14.81376 -12.00893,26.82268 -26.82268,26.82268 -14.81376,0 -26.82268,-12.00892 -26.82268,-26.82268 0,-14.81376 12.00892,-26.82268 26.82268,-26.82268 14.81375,0 26.82268,12.00892 26.82268,26.82268 z"
sodipodi:ry="26.82268"
sodipodi:rx="26.82268"
sodipodi:cy="332.62314"
@@ -2315,7 +2315,7 @@
sodipodi:type="arc" />
<path
transform="matrix(0.05245387,0,0,0.05245387,400.1808,-0.554549)"
- d="m 277.35793,332.62314 a 26.82268,26.82268 0 1 1 -53.64536,0 26.82268,26.82268 0 1 1 53.64536,0 z"
+ d="m 277.35793,332.62314 c 0,14.81376 -12.00893,26.82268 -26.82268,26.82268 -14.81376,0 -26.82268,-12.00892 -26.82268,-26.82268 0,-14.81376 12.00892,-26.82268 26.82268,-26.82268 14.81375,0 26.82268,12.00892 26.82268,26.82268 z"
sodipodi:ry="26.82268"
sodipodi:rx="26.82268"
sodipodi:cy="332.62314"
@@ -2360,7 +2360,7 @@
inkscape:export-xdpi="90"
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/webtemplate/web_template-2011.png"
y="132.04793"
- x="399.09167"
+ x="402.09167"
height="1"
width="122"
id="rect5387"
@@ -2371,7 +2371,7 @@
id="rect5389"
width="112.5"
height="1"
- x="536.09167"
+ x="541.09167"
y="-133.04793"
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/webtemplate/web_template-2011.png"
inkscape:export-xdpi="90"
@@ -2640,7 +2640,7 @@
transform="translate(-751,-12)">
<path
transform="translate(0,-3)"
- d="m 333,232 a 11,11 0 1 1 -22,0 11,11 0 1 1 22,0 z"
+ d="m 333,232 c 0,6.07513 -4.92487,11 -11,11 -6.07513,0 -11,-4.92487 -11,-11 0,-6.07513 4.92487,-11 11,-11 6.07513,0 11,4.92487 11,11 z"
sodipodi:ry="11"
sodipodi:rx="11"
sodipodi:cy="232"
@@ -3347,7 +3347,7 @@
inkscape:export-xdpi="90"
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/webtemplate/web_template-2011.png"
y="-133.04793"
- x="663.09167"
+ x="666.09167"
height="1"
width="48.90947"
id="rect23163"
@@ -3355,7 +3355,7 @@
transform="scale(1,-1)" />
<image
y="117.04793"
- x="710.00116"
+ x="715.00116"
id="image24737"
xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAJ1JREFU OI3dkjEKxCAQRX9EmWIOYJEu9opFyB28cU5hmVukFwW32rC7MWHZFIH93f/MPPjDdLXWigsSV5b/ BCA/g5QS5nlGKQWv9xVCIIQAIjoHEBH6vkeM8S333u+WgYMKzjkw8+aZGdbaZoUmQEqJaZo2P44j lFJNwK7CU8MwYFkWlFJgjDkaQ3f2ieu6IucMrfVvgG90/yPdD3gAkHQqk0hfw2IAAAAASUVORK5C YII= "
height="16"
@@ -4443,15 +4443,7 @@
y="112.88816"
x="135.45085"
id="image4632"
- xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAV5JREFU
-OI2lk01OAkEQhb8axgGG30EiEEiMLoxuvK1X8ABewDsQdy4gBhNiJgg4IuhMl4vWAQSFxFp2+n2v
-XnW1mJsr5R/l/jyQSh3qbai1oVhFb6/3B0jnDDrnUArAcTZvOw4Ysx0grRM4uQTXQx/vkXAAk3CD
-IRkXTeJ1gJQC6FxAxoX+HfS6bB2MMeB5FvI+t00BELQg56PDPtrr/pmZJIaMi2TcJUArddteOPhb
-DKgaEAe83BIgfhmSD5huZt4aAyyE7yEakx7sVQcemGQlwssI1IBf3qkVL2fNkhWARCPbRdDc7Z7N
-W4CaJYDREH0dQ62JNI5/d/fLkC9Z8dczugA6myJPD2jrFI6OES8P09BGAyRXhKwPhbIVLmbpMqWb
-qOEASWI4bKGlGhSq0IgRk9i8SQzzCKIx+halXa39BX0eIvMIKVTtQL2sFc8msHiD2TTdwK0AwNJX
-HHbVJ0YdhWYwKlACAAAAAElFTkSuQmCC
-"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAV5JREFU OI2lk01OAkEQhb8axgGG30EiEEiMLoxuvK1X8ABewDsQdy4gBhNiJgg4IuhMl4vWAQSFxFp2+n2v XnW1mJsr5R/l/jyQSh3qbai1oVhFb6/3B0jnDDrnUArAcTZvOw4Ysx0grRM4uQTXQx/vkXAAk3CD IRkXTeJ1gJQC6FxAxoX+HfS6bB2MMeB5FvI+t00BELQg56PDPtrr/pmZJIaMi2TcJUArddteOPhb DKgaEAe83BIgfhmSD5huZt4aAyyE7yEakx7sVQcemGQlwssI1IBf3qkVL2fNkhWARCPbRdDc7Z7N W4CaJYDREH0dQ62JNI5/d/fLkC9Z8dczugA6myJPD2jrFI6OES8P09BGAyRXhKwPhbIVLmbpMqWb qOEASWI4bKGlGhSq0IgRk9i8SQzzCKIx+halXa39BX0eIvMIKVTtQL2sFc8msHiD2TTdwK0AwNJX HHbVJ0YdhWYwKlACAAAAAElFTkSuQmCC "
height="16"
width="16" />
<text
@@ -4470,12 +4462,194 @@
sodipodi:role="line"
style="font-size:16px;font-weight:bold;-inkscape-font-specification:Ubuntu Bold">Loading</tspan></text>
<rect
- style="color:#000000;fill:#feb295;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ style="color:#000000;fill:#a40603;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect4721"
width="87.663948"
height="3.7137473"
x="130.07883"
y="111.25339" />
+ <rect
+ style="color:#000000;fill:#501616;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="rect4526"
+ width="13"
+ height="6"
+ x="17"
+ y="139" />
+ <g
+ id="g4532"
+ style="fill:#892c00;fill-opacity:1;opacity:0.85">
+ <rect
+ rx="5"
+ ry="5"
+ y="110.34837"
+ x="4.9808998"
+ height="182.65163"
+ width="322.0191"
+ id="rect4520"
+ style="color:#000000;fill:#892c00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <rect
+ y="110.5"
+ x="5"
+ height="45"
+ width="71"
+ id="rect4522"
+ style="color:#000000;fill:#892c00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <rect
+ style="color:#000000;fill:#892c00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="rect4528"
+ width="71"
+ height="45"
+ x="5"
+ y="247.5" />
+ <rect
+ y="110.5"
+ x="256"
+ height="45"
+ width="71"
+ id="rect4530"
+ style="color:#000000;fill:#892c00;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ </g>
+ <rect
+ style="opacity:0.79000004999999984;color:#000000;fill:#fff0e6;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:2;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="rect4538"
+ width="294.9017"
+ height="42"
+ x="17"
+ y="141"
+ ry="3"
+ rx="3" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#rect4538"
+ id="use4540"
+ transform="translate(0,49)"
+ width="1024"
+ height="768" />
+ <use
+ x="0"
+ y="0"
+ xlink:href="#use4540"
+ id="use4542"
+ transform="translate(0,49)"
+ width="1024"
+ height="768" />
+ <text
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/webtemplate/web_template-2011.png"
+ xml:space="preserve"
+ style="font-size:20px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:100%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;color:#000000;fill:#ffe9da;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Ubuntu;-inkscape-font-specification:Ubuntu Bold"
+ x="15.226257"
+ y="133.22296"
+ id="text4548"
+ sodipodi:linespacing="100%"><tspan
+ id="tspan4550"
+ sodipodi:role="line"
+ x="15.226257"
+ y="133.22296">Messages</tspan></text>
+ <image
+ y="140"
+ x="17"
+ id="image5750"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAWpJREFU
+OI3V07svw1EUB/Bv65FqtKrUY0A8QjQIaRCbgUZSoQkSiSYSj8mASEgHg8dfYDWRWjvUahAj0QRD
+k9+AySAsIvq7j985tqYJ9UgtTnJyh5v7Od/hHhszI5+y5/X6L4DCXBf3p7NTTLTGxGNNQ7HHXyW4
+PYm4SamtsvrxflJq/asEnwKk1Iq7LtTuru2BFmo+FQ/3/hgwEpN+LdSyq9ID6yWB6q4FjyXk5k1s
+pOhbIBUP27WQUZ9/xgszifPDI5R60tCmHNWmHPsWsIQMOiu6Iq7yN5C4A5hgvV6gcXDNpoXYOd8b
+cOUErg6CxdqUu576btDbNZjSCEy0geQDHA4D1Z3T7VrI1ZyAJeSityUUcLqewPoZsBXgMm4AIJBp
+wNfaAEuopbPtDn82kPkH2hRRn38csN/D7vYBYPTNhTNzCkqa0TS8UWUcb28BmPoICOlI7k+kmRhM
+lNWcOUEEZq7JTmD7/8v0DkyzqBlaCormAAAAAElFTkSuQmCC
+"
+ height="40"
+ width="40" />
+ <flowRoot
+ xml:space="preserve"
+ id="flowRoot5765"
+ style="font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:100%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#280b0b;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Ubuntu;-inkscape-font-specification:Ubuntu"
+ transform="translate(4.170296,-7.003638)"><flowRegion
+ id="flowRegion5767"><rect
+ id="rect5769"
+ width="272.94324"
+ height="32.526917"
+ x="51.618793"
+ y="156.35263"
+ style="font-size:13px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:100%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#280b0b;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Ubuntu;-inkscape-font-specification:Ubuntu" /></flowRegion><flowPara
+ id="flowPara5771">Lorem ipsum dolor sit amet, consectetuer adipiscing elit</flowPara></flowRoot> <image
+ y="171.03604"
+ x="303.15076"
+ id="image8263"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAABHNCSVQICAgIfAhkiAAAAsNJREFU
+OI1tk7tPk1EUwH/fow+0NRIjg48YGgOt4KOp4aWk2iBqYkLixmJw8T9w6cBgpHFwMHEwLsRBB/AB
+MbiYUDSasIjBxA4OKLXUFkppsR/C1373uw6UCupNbm5ykt/vnHtOjsK28zgc1tNv344IuMp/jgaT
+Ai5HobIVU/6Cnzb5fJcu3rjhVjQNACklCIG0LN49emR+mpt7I+BKFKyaoAo/9/t8vZHr192LU1OY
++fyO7E6vl4bOTt6NjpqJZHJSQF8ULG04FHJkp6dfBI4e7Y0MDGzCa2tgWTsEQlVZT6cJRCL62sLC
+4ZVS6fRAOPxM68pkXh5rauo5f+2aOxuPYzU0oMdikEwis9nNvx8/zt5796gkEhifP3MsHNaNVOrI
+t0QiqPWo6pP+mzf1zOvXlAsF1L4+1NZWlM5O+PoVdd8+9gwN4aqvR5GS0tQUvwoFWsJhfebjx4Cu
+KApISblQ2Cx1eBhcLly9vbgHB9EVBafHgxmPk797FxvYMAykECiA+s+spEQ8eICcmcG5axdOrxdr
+dpZcLIawbWzABmS1R/8KAK2lBXcohK7rOBwOdgeD1IVCyCosymXEwsIfgRSiBqutrXhv38bp9bIR
+j7M2MYHT48F3/z6ejg7MXA7jyxfkz58A6FLKTZthICyLuvZ2XFV4eWgI2zTRgP39/dSdPMnGw4eg
+adjVpNoFKbsrxeKhQHu7VkokKI2PU/n+naVbtyhnMpSXl8mNjbE+P0/yzh0UTcPn95NeWbG/ra7m
+lRg4NXh1orGxuy0YdKXicdaLxVqztl/F4aCxuZl0oSDep9NLNnRpkyAiMJIrFs+ahnEw0NamlxYX
+qZjmDlh1OGj0+5nP58X0jx8pGzqikKot01Yl/gMHus+cOuVShMC2LKRl1d5EMml9yGbnbDgbheUd
+27hdIqDnf+NVYdaGc1FY3Yr9BsdNUva1UTzZAAAAAElFTkSuQmCC
+"
+ height="16"
+ width="16"
+ style="fill:#cccccc;opacity:0.81" />
+ <g
+ transform="translate(804.21116,-270.59772)"
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/webtemplate/kune-logo.png"
+ id="g8266"
+ style="opacity:0.5;display:inline">
+ <path
+ style="font-size:58.13353348px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;line-height:100%;writing-mode:lr-tb;text-anchor:start;fill:#a56941;fill-opacity:1;stroke:none;font-family:Emblem"
+ d="m 206.0077,119.17481 c -0.23779,0 -0.46633,8.7e-4 -0.69567,0.0158 -0.0214,0.004 -0.0417,0.0118 -0.0632,0.0158 -0.21349,0.0399 -0.4241,0.0739 -0.6482,0.0791 -0.0311,0.004 -0.064,-0.005 -0.0949,0 -1.82915,0.27537 -3.37459,1.06959 -4.61662,2.38736 -1.45043,1.53186 -2.18178,3.36697 -2.18178,5.50197 0,2.15893 0.73135,4.00649 2.18178,5.53358 1.57013,1.64669 3.61017,2.46636 6.11859,2.46636 1.33077,0 2.61016,-0.33065 3.82604,-0.99601 1.21588,-0.64624 2.27312,-1.56093 3.1779,-2.71936 l -2.73518,-1.51778 c -1.17765,1.57013 -2.6245,2.35569 -4.34781,2.35569 -1.19676,0 -2.26981,-0.3882 -3.1937,-1.1541 -0.93824,-0.76596 -1.40711,-1.69889 -1.40711,-2.81422 l 12.5059,0 0,-0.63244 c 0,-2.70464 -0.91615,-4.8704 -2.73518,-6.49798 -1.53185,-1.35475 -3.22873,-2.02374 -5.09086,-2.02374 z m -58.15001,0.11067 0,6.0553 -2.1186,0 0,3.09885 2.1186,0 0,6.32407 3.22527,0 0,-6.32407 1.94464,0 3.96838,6.32407 3.82609,0 -5.32806,-8.03161 5.09091,-7.14623 -3.90514,0 -3.93676,5.75492 -1.66006,0 0,-6.0553 -3.22527,0 z m 39.573,0 c -0.55523,0.0991 -1.07256,0.26037 -1.5494,0.50596 -0.80423,0.43082 -1.43916,0.99904 -1.91307,1.7075 l 0,-1.91308 -3.24108,0 0,15.17784 3.24108,0 0,-8.5059 c 0,-1.21588 0.3431,-2.14881 1.02768,-2.81422 0.68934,-0.66536 1.5632,-0.99601 2.64032,-0.99607 1.13926,6e-5 2.02899,0.30575 2.65612,0.93283 0.62708,0.62713 0.93277,1.60993 0.93277,2.94069 l 0,8.44267 3.24113,0 0,-9.1541 c -5e-5,-1.86218 -0.56822,-3.40069 -1.70754,-4.61662 -0.85448,-0.91187 -1.84318,-1.4795 -2.97232,-1.7075 l -2.35569,0 z m -24.56913,0.30038 0,8.79053 c 0,2.0584 0.69395,3.72268 2.08698,4.99601 1.29249,1.19676 2.89338,1.80235 4.77467,1.80235 1.90046,0 3.49322,-0.60559 4.79053,-1.80235 1.39298,-1.27333 2.08693,-2.93761 2.08693,-4.99601 l 0,-8.79053 -3.24108,0 0,8.50591 c -6e-5,1.12015 -0.34316,2.03148 -1.02768,2.73517 -0.70851,0.72762 -1.56992,1.09092 -2.6087,1.09092 -1.0005,0 -1.86857,-0.36806 -2.57708,-1.09092 -0.70369,-0.72762 -1.04349,-1.63413 -1.04343,-2.73517 l 0,-8.50591 -3.24114,0 z m 42.73504,2.49803 c 1.05794,0 1.98172,0.2966 2.76679,0.8854 0.76114,0.60314 1.32167,1.48182 1.67593,2.64031 l -8.71148,0 c 0.25371,-1.11539 0.78014,-1.98162 1.5652,-2.60869 0.76114,-0.60797 1.66002,-0.91702 2.70356,-0.91702 z"
+ id="path8268"
+ inkscape:export-filename="/home/vjrj/proyectos/ourproject.org/kune/svn/trunk/img/kune-logo-16px.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ inkscape:connector-curvature="0" />
+ <g
+ id="g8270"
+ transform="matrix(0.1111494,0,0,0.111008,121.5678,22.515968)"
+ inkscape:export-filename="/home/vjrj/proyectos/ourproject.org/kune/svn/trunk/img/kune-logo-16px.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <path
+ style="color:#000000;fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#dd8a3d;stroke-width:109.23953247;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block"
+ d="m 60.321717,411.99998 377.014613,0"
+ id="path8272"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffdb6b;stroke-width:109.23950958;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block"
+ d="m 252.61203,788.60332 0,-377.01178"
+ id="path8274"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#69312f;stroke-width:109.23951721;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block"
+ d="m 252.86937,597.15755 377.0124,0"
+ id="path8276"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#cc6633;stroke-width:109.23950195;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block"
+ d="m 437.45588,596.97447 0,-377.01491"
+ id="path8278"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ inkscape:connector-curvature="0" />
+ <path
+ style="color:#000000;fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#dd8a3d;stroke-width:109.23947906;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block"
+ d="m 372.87905,411.27704 64.93441,0"
+ id="path8280"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ inkscape:connector-curvature="0" />
+ </g>
+ </g>
</g>
<g
inkscape:groupmode="layer"
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/pom.xml 2011-01-09 04:44:25 UTC (rev 1178)
@@ -10,7 +10,7 @@
<url>http://kune.ourproject.org</url>
<properties>
<!-- Available versions: http://repo1.maven.org/maven2/com/google/gwt/gwt-dev/ -->
- <gwt.version>2.1.0</gwt.version>
+ <gwt.version>2.1.1</gwt.version>
<maven.compiler.source>1.6</maven.compiler.source>
<maven.compiler.target>1.6</maven.compiler.target>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
@@ -78,6 +78,10 @@
<url>http://google-web-toolkit.googlecode.com/svn/2.1.0/gwt/maven/</url>
<name>Google Web Toolkit Repository</name>
</repository>
+ <repository>
+ <id>gwt-maven-rewraps</id>
+ <url>http://gwt-maven-rewraps.googlecode.com/hg/</url>
+ </repository>
<!-- cc -->
<repository>
<id>dyndns-repo</id>
@@ -244,6 +248,11 @@
<artifactId>gwtp</artifactId>
<version>0.4</version>
</dependency>
+ <dependency>
+ <groupId>org.adamtacy</groupId>
+ <artifactId>gwt-fx</artifactId>
+ <version>r464</version>
+ </dependency>
<!-- cc -->
<dependency>
<groupId>com.gwtext</groupId>
@@ -500,7 +509,7 @@
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>waveinabox-server</artifactId>
- <version>0.0.3.2</version>
+ <version>0.0.3.2</version>
</dependency>
<dependency>
<groupId>commons-cli</groupId>
@@ -521,55 +530,55 @@
<!-- <type>jar</type> -->
<!-- </dependency> -->
<!-- <dependency> -->
- <!-- <groupId>com.google.code.guice</groupId> -->
- <!-- <artifactId>guice-assistedinject</artifactId> -->
- <!-- <version>2.0</version> -->
+ <!-- <groupId>com.google.code.guice</groupId> -->
+ <!-- <artifactId>guice-assistedinject</artifactId> -->
+ <!-- <version>2.0</version> -->
<!-- </dependency> -->
<!-- <dependency> -->
- <!-- <groupId>jline<!/groupId> -->
- <!-- <artifactId>jline</artifactId> -->
- <!-- <version>0.9.94</version> -->
- <!-- <type>jar</type> -->
+ <!-- <groupId>jline<!/groupId> -->
+ <!-- <artifactId>jline</artifactId> -->
+ <!-- <version>0.9.94</version> -->
+ <!-- <type>jar</type> -->
<!-- </dependency> -->
<!-- <dependency> -->
- <!-- <groupId>org.gnu.inet</groupId> -->
- <!-- <artifactId>libidn</artifactId> -->
- <!-- <version>1.15</version> -->
- <!-- <type>jar</type> -->
+ <!-- <groupId>org.gnu.inet</groupId> -->
+ <!-- <artifactId>libidn</artifactId> -->
+ <!-- <version>1.15</version> -->
+ <!-- <type>jar</type> -->
<!-- </dependency> -->
<!-- <dependency> -->
- <!-- <groupId>com.google.protobuf</groupId> -->
- <!-- <artifactId>protobuf-java</artifactId> -->
- <!-- <version>2.3.0</version> -->
- <!-- <type>jar</type> -->
+ <!-- <groupId>com.google.protobuf</groupId> -->
+ <!-- <artifactId>protobuf-java</artifactId> -->
+ <!-- <version>2.3.0</version> -->
+ <!-- <type>jar</type> -->
<!-- </dependency> -->
<!-- <dependency> -->
- <!-- <groupId>xpp3</groupId> -->
- <!-- <artifactId>xpp3</artifactId> -->
- <!-- <version>1.1.4c</version> -->
- <!-- <type>jar</type> -->
+ <!-- <groupId>xpp3</groupId> -->
+ <!-- <artifactId>xpp3</artifactId> -->
+ <!-- <version>1.1.4c</version> -->
+ <!-- <type>jar</type> -->
<!-- </dependency> -->
<!-- <dependency> -->
- <!-- <groupId>xpp3</groupId> -->
- <!-- <artifactId>xpp3_xpath</artifactId> -->
- <!-- <version>1.1.4c</version> -->
- <!-- <type>jar</type> -->
+ <!-- <groupId>xpp3</groupId> -->
+ <!-- <artifactId>xpp3_xpath</artifactId> -->
+ <!-- <version>1.1.4c</version> -->
+ <!-- <type>jar</type> -->
<!-- </dependency> -->
<!-- <dependency> -->
- <!-- <groupId>aopalliance</groupId> -->
- <!-- <artifactId>aopalliance</artifactId> -->
- <!-- <version>1.0</version> -->
- <!-- <type>jar</type> -->
+ <!-- <groupId>aopalliance</groupId> -->
+ <!-- <artifactId>aopalliance</artifactId> -->
+ <!-- <version>1.0</version> -->
+ <!-- <type>jar</type> -->
<!-- </dependency> -->
<!-- <dependency> -->
- <!-- <groupId>org.wave-protocol</groupId> -->
- <!-- <artifactId>xmpp</artifactId> -->
- <!-- <version>1.0.0</version> -->
+ <!-- <groupId>org.wave-protocol</groupId> -->
+ <!-- <artifactId>xmpp</artifactId> -->
+ <!-- <version>1.0.0</version> -->
<!-- </dependency> -->
<!-- <dependency> -->
- <!-- <groupId>org.wave-protocol</groupId> -->
- <!-- <artifactId>whack</artifactId> -->
- <!-- <version>1.0.0</version> -->
+ <!-- <groupId>org.wave-protocol</groupId> -->
+ <!-- <artifactId>whack</artifactId> -->
+ <!-- <version>1.0.0</version> -->
<!-- </dependency> -->
<dependency>
<groupId>com.google.guava</groupId>
@@ -580,8 +589,7 @@
<distributionManagement>
<repository>
<id>kune.ourproject.org</id>
- <url>scpexe://kune.ourproject.org/home/groups/kune/htdocs/mavenrepo/
- </url>
+ <url>scpexe://kune.ourproject.org/home/groups/kune/htdocs/mavenrepo/ </url>
</repository>
</distributionManagement>
<issueManagement>
@@ -732,23 +740,17 @@
<scanIntervalSeconds>0</scanIntervalSeconds>
</configuration>
</plugin>
+ <!-- pensar/probar: openjpa-maven-plugin -->
+ <!-- gwtp & GenEvent need this plugin -->
+ <!-- maybe test: http://mojo.codehaus.org/apt-maven-plugin/index.html -->
+ <!-- instead of this: https://code.google.com/p/maven-annotation-plugin/ -->
+ <!-- <plugin> <groupId>org.bsc.maven</groupId> <artifactId>maven-processor-plugin</artifactId>
+ <version>1.3.7</version> <executions> <execution> <id>process</id> <goals>
+ <goal>process</goal> </goals> <phase>generate-sources</phase> </execution>
+ </executions> </plugin> <plugin> <groupId>org.codehaus.mojo</groupId> <artifactId>apt-maven-plugin</artifactId>
+ <version>1.0-alpha-4</version> <executions> <execution> <goals> <goal>process</goal>
+ <goal>test-process</goal> </goals> </execution> </executions> </plugin> -->
<plugin>
- <!-- pensar/probar: openjpa-maven-plugin -->
- <!-- gwtp & GenEvent need this plugin -->
- <groupId>org.bsc.maven</groupId>
- <artifactId>maven-processor-plugin</artifactId>
- <version>1.3.7</version>
- <executions>
- <execution>
- <id>process</id>
- <goals>
- <goal>process</goal>
- </goals>
- <phase>generate-sources</phase>
- </execution>
- </executions>
- </plugin>
- <plugin>
<!-- =roo -->
<groupId>org.codehaus.mojo</groupId>
<artifactId>gwt-maven-plugin</artifactId>
@@ -934,4 +936,4 @@
</plugin>
</plugins>
</reporting>
-</project>
+</project>
\ No newline at end of file
Modified: trunk/script/css-update.sh
===================================================================
--- trunk/script/css-update.sh 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/script/css-update.sh 2011-01-09 04:44:25 UTC (rev 1178)
@@ -2,9 +2,11 @@
APPPUB=src/main/java/org/ourproject/kune/app/public
#WEBAPP=src/main/webapp/gwt/ws
-$PWD/script/css-compact-and-tidy.sh
+## > $PWD/script/css-compact-and-tidy.sh
#rsync -aC $APPPUB/ws.html $WEBAPP/ws.html
#rsync -aC $APPPUB/js/ $WEBAPP/js
#rsync -aC $APPPUB/css/ $WEBAPP/css
#rsync -aC $APPPUB/images/ $WEBAPP/images
+
+cp src/main/java/cc/kune/msgs/public/kune-message.css target/kune-0.0.7/ws/
Modified: trunk/script/mvn-eclipse.sh
===================================================================
--- trunk/script/mvn-eclipse.sh 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/script/mvn-eclipse.sh 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,3 +1,5 @@
mvn eclipse:eclipse -Dgwt.compiler.skip=true
perl -p -i -e 's/<\/classpath>//g' .classpath
+echo -en " <classpathentry kind=\"src\" path=\"target/generated-sources/apt\" including=\"**/*.java\"/>" >> .classpath
echo -en " <classpathentry kind=\"con\" path=\"com.google.gwt.eclipse.core.GWT_CONTAINER\"/>\n</classpath>" >> .classpath
+
Modified: trunk/src/main/java/cc/kune/Kune.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/Kune.gwt.xml 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/Kune.gwt.xml 2011-01-09 04:44:25 UTC (rev 1178)
@@ -5,6 +5,7 @@
<inherits name='com.google.gwt.logging.Logging' />
<inherits name="cc.kune.core.Core" />
<inherits name="com.calclab.suco.Suco" />
+ <inherits name="org.adamtacy.GWTEffects"></inherits>
<source path='client'
excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java" />
<!-- <source path='shared'/> -->
Modified: trunk/src/main/java/cc/kune/core/Core.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/core/Core.gwt.xml 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/Core.gwt.xml 2011-01-09 04:44:25 UTC (rev 1178)
@@ -12,6 +12,7 @@
<inherits name="com.google.gwt.user.User" />
<!-- <inherits name='com.mvp4g.Mvp4gModule' /> -->
<inherits name="cc.kune.core.ws.armor.WsArmor" />
+ <inherits name="cc.kune.msgs.KuneMsgs" />
<inherits name="org.ourproject.common.Common" />
<inherits name="com.extjs.gxt.ui.GXT" />
<inherits name="com.calclab.suco.Suco" />
Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -7,11 +7,11 @@
import cc.kune.core.client.init.AppStarter;
import cc.kune.core.client.init.AppStarterDefault;
import cc.kune.core.client.init.PrefetchUtilities;
-import cc.kune.core.client.notify.SpinerPresenter;
-import cc.kune.core.client.notify.SpinerViewImpl;
-import cc.kune.core.client.notify.UserNotifierPresenter;
-import cc.kune.core.client.notify.UserNotifierPresenter.UserNotifierProxy;
-import cc.kune.core.client.notify.UserNotifierViewImpl;
+import cc.kune.core.client.notify.msgs.UserNotifierPresenter;
+import cc.kune.core.client.notify.msgs.UserNotifierPresenter.UserNotifierProxy;
+import cc.kune.core.client.notify.msgs.UserNotifierViewImpl;
+import cc.kune.core.client.notify.spiner.SpinerPresenter;
+import cc.kune.core.client.notify.spiner.SpinerViewImpl;
import cc.kune.core.client.sitebar.logo.SiteLogoPresenter;
import cc.kune.core.client.sitebar.logo.SiteLogoViewImpl;
import cc.kune.core.client.state.ContentProvider;
@@ -28,6 +28,8 @@
import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.core.ws.armor.client.WsArmor;
import cc.kune.core.ws.armor.client.WsArmorImpl;
+import cc.kune.msgs.client.panel.UserMessagesPanel;
+import cc.kune.msgs.client.panel.UserMessagesPresenter;
import com.google.inject.Singleton;
import com.gwtplatform.mvp.client.DefaultEventBus;
@@ -67,6 +69,9 @@
bindPresenter(SiteLogoPresenter.class, SiteLogoPresenter.SiteLogoView.class, SiteLogoViewImpl.class,
SiteLogoPresenter.SiteLogoProxy.class);
+ bind(UserMessagesPresenter.class).in(Singleton.class);
+ bind(UserMessagesPanel.class).in(Singleton.class);
+
bind(WsArmorImpl.class).in(Singleton.class);
bind(WsArmor.class).to(WsArmorImpl.class);
bind(Session.class).to(SessionDefault.class).in(Singleton.class);
Modified: trunk/src/main/java/cc/kune/core/client/CoreGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinjector.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinjector.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -2,8 +2,8 @@
import cc.kune.core.client.cookies.CookiesManager;
import cc.kune.core.client.errors.ErrorHandler;
-import cc.kune.core.client.notify.SpinerPresenter;
-import cc.kune.core.client.notify.UserNotifierPresenter;
+import cc.kune.core.client.notify.msgs.UserNotifierPresenter;
+import cc.kune.core.client.notify.spiner.SpinerPresenter;
import cc.kune.core.client.sitebar.logo.SiteLogoPresenter;
import cc.kune.core.client.state.StateManager;
import cc.kune.core.client.ws.CorePresenter;
Modified: trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -21,9 +21,9 @@
import org.ourproject.common.client.notify.NotifyLevel;
-import cc.kune.core.client.notify.AlertEvent;
-import cc.kune.core.client.notify.ProgressHideEvent;
-import cc.kune.core.client.notify.UserNotifyEvent;
+import cc.kune.core.client.notify.alerts.AlertEvent;
+import cc.kune.core.client.notify.msgs.UserNotifyEvent;
+import cc.kune.core.client.notify.spiner.ProgressHideEvent;
import cc.kune.core.client.state.Session;
import cc.kune.core.shared.i18n.I18nTranslationService;
Deleted: trunk/src/main/java/cc/kune/core/client/i18n/I18nReady.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nReady.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nReady.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,7 +0,0 @@
-package cc.kune.core.client.i18n;
-
-import com.gwtplatform.annotation.GenEvent;
-
- at GenEvent
-public class I18nReady {
-}
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/core/client/i18n/I18nReadyEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nReadyEvent.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nReadyEvent.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,67 @@
+package cc.kune.core.client.i18n;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+import com.gwtplatform.mvp.client.HasEventBus;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class I18nReadyEvent extends GwtEvent<I18nReadyEvent.I18nReadyHandler> {
+
+ public interface HasI18nReadyHandlers extends HasHandlers {
+ HandlerRegistration addI18nReadyHandler(I18nReadyHandler handler);
+ }
+
+ public interface I18nReadyHandler extends EventHandler {
+ public void onI18nReady(I18nReadyEvent event);
+ }
+
+ private static final Type<I18nReadyHandler> TYPE = new Type<I18nReadyHandler>();
+
+ public static void fire(HasEventBus source) {
+ source.fireEvent(new I18nReadyEvent());
+ }
+
+ public static Type<I18nReadyHandler> getType() {
+ return TYPE;
+ }
+
+
+ public I18nReadyEvent() {
+ }
+
+ @Override
+ public Type<I18nReadyHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ @Override
+ protected void dispatch(I18nReadyHandler handler) {
+ handler.onI18nReady(this);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other != null && other.getClass().equals(this.getClass())) {
+ I18nReadyEvent o = (I18nReadyEvent) other;
+ return true
+ ;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 23;
+ hashCode = (hashCode * 37) + getClass().hashCode();
+ return hashCode;
+ }
+
+ @Override
+ public String toString() {
+ return "I18nReadyEvent["
+ + "]";
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/i18n/I18nReadyEvent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/java/cc/kune/core/client/init/AppStart.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/init/AppStart.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/init/AppStart.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,12 +0,0 @@
-package cc.kune.core.client.init;
-
-import cc.kune.core.shared.dto.InitDataDTO;
-
-import com.gwtplatform.annotation.GenEvent;
-import com.gwtplatform.annotation.Order;
-
- at GenEvent
-public class AppStart {
- @Order(1)
- InitDataDTO initData;
-}
Added: trunk/src/main/java/cc/kune/core/client/init/AppStartEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/init/AppStartEvent.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/init/AppStartEvent.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,76 @@
+package cc.kune.core.client.init;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+import com.gwtplatform.mvp.client.HasEventBus;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class AppStartEvent extends GwtEvent<AppStartEvent.AppStartHandler> {
+
+ public interface HasAppStartHandlers extends HasHandlers {
+ HandlerRegistration addAppStartHandler(AppStartHandler handler);
+ }
+
+ public interface AppStartHandler extends EventHandler {
+ public void onAppStart(AppStartEvent event);
+ }
+
+ private static final Type<AppStartHandler> TYPE = new Type<AppStartHandler>();
+
+ public static void fire(HasEventBus source, cc.kune.core.shared.dto.InitDataDTO initData) {
+ source.fireEvent(new AppStartEvent(initData));
+ }
+
+ public static Type<AppStartHandler> getType() {
+ return TYPE;
+ }
+
+ private final cc.kune.core.shared.dto.InitDataDTO initData;
+
+ public AppStartEvent(cc.kune.core.shared.dto.InitDataDTO initData) {
+ this.initData = initData;
+ }
+
+ @Override
+ public Type<AppStartHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ public cc.kune.core.shared.dto.InitDataDTO getInitData() {
+ return initData;
+ }
+
+ @Override
+ protected void dispatch(AppStartHandler handler) {
+ handler.onAppStart(this);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other != null && other.getClass().equals(this.getClass())) {
+ AppStartEvent o = (AppStartEvent) other;
+ return true
+ && ((o.initData == null && this.initData == null) || (o.initData != null && o.initData.equals(this.initData)))
+ ;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 23;
+ hashCode = (hashCode * 37) + getClass().hashCode();
+ hashCode = (hashCode * 37) + (initData == null ? 1 : initData.hashCode());
+ return hashCode;
+ }
+
+ @Override
+ public String toString() {
+ return "AppStartEvent["
+ + initData
+ + "]";
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/init/AppStartEvent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -21,8 +21,8 @@
import org.ourproject.common.client.notify.NotifyLevel;
-import cc.kune.core.client.notify.ProgressHideEvent;
-import cc.kune.core.client.notify.UserNotifyEvent;
+import cc.kune.core.client.notify.msgs.UserNotifyEvent;
+import cc.kune.core.client.notify.spiner.ProgressHideEvent;
import cc.kune.core.client.rpcservices.SiteServiceAsync;
import cc.kune.core.client.state.Session;
import cc.kune.core.shared.dto.InitDataDTO;
@@ -78,7 +78,8 @@
@Override
public void onFailure(final Throwable error) {
eventBus.fireEvent(new ProgressHideEvent());
- eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, "Error fetching initial data"));
+ eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error,
+ "Error fetching initial data from Kune server"));
Log.debug(error.getMessage());
hideInitialPanels();
}
@@ -97,6 +98,9 @@
@Override
public void execute() {
hideInitialPanels();
+ eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, "Started"));
+ eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error,
+ "Started closeable. Started closeable. Started closeable. Started closeable", true));
}
});
}
Deleted: trunk/src/main/java/cc/kune/core/client/init/AppStop.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/init/AppStop.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/init/AppStop.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,8 +0,0 @@
-package cc.kune.core.client.init;
-
-import com.gwtplatform.annotation.GenEvent;
-
- at GenEvent
-public class AppStop {
-
-}
Added: trunk/src/main/java/cc/kune/core/client/init/AppStopEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/init/AppStopEvent.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/init/AppStopEvent.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,67 @@
+package cc.kune.core.client.init;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+import com.gwtplatform.mvp.client.HasEventBus;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class AppStopEvent extends GwtEvent<AppStopEvent.AppStopHandler> {
+
+ public interface HasAppStopHandlers extends HasHandlers {
+ HandlerRegistration addAppStopHandler(AppStopHandler handler);
+ }
+
+ public interface AppStopHandler extends EventHandler {
+ public void onAppStop(AppStopEvent event);
+ }
+
+ private static final Type<AppStopHandler> TYPE = new Type<AppStopHandler>();
+
+ public static void fire(HasEventBus source) {
+ source.fireEvent(new AppStopEvent());
+ }
+
+ public static Type<AppStopHandler> getType() {
+ return TYPE;
+ }
+
+
+ public AppStopEvent() {
+ }
+
+ @Override
+ public Type<AppStopHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ @Override
+ protected void dispatch(AppStopHandler handler) {
+ handler.onAppStop(this);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other != null && other.getClass().equals(this.getClass())) {
+ AppStopEvent o = (AppStopEvent) other;
+ return true
+ ;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 23;
+ hashCode = (hashCode * 37) + getClass().hashCode();
+ return hashCode;
+ }
+
+ @Override
+ public String toString() {
+ return "AppStopEvent["
+ + "]";
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/init/AppStopEvent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/java/cc/kune/core/client/notify/Alert.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/Alert.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/notify/Alert.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,12 +0,0 @@
-package cc.kune.core.client.notify;
-
-import com.gwtplatform.annotation.GenEvent;
-import com.gwtplatform.annotation.Order;
-
- at GenEvent
-public class Alert {
- @Order(1)
- String title;
- @Order(2)
- String message;
-}
Deleted: trunk/src/main/java/cc/kune/core/client/notify/ProgressHide.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/ProgressHide.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/notify/ProgressHide.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,7 +0,0 @@
-package cc.kune.core.client.notify;
-
-import com.gwtplatform.annotation.GenEvent;
-
- at GenEvent
-public class ProgressHide {
-}
Deleted: trunk/src/main/java/cc/kune/core/client/notify/ProgressShow.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/ProgressShow.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/notify/ProgressShow.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,10 +0,0 @@
-package cc.kune.core.client.notify;
-
-import com.gwtplatform.annotation.GenEvent;
-import com.gwtplatform.annotation.Order;
-
- at GenEvent
-public class ProgressShow {
- @Order(1)
- String message;
-}
Deleted: trunk/src/main/java/cc/kune/core/client/notify/SpinerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/SpinerPresenter.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/notify/SpinerPresenter.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,56 +0,0 @@
-package cc.kune.core.client.notify;
-
-import cc.kune.core.client.i18n.I18nReadyEvent;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.inject.Inject;
-import com.gwtplatform.mvp.client.EventBus;
-import com.gwtplatform.mvp.client.PopupView;
-import com.gwtplatform.mvp.client.Presenter;
-import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
-import com.gwtplatform.mvp.client.annotations.ProxyEvent;
-import com.gwtplatform.mvp.client.proxy.Proxy;
-import com.gwtplatform.mvp.client.proxy.RevealRootPopupContentEvent;
-
-public class SpinerPresenter extends Presenter<SpinerPresenter.SpinerView, SpinerPresenter.SpinerProxy> {
-
- private final I18nTranslationService i18n;
-
- @ProxyCodeSplit
- public interface SpinerProxy extends Proxy<SpinerPresenter> {
- }
-
- public interface SpinerView extends PopupView {
- void fade();
-
- void show(String message);
- }
-
- @Inject
- public SpinerPresenter(final EventBus eventBus, final SpinerView view, final SpinerProxy proxy,
- I18nTranslationService i18n) {
- super(eventBus, view, proxy);
- this.i18n = i18n;
- }
-
- @ProxyEvent
- public void onProgressShow(ProgressShowEvent event) {
- getView().show(event.getMessage());
- }
-
- @ProxyEvent
- public void onI18nReady(I18nReadyEvent event) {
- getView().show(i18n.t("Loading"));
- }
-
- @ProxyEvent
- public void onProgressHide(ProgressHideEvent event) {
- getView().fade();
- }
-
- @Override
- protected void revealInParent() {
- RevealRootPopupContentEvent.fire(this, this);
- // RevealRootContentEvent.fire(this, this);
- }
-}
Deleted: trunk/src/main/java/cc/kune/core/client/notify/SpinerViewImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/SpinerViewImpl.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/notify/SpinerViewImpl.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,66 +0,0 @@
-package cc.kune.core.client.notify;
-
-import cc.kune.core.client.notify.SpinerPresenter.SpinerView;
-import cc.kune.core.ws.armor.client.WsArmor;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.InlineLabel;
-import com.google.gwt.user.client.ui.PopupPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.inject.Inject;
-import com.gwtplatform.mvp.client.EventBus;
-import com.gwtplatform.mvp.client.PopupViewWithUiHandlers;
-import com.gwtplatform.mvp.client.UiHandlers;
-
-public class SpinerViewImpl extends PopupViewWithUiHandlers<UiHandlers> implements SpinerView {
-
- private final PopupPanel popup;
-
- @Inject
- protected SpinerViewImpl(EventBus eventBus, WsArmor armor) {
- super(eventBus);
- widget = uiBinder.createAndBindUi(this);
- popup = new PopupPanel(false, false);
- popup.add(widget);
- popup.setPopupPosition(0, 0);
- popup.setStyleName("k-spiner-popup");
- popup.show();
- }
-
- private static SpinerViewImplUiBinder uiBinder = GWT.create(SpinerViewImplUiBinder.class);
-
- interface SpinerViewImplUiBinder extends UiBinder<Widget, SpinerViewImpl> {
- }
-
- @UiField
- HorizontalPanel panel;
- @UiField
- InlineLabel label;
- @UiField
- Image img;
- Widget widget;
-
- @Override
- public Widget asWidget() {
- return popup;
- }
-
- @Override
- public void fade() {
- popup.hide();
- }
-
- @Override
- public void show(String message) {
- if (message == null || message.isEmpty()) {
- label.setText("");
- } else {
- label.setText(message);
- }
- popup.show();
- }
-}
Deleted: trunk/src/main/java/cc/kune/core/client/notify/SpinerViewImpl.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/SpinerViewImpl.ui.xml 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/notify/SpinerViewImpl.ui.xml 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,11 +0,0 @@
-<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
-<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
- xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:p1="urn:import:com.extjs.gxt.ui.client.widget">
- <ui:with field='res' type='cc.kune.core.client.resources.CoreResources' />
- <g:FlowPanel>
- <g:HorizontalPanel ui:field="panel" styleName="kLoadingPanel" verticalAlignment="ALIGN_MIDDLE" horizontalAlignment="ALIGN_CENTER" borderWidth="0">
- <g:Image ui:field="img" styleName="{res.css.loadingSpiner}" />
- <g:InlineLabel ui:field="label" styleName="kLoadingLabel" horizontalAlignment="ALIGN_CENTER" />
- </g:HorizontalPanel>
- </g:FlowPanel>
-</ui:UiBinder>
\ No newline at end of file
Deleted: trunk/src/main/java/cc/kune/core/client/notify/UserNotifierPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/UserNotifierPresenter.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/notify/UserNotifierPresenter.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,51 +0,0 @@
-package cc.kune.core.client.notify;
-
-import org.ourproject.common.client.notify.ConfirmationAsk;
-import org.ourproject.common.client.notify.NotifyLevel;
-
-import cc.kune.core.client.notify.UserNotifierPresenter.UserNotifierProxy;
-import cc.kune.core.client.notify.UserNotifierPresenter.UserNotifierView;
-
-import com.google.gwt.user.client.ui.RootPanel;
-import com.google.inject.Inject;
-import com.gwtplatform.mvp.client.EventBus;
-import com.gwtplatform.mvp.client.Presenter;
-import com.gwtplatform.mvp.client.View;
-import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
-import com.gwtplatform.mvp.client.annotations.ProxyEvent;
-import com.gwtplatform.mvp.client.proxy.Proxy;
-
-public class UserNotifierPresenter extends Presenter<UserNotifierView, UserNotifierProxy> {
- @ProxyCodeSplit
- public interface UserNotifierProxy extends Proxy<UserNotifierPresenter> {
- }
-
- public interface UserNotifierView extends View {
- public void alert(String title, String message);
-
- public void confirmationAsk(ConfirmationAsk<?> ask);
-
- public void notify(NotifyLevel level, String message);
- }
-
- @Inject
- public UserNotifierPresenter(final EventBus eventBus, final UserNotifierView view, final UserNotifierProxy proxy) {
- super(eventBus, view, proxy);
- }
-
- @ProxyEvent
- public void onUserNotify(UserNotifyEvent event) {
- getView().notify(event.getLevel(), event.getMessage());
- }
-
- @ProxyEvent
- public void onAlert(AlertEvent event) {
- getView().alert(event.getTitle(), event.getMessage());
- }
-
- @Override
- protected void revealInParent() {
- RootPanel.get().add(getWidget());
- }
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/cc/kune/core/client/notify/UserNotifierViewImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/UserNotifierViewImpl.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/notify/UserNotifierViewImpl.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,43 +0,0 @@
-package cc.kune.core.client.notify;
-
-import org.ourproject.common.client.notify.ConfirmationAsk;
-import org.ourproject.common.client.notify.NotifyLevel;
-
-import cc.kune.core.client.notify.UserNotifierPresenter.UserNotifierView;
-
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.inject.Inject;
-import com.gwtplatform.mvp.client.ViewImpl;
-
-public class UserNotifierViewImpl extends ViewImpl implements UserNotifierView {
- @Inject
- public UserNotifierViewImpl() {
- }
-
- @Override
- public void alert(final String title, final String message) {
- message(title, message);
- }
-
- @Override
- public Widget asWidget() {
- return null;
- }
-
- @Override
- public void confirmationAsk(final ConfirmationAsk<?> ask) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void notify(final NotifyLevel level, final String message) {
- message("", message);
- }
-
- private void message(final String title, final String message) {
- Window.alert(title + " " + message);
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/core/client/notify/UserNotify.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/UserNotify.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/notify/UserNotify.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,14 +0,0 @@
-package cc.kune.core.client.notify;
-
-import org.ourproject.common.client.notify.NotifyLevel;
-
-import com.gwtplatform.annotation.GenEvent;
-import com.gwtplatform.annotation.Order;
-
- at GenEvent
-public class UserNotify {
- @Order(1)
- NotifyLevel level;
- @Order(2)
- String message;
-}
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/core/client/notify/alerts/AlertEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/alerts/AlertEvent.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/notify/alerts/AlertEvent.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,86 @@
+package cc.kune.core.client.notify.alerts;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+import com.gwtplatform.mvp.client.HasEventBus;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class AlertEvent extends GwtEvent<AlertEvent.AlertHandler> {
+
+ public interface HasAlertHandlers extends HasHandlers {
+ HandlerRegistration addAlertHandler(AlertHandler handler);
+ }
+
+ public interface AlertHandler extends EventHandler {
+ public void onAlert(AlertEvent event);
+ }
+
+ private static final Type<AlertHandler> TYPE = new Type<AlertHandler>();
+
+ public static void fire(HasEventBus source, java.lang.String title, java.lang.String message) {
+ source.fireEvent(new AlertEvent(title, message));
+ }
+
+ public static Type<AlertHandler> getType() {
+ return TYPE;
+ }
+
+ private final java.lang.String title;
+ private final java.lang.String message;
+
+ public AlertEvent(java.lang.String title, java.lang.String message) {
+ this.title = title;
+ this.message = message;
+ }
+
+ @Override
+ public Type<AlertHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ public java.lang.String getTitle() {
+ return title;
+ }
+
+ public java.lang.String getMessage() {
+ return message;
+ }
+
+ @Override
+ protected void dispatch(AlertHandler handler) {
+ handler.onAlert(this);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other != null && other.getClass().equals(this.getClass())) {
+ AlertEvent o = (AlertEvent) other;
+ return true
+ && ((o.title == null && this.title == null) || (o.title != null && o.title.equals(this.title)))
+ && ((o.message == null && this.message == null) || (o.message != null && o.message.equals(this.message)))
+ ;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 23;
+ hashCode = (hashCode * 37) + getClass().hashCode();
+ hashCode = (hashCode * 37) + (title == null ? 1 : title.hashCode());
+ hashCode = (hashCode * 37) + (message == null ? 1 : message.hashCode());
+ return hashCode;
+ }
+
+ @Override
+ public String toString() {
+ return "AlertEvent["
+ + title
+ + ","
+ + message
+ + "]";
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/notify/alerts/AlertEvent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/client/notify/alerts/UserAlerterPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/alerts/UserAlerterPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/notify/alerts/UserAlerterPresenter.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,39 @@
+package cc.kune.core.client.notify.alerts;
+
+import cc.kune.core.client.notify.alerts.UserAlerterPresenter.UserAlerterProxy;
+import cc.kune.core.client.notify.alerts.UserAlerterPresenter.UserAlerterView;
+
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.EventBus;
+import com.gwtplatform.mvp.client.Presenter;
+import com.gwtplatform.mvp.client.View;
+import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
+import com.gwtplatform.mvp.client.annotations.ProxyEvent;
+import com.gwtplatform.mvp.client.proxy.Proxy;
+
+public class UserAlerterPresenter extends Presenter<UserAlerterView, UserAlerterProxy> {
+ @ProxyCodeSplit
+ public interface UserAlerterProxy extends Proxy<UserAlerterPresenter> {
+ }
+
+ public interface UserAlerterView extends View {
+ public void alert(String title, String message);
+ }
+
+ @Inject
+ public UserAlerterPresenter(final EventBus eventBus, final UserAlerterView view, final UserAlerterProxy proxy) {
+ super(eventBus, view, proxy);
+ }
+
+ @ProxyEvent
+ public void onAlert(AlertEvent event) {
+ getView().alert(event.getTitle(), event.getMessage());
+ }
+
+ @Override
+ protected void revealInParent() {
+ RootPanel.get().add(getWidget());
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/core/client/notify/alerts/UserAlerterPresenter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/client/notify/alerts/UserAlerterViewImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/alerts/UserAlerterViewImpl.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/notify/alerts/UserAlerterViewImpl.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,29 @@
+package cc.kune.core.client.notify.alerts;
+
+import cc.kune.core.client.notify.alerts.UserAlerterPresenter.UserAlerterView;
+
+import com.google.gwt.user.client.Window;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.ViewImpl;
+
+public class UserAlerterViewImpl extends ViewImpl implements UserAlerterView {
+ @Inject
+ public UserAlerterViewImpl() {
+ }
+
+ @Override
+ public void alert(final String title, final String message) {
+ message(title, message);
+ }
+
+ @Override
+ public Widget asWidget() {
+ return null;
+ }
+
+ private void message(final String title, final String message) {
+ Window.alert(title + " " + message);
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/notify/alerts/UserAlerterViewImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPresenter.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,36 @@
+package cc.kune.core.client.notify.confirm;
+
+import org.ourproject.common.client.notify.ConfirmationAsk;
+
+import cc.kune.core.client.notify.confirm.UserConfirmPresenter.UserConfirmProxy;
+import cc.kune.core.client.notify.confirm.UserConfirmPresenter.UserConfirmView;
+
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.EventBus;
+import com.gwtplatform.mvp.client.Presenter;
+import com.gwtplatform.mvp.client.View;
+import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
+import com.gwtplatform.mvp.client.proxy.Proxy;
+
+public class UserConfirmPresenter extends Presenter<UserConfirmView, UserConfirmProxy> {
+ @ProxyCodeSplit
+ public interface UserConfirmProxy extends Proxy<UserConfirmPresenter> {
+ }
+
+ public interface UserConfirmView extends View {
+
+ public void confirmationAsk(ConfirmationAsk<?> ask);
+ }
+
+ @Inject
+ public UserConfirmPresenter(final EventBus eventBus, final UserConfirmView view, final UserConfirmProxy proxy) {
+ super(eventBus, view, proxy);
+ }
+
+ @Override
+ protected void revealInParent() {
+ RootPanel.get().add(getWidget());
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPresenter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmViewImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmViewImpl.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmViewImpl.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,27 @@
+package cc.kune.core.client.notify.confirm;
+
+import org.ourproject.common.client.notify.ConfirmationAsk;
+
+import cc.kune.core.client.notify.confirm.UserConfirmPresenter.UserConfirmView;
+
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.ViewImpl;
+
+public class UserConfirmViewImpl extends ViewImpl implements UserConfirmView {
+ @Inject
+ public UserConfirmViewImpl() {
+ }
+
+ @Override
+ public Widget asWidget() {
+ return null;
+ }
+
+ @Override
+ public void confirmationAsk(final ConfirmationAsk<?> ask) {
+ // TODO Auto-generated method stub
+
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmViewImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifierPresenter.java (from rev 1176, trunk/src/main/java/cc/kune/core/client/notify/UserNotifierPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifierPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifierPresenter.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,41 @@
+package cc.kune.core.client.notify.msgs;
+
+import org.ourproject.common.client.notify.NotifyLevel;
+
+import cc.kune.core.client.notify.msgs.UserNotifierPresenter.UserNotifierProxy;
+import cc.kune.core.client.notify.msgs.UserNotifierPresenter.UserNotifierView;
+
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.EventBus;
+import com.gwtplatform.mvp.client.PopupView;
+import com.gwtplatform.mvp.client.Presenter;
+import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
+import com.gwtplatform.mvp.client.annotations.ProxyEvent;
+import com.gwtplatform.mvp.client.proxy.Proxy;
+import com.gwtplatform.mvp.client.proxy.RevealRootPopupContentEvent;
+
+public class UserNotifierPresenter extends Presenter<UserNotifierView, UserNotifierProxy> {
+ @ProxyCodeSplit
+ public interface UserNotifierProxy extends Proxy<UserNotifierPresenter> {
+ }
+
+ public interface UserNotifierView extends PopupView {
+ public void notify(NotifyLevel level, String message, Boolean closeable);
+ }
+
+ @Inject
+ public UserNotifierPresenter(final EventBus eventBus, final UserNotifierView view, final UserNotifierProxy proxy) {
+ super(eventBus, view, proxy);
+ }
+
+ @ProxyEvent
+ public void onUserNotify(UserNotifyEvent event) {
+ getView().notify(event.getLevel(), event.getMessage(), event.getCloseable());
+ }
+
+ @Override
+ protected void revealInParent() {
+ RevealRootPopupContentEvent.fire(this, this);
+ }
+
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifierPresenter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifierViewImpl.java (from rev 1176, trunk/src/main/java/cc/kune/core/client/notify/UserNotifierViewImpl.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifierViewImpl.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifierViewImpl.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,58 @@
+package cc.kune.core.client.notify.msgs;
+
+import org.ourproject.common.client.notify.NotifyLevel;
+
+import cc.kune.core.client.notify.msgs.UserNotifierPresenter.UserNotifierView;
+import cc.kune.msgs.client.msgs.UserMessageLevel;
+import cc.kune.msgs.client.panel.UserMessagesPanel;
+import cc.kune.msgs.client.panel.UserMessagesPresenter;
+
+import com.google.gwt.user.client.ui.PopupPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.EventBus;
+import com.gwtplatform.mvp.client.PopupViewImpl;
+
+public class UserNotifierViewImpl extends PopupViewImpl implements UserNotifierView {
+ private final UserMessagesPresenter msgs;
+ private final PopupPanel popup;
+
+ @Inject
+ public UserNotifierViewImpl(EventBus eventBus, UserMessagesPresenter msgs, UserMessagesPanel panel) {
+ super(eventBus);
+ this.msgs = msgs;
+ msgs.init(panel);
+ panel.setWidth("370px");
+ popup = new PopupPanel(false, false);
+ popup.add(panel);
+ popup.setPopupPosition(0, 0);
+ popup.setStyleName("k-user-notif-popup");
+ popup.show();
+ }
+
+ @Override
+ public Widget asWidget() {
+ return popup;
+ }
+
+ @Override
+ public void notify(final NotifyLevel level, final String message, Boolean closeable) {
+ switch (level) {
+ case error:
+ msgs.add(UserMessageLevel.error, message, closeable);
+ break;
+ case important:
+ msgs.add(UserMessageLevel.important, message, closeable);
+ break;
+ case info:
+ msgs.add(UserMessageLevel.info, message, closeable);
+ break;
+ case veryImportant:
+ msgs.add(UserMessageLevel.veryImportant, message, false);
+ break;
+ default:
+ break;
+ }
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifierViewImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifyEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifyEvent.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifyEvent.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,119 @@
+package cc.kune.core.client.notify.msgs;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+import com.gwtplatform.mvp.client.HasEventBus;
+
+public class UserNotifyEvent extends GwtEvent<UserNotifyEvent.UserNotifyHandler> {
+
+ public interface HasUserNotifyHandlers extends HasHandlers {
+ HandlerRegistration addUserNotifyHandler(UserNotifyHandler handler);
+ }
+
+ public interface UserNotifyHandler extends EventHandler {
+ public void onUserNotify(UserNotifyEvent event);
+ }
+
+ private static final Type<UserNotifyHandler> TYPE = new Type<UserNotifyHandler>();
+
+ public static void fire(HasEventBus source, org.ourproject.common.client.notify.NotifyLevel level,
+ java.lang.String message, Boolean closeable) {
+ source.fireEvent(new UserNotifyEvent(level, message, closeable));
+ }
+
+ public static void fire(HasEventBus source, org.ourproject.common.client.notify.NotifyLevel level,
+ java.lang.String message) {
+ source.fireEvent(new UserNotifyEvent(level, message));
+ }
+
+ public static Type<UserNotifyHandler> getType() {
+ return TYPE;
+ }
+
+ private final org.ourproject.common.client.notify.NotifyLevel level;
+ private final java.lang.String message;
+ private final Boolean closeable;
+
+ public UserNotifyEvent(org.ourproject.common.client.notify.NotifyLevel level, java.lang.String message,
+ Boolean closeable) {
+ this.level = level;
+ this.message = message;
+ this.closeable = closeable;
+ }
+
+ public UserNotifyEvent(org.ourproject.common.client.notify.NotifyLevel level, java.lang.String message) {
+ this(level, message, false);
+ }
+
+ @Override
+ public Type<UserNotifyHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ public org.ourproject.common.client.notify.NotifyLevel getLevel() {
+ return level;
+ }
+
+ public java.lang.String getMessage() {
+ return message;
+ }
+
+ @Override
+ protected void dispatch(UserNotifyHandler handler) {
+ handler.onUserNotify(this);
+ }
+
+ public Boolean getCloseable() {
+ return closeable;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (closeable == null ? 0 : closeable.hashCode());
+ result = prime * result + (level == null ? 0 : level.hashCode());
+ result = prime * result + (message == null ? 0 : message.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;
+ }
+ UserNotifyEvent other = (UserNotifyEvent) obj;
+ if (closeable == null) {
+ if (other.closeable != null) {
+ return false;
+ }
+ } else if (!closeable.equals(other.closeable)) {
+ return false;
+ }
+ if (level != other.level) {
+ return false;
+ }
+ if (message == null) {
+ if (other.message != null) {
+ return false;
+ }
+ } else if (!message.equals(other.message)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "UserNotifyEvent [level=" + level + ", message=" + message + ", closeable=" + closeable + "]";
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/notify/msgs/UserNotifyEvent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/client/notify/spiner/ProgressHideEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/spiner/ProgressHideEvent.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/notify/spiner/ProgressHideEvent.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,67 @@
+package cc.kune.core.client.notify.spiner;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+import com.gwtplatform.mvp.client.HasEventBus;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class ProgressHideEvent extends GwtEvent<ProgressHideEvent.ProgressHideHandler> {
+
+ public interface HasProgressHideHandlers extends HasHandlers {
+ HandlerRegistration addProgressHideHandler(ProgressHideHandler handler);
+ }
+
+ public interface ProgressHideHandler extends EventHandler {
+ public void onProgressHide(ProgressHideEvent event);
+ }
+
+ private static final Type<ProgressHideHandler> TYPE = new Type<ProgressHideHandler>();
+
+ public static void fire(HasEventBus source) {
+ source.fireEvent(new ProgressHideEvent());
+ }
+
+ public static Type<ProgressHideHandler> getType() {
+ return TYPE;
+ }
+
+
+ public ProgressHideEvent() {
+ }
+
+ @Override
+ public Type<ProgressHideHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ @Override
+ protected void dispatch(ProgressHideHandler handler) {
+ handler.onProgressHide(this);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other != null && other.getClass().equals(this.getClass())) {
+ ProgressHideEvent o = (ProgressHideEvent) other;
+ return true
+ ;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 23;
+ hashCode = (hashCode * 37) + getClass().hashCode();
+ return hashCode;
+ }
+
+ @Override
+ public String toString() {
+ return "ProgressHideEvent["
+ + "]";
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/notify/spiner/ProgressHideEvent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/core/client/notify/spiner/ProgressShowEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/spiner/ProgressShowEvent.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/notify/spiner/ProgressShowEvent.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,76 @@
+package cc.kune.core.client.notify.spiner;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+import com.gwtplatform.mvp.client.HasEventBus;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class ProgressShowEvent extends GwtEvent<ProgressShowEvent.ProgressShowHandler> {
+
+ public interface HasProgressShowHandlers extends HasHandlers {
+ HandlerRegistration addProgressShowHandler(ProgressShowHandler handler);
+ }
+
+ public interface ProgressShowHandler extends EventHandler {
+ public void onProgressShow(ProgressShowEvent event);
+ }
+
+ private static final Type<ProgressShowHandler> TYPE = new Type<ProgressShowHandler>();
+
+ public static void fire(HasEventBus source, java.lang.String message) {
+ source.fireEvent(new ProgressShowEvent(message));
+ }
+
+ public static Type<ProgressShowHandler> getType() {
+ return TYPE;
+ }
+
+ private final java.lang.String message;
+
+ public ProgressShowEvent(java.lang.String message) {
+ this.message = message;
+ }
+
+ @Override
+ public Type<ProgressShowHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ public java.lang.String getMessage() {
+ return message;
+ }
+
+ @Override
+ protected void dispatch(ProgressShowHandler handler) {
+ handler.onProgressShow(this);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other != null && other.getClass().equals(this.getClass())) {
+ ProgressShowEvent o = (ProgressShowEvent) other;
+ return true
+ && ((o.message == null && this.message == null) || (o.message != null && o.message.equals(this.message)))
+ ;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 23;
+ hashCode = (hashCode * 37) + getClass().hashCode();
+ hashCode = (hashCode * 37) + (message == null ? 1 : message.hashCode());
+ return hashCode;
+ }
+
+ @Override
+ public String toString() {
+ return "ProgressShowEvent["
+ + message
+ + "]";
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/notify/spiner/ProgressShowEvent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerPresenter.java (from rev 1176, trunk/src/main/java/cc/kune/core/client/notify/SpinerPresenter.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerPresenter.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,56 @@
+package cc.kune.core.client.notify.spiner;
+
+import cc.kune.core.client.i18n.I18nReadyEvent;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.EventBus;
+import com.gwtplatform.mvp.client.PopupView;
+import com.gwtplatform.mvp.client.Presenter;
+import com.gwtplatform.mvp.client.annotations.ProxyCodeSplit;
+import com.gwtplatform.mvp.client.annotations.ProxyEvent;
+import com.gwtplatform.mvp.client.proxy.Proxy;
+import com.gwtplatform.mvp.client.proxy.RevealRootPopupContentEvent;
+
+public class SpinerPresenter extends Presenter<SpinerPresenter.SpinerView, SpinerPresenter.SpinerProxy> {
+
+ private final I18nTranslationService i18n;
+
+ @ProxyCodeSplit
+ public interface SpinerProxy extends Proxy<SpinerPresenter> {
+ }
+
+ public interface SpinerView extends PopupView {
+ void fade();
+
+ void show(String message);
+ }
+
+ @Inject
+ public SpinerPresenter(final EventBus eventBus, final SpinerView view, final SpinerProxy proxy,
+ I18nTranslationService i18n) {
+ super(eventBus, view, proxy);
+ this.i18n = i18n;
+ }
+
+ @ProxyEvent
+ public void onProgressShow(ProgressShowEvent event) {
+ getView().show(event.getMessage());
+ }
+
+ @ProxyEvent
+ public void onI18nReady(I18nReadyEvent event) {
+ getView().show(i18n.t("Loading"));
+ }
+
+ @ProxyEvent
+ public void onProgressHide(ProgressHideEvent event) {
+ getView().fade();
+ }
+
+ @Override
+ protected void revealInParent() {
+ RevealRootPopupContentEvent.fire(this, this);
+ // RevealRootContentEvent.fire(this, this);
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerPresenter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerViewImpl.java (from rev 1176, trunk/src/main/java/cc/kune/core/client/notify/SpinerViewImpl.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerViewImpl.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerViewImpl.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,66 @@
+package cc.kune.core.client.notify.spiner;
+
+import cc.kune.core.client.notify.spiner.SpinerPresenter.SpinerView;
+import cc.kune.core.ws.armor.client.WsArmor;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.InlineLabel;
+import com.google.gwt.user.client.ui.PopupPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+import com.gwtplatform.mvp.client.EventBus;
+import com.gwtplatform.mvp.client.PopupViewWithUiHandlers;
+import com.gwtplatform.mvp.client.UiHandlers;
+
+public class SpinerViewImpl extends PopupViewWithUiHandlers<UiHandlers> implements SpinerView {
+
+ private final PopupPanel popup;
+
+ @Inject
+ protected SpinerViewImpl(EventBus eventBus, WsArmor armor) {
+ super(eventBus);
+ widget = uiBinder.createAndBindUi(this);
+ popup = new PopupPanel(false, false);
+ popup.add(widget);
+ popup.setPopupPosition(0, 0);
+ popup.setStyleName("k-spiner-popup");
+ popup.show();
+ }
+
+ private static SpinerViewImplUiBinder uiBinder = GWT.create(SpinerViewImplUiBinder.class);
+
+ interface SpinerViewImplUiBinder extends UiBinder<Widget, SpinerViewImpl> {
+ }
+
+ @UiField
+ HorizontalPanel panel;
+ @UiField
+ InlineLabel label;
+ @UiField
+ Image img;
+ Widget widget;
+
+ @Override
+ public Widget asWidget() {
+ return popup;
+ }
+
+ @Override
+ public void fade() {
+ popup.hide();
+ }
+
+ @Override
+ public void show(String message) {
+ if (message == null || message.isEmpty()) {
+ label.setText("");
+ } else {
+ label.setText(message);
+ }
+ popup.show();
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerViewImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Copied: trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerViewImpl.ui.xml (from rev 1176, trunk/src/main/java/cc/kune/core/client/notify/SpinerViewImpl.ui.xml)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerViewImpl.ui.xml (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerViewImpl.ui.xml 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,11 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+ xmlns:g="urn:import:com.google.gwt.user.client.ui" xmlns:p1="urn:import:com.extjs.gxt.ui.client.widget">
+ <ui:with field='res' type='cc.kune.core.client.resources.CoreResources' />
+ <g:FlowPanel>
+ <g:HorizontalPanel ui:field="panel" styleName="kLoadingPanel" verticalAlignment="ALIGN_MIDDLE" horizontalAlignment="ALIGN_CENTER" borderWidth="0">
+ <g:Image ui:field="img" styleName="{res.css.loadingSpiner}" />
+ <g:InlineLabel ui:field="label" styleName="kLoadingLabel" horizontalAlignment="ALIGN_CENTER" />
+ </g:HorizontalPanel>
+ </g:FlowPanel>
+</ui:UiBinder>
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/core/client/notify/spiner/SpinerViewImpl.ui.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/core/client/state/ContentProviderDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/ContentProviderDefault.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/state/ContentProviderDefault.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -21,7 +21,7 @@
import java.util.HashMap;
-import cc.kune.core.client.notify.ProgressShowEvent;
+import cc.kune.core.client.notify.spiner.ProgressShowEvent;
import cc.kune.core.client.rpcservices.ContentServiceAsync;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.StateAbstractDTO;
Modified: trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -23,7 +23,7 @@
import cc.kune.core.client.actions.BeforeActionCollection;
import cc.kune.core.client.actions.BeforeActionListener;
-import cc.kune.core.client.notify.ProgressHideEvent;
+import cc.kune.core.client.notify.spiner.ProgressHideEvent;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.SocialNetworkDataDTO;
Deleted: trunk/src/main/java/cc/kune/core/client/state/UserSignIn.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/UserSignIn.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/state/UserSignIn.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,12 +0,0 @@
-package cc.kune.core.client.state;
-
-import cc.kune.core.shared.dto.UserInfoDTO;
-
-import com.gwtplatform.annotation.GenEvent;
-import com.gwtplatform.annotation.Order;
-
- at GenEvent
-public class UserSignIn {
- @Order(1)
- UserInfoDTO userInfo;
-}
Added: trunk/src/main/java/cc/kune/core/client/state/UserSignInEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/UserSignInEvent.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/state/UserSignInEvent.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,76 @@
+package cc.kune.core.client.state;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+import com.gwtplatform.mvp.client.HasEventBus;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class UserSignInEvent extends GwtEvent<UserSignInEvent.UserSignInHandler> {
+
+ public interface HasUserSignInHandlers extends HasHandlers {
+ HandlerRegistration addUserSignInHandler(UserSignInHandler handler);
+ }
+
+ public interface UserSignInHandler extends EventHandler {
+ public void onUserSignIn(UserSignInEvent event);
+ }
+
+ private static final Type<UserSignInHandler> TYPE = new Type<UserSignInHandler>();
+
+ public static void fire(HasEventBus source, cc.kune.core.shared.dto.UserInfoDTO userInfo) {
+ source.fireEvent(new UserSignInEvent(userInfo));
+ }
+
+ public static Type<UserSignInHandler> getType() {
+ return TYPE;
+ }
+
+ private final cc.kune.core.shared.dto.UserInfoDTO userInfo;
+
+ public UserSignInEvent(cc.kune.core.shared.dto.UserInfoDTO userInfo) {
+ this.userInfo = userInfo;
+ }
+
+ @Override
+ public Type<UserSignInHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ public cc.kune.core.shared.dto.UserInfoDTO getUserInfo() {
+ return userInfo;
+ }
+
+ @Override
+ protected void dispatch(UserSignInHandler handler) {
+ handler.onUserSignIn(this);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other != null && other.getClass().equals(this.getClass())) {
+ UserSignInEvent o = (UserSignInEvent) other;
+ return true
+ && ((o.userInfo == null && this.userInfo == null) || (o.userInfo != null && o.userInfo.equals(this.userInfo)))
+ ;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 23;
+ hashCode = (hashCode * 37) + getClass().hashCode();
+ hashCode = (hashCode * 37) + (userInfo == null ? 1 : userInfo.hashCode());
+ return hashCode;
+ }
+
+ @Override
+ public String toString() {
+ return "UserSignInEvent["
+ + userInfo
+ + "]";
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/state/UserSignInEvent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Deleted: trunk/src/main/java/cc/kune/core/client/state/UserSignOut.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/UserSignOut.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/client/state/UserSignOut.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -1,8 +0,0 @@
-package cc.kune.core.client.state;
-
-import com.gwtplatform.annotation.GenEvent;
-
- at GenEvent
-public class UserSignOut {
-
-}
Added: trunk/src/main/java/cc/kune/core/client/state/UserSignOutEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/UserSignOutEvent.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/state/UserSignOutEvent.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,67 @@
+package cc.kune.core.client.state;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+import com.gwtplatform.mvp.client.HasEventBus;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class UserSignOutEvent extends GwtEvent<UserSignOutEvent.UserSignOutHandler> {
+
+ public interface HasUserSignOutHandlers extends HasHandlers {
+ HandlerRegistration addUserSignOutHandler(UserSignOutHandler handler);
+ }
+
+ public interface UserSignOutHandler extends EventHandler {
+ public void onUserSignOut(UserSignOutEvent event);
+ }
+
+ private static final Type<UserSignOutHandler> TYPE = new Type<UserSignOutHandler>();
+
+ public static void fire(HasEventBus source) {
+ source.fireEvent(new UserSignOutEvent());
+ }
+
+ public static Type<UserSignOutHandler> getType() {
+ return TYPE;
+ }
+
+
+ public UserSignOutEvent() {
+ }
+
+ @Override
+ public Type<UserSignOutHandler> getAssociatedType() {
+ return TYPE;
+ }
+
+ @Override
+ protected void dispatch(UserSignOutHandler handler) {
+ handler.onUserSignOut(this);
+ }
+
+ @Override
+ public boolean equals(Object other) {
+ if (other != null && other.getClass().equals(this.getClass())) {
+ UserSignOutEvent o = (UserSignOutEvent) other;
+ return true
+ ;
+ }
+ return false;
+ }
+
+ @Override
+ public int hashCode() {
+ int hashCode = 23;
+ hashCode = (hashCode * 37) + getClass().hashCode();
+ return hashCode;
+ }
+
+ @Override
+ public String toString() {
+ return "UserSignOutEvent["
+ + "]";
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/core/client/state/UserSignOutEvent.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/cc/kune/core/public/images/kune-logo-16px.png
===================================================================
(Binary files differ)
Modified: trunk/src/main/java/cc/kune/core/public/ws.html
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.html 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/cc/kune/core/public/ws.html 2011-01-09 04:44:25 UTC (rev 1178)
@@ -52,6 +52,13 @@
</style>
<body>
+<!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
+<noscript>
+<div
+ style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
+Your web browser must have JavaScript enabled in order for this
+application to display correctly.</div>
+</noscript>
<iframe id="__gwt_historyFrame" style="width: 0; height: 0; border: 0"></iframe>
<iframe src="" id="__download" style="width: 0; height: 0; border: 0"></iframe>
<div id="kuneinitialcurtain"></div>
Added: trunk/src/main/java/cc/kune/msgs/KuneMsgs.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/msgs/KuneMsgs.gwt.xml (rev 0)
+++ trunk/src/main/java/cc/kune/msgs/KuneMsgs.gwt.xml 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module>
+ <!-- Inherit the core Web Toolkit stuff. -->
+ <inherits name='com.google.gwt.user.User' />
+ <inherits name="org.adamtacy.GWTEffects"></inherits>
+ <!-- Inherit the default GWT style sheet. You can change -->
+ <!-- the theme of your GWT application by uncommenting -->
+ <!-- any one of the following lines. -->
+ <!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
+ <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
+ <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
+ <!-- Other module inherits -->
+ <!-- Specify the app entry point class. -->
+<!-- <entry-point class='cc.kune.msgs.client.KuneMessagesSampleEntryPoint' />-->
+ <!-- Specify the paths for translatable code -->
+ <source path='client' />
+ <public path="public" />
+ <stylesheet src="kune-message.css" />
+</module>
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/msgs/KuneMsgs.gwt.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/msgs/KuneMsgsTests.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/msgs/KuneMsgsTests.gwt.xml (rev 0)
+++ trunk/src/main/java/cc/kune/msgs/KuneMsgsTests.gwt.xml 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module rename-to='kune_messages'>
+ <!-- Inherit the core Web Toolkit stuff. -->
+ <inherits name='com.google.gwt.user.User' />
+ <inherits name="org.adamtacy.GWTEffects"></inherits>
+ <!-- Inherit the default GWT style sheet. You can change -->
+ <!-- the theme of your GWT application by uncommenting -->
+ <!-- any one of the following lines. -->
+ <!-- <inherits name='com.google.gwt.user.theme.standard.Standard'/> -->
+ <!-- <inherits name='com.google.gwt.user.theme.chrome.Chrome'/> -->
+ <!-- <inherits name='com.google.gwt.user.theme.dark.Dark'/> -->
+ <!-- Other module inherits -->
+ <!-- Specify the app entry point class. -->
+ <entry-point class='cc.kune.msgs.client.KuneMessagesSampleEntryPoint' />
+ <!-- Specify the paths for translatable code -->
+ <source path='client' />
+ <public path="public" />
+ <stylesheet src="kune-message.css" />
+</module>
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/msgs/KuneMsgsTests.gwt.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/msgs/client/KuneMessagesSampleEntryPoint.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/KuneMessagesSampleEntryPoint.java (rev 0)
+++ trunk/src/main/java/cc/kune/msgs/client/KuneMessagesSampleEntryPoint.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,54 @@
+package cc.kune.msgs.client;
+
+import cc.kune.msgs.client.msgs.UserMessage;
+import cc.kune.msgs.client.msgs.UserMessageLevel;
+import cc.kune.msgs.client.panel.UserMessagesPanel;
+import cc.kune.msgs.client.panel.UserMessagesPresenter;
+
+import com.google.gwt.core.client.EntryPoint;
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.ui.PopupPanel;
+
+/**
+ * Entry point classes define <code>onModuleLoad()</code>.
+ */
+public class KuneMessagesSampleEntryPoint implements EntryPoint {
+
+ /**
+ * This is the entry point method.
+ */
+ @Override
+ public void onModuleLoad() {
+ UserMessagesPanel panel = new UserMessagesPanel();
+ UserMessage.setFadeMills(3000);
+ UserMessage.setCloseTitle("Close message");
+ panel.setWidth("422px");
+ final UserMessagesPresenter presenter = new UserMessagesPresenter();
+ presenter.init(panel);
+ presenter.add(UserMessageLevel.info, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit", false);
+ presenter.add(UserMessageLevel.error, "Lorem ipsum dolor sit amet, consectetuer adipiscing elit", false);
+ Timer time = new Timer() {
+ @Override
+ public void run() {
+ presenter.add(
+ UserMessageLevel.error,
+ "Lorem <a href='/'>ipsum</a> dolor sit amet, consectetuer adipiscing elit. Lorem ipsum dolor sit amet, consectetuer adipiscing elit",
+ true);
+ }
+ };
+ Timer time2 = new Timer() {
+ @Override
+ public void run() {
+ presenter.add(UserMessageLevel.important, "Lorem ", false);
+ presenter.add(UserMessageLevel.important, "Lorem ", true);
+ }
+ };
+ time.schedule(1000);
+ time2.schedule(2000);
+ PopupPanel aPanel = new PopupPanel();
+ aPanel.add(panel);
+ aPanel.setPopupPosition(0, 0);
+ aPanel.show();
+ // RootPanel.get().add(aPanel);
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/msgs/client/KuneMessagesSampleEntryPoint.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessage.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessage.java (rev 0)
+++ trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessage.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,119 @@
+package cc.kune.msgs.client.msgs;
+
+import org.adamtacy.client.ui.effects.events.EffectCompletedEvent;
+import org.adamtacy.client.ui.effects.events.EffectCompletedHandler;
+import org.adamtacy.client.ui.effects.examples.Fade;
+import org.adamtacy.client.ui.effects.examples.Show;
+
+import cc.kune.msgs.client.resources.UserMessageImages;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.ClickEvent;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.uibinder.client.UiHandler;
+import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HasText;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.InlineHTML;
+import com.google.gwt.user.client.ui.PushButton;
+import com.google.gwt.user.client.ui.Widget;
+
+public class UserMessage extends Composite implements HasText {
+
+ private static int fadeMills = 5000;
+ private static MessageUiBinder uiBinder = GWT.create(MessageUiBinder.class);
+ private static String closeTitle = "Close";
+
+ @UiField
+ Image icon;
+ @UiField
+ InlineHTML label;
+ @UiField
+ PushButton close;
+
+ interface MessageUiBinder extends UiBinder<Widget, UserMessage> {
+ }
+
+ public static void setCloseTitle(String title) {
+ closeTitle = title;
+ }
+
+ public static void setFadeMills(int mills) {
+ fadeMills = mills;
+ }
+
+ public UserMessage(UserMessageLevel level, String message, boolean closeable) {
+ initWidget(uiBinder.createAndBindUi(this));
+ setStyleName("k-msg");
+ label.setHTML(message);
+ close.setVisible(closeable);
+ close.setTitle(closeTitle);
+ if (!closeable) {
+ Timer time = new Timer() {
+ @Override
+ public void run() {
+ close();
+ }
+ };
+ time.schedule(fadeMills);
+ }
+ switch (level) {
+ case error:
+ icon.setResource(UserMessageImages.INST.error());
+ break;
+ case important:
+ icon.setResource(UserMessageImages.INST.important());
+ break;
+ case info:
+ icon.setResource(UserMessageImages.INST.info());
+ break;
+ case veryImportant:
+ icon.setResource(UserMessageImages.INST.warning());
+ break;
+ default:
+ break;
+ }
+ Show anim = new Show(this.getElement());
+ anim.setDuration(0.5);
+ anim.play();
+ }
+
+ public UserMessage(String message) {
+ this(message, false);
+ }
+
+ public UserMessage(String message, boolean closeable) {
+ this(UserMessageLevel.info, message, closeable);
+ }
+
+ @Override
+ public void setText(String text) {
+ label.setText(text);
+ }
+
+ @Override
+ public String getText() {
+ return label.getText();
+ }
+
+ @UiHandler("close")
+ void handleClick(ClickEvent e) {
+ close();
+ }
+
+ private void close() {
+ Fade fade = new Fade(this.getElement());
+ fade.setDuration(0.7);
+ fade.play();
+ fade.addEffectCompletedHandler(new EffectCompletedHandler() {
+
+ @Override
+ public void onEffectCompleted(EffectCompletedEvent event) {
+ removeFromParent();
+ }
+ });
+ }
+
+}
Property changes on: trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessage.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessage.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessage.ui.xml (rev 0)
+++ trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessage.ui.xml 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,20 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+ xmlns:g="urn:import:com.google.gwt.user.client.ui">
+ <ui:with field='img' type='cc.kune.msgs.client.resources.UserMessageImages' />
+ <g:HorizontalPanel verticalAlignment="ALIGN_MIDDLE"
+ height="42px">
+ <g:SimplePanel addStyleNames="k-msg-icon">
+ <g:Image width="100%" ui:field="icon" height="100%" />
+ </g:SimplePanel>
+ <g:Cell width="100%">
+ <g:InlineHTML ui:field="label" width="100%" styleName="k-msg-label" />
+ </g:Cell>
+ <g:PushButton ui:field="close" styleName="k-msg-close"
+ width="22px">
+ <g:upHoveringFace image='{img.removeGrey}' />
+ <g:downFace image='{img.removeOver}'/>
+ <g:upFace image='{img.remove}' />
+ </g:PushButton>
+ </g:HorizontalPanel>
+</ui:UiBinder>
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessage.ui.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessageLevel.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessageLevel.java (rev 0)
+++ trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessageLevel.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,5 @@
+package cc.kune.msgs.client.msgs;
+
+public enum UserMessageLevel {
+ info, important, veryImportant, error
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/msgs/client/msgs/UserMessageLevel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPanel.java (rev 0)
+++ trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPanel.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,40 @@
+package cc.kune.msgs.client.panel;
+
+import org.adamtacy.client.ui.effects.impl.SlideDown;
+
+import cc.kune.msgs.client.msgs.UserMessage;
+import cc.kune.msgs.client.msgs.UserMessageLevel;
+import cc.kune.msgs.client.panel.UserMessagesPresenter.MessagesView;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class UserMessagesPanel extends Composite implements MessagesView {
+
+ private static MessagesPanelUiBinder uiBinder = GWT.create(MessagesPanelUiBinder.class);
+ @UiField
+ VerticalPanel vp;
+ private final SlideDown anim;
+
+ interface MessagesPanelUiBinder extends UiBinder<Widget, UserMessagesPanel> {
+ }
+
+ public UserMessagesPanel() {
+ initWidget(uiBinder.createAndBindUi(this));
+ anim = new SlideDown(this.getElement());
+ anim.setDuration(2);
+ }
+
+ @Override
+ public void add(UserMessageLevel info, String message, boolean closeable) {
+ UserMessage msg = new UserMessage(info, message, closeable);
+ vp.add(msg);
+ if (anim.isFinished()) {
+ // anim.play();
+ }
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPanel.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPanel.ui.xml (rev 0)
+++ trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPanel.ui.xml 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,7 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+ xmlns:g="urn:import:com.google.gwt.user.client.ui">
+ <g:VerticalPanel verticalAlignment="ALIGN_TOP"
+ ui:field="vp" width="100%" height="" styleName="k-msg-panel" spacing="10">
+ </g:VerticalPanel>
+</ui:UiBinder>
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPanel.ui.xml
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPresenter.java (rev 0)
+++ trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPresenter.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,23 @@
+package cc.kune.msgs.client.panel;
+
+import cc.kune.msgs.client.msgs.UserMessageLevel;
+
+public class UserMessagesPresenter {
+
+ private MessagesView view;
+
+ public interface MessagesView {
+ void add(UserMessageLevel info, String message, boolean closable);
+ }
+
+ public UserMessagesPresenter() {
+ }
+
+ public void init(MessagesView view) {
+ this.view = view;
+ }
+
+ public void add(UserMessageLevel info, String message, boolean closable) {
+ view.add(info, message, closable);
+ }
+}
Property changes on: trunk/src/main/java/cc/kune/msgs/client/panel/UserMessagesPresenter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/msgs/client/resources/UserMessageImages.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/resources/UserMessageImages.java (rev 0)
+++ trunk/src/main/java/cc/kune/msgs/client/resources/UserMessageImages.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,28 @@
+package cc.kune.msgs.client.resources;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
+
+public interface UserMessageImages extends ClientBundle {
+
+ public static final UserMessageImages INST = GWT.create(UserMessageImages.class);
+
+ ImageResource error();
+
+ ImageResource info();
+
+ ImageResource warning();
+
+ ImageResource important();
+
+ ImageResource severe();
+
+ ImageResource remove();
+
+ @Source("remove-grey.png")
+ ImageResource removeGrey();
+
+ @Source("remove-over.png")
+ ImageResource removeOver();
+}
Property changes on: trunk/src/main/java/cc/kune/msgs/client/resources/UserMessageImages.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/cc/kune/msgs/client/resources/error.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/msgs/client/resources/error.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/msgs/client/resources/important.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/msgs/client/resources/important.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/msgs/client/resources/info.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/msgs/client/resources/info.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/msgs/client/resources/remove-grey.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/msgs/client/resources/remove-grey.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/msgs/client/resources/remove-over.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/msgs/client/resources/remove-over.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/msgs/client/resources/remove.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/msgs/client/resources/remove.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/msgs/client/resources/severe.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/msgs/client/resources/severe.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/msgs/client/resources/warning.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/msgs/client/resources/warning.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/msgs/public/kune-message.css
===================================================================
--- trunk/src/main/java/cc/kune/msgs/public/kune-message.css (rev 0)
+++ trunk/src/main/java/cc/kune/msgs/public/kune-message.css 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,45 @@
+.k-msg-panel {
+ background-color: #892c00;
+ -webkit-border-bottom-right-radius: 5px;
+ -moz-border-radius-bottomright: 5px;
+ border-bottom-right-radius: 5px;
+ kfilter: alpha(opacity = 80);
+ -moz-opacity: 0.80;
+ -khtml-opacity: 0.80;
+ opacity: 0.80;
+}
+
+.k-msg-panel-title {
+ color: #ffe9da;
+ font-weight: bold;
+ margin-bottom: 10px;
+}
+
+.k-msg {
+ margin: 0 5px;
+ border: solid 1px #F2F2F2;
+ -moz-border-radius: 3px;
+ -webkit-border-radius: 3px;
+ border-radius: 3px;
+ background: #fff0e6;
+ color: #280b0b;
+ filter: alpha(opacity = 80);
+ -moz-opacity: 0.80;
+ -khtml-opacity: 0.80;
+ opacity: 0.80;
+ font-weight: bold;
+}
+
+.k-msg-close {
+ position: relative;
+ right: -14px;
+ top: 30px;
+}
+
+.k-msg-icon {
+ padding: 10px 10px 5px;
+}
+
+.k-msg-label {
+ font-size: 17px;
+}
\ No newline at end of file
Property changes on: trunk/src/main/java/cc/kune/msgs/public/kune-message.css
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -99,6 +99,20 @@
builder.exclude("/stylesheets/.*");
builder.exclude("/javascripts/.*");
builder.exclude("/templates/.*");
+ // wave servlets (see RackServletFilter)
+ // builder.exclude("/gadget.*");
+ // builder.exclude("/attachment/*");
+ // builder.exclude("/auth/signin");
+ // builder.exclude("/auth/signout");
+ // builder.exclude("/auth/register");
+ // builder.exclude("/fetch/*");
+ // builder.exclude("/gadgets.*");
+ // // wave (from ServerRprcProvider)
+ // builder.exclude("/socket");
+ // builder.exclude("/socket.io/*");
+ // builder.exclude("/static/*");
+ // FIXME (add robots and / WaveClientServlet)
+
builder.at(".*").install(new LogFilter());
builder.at(".*").install(new GuiceFilter());
@@ -119,6 +133,7 @@
}
private void installGuiceModules(final RackBuilder builder) {
+ // https://code.google.com/p/google-guice/wiki/ServletModule
builder.use(new ServletModule());
builder.use(new PlatformServerModule());
builder.use(new DocumentServerModule());
Added: trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcControllerImpl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcControllerImpl.java (rev 0)
+++ trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcControllerImpl.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,225 @@
+/**
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.ourproject.kune.app.server.wave;
+
+import org.waveprotocol.box.server.rpc.Rpc;
+import org.waveprotocol.box.server.rpc.ServerRpcController;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+
+import com.google.protobuf.Descriptors;
+import com.google.protobuf.Message;
+import com.google.protobuf.RpcCallback;
+import com.google.protobuf.Service;
+
+/**
+ * Implements the server end-point of a wave server RPC connection. This is a
+ * single-use RPC controller.
+ *
+ *
+ */
+public class CustomServerRpcControllerImpl implements ServerRpcController {
+ private final Message requestMessage;
+ private final Service backingService;
+ private final Descriptors.MethodDescriptor serviceMethod;
+ private final RpcCallback<Message> callback;
+ private final boolean isStreamingRpc;
+
+ // The following variables represent the current status of this instance,
+ // and
+ // must all only be accessed or modified while synchronised on statusLock.
+ private final Object statusLock = new Object();
+ private boolean complete = false;
+ private RpcCallback<Object> cancelCallback = null;
+ private boolean cancelled = false;
+ private final ParticipantId loggedInUser;
+
+ /**
+ * Instantiate a new ServerRpcController that may later be completely
+ * invoked by calling {#link run}.
+ *
+ * @param requestMessage
+ * the request being handled
+ * @param backingService
+ * the backing service type
+ * @param serviceMethod
+ * the specific method within the backing service type
+ * @param loggedInUser
+ * the currently logged in user
+ * @param callback
+ * the destination where responses may be passed - may be called
+ * once (normal RPC) or 1-n times (streaming RPC), and will pass
+ * instances of RpcFinished as required (error cases, or
+ * streaming RPC shutdown); is also always called under the
+ * ServerRpcController's statusLock to ensure that consecutive
+ * calls (in the streaming case) are called in series
+ */
+ public CustomServerRpcControllerImpl(Message requestMessage, Service backingService,
+ Descriptors.MethodDescriptor serviceMethod, ParticipantId loggedInUser, RpcCallback<Message> callback) {
+ this.requestMessage = requestMessage;
+ this.backingService = backingService;
+ this.serviceMethod = serviceMethod;
+ this.loggedInUser = loggedInUser;
+ this.isStreamingRpc = serviceMethod.getOptions().getExtension(Rpc.isStreamingRpc);
+ this.callback = callback;
+ }
+
+ @Override
+ public String errorText() {
+ throw new UnsupportedOperationException("Client-side method of RpcController only.");
+ }
+
+ @Override
+ public boolean failed() {
+ throw new UnsupportedOperationException("Client-side method of RpcController only.");
+ }
+
+ @Override
+ public boolean isCanceled() {
+ return cancelled;
+ }
+
+ /**
+ * Registers a cancellation callback. This will always be called as part of
+ * this RPC, and always at most once; either when the client asks to cancel
+ * it, or when the RPC finishes (regardless of error case).
+ *
+ * This callback will be called outside normal locks on ServerRpcController
+ * state, i.e., not within a block synchronised on statusLock.
+ */
+ @Override
+ public void notifyOnCancel(final RpcCallback<Object> callback) {
+ RpcCallback<Object> runCallback = null;
+ synchronized (statusLock) {
+ if (cancelCallback != null) {
+ throw new IllegalStateException("Must only be called once per request.");
+ } else {
+ cancelCallback = callback;
+ if (cancelled || complete) {
+ runCallback = cancelCallback;
+ }
+ }
+ }
+ if (runCallback != null) {
+ runCallback.run(null);
+ }
+ }
+
+ @Override
+ public void reset() {
+ throw new UnsupportedOperationException("Client-side method of RpcController only.");
+ }
+
+ @Override
+ public void setFailed(String reason) {
+ RpcCallback<Object> runCallback = null;
+ synchronized (statusLock) {
+ if (complete) {
+ throw new IllegalStateException("Can't fail this RPC, as it is already complete.");
+ } else {
+ complete = true;
+ callback.run(Rpc.RpcFinished.newBuilder().setFailed(true).setErrorText(reason).build());
+ if (cancelCallback != null && !cancelled) {
+ runCallback = cancelCallback;
+ }
+ }
+ }
+ if (runCallback != null) {
+ runCallback.run(null);
+ }
+ }
+
+ @Override
+ public void startCancel() {
+ throw new UnsupportedOperationException("Client-side method of RpcController only.");
+ }
+
+ @Override
+ public void cancel() {
+ RpcCallback<Object> runCallback = null;
+ synchronized (statusLock) {
+ if (cancelled) {
+ throw new IllegalStateException("Can't cancel RPC, already cancelled.");
+ }
+ cancelled = true;
+ if (cancelCallback != null && !complete) {
+ runCallback = cancelCallback;
+ }
+ }
+ if (runCallback != null) {
+ runCallback.run(null);
+ }
+ }
+
+ /**
+ * Run this ServerRpcController in the current thread. This must only be
+ * invoked ONCE, and will throw an IllegalStateException otherwise.
+ */
+ @Override
+ public void run() {
+ RpcCallback<Message> messageCallback = new RpcCallback<Message>() {
+ @Override
+ public void run(Message result) {
+ RpcCallback<Object> runCallback = null;
+ synchronized (statusLock) {
+ if (complete) {
+ throw new IllegalStateException("Can't send responses over this RPC, as it is"
+ + " already complete: " + result);
+ }
+ if (!isStreamingRpc || result == null) {
+ // This either completes the streaming RPC (by passing
+ // an instance
+ // of RpcFinished in place of null) or completes a
+ // normal RPC (by
+ // passing any other message).
+ if (result == null) {
+ result = Rpc.RpcFinished.newBuilder().setFailed(false).build();
+ }
+ callback.run(result);
+
+ // Now complete, mark as such and invoke the
+ // cancellation callback.
+ complete = true;
+ if (cancelCallback != null && !cancelled) {
+ runCallback = cancelCallback;
+ }
+ } else {
+ // Streaming RPC update.
+ callback.run(result);
+ }
+ }
+ if (runCallback != null) {
+ runCallback.run(null);
+ }
+ }
+ };
+ try {
+ backingService.callMethod(serviceMethod, this, requestMessage, messageCallback);
+ } catch (RuntimeException e) {
+ // Pass the description of any RuntimeException back to the caller.
+ e.printStackTrace();
+ if (!complete) {
+ setFailed(e.toString());
+ }
+ }
+ }
+
+ @Override
+ public ParticipantId getLoggedInUser() {
+ return loggedInUser;
+ }
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcControllerImpl.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcProvider.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcProvider.java (rev 0)
+++ trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcProvider.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,494 @@
+/**
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.ourproject.kune.app.server.wave;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import javax.servlet.Servlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.eclipse.jetty.server.Connector;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.nio.SelectChannelConnector;
+import org.eclipse.jetty.servlet.DefaultServlet;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.websocket.WebSocket;
+import org.eclipse.jetty.websocket.WebSocketServlet;
+import org.waveprotocol.box.common.comms.WaveClientRpc.ProtocolAuthenticate;
+import org.waveprotocol.box.common.comms.WaveClientRpc.ProtocolAuthenticationResult;
+import org.waveprotocol.box.server.CoreSettings;
+import org.waveprotocol.box.server.authentication.SessionManager;
+import org.waveprotocol.box.server.rpc.MessageExpectingChannel;
+import org.waveprotocol.box.server.rpc.ProtoCallback;
+import org.waveprotocol.box.server.rpc.Rpc;
+import org.waveprotocol.box.server.rpc.ServerRpcController;
+import org.waveprotocol.box.server.rpc.SocketIOServerChannel;
+import org.waveprotocol.box.server.rpc.WebSocketServerChannel;
+import org.waveprotocol.box.server.util.NetUtils;
+import org.waveprotocol.wave.model.util.Pair;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+import org.waveprotocol.wave.util.logging.Log;
+
+import com.glines.socketio.server.SocketIOInbound;
+import com.glines.socketio.server.SocketIOServlet;
+import com.glines.socketio.server.transport.FlashSocketTransport;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+import com.google.protobuf.Descriptors;
+import com.google.protobuf.Descriptors.MethodDescriptor;
+import com.google.protobuf.Message;
+import com.google.protobuf.RpcCallback;
+import com.google.protobuf.Service;
+import com.google.protobuf.UnknownFieldSet;
+
+/**
+ * ServerRpcProvider can provide instances of type Service over an incoming
+ * network socket and service incoming RPCs to these services and their methods.
+ *
+ *
+ */
+public class CustomServerRpcProvider {
+ private static final Log LOG = Log.get(CustomServerRpcProvider.class);
+
+ private final InetSocketAddress[] httpAddresses;
+ private final Integer flashsocketPolicyPort;
+ private final Set<Connection> incomingConnections = Sets.newHashSet();
+ private final ExecutorService threadPool;
+ private final SessionManager sessionManager;
+ private final org.eclipse.jetty.server.SessionManager jettySessionManager;
+ private Server httpServer = null;
+
+ // Mapping from incoming protocol buffer type -> specific handler.
+ private final Map<Descriptors.Descriptor, RegisteredServiceMethod> registeredServices = Maps.newHashMap();
+
+ /**
+ * Internal, static container class for any specific registered service
+ * method.
+ */
+ static class RegisteredServiceMethod {
+ final Service service;
+ final MethodDescriptor method;
+
+ RegisteredServiceMethod(Service service, MethodDescriptor method) {
+ this.service = service;
+ this.method = method;
+ }
+ }
+
+ class WebSocketConnection extends Connection {
+ private final WebSocketServerChannel socketChannel;
+
+ WebSocketConnection(ParticipantId loggedInUser) {
+ super(loggedInUser);
+ socketChannel = new WebSocketServerChannel(this);
+ LOG.info("New websocket connection set up for user " + loggedInUser);
+ expectMessages(socketChannel);
+ }
+
+ @Override
+ protected void sendMessage(long sequenceNo, Message message) {
+ socketChannel.sendMessage(sequenceNo, message);
+ }
+
+ public WebSocketServerChannel getWebSocketServerChannel() {
+ return socketChannel;
+ }
+ }
+
+ class SocketIOConnection extends Connection {
+ private final SocketIOServerChannel socketChannel;
+
+ SocketIOConnection(ParticipantId loggedInUser) {
+ super(loggedInUser);
+ socketChannel = new SocketIOServerChannel(this);
+ LOG.info("New websocket connection set up for user " + loggedInUser);
+ expectMessages(socketChannel);
+ }
+
+ @Override
+ protected void sendMessage(long sequenceNo, Message message) {
+ socketChannel.sendMessage(sequenceNo, message);
+ }
+
+ public SocketIOServerChannel getWebSocketServerChannel() {
+ return socketChannel;
+ }
+ }
+
+ abstract class Connection implements ProtoCallback {
+ private final Map<Long, ServerRpcController> activeRpcs = new ConcurrentHashMap<Long, ServerRpcController>();
+
+ // The logged in user.
+ // Note: Due to this bug:
+ // http://code.google.com/p/wave-protocol/issues/detail?id=119,
+ // the field may be null on first connect and then set later using an
+ // RPC.
+ private ParticipantId loggedInUser;
+
+ /**
+ * @param loggedInUser
+ * The currently logged in user, or null if no user is logged
+ * in.
+ */
+ public Connection(ParticipantId loggedInUser) {
+ this.loggedInUser = loggedInUser;
+ }
+
+ protected void expectMessages(MessageExpectingChannel channel) {
+ synchronized (registeredServices) {
+ for (RegisteredServiceMethod serviceMethod : registeredServices.values()) {
+ channel.expectMessage(serviceMethod.service.getRequestPrototype(serviceMethod.method));
+ LOG.fine("Expecting: " + serviceMethod.method.getFullName());
+ }
+ }
+ channel.expectMessage(Rpc.CancelRpc.getDefaultInstance());
+ }
+
+ protected abstract void sendMessage(long sequenceNo, Message message);
+
+ private ParticipantId authenticate(String token) {
+ HttpSession session = sessionManager.getSessionFromToken(token);
+ ParticipantId user = sessionManager.getLoggedInUser(session);
+ return user;
+ }
+
+ @Override
+ public void message(final long sequenceNo, Message message) {
+ if (message instanceof Rpc.CancelRpc) {
+ final ServerRpcController controller = activeRpcs.get(sequenceNo);
+ if (controller == null) {
+ throw new IllegalStateException("Trying to cancel an RPC that is not active!");
+ } else {
+ LOG.info("Cancelling open RPC " + sequenceNo);
+ controller.cancel();
+ }
+ } else if (message instanceof ProtocolAuthenticate) {
+ // Workaround for bug:
+ // http://codereview.waveprotocol.org/224001/
+
+ // When we get this message, either the connection will not be
+ // logged in
+ // (loggedInUser == null) or the connection will have been
+ // authenticated
+ // via cookies
+ // (in which case loggedInUser must match the authenticated
+ // user, and
+ // this message has no
+ // effect).
+
+ ProtocolAuthenticate authMessage = (ProtocolAuthenticate) message;
+ ParticipantId authenticatedAs = authenticate(authMessage.getToken());
+
+ Preconditions.checkArgument(authenticatedAs != null, "Auth token invalid");
+ Preconditions.checkState(loggedInUser == null || loggedInUser.equals(authenticatedAs),
+ "Session already authenticated as a different user");
+
+ loggedInUser = authenticatedAs;
+ LOG.info("Session authenticated as " + loggedInUser);
+ sendMessage(sequenceNo, ProtocolAuthenticationResult.getDefaultInstance());
+ } else if (registeredServices.containsKey(message.getDescriptorForType())) {
+ if (activeRpcs.containsKey(sequenceNo)) {
+ throw new IllegalStateException("Can't invoke a new RPC with a sequence number already in use.");
+ } else {
+ final RegisteredServiceMethod serviceMethod = registeredServices.get(message.getDescriptorForType());
+
+ // Create the internal ServerRpcController used to invoke
+ // the call.
+ final ServerRpcController controller = new CustomServerRpcControllerImpl(message,
+ serviceMethod.service, serviceMethod.method, loggedInUser, new RpcCallback<Message>() {
+ @Override
+ synchronized public void run(Message message) {
+ if (message instanceof Rpc.RpcFinished
+ || !serviceMethod.method.getOptions().getExtension(Rpc.isStreamingRpc)) {
+ // This RPC is over - remove it from the
+ // map.
+ boolean failed = message instanceof Rpc.RpcFinished ? ((Rpc.RpcFinished) message).getFailed()
+ : false;
+ LOG.fine("RPC " + sequenceNo + " is now finished, failed = " + failed);
+ if (failed) {
+ LOG.info("error = " + ((Rpc.RpcFinished) message).getErrorText());
+ }
+ activeRpcs.remove(sequenceNo);
+ }
+ sendMessage(sequenceNo, message);
+ }
+ });
+
+ // Kick off a new thread specific to this RPC.
+ activeRpcs.put(sequenceNo, controller);
+ threadPool.execute(controller);
+ }
+ } else {
+ // Sent a message type we understand, but don't expect -
+ // erronous case!
+ throw new IllegalStateException("Got expected but unknown message (" + message + ") for sequence: "
+ + sequenceNo);
+ }
+ }
+
+ @Override
+ public void unknown(long sequenceNo, String messageType, UnknownFieldSet message) {
+ throw new IllegalStateException("Got unknown message (type: " + messageType + ", " + message
+ + ") for sequence: " + sequenceNo);
+ }
+
+ @Override
+ public void unknown(long sequenceNo, String messageType, String message) {
+ throw new IllegalStateException("Got unknown message (type: " + messageType + ", " + message
+ + ") for sequence: " + sequenceNo);
+ }
+ }
+
+ /**
+ * Construct a new ServerRpcProvider, hosting on the specified WebSocket
+ * addresses.
+ *
+ * Also accepts an ExecutorService for spawning managing threads.
+ */
+ public CustomServerRpcProvider(InetSocketAddress[] httpAddresses, Integer flashsocketPolicyPort,
+ ExecutorService threadPool, SessionManager sessionManager,
+ org.eclipse.jetty.server.SessionManager jettySessionManager) {
+ this.httpAddresses = httpAddresses;
+ this.flashsocketPolicyPort = flashsocketPolicyPort;
+ this.threadPool = threadPool;
+ this.sessionManager = sessionManager;
+ this.jettySessionManager = jettySessionManager;
+ }
+
+ /**
+ * Constructs a new ServerRpcProvider with a default ExecutorService.
+ */
+ public CustomServerRpcProvider(InetSocketAddress[] httpAddresses, Integer flashsocketPolicyPort,
+ SessionManager sessionManager, org.eclipse.jetty.server.SessionManager jettySessionManager) {
+ this(httpAddresses, flashsocketPolicyPort, Executors.newCachedThreadPool(), sessionManager, jettySessionManager);
+ }
+
+ @Inject
+ public CustomServerRpcProvider(@Named(CoreSettings.HTTP_FRONTEND_ADDRESSES) List<String> httpAddresses,
+ @Named(CoreSettings.FLASHSOCKET_POLICY_PORT) Integer flashsocketPolicyPort, SessionManager sessionManager,
+ org.eclipse.jetty.server.SessionManager jettySessionManager) {
+ this(parseAddressList(httpAddresses), flashsocketPolicyPort, sessionManager, jettySessionManager);
+ }
+
+ public void startWebSocketServer() {
+ httpServer = new Server();
+
+ List<SelectChannelConnector> connectors = getSelectChannelConnectors(httpAddresses);
+ if (connectors.isEmpty()) {
+ LOG.severe("No valid http end point address provided!");
+ }
+ for (SelectChannelConnector connector : connectors) {
+ httpServer.addConnector(connector);
+ }
+
+ ServletContextHandler context = new ServletContextHandler(ServletContextHandler.SESSIONS);
+ if (jettySessionManager != null) {
+ context.getSessionHandler().setSessionManager(jettySessionManager);
+ }
+ context.setResourceBase("./war");
+
+ // Servlet where the websocket connection is served from.
+ ServletHolder wsholder = new ServletHolder(new WaveWebSocketServlet());
+ context.addServlet(wsholder, "/socket");
+ // TODO(zamfi): fix to let messages span frames.
+ wsholder.setInitParameter("bufferSize", "" + 1024 * 1024); // 1M buffer
+
+ // Servlet where the websocket connection is served from.
+ ServletHolder sioholder = new ServletHolder(new WaveSocketIOServlet());
+ context.addServlet(sioholder, "/socket.io/*");
+ // TODO(zamfi): fix to let messages span frames.
+ sioholder.setInitParameter("bufferSize", "" + 1024 * 1024); // 1M buffer
+ // Set flash policy server parameters
+ String flashPolicyServerHost = "localhost";
+ StringBuilder flashPolicyAllowedPorts = new StringBuilder();
+ /*
+ * Loop through addresses, collect list of ports, and determine if we
+ * are to use "localhost" of the AnyHost wildcard.
+ */
+ for (InetSocketAddress addr : httpAddresses) {
+ if (flashPolicyAllowedPorts.length() > 0) {
+ flashPolicyAllowedPorts.append(",");
+ }
+ flashPolicyAllowedPorts.append(addr.getPort());
+ if (!addr.getAddress().isLoopbackAddress()) {
+ // Until it's possible to pass a list of address, this is the
+ // only valid alternative.
+ flashPolicyServerHost = "0.0.0.0";
+ }
+ }
+ sioholder.setInitParameter(FlashSocketTransport.FLASHPOLICY_SERVER_HOST_KEY, flashPolicyServerHost);
+ sioholder.setInitParameter(FlashSocketTransport.FLASHPOLICY_SERVER_PORT_KEY, "" + flashsocketPolicyPort);
+ // TODO: Change to use the public http address and all other bound
+ // addresses.
+ sioholder.setInitParameter(FlashSocketTransport.FLASHPOLICY_DOMAIN_KEY, "*");
+ sioholder.setInitParameter(FlashSocketTransport.FLASHPOLICY_PORTS_KEY, flashPolicyAllowedPorts.toString());
+
+ // Serve the static content and GWT web client with the default servlet
+ // (acts like a standard file-based web server).
+ ServletHolder defaultServlet = new ServletHolder(new DefaultServlet());
+ context.addServlet(defaultServlet, "/static/*");
+ context.addServlet(defaultServlet, "/webclient/*");
+
+ for (Pair<String, ServletHolder> servlet : servletRegistry) {
+ context.addServlet(servlet.getSecond(), servlet.getFirst());
+ }
+
+ httpServer.setHandler(context);
+
+ try {
+ httpServer.start();
+ } catch (Exception e) { // yes, .start() throws "Exception"
+ LOG.severe("Fatal error starting http server.", e);
+ return;
+ }
+ LOG.fine("WebSocket server running.");
+ }
+
+ private static InetSocketAddress[] parseAddressList(List<String> addressList) {
+ if (addressList == null || addressList.size() == 0) {
+ return new InetSocketAddress[0];
+ } else {
+ Set<InetSocketAddress> addresses = Sets.newHashSet();
+ for (String str : addressList) {
+ if (str.length() == 0) {
+ LOG.warning("Encountered empty address in http addresses list.");
+ } else {
+ try {
+ InetSocketAddress address = NetUtils.parseHttpAddress(str);
+ if (!addresses.contains(address)) {
+ addresses.add(address);
+ } else {
+ LOG.warning("Ignoring duplicate address in http addresses list: Duplicate entry '" + str
+ + "' resolved to " + address.getAddress().getHostAddress());
+ }
+ } catch (IOException e) {
+ LOG.severe("Unable to process address " + str, e);
+ }
+ }
+ }
+ return addresses.toArray(new InetSocketAddress[0]);
+ }
+ }
+
+ /**
+ * @return a list of {@link SelectChannelConnector} each bound to a
+ * host:port pair form the list addresses.
+ */
+ private List<SelectChannelConnector> getSelectChannelConnectors(InetSocketAddress[] httpAddresses) {
+ List<SelectChannelConnector> list = Lists.newArrayList();
+ for (InetSocketAddress address : httpAddresses) {
+ SelectChannelConnector connector = new SelectChannelConnector();
+ connector.setHost(address.getAddress().getHostAddress());
+ connector.setPort(address.getPort());
+ list.add(connector);
+ }
+
+ return list;
+ }
+
+ public class WaveWebSocketServlet extends WebSocketServlet {
+ @Override
+ protected WebSocket doWebSocketConnect(HttpServletRequest request, String protocol) {
+ ParticipantId loggedInUser = sessionManager.getLoggedInUser(request.getSession(false));
+
+ WebSocketConnection connection = new WebSocketConnection(loggedInUser);
+ return connection.getWebSocketServerChannel();
+ }
+ }
+
+ public class WaveSocketIOServlet extends SocketIOServlet {
+ @Override
+ protected SocketIOInbound doSocketIOConnect(HttpServletRequest request, String[] protocols) {
+ ParticipantId loggedInUser = sessionManager.getLoggedInUser(request.getSession(false));
+
+ SocketIOConnection connection = new SocketIOConnection(loggedInUser);
+ return connection.getWebSocketServerChannel();
+ }
+ }
+
+ /**
+ * Returns the socket the WebSocket server is listening on.
+ */
+ public SocketAddress getWebSocketAddress() {
+ if (httpServer == null) {
+ return null;
+ } else {
+ Connector c = httpServer.getConnectors()[0];
+ return new InetSocketAddress(c.getHost(), c.getLocalPort());
+ }
+ }
+
+ /**
+ * Stops this server.
+ */
+ public void stopServer() throws IOException {
+ try {
+ httpServer.stop(); // yes, .stop() throws "Exception"
+ } catch (Exception e) {
+ LOG.warning("Fatal error stopping http server.", e);
+ }
+ LOG.fine("server shutdown.");
+ }
+
+ /**
+ * Register all methods provided by the given service type.
+ */
+ public void registerService(Service service) {
+ synchronized (registeredServices) {
+ for (MethodDescriptor methodDescriptor : service.getDescriptorForType().getMethods()) {
+ registeredServices.put(methodDescriptor.getInputType(), new RegisteredServiceMethod(service,
+ methodDescriptor));
+ }
+ }
+ }
+
+ /**
+ * Set of servlets
+ */
+ List<Pair<String, ServletHolder>> servletRegistry = Lists.newArrayList();
+
+ /**
+ * Add a servlet to the servlet registry. This servlet will be attached to
+ * the specified URL pattern when the server is started up.
+ *
+ * @param urlPattern
+ * URL pattern for paths. Eg, '/foo', '/foo/*'
+ * @param servlet
+ * The servlet object to bind to the specified paths
+ * @return the {@link ServletHolder} that holds the servlet.
+ */
+ public ServletHolder addServlet(String urlPattern, Servlet servlet) {
+ ServletHolder servletHolder = new ServletHolder(servlet);
+ servletRegistry.add(new Pair<String, ServletHolder>(urlPattern, servletHolder));
+ return servletHolder;
+ }
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcProvider.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcProviderSamePort.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcProviderSamePort.java (rev 0)
+++ trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcProviderSamePort.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,564 @@
+/**
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.ourproject.kune.app.server.wave;
+
+import java.io.IOException;
+import java.net.InetSocketAddress;
+import java.net.SocketAddress;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.Set;
+import java.util.concurrent.ConcurrentHashMap;
+import java.util.concurrent.ExecutorService;
+import java.util.concurrent.Executors;
+
+import javax.servlet.Servlet;
+import javax.servlet.ServletConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpSession;
+
+import org.eclipse.jetty.server.nio.SelectChannelConnector;
+import org.eclipse.jetty.servlet.DefaultServlet;
+import org.eclipse.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.websocket.WebSocket;
+import org.eclipse.jetty.websocket.WebSocketServlet;
+import org.waveprotocol.box.common.comms.WaveClientRpc.ProtocolAuthenticate;
+import org.waveprotocol.box.common.comms.WaveClientRpc.ProtocolAuthenticationResult;
+import org.waveprotocol.box.server.CoreSettings;
+import org.waveprotocol.box.server.authentication.SessionManager;
+import org.waveprotocol.box.server.rpc.MessageExpectingChannel;
+import org.waveprotocol.box.server.rpc.ProtoCallback;
+import org.waveprotocol.box.server.rpc.Rpc;
+import org.waveprotocol.box.server.rpc.ServerRpcController;
+import org.waveprotocol.box.server.rpc.SocketIOServerChannel;
+import org.waveprotocol.box.server.rpc.WebSocketServerChannel;
+import org.waveprotocol.box.server.util.NetUtils;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+import org.waveprotocol.wave.util.logging.Log;
+
+import com.glines.socketio.server.SocketIOInbound;
+import com.glines.socketio.server.SocketIOServlet;
+import com.glines.socketio.server.transport.FlashSocketTransport;
+import com.google.common.base.Preconditions;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.common.collect.Sets;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import com.google.inject.name.Named;
+import com.google.inject.servlet.ServletModule;
+import com.google.protobuf.Descriptors;
+import com.google.protobuf.Descriptors.MethodDescriptor;
+import com.google.protobuf.Message;
+import com.google.protobuf.RpcCallback;
+import com.google.protobuf.Service;
+import com.google.protobuf.UnknownFieldSet;
+
+/**
+ * ServerRpcProvider can provide instances of type Service over an incoming
+ * network socket and service incoming RPCs to these services and their methods.
+ *
+ *
+ */
+public class CustomServerRpcProviderSamePort extends ServletModule {
+ private static final Log LOG = Log.get(CustomServerRpcProviderSamePort.class);
+
+ private final InetSocketAddress[] httpAddresses;
+ private final Integer flashsocketPolicyPort;
+ private final Set<Connection> incomingConnections = Sets.newHashSet();
+ private final ExecutorService threadPool;
+ private final SessionManager sessionManager;
+ private final org.eclipse.jetty.server.SessionManager jettySessionManager;
+ // private Server httpServer = null;
+
+ // Mapping from incoming protocol buffer type -> specific handler.
+ private final Map<Descriptors.Descriptor, RegisteredServiceMethod> registeredServices = Maps.newHashMap();
+
+ /**
+ * Internal, static container class for any specific registered service
+ * method.
+ */
+ static class RegisteredServiceMethod {
+ final Service service;
+ final MethodDescriptor method;
+
+ RegisteredServiceMethod(Service service, MethodDescriptor method) {
+ this.service = service;
+ this.method = method;
+ }
+ }
+
+ // SocketIO is a Generic Servlet then we use this workaround
+ // http://stackoverflow.com/questions/3597414/how-to-integrate-hessian-with-guice
+ @Singleton
+ public class WaveSocketIOWrapperServlet extends HttpServlet {
+
+ private WaveSocketIOServlet waveSocketIOServlet;
+
+ @Override
+ public void init(ServletConfig config) throws ServletException {
+ LOG.info("init() in");
+ try {
+ if (waveSocketIOServlet == null) {
+ waveSocketIOServlet = new WaveSocketIOServlet();
+ }
+ waveSocketIOServlet.init(config);
+ } catch (Throwable t) {
+ LOG.severe("Error initialising waveSocketIO servlet", t);
+ throw new ServletException(t);
+ }
+ LOG.info("init() out");
+ }
+
+ @Override
+ public void service(ServletRequest request, ServletResponse response) throws ServletException, IOException {
+
+ try {
+ waveSocketIOServlet.service(request, response);
+ } catch (Throwable t) {
+ LOG.severe("Error calling service()", t);
+ throw new ServletException(t);
+ }
+
+ }
+ }
+
+ class WebSocketConnection extends Connection {
+ private final WebSocketServerChannel socketChannel;
+
+ WebSocketConnection(ParticipantId loggedInUser) {
+ super(loggedInUser);
+ socketChannel = new WebSocketServerChannel(this);
+ LOG.info("New websocket connection set up for user " + loggedInUser);
+ expectMessages(socketChannel);
+ }
+
+ @Override
+ protected void sendMessage(long sequenceNo, Message message) {
+ socketChannel.sendMessage(sequenceNo, message);
+ }
+
+ public WebSocketServerChannel getWebSocketServerChannel() {
+ return socketChannel;
+ }
+ }
+
+ class SocketIOConnection extends Connection {
+ private final SocketIOServerChannel socketChannel;
+
+ SocketIOConnection(ParticipantId loggedInUser) {
+ super(loggedInUser);
+ socketChannel = new SocketIOServerChannel(this);
+ LOG.info("New websocket connection set up for user " + loggedInUser);
+ expectMessages(socketChannel);
+ }
+
+ @Override
+ protected void sendMessage(long sequenceNo, Message message) {
+ socketChannel.sendMessage(sequenceNo, message);
+ }
+
+ public SocketIOServerChannel getWebSocketServerChannel() {
+ return socketChannel;
+ }
+ }
+
+ abstract class Connection implements ProtoCallback {
+ private final Map<Long, ServerRpcController> activeRpcs = new ConcurrentHashMap<Long, ServerRpcController>();
+
+ // The logged in user.
+ // Note: Due to this bug:
+ // http://code.google.com/p/wave-protocol/issues/detail?id=119,
+ // the field may be null on first connect and then set later using an
+ // RPC.
+ private ParticipantId loggedInUser;
+
+ /**
+ * @param loggedInUser
+ * The currently logged in user, or null if no user is logged
+ * in.
+ */
+ public Connection(ParticipantId loggedInUser) {
+ this.loggedInUser = loggedInUser;
+ }
+
+ protected void expectMessages(MessageExpectingChannel channel) {
+ synchronized (registeredServices) {
+ for (RegisteredServiceMethod serviceMethod : registeredServices.values()) {
+ channel.expectMessage(serviceMethod.service.getRequestPrototype(serviceMethod.method));
+ LOG.fine("Expecting: " + serviceMethod.method.getFullName());
+ }
+ }
+ channel.expectMessage(Rpc.CancelRpc.getDefaultInstance());
+ }
+
+ protected abstract void sendMessage(long sequenceNo, Message message);
+
+ private ParticipantId authenticate(String token) {
+ HttpSession session = sessionManager.getSessionFromToken(token);
+ ParticipantId user = sessionManager.getLoggedInUser(session);
+ return user;
+ }
+
+ @Override
+ public void message(final long sequenceNo, Message message) {
+ if (message instanceof Rpc.CancelRpc) {
+ final ServerRpcController controller = activeRpcs.get(sequenceNo);
+ if (controller == null) {
+ throw new IllegalStateException("Trying to cancel an RPC that is not active!");
+ } else {
+ LOG.info("Cancelling open RPC " + sequenceNo);
+ controller.cancel();
+ }
+ } else if (message instanceof ProtocolAuthenticate) {
+ // Workaround for bug:
+ // http://codereview.waveprotocol.org/224001/
+
+ // When we get this message, either the connection will not be
+ // logged in
+ // (loggedInUser == null) or the connection will have been
+ // authenticated
+ // via cookies
+ // (in which case loggedInUser must match the authenticated
+ // user, and
+ // this message has no
+ // effect).
+
+ ProtocolAuthenticate authMessage = (ProtocolAuthenticate) message;
+ ParticipantId authenticatedAs = authenticate(authMessage.getToken());
+
+ Preconditions.checkArgument(authenticatedAs != null, "Auth token invalid");
+ Preconditions.checkState(loggedInUser == null || loggedInUser.equals(authenticatedAs),
+ "Session already authenticated as a different user");
+
+ loggedInUser = authenticatedAs;
+ LOG.info("Session authenticated as " + loggedInUser);
+ sendMessage(sequenceNo, ProtocolAuthenticationResult.getDefaultInstance());
+ } else if (registeredServices.containsKey(message.getDescriptorForType())) {
+ if (activeRpcs.containsKey(sequenceNo)) {
+ throw new IllegalStateException("Can't invoke a new RPC with a sequence number already in use.");
+ } else {
+ final RegisteredServiceMethod serviceMethod = registeredServices.get(message.getDescriptorForType());
+
+ // Create the internal ServerRpcController used to invoke
+ // the call.
+ final ServerRpcController controller = new CustomServerRpcControllerImpl(message,
+ serviceMethod.service, serviceMethod.method, loggedInUser, new RpcCallback<Message>() {
+ @Override
+ synchronized public void run(Message message) {
+ if (message instanceof Rpc.RpcFinished
+ || !serviceMethod.method.getOptions().getExtension(Rpc.isStreamingRpc)) {
+ // This RPC is over - remove it from the
+ // map.
+ boolean failed = message instanceof Rpc.RpcFinished ? ((Rpc.RpcFinished) message).getFailed()
+ : false;
+ LOG.fine("RPC " + sequenceNo + " is now finished, failed = " + failed);
+ if (failed) {
+ LOG.info("error = " + ((Rpc.RpcFinished) message).getErrorText());
+ }
+ activeRpcs.remove(sequenceNo);
+ }
+ sendMessage(sequenceNo, message);
+ }
+ });
+
+ // Kick off a new thread specific to this RPC.
+ activeRpcs.put(sequenceNo, controller);
+ threadPool.execute(controller);
+ }
+ } else {
+ // Sent a message type we understand, but don't expect -
+ // erronous case!
+ throw new IllegalStateException("Got expected but unknown message (" + message + ") for sequence: "
+ + sequenceNo);
+ }
+ }
+
+ @Override
+ public void unknown(long sequenceNo, String messageType, UnknownFieldSet message) {
+ throw new IllegalStateException("Got unknown message (type: " + messageType + ", " + message
+ + ") for sequence: " + sequenceNo);
+ }
+
+ @Override
+ public void unknown(long sequenceNo, String messageType, String message) {
+ throw new IllegalStateException("Got unknown message (type: " + messageType + ", " + message
+ + ") for sequence: " + sequenceNo);
+ }
+ }
+
+ /**
+ * Construct a new ServerRpcProvider, hosting on the specified WebSocket
+ * addresses.
+ *
+ * Also accepts an ExecutorService for spawning managing threads.
+ */
+ public CustomServerRpcProviderSamePort(InetSocketAddress[] httpAddresses, Integer flashsocketPolicyPort,
+ ExecutorService threadPool, SessionManager sessionManager,
+ org.eclipse.jetty.server.SessionManager jettySessionManager) {
+ this.httpAddresses = httpAddresses;
+ this.flashsocketPolicyPort = flashsocketPolicyPort;
+ this.threadPool = threadPool;
+ this.sessionManager = sessionManager;
+ this.jettySessionManager = jettySessionManager;
+ }
+
+ /**
+ * Constructs a new ServerRpcProvider with a default ExecutorService.
+ */
+ public CustomServerRpcProviderSamePort(InetSocketAddress[] httpAddresses, Integer flashsocketPolicyPort,
+ SessionManager sessionManager, org.eclipse.jetty.server.SessionManager jettySessionManager) {
+ this(httpAddresses, flashsocketPolicyPort, Executors.newCachedThreadPool(), sessionManager, jettySessionManager);
+ }
+
+ @Inject
+ public CustomServerRpcProviderSamePort(@Named(CoreSettings.HTTP_FRONTEND_ADDRESSES) List<String> httpAddresses,
+ @Named(CoreSettings.FLASHSOCKET_POLICY_PORT) Integer flashsocketPolicyPort, SessionManager sessionManager,
+ org.eclipse.jetty.server.SessionManager jettySessionManager) {
+ this(parseAddressList(httpAddresses), flashsocketPolicyPort, sessionManager, jettySessionManager);
+ }
+
+ @Override
+ protected void configureServlets() {
+ // public void startWebSocketServer() {
+ // httpServer = new Server();
+
+ List<SelectChannelConnector> connectors = getSelectChannelConnectors(httpAddresses);
+ if (connectors.isEmpty()) {
+ LOG.severe("No valid http end point address provided!");
+ }
+ for (SelectChannelConnector connector : connectors) {
+ // httpServer.addConnector(connector);
+ }
+
+ // ServletContextHandler context = new
+ // ServletContextHandler(ServletContextHandler.SESSIONS);
+ // if (jettySessionManager != null) {
+ // context.getSessionHandler().setSessionManager(jettySessionManager);
+ // }
+ // context.setResourceBase("./war");
+
+ // Servlet where the websocket connection is served from.
+ // ServletHolder wsholder = new ServletHolder(new
+ // WaveWebSocketServlet());
+ // context.addServlet(wsholder, "/socket");
+ // TODO(zamfi): fix to let messages span frames.
+ // wsholder.setInitParameter("bufferSize", "" + 1024 * 1024); // 1M
+ // buffer
+ Map<String, String> params = new HashMap<String, String>();
+ params.put("bufferSize", "" + 1024 * 1024);
+ serveRegex("/socket").with(WaveWebSocketServlet.class, params);
+ // Servlet where the websocket connection is served from.
+ // ServletHolder sioholder = new ServletHolder(new
+ // WaveSocketIOServlet());
+ // context.addServlet(sioholder, "/socket.io/*");
+ Map<String, String> sioParams = new HashMap<String, String>();
+ // TODO(zamfi): fix to let messages span frames.
+ sioParams.put("bufferSize", "" + 1024 * 1024); // 1M buffer
+
+ // Set flash policy server parameters
+ String flashPolicyServerHost = "localhost";
+ StringBuilder flashPolicyAllowedPorts = new StringBuilder();
+ /*
+ * Loop through addresses, collect list of ports, and determine if we
+ * are to use "localhost" of the AnyHost wildcard.
+ */
+ for (InetSocketAddress addr : httpAddresses) {
+ if (flashPolicyAllowedPorts.length() > 0) {
+ flashPolicyAllowedPorts.append(",");
+ }
+ flashPolicyAllowedPorts.append(addr.getPort());
+ if (!addr.getAddress().isLoopbackAddress()) {
+ // Until it's possible to pass a list of address, this is the
+ // only valid alternative.
+ flashPolicyServerHost = "0.0.0.0";
+ }
+ }
+ sioParams.put(FlashSocketTransport.FLASHPOLICY_SERVER_HOST_KEY, flashPolicyServerHost);
+ sioParams.put(FlashSocketTransport.FLASHPOLICY_SERVER_PORT_KEY, "" + flashsocketPolicyPort);
+ // TODO: Change to use the public http address and all other bound
+ // addresses.
+ sioParams.put(FlashSocketTransport.FLASHPOLICY_DOMAIN_KEY, "*");
+ sioParams.put(FlashSocketTransport.FLASHPOLICY_PORTS_KEY, flashPolicyAllowedPorts.toString());
+ serveRegex("/socket.io/*").with(WaveSocketIOWrapperServlet.class, sioParams);
+
+ // Serve the static content and GWT web client with the default servlet
+ // (acts like a standard file-based web server).
+ // ServletHolder defaultServlet = new ServletHolder(new
+ // DefaultServlet());
+ // context.addServlet(defaultServlet, "/static/*");
+ // context.addServlet(defaultServlet, "/webclient/*");
+ serveRegex("/static/*").with(DefaultServlet.class);
+ serveRegex("/webclient/*").with(DefaultServlet.class);
+
+ for (Trio<String, HttpServlet, Map<String, String>> servlet : servletNewRegistry) {
+ Map<String, String> sParams = servlet.getThird();
+ LOG.info("Configuring servlet for: " + servlet.getFirst());
+ if (sParams == null) {
+ serveRegex(servlet.getFirst()).with(servlet.getSecond().getClass());
+ } else {
+ serveRegex(servlet.getFirst()).with(servlet.getSecond().getClass(), sParams);
+ }
+ // context.addServlet(servlet.getSecond(), servlet.getFirst());
+ }
+
+ // httpServer.setHandler(context);
+
+ try {
+ // httpServer.start();
+ } catch (Exception e) { // yes, .start() throws "Exception"
+ LOG.severe("Fatal error starting http server.", e);
+ return;
+ }
+ LOG.fine("Wave WebSocket server running.");
+ }
+
+ private static InetSocketAddress[] parseAddressList(List<String> addressList) {
+ if (addressList == null || addressList.size() == 0) {
+ return new InetSocketAddress[0];
+ } else {
+ Set<InetSocketAddress> addresses = Sets.newHashSet();
+ for (String str : addressList) {
+ if (str.length() == 0) {
+ LOG.warning("Encountered empty address in http addresses list.");
+ } else {
+ try {
+ InetSocketAddress address = NetUtils.parseHttpAddress(str);
+ if (!addresses.contains(address)) {
+ addresses.add(address);
+ } else {
+ LOG.warning("Ignoring duplicate address in http addresses list: Duplicate entry '" + str
+ + "' resolved to " + address.getAddress().getHostAddress());
+ }
+ } catch (IOException e) {
+ LOG.severe("Unable to process address " + str, e);
+ }
+ }
+ }
+ return addresses.toArray(new InetSocketAddress[0]);
+ }
+ }
+
+ /**
+ * @return a list of {@link SelectChannelConnector} each bound to a
+ * host:port pair form the list addresses.
+ */
+ private List<SelectChannelConnector> getSelectChannelConnectors(InetSocketAddress[] httpAddresses) {
+ List<SelectChannelConnector> list = Lists.newArrayList();
+ for (InetSocketAddress address : httpAddresses) {
+ SelectChannelConnector connector = new SelectChannelConnector();
+ connector.setHost(address.getAddress().getHostAddress());
+ connector.setPort(address.getPort());
+ list.add(connector);
+ }
+
+ return list;
+ }
+
+ public class WaveWebSocketServlet extends WebSocketServlet {
+ @Override
+ protected WebSocket doWebSocketConnect(HttpServletRequest request, String protocol) {
+ ParticipantId loggedInUser = sessionManager.getLoggedInUser(request.getSession(false));
+
+ WebSocketConnection connection = new WebSocketConnection(loggedInUser);
+ return connection.getWebSocketServerChannel();
+ }
+ }
+
+ public class WaveSocketIOServlet extends SocketIOServlet {
+ @Override
+ protected SocketIOInbound doSocketIOConnect(HttpServletRequest request, String[] protocols) {
+ ParticipantId loggedInUser = sessionManager.getLoggedInUser(request.getSession(false));
+
+ SocketIOConnection connection = new SocketIOConnection(loggedInUser);
+ return connection.getWebSocketServerChannel();
+ }
+ }
+
+ /**
+ * Returns the socket the WebSocket server is listening on.
+ */
+ public SocketAddress getWebSocketAddress() {
+ // if (httpServer == null) {
+ // return null;
+ // } else {
+ // Connector c = httpServer.getConnectors()[0];
+ // return new InetSocketAddress(c.getHost(), c.getLocalPort());
+ // }
+ return null;
+ }
+
+ /**
+ * Stops this server.
+ */
+ public void stopServer() throws IOException {
+ try {
+ // httpServer.stop(); // yes, .stop() throws "Exception"
+ } catch (Exception e) {
+ LOG.warning("Fatal error stopping http server.", e);
+ }
+ LOG.fine("server shutdown.");
+ }
+
+ /**
+ * Register all methods provided by the given service type.
+ */
+ public void registerService(Service service) {
+ synchronized (registeredServices) {
+ for (MethodDescriptor methodDescriptor : service.getDescriptorForType().getMethods()) {
+ registeredServices.put(methodDescriptor.getInputType(), new RegisteredServiceMethod(service,
+ methodDescriptor));
+ }
+ }
+ }
+
+ /**
+ * Set of servlets
+ */
+ // List<Pair<String, ServletHolder>> servletRegistry = Lists.newArrayList();
+
+ List<Trio<String, HttpServlet, Map<String, String>>> servletNewRegistry = Lists.newArrayList();
+
+ /**
+ * Add a servlet to the servlet registry. This servlet will be attached to
+ * the specified URL pattern when the server is started up.
+ *
+ * @param urlPattern
+ * URL pattern for paths. Eg, '/foo', '/foo/*'
+ * @param servlet
+ * The servlet object to bind to the specified paths
+ * @return the {@link ServletHolder} that holds the servlet.
+ */
+ public Servlet addServlet(String urlPattern, HttpServlet servlet) {
+ // ServletHolder servletHolder = new ServletHolder(servlet);
+ servletNewRegistry.add(new Trio<String, HttpServlet, Map<String, String>>(urlPattern, servlet, null));
+ return servlet;
+ }
+
+ public Servlet addServlet(String urlPattern, HttpServlet servlet, Map<String, String> params) {
+ // ServletHolder servletHolder = new ServletHolder(servlet);
+ servletNewRegistry.add(new Trio<String, HttpServlet, Map<String, String>>(urlPattern, servlet, params));
+ return servlet;
+ }
+
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/app/server/wave/CustomServerRpcProviderSamePort.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/ourproject/kune/app/server/wave/Trio.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/server/wave/Trio.java (rev 0)
+++ trunk/src/main/java/org/ourproject/kune/app/server/wave/Trio.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,156 @@
+/**
+ * Copyright 2009 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+package org.ourproject.kune.app.server.wave;
+
+/**
+ * An immutable ordered pair of typed objects.
+ *
+ * Essentially the same as com.google.common.base.Pair. (we avoid external
+ * dependencies from model/)
+ *
+ *
+ *
+ * @param <A>
+ * Type of value 1
+ * @param <B>
+ * Type of value 2
+ * @param <C>
+ * Type of value 3
+ */
+public class Trio<A, B, C> {
+
+ /**
+ * Static constructor to save typing on generic arguments.
+ */
+ public static <A, B, C> Trio<A, B, C> of(A a, B b, C c) {
+ return new Trio<A, B, C>(a, b, c);
+ }
+
+ /**
+ * The first element of the trio; see also {@link #getFirst}.
+ */
+ public final A first;
+
+ /**
+ * The second element of the trio; see also {@link #getSecond}.
+ */
+ public final B second;
+ /**
+ * The third element of the trio; see also {@link #getThird}.
+ */
+ public final C third;
+
+ /**
+ * Pair constructor
+ *
+ * @param first
+ * Value 1
+ * @param second
+ * Value 2
+ */
+ public Trio(A first, B second, C third) {
+ this.first = first;
+ this.second = second;
+ this.third = third;
+ }
+
+ /**
+ * Copy constructor
+ *
+ * @param trio
+ * Trio to shallow copy from
+ */
+ public Trio(Trio<? extends A, ? extends B, ? extends C> trio) {
+ first = trio.first;
+ second = trio.second;
+ third = trio.third;
+ }
+
+ /**
+ * Returns the first element of this pair; see also {@link #first}.
+ */
+ public A getFirst() {
+ return first;
+ }
+
+ /**
+ * Returns the second element of this pair; see also {@link #second}.
+ */
+ public B getSecond() {
+ return second;
+ }
+
+ /**
+ * Returns the third element of this pair; see also {@link #third}.
+ */
+ public C getThird() {
+ return third;
+ }
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (first == null ? 0 : first.hashCode());
+ result = prime * result + (second == null ? 0 : second.hashCode());
+ result = prime * result + (third == null ? 0 : third.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;
+ }
+ Trio<?, ?, ?> other = (Trio<?, ?, ?>) obj;
+ if (first == null) {
+ if (other.first != null) {
+ return false;
+ }
+ } else if (!first.equals(other.first)) {
+ return false;
+ }
+ if (second == null) {
+ if (other.second != null) {
+ return false;
+ }
+ } else if (!second.equals(other.second)) {
+ return false;
+ }
+ if (third == null) {
+ if (other.third != null) {
+ return false;
+ }
+ } else if (!third.equals(other.third)) {
+ return false;
+ }
+ return true;
+ }
+
+ @Override
+ public String toString() {
+ return "Trio [first=" + first + ", second=" + second + ", third=" + third + "]";
+ }
+
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/app/server/wave/Trio.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveModule.java (rev 0)
+++ trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveModule.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,28 @@
+package org.ourproject.kune.app.server.wave;
+
+import java.io.IOException;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.waveprotocol.box.server.persistence.PersistenceException;
+
+import com.google.inject.Injector;
+import com.google.inject.servlet.ServletModule;
+
+public class WaveModule extends ServletModule {
+
+ private static final Log LOG = LogFactory.getLog(WaveModule.class);
+
+ @Override
+ protected void configureServlets() {
+ super.configureServlets();
+
+ }
+
+ public void runWaveServer(Injector settingsInjector) throws IOException, PersistenceException,
+ ConfigurationException {
+
+ }
+
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveModule.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveStarter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveStarter.java (rev 0)
+++ trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveStarter.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,137 @@
+package org.ourproject.kune.app.server.wave;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import org.apache.commons.configuration.ConfigurationException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.eclipse.jetty.servlets.ProxyServlet;
+import org.waveprotocol.box.common.comms.WaveClientRpc.ProtocolWaveClientRpc;
+import org.waveprotocol.box.server.CoreSettings;
+import org.waveprotocol.box.server.authentication.AccountStoreHolder;
+import org.waveprotocol.box.server.authentication.SessionManager;
+import org.waveprotocol.box.server.persistence.AccountStore;
+import org.waveprotocol.box.server.persistence.PersistenceException;
+import org.waveprotocol.box.server.persistence.PersistenceModule;
+import org.waveprotocol.box.server.persistence.SignerInfoStore;
+import org.waveprotocol.box.server.robots.RobotApiModule;
+import org.waveprotocol.box.server.robots.passive.RobotsGateway;
+import org.waveprotocol.box.server.rpc.AuthenticationServlet;
+import org.waveprotocol.box.server.rpc.SignOutServlet;
+import org.waveprotocol.box.server.rpc.WaveClientServlet;
+import org.waveprotocol.box.server.waveserver.WaveBus;
+import org.waveprotocol.wave.crypto.CertPathStore;
+import org.waveprotocol.wave.federation.FederationSettings;
+import org.waveprotocol.wave.federation.FederationTransport;
+import org.waveprotocol.wave.federation.noop.NoOpFederationModule;
+import org.waveprotocol.wave.federation.xmpp.XmppFederationModule;
+
+import com.google.inject.Injector;
+import com.google.inject.Key;
+import com.google.inject.Module;
+import com.google.inject.name.Names;
+
+public class WaveStarter {
+
+ private static final Log LOG = LogFactory.getLog(WaveStarter.class);
+ private static final String PROPERTY_FILE = "wave-server.properties";
+
+ public WaveStarter() {
+ }
+
+ public void run(Injector settingsInjector) {
+
+ try {
+ Module coreSettings = CustomSettingsBinder.bindSettings(PROPERTY_FILE, CoreSettings.class);
+ settingsInjector = settingsInjector.createChildInjector(coreSettings);
+ // Injector settingsInjector = Guice.createInjector(coreSettings);
+ // settingsInjector.createChildInjector(coreSettings);
+
+ boolean enableFederation = settingsInjector.getInstance(Key.get(Boolean.class,
+ Names.named(CoreSettings.ENABLE_FEDERATION)));
+ Module federationModule;
+ if (enableFederation) {
+ Module federationSettings = CustomSettingsBinder.bindSettings(PROPERTY_FILE, FederationSettings.class);
+ settingsInjector = settingsInjector.createChildInjector(federationSettings);
+ federationModule = settingsInjector.getInstance(XmppFederationModule.class);
+ } else {
+ federationModule = settingsInjector.getInstance(NoOpFederationModule.class);
+ }
+
+ PersistenceModule persistenceModule = settingsInjector.getInstance(PersistenceModule.class);
+
+ Injector injector = settingsInjector.createChildInjector(new CustomServerModule(enableFederation),
+ new RobotApiModule(), federationModule, persistenceModule);
+
+ AccountStore accountStore = injector.getInstance(AccountStore.class);
+ accountStore.initializeAccountStore();
+ AccountStoreHolder.init(accountStore,
+ injector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN))));
+
+ // Initialize the SignerInfoStore
+ CertPathStore certPathStore = injector.getInstance(CertPathStore.class);
+ if (certPathStore instanceof SignerInfoStore) {
+ ((SignerInfoStore) certPathStore).initializeSignerInfoStore();
+ }
+
+ CustomServerRpcProvider server = injector.getInstance(CustomServerRpcProvider.class);
+
+ server.addServlet("/attachment/*", injector.getInstance(CustomAttachmentServlet.class));
+
+ server.addServlet(SessionManager.SIGN_IN_URL, injector.getInstance(AuthenticationServlet.class));
+ server.addServlet("/auth/signout", injector.getInstance(SignOutServlet.class));
+ server.addServlet("/auth/register", injector.getInstance(CustomUserRegistrationServlet.class));
+
+ server.addServlet("/fetch/*", injector.getInstance(CustomFetchServlet.class));
+
+ // server.addServlet("/robot/dataapi",
+ // injector.getInstance(DataApiServlet.class));
+ // server.addServlet(DataApiOAuthServlet.DATA_API_OAUTH_PATH + "/*",
+ // injector.getInstance(DataApiOAuthServlet.class));
+ // server.addServlet("/robot/dataapi/rpc",
+ // injector.getInstance(DataApiServlet.class));
+ // server.addServlet("/robot/register/*",
+ // injector.getInstance(RobotRegistrationServlet.class));
+ // server.addServlet("/robot/rpc",
+ // injector.getInstance(ActiveApiServlet.class));
+
+ String gadgetServerHostname = injector.getInstance(Key.get(String.class,
+ Names.named(CoreSettings.GADGET_SERVER_HOSTNAME)));
+ ProxyServlet.Transparent proxyServlet = new ProxyServlet.Transparent("/gadgets", "http",
+ gadgetServerHostname, injector.getInstance(Key.get(int.class,
+ Names.named(CoreSettings.GADGET_SERVER_PORT))), "/gadgets");
+ // FIXME ServletHolder proxyServletHolder =
+ Map<String, String> params = new HashMap<String, String>();
+ // proxyServletHolder.setInitParameter("HostHeader",
+ // gadgetServerHostname);
+ params.put("HostHeader", gadgetServerHostname);
+ // server.addServlet("/gadgets/*", proxyServlet, params);
+
+ server.addServlet("/", injector.getInstance(WaveClientServlet.class));
+
+ RobotsGateway robotsGateway = injector.getInstance(RobotsGateway.class);
+ WaveBus waveBus = injector.getInstance(WaveBus.class);
+ waveBus.subscribe(robotsGateway);
+
+ ProtocolWaveClientRpc.Interface rpcImpl = injector.getInstance(ProtocolWaveClientRpc.Interface.class);
+ server.registerService(ProtocolWaveClientRpc.newReflectiveService(rpcImpl));
+
+ FederationTransport federationManager = injector.getInstance(FederationTransport.class);
+ federationManager.startFederation();
+ // server.startWebSocketServer();
+ // injector.createChildInjector(new WaveStarterModule(server));
+ LOG.info("Starting wave server");
+ server.startWebSocketServer();
+ // } catch (IOException e) {
+ // LOG.error("IOException when running server:", e);
+ } catch (PersistenceException e) {
+ LOG.error("PersistenceException when running server:", e);
+ } catch (ConfigurationException e) {
+ LOG.error("ConfigurationException when running server:", e);
+ }
+ }
+
+ public void runCont(Injector settingsInjector) {
+ }
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveStarter.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Added: trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveStarterModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveStarterModule.java (rev 0)
+++ trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveStarterModule.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -0,0 +1,18 @@
+package org.ourproject.kune.app.server.wave;
+
+import com.google.inject.AbstractModule;
+
+public class WaveStarterModule extends AbstractModule {
+
+ private final CustomServerRpcProviderSamePort rpc;
+
+ public WaveStarterModule(CustomServerRpcProviderSamePort rpc) {
+ this.rpc = rpc;
+ }
+
+ @Override
+ protected void configure() {
+ install(rpc);
+ // rpc.startWebSocketServer();
+ }
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/app/server/wave/WaveStarterModule.java
___________________________________________________________________
Name: svn:mime-type
+ text/plain
Modified: trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/org/ourproject/kune/rack/RackServletFilter.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -30,54 +30,16 @@
import javax.servlet.ServletRequest;
import javax.servlet.ServletResponse;
-import org.apache.commons.configuration.ConfigurationException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.eclipse.jetty.servlet.ServletHolder;
-import org.eclipse.jetty.servlets.ProxyServlet;
-import org.ourproject.kune.app.server.wave.CustomAttachmentServlet;
-import org.ourproject.kune.app.server.wave.CustomFetchServlet;
-import org.ourproject.kune.app.server.wave.CustomServerModule;
-import org.ourproject.kune.app.server.wave.CustomSettingsBinder;
-import org.ourproject.kune.app.server.wave.CustomUserRegistrationServlet;
import org.ourproject.kune.platf.server.ServerException;
import org.ourproject.kune.rack.dock.Dock;
import org.ourproject.kune.rack.dock.RequestMatcher;
-import org.waveprotocol.box.common.comms.WaveClientRpc.ProtocolWaveClientRpc;
-import org.waveprotocol.box.server.CoreSettings;
-import org.waveprotocol.box.server.authentication.AccountStoreHolder;
-import org.waveprotocol.box.server.authentication.SessionManager;
-import org.waveprotocol.box.server.persistence.AccountStore;
-import org.waveprotocol.box.server.persistence.PersistenceException;
-import org.waveprotocol.box.server.persistence.PersistenceModule;
-import org.waveprotocol.box.server.persistence.SignerInfoStore;
-import org.waveprotocol.box.server.robots.RobotApiModule;
-import org.waveprotocol.box.server.robots.passive.RobotsGateway;
-import org.waveprotocol.box.server.rpc.AuthenticationServlet;
-import org.waveprotocol.box.server.rpc.ServerRpcProvider;
-import org.waveprotocol.box.server.rpc.SignOutServlet;
-import org.waveprotocol.box.server.rpc.WaveClientServlet;
-import org.waveprotocol.box.server.waveserver.WaveBus;
-import org.waveprotocol.wave.crypto.CertPathStore;
-import org.waveprotocol.wave.federation.FederationSettings;
-import org.waveprotocol.wave.federation.FederationTransport;
-import org.waveprotocol.wave.federation.noop.NoOpFederationModule;
-import org.waveprotocol.wave.federation.xmpp.XmppFederationModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
-import com.google.inject.Key;
-import com.google.inject.Module;
-import com.google.inject.name.Names;
public class RackServletFilter implements Filter {
-
- /**
- * This is the name of the system property used to find the server config
- * file.
- */
- private static final String PROPERTY_FILE = "wave-server.properties";
-
public static class DockChain implements FilterChain {
private final Iterator<Dock> iterator;
@@ -107,6 +69,7 @@
filter.doFilter(request, response, this);
}
}
+
public static final String INJECTOR_ATTRIBUTE = Injector.class.getName();
private static final String MODULE_PARAMETER = RackModule.class.getName();
private static final Log LOG = LogFactory.getLog(RackServletFilter.class);
@@ -141,37 +104,19 @@
@Override
public void init(final FilterConfig filterConfig) throws ServletException {
- try {
- LOG.debug("INITIALIZING RackServletFilter...");
- final RackModule module = getModule(filterConfig);
- final RackBuilder builder = new RackBuilder();
- module.configure(builder);
+ LOG.debug("INITIALIZING RackServletFilter...");
+ final RackModule module = getModule(filterConfig);
+ final RackBuilder builder = new RackBuilder();
+ module.configure(builder);
- final Rack rack = builder.getRack();
- Module waveCoreSettings = CustomSettingsBinder.bindSettings(PROPERTY_FILE, CoreSettings.class);
- rack.add(waveCoreSettings);
- final Injector injector = installInjector(filterConfig, rack);
- startContainerListeners(rack.getListeners(), injector);
- docks = rack.getDocks();
- excludes = rack.getExcludes();
- initFilters(filterConfig);
-
- // This is a extract from Wave ServerMain.java don't integrate it
- // more
- // in our code to check for differences easily between this and the
- // WIAB
- // code
- try {
- runWaveServer(injector);
- return;
- } catch (IOException e) {
- LOG.fatal("IOException when running server:", e);
- } catch (PersistenceException e) {
- LOG.fatal("PersistenceException when running server:", e);
- }
- } catch (ConfigurationException e) {
- LOG.fatal("ConfigurationException when running server:", e);
- }
+ final Rack rack = builder.getRack();
+ // WaveStarter waveStarter = new WaveStarter();
+ final Injector injector = installInjector(filterConfig, rack);
+ // waveStarter.run(injector);
+ startContainerListeners(rack.getListeners(), injector);
+ docks = rack.getDocks();
+ excludes = rack.getExcludes();
+ initFilters(filterConfig);
LOG.debug("INITIALIZATION DONE!");
}
@@ -226,78 +171,4 @@
}
}
- public static void runWaveServer(Injector settingsInjector) throws IOException, PersistenceException,
- ConfigurationException {
- // Injector settingsInjector = Guice.createInjector(coreSettings);
- // settingsInjector.createChildInjector(coreSettings);
- boolean enableFederation = settingsInjector.getInstance(Key.get(Boolean.class,
- Names.named(CoreSettings.ENABLE_FEDERATION)));
- Module federationModule;
- if (enableFederation) {
- Module federationSettings = CustomSettingsBinder.bindSettings(PROPERTY_FILE, FederationSettings.class);
- settingsInjector = settingsInjector.createChildInjector(federationSettings);
- federationModule = settingsInjector.getInstance(XmppFederationModule.class);
- } else {
- federationModule = settingsInjector.getInstance(NoOpFederationModule.class);
- }
-
- PersistenceModule persistenceModule = settingsInjector.getInstance(PersistenceModule.class);
-
- Injector injector = settingsInjector.createChildInjector(new CustomServerModule(enableFederation),
- new RobotApiModule(), federationModule, persistenceModule);
-
- AccountStore accountStore = injector.getInstance(AccountStore.class);
- accountStore.initializeAccountStore();
- AccountStoreHolder.init(accountStore,
- injector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN))));
-
- // Initialize the SignerInfoStore
- CertPathStore certPathStore = injector.getInstance(CertPathStore.class);
- if (certPathStore instanceof SignerInfoStore) {
- ((SignerInfoStore) certPathStore).initializeSignerInfoStore();
- }
-
- ServerRpcProvider server = injector.getInstance(ServerRpcProvider.class);
-
- server.addServlet("/attachment/*", injector.getInstance(CustomAttachmentServlet.class));
-
- server.addServlet(SessionManager.SIGN_IN_URL, injector.getInstance(AuthenticationServlet.class));
- server.addServlet("/auth/signout", injector.getInstance(SignOutServlet.class));
- server.addServlet("/auth/register", injector.getInstance(CustomUserRegistrationServlet.class));
-
- server.addServlet("/fetch/*", injector.getInstance(CustomFetchServlet.class));
-
- // server.addServlet("/robot/dataapi",
- // injector.getInstance(DataApiServlet.class));
- // server.addServlet(DataApiOAuthServlet.DATA_API_OAUTH_PATH + "/*",
- // injector.getInstance(DataApiOAuthServlet.class));
- // server.addServlet("/robot/dataapi/rpc",
- // injector.getInstance(DataApiServlet.class));
- // server.addServlet("/robot/register/*",
- // injector.getInstance(RobotRegistrationServlet.class));
- // server.addServlet("/robot/rpc",
- // injector.getInstance(ActiveApiServlet.class));
-
- String gadgetServerHostname = injector.getInstance(Key.get(String.class,
- Names.named(CoreSettings.GADGET_SERVER_HOSTNAME)));
- ProxyServlet.Transparent proxyServlet = new ProxyServlet.Transparent("/gadgets", "http", gadgetServerHostname,
- injector.getInstance(Key.get(int.class, Names.named(CoreSettings.GADGET_SERVER_PORT))), "/gadgets");
- ServletHolder proxyServletHolder = server.addServlet("/gadgets/*", proxyServlet);
- proxyServletHolder.setInitParameter("HostHeader", gadgetServerHostname);
-
- server.addServlet("/", injector.getInstance(WaveClientServlet.class));
-
- RobotsGateway robotsGateway = injector.getInstance(RobotsGateway.class);
- WaveBus waveBus = injector.getInstance(WaveBus.class);
- waveBus.subscribe(robotsGateway);
-
- ProtocolWaveClientRpc.Interface rpcImpl = injector.getInstance(ProtocolWaveClientRpc.Interface.class);
- server.registerService(ProtocolWaveClientRpc.newReflectiveService(rpcImpl));
-
- FederationTransport federationManager = injector.getInstance(FederationTransport.class);
- federationManager.startFederation();
-
- LOG.info("Starting server");
- server.startWebSocketServer();
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/rack/filters/AbstractInjectedFilter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/rack/filters/AbstractInjectedFilter.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/org/ourproject/kune/rack/filters/AbstractInjectedFilter.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -32,12 +32,14 @@
protected ServletContext ctx;
+ @Override
public abstract void destroy();
public <T> T getInstance(final Class<T> type) {
return getInjector().getInstance(type);
}
+ @Override
public void init(final FilterConfig filterConfig) throws ServletException {
this.ctx = filterConfig.getServletContext();
getInjector().injectMembers(this);
Modified: trunk/src/main/java/org/ourproject/kune/rack/filters/servlet/ServletServiceFilter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/rack/filters/servlet/ServletServiceFilter.java 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/java/org/ourproject/kune/rack/filters/servlet/ServletServiceFilter.java 2011-01-09 04:44:25 UTC (rev 1178)
@@ -45,6 +45,7 @@
public void destroy() {
}
+ @Override
public void doFilter(final ServletRequest request, final ServletResponse response, final FilterChain chain)
throws IOException, ServletException {
log.debug("SERVICE: " + RackHelper.getURI(request) + " - " + servletClass.getSimpleName());
Modified: trunk/src/main/resources/wave-server.properties
===================================================================
--- trunk/src/main/resources/wave-server.properties 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/resources/wave-server.properties 2011-01-09 04:44:25 UTC (rev 1178)
@@ -2,7 +2,7 @@
#
# Domain name of the wave server
-wave_server_domain = local
+wave_server_domain = localhost
# A comma separated list of address on which to listen for connections.
# Each address is a comma separated host:port pair.
@@ -45,7 +45,7 @@
delta_store_directory = _deltas
# Set true to use Socket.IO instead of raw WebSockets in the webclient.
-use_socketio = false
+use_socketio = true
# To enable federation, edit the server.federation.config file and uncomment the line below
#include = server.federation.config
Modified: trunk/src/main/webapp/WEB-INF/web.xml
===================================================================
--- trunk/src/main/webapp/WEB-INF/web.xml 2010-12-29 03:43:22 UTC (rev 1177)
+++ trunk/src/main/webapp/WEB-INF/web.xml 2011-01-09 04:44:25 UTC (rev 1178)
@@ -85,4 +85,12 @@
<servlet-name>Proxy</servlet-name>
<url-pattern>/http-bind/</url-pattern>
</servlet-mapping>
+ <servlet>
+ <servlet-name>remoteLoggerServiceImpl</servlet-name>
+ <servlet-class>com.allen_sauer.gwt.log.server.RemoteLoggerServiceImpl</servlet-class>
+ </servlet>
+ <servlet-mapping>
+ <servlet-name>remoteLoggerServiceImpl</servlet-name>
+ <url-pattern>/ws/gwt-log</url-pattern>
+ </servlet-mapping>
</web-app>
\ No newline at end of file
More information about the kune-commits
mailing list