[kune-commits] r1652 - in trunk: img/webtemplate src/main/java/cc/kune/chat/client src/main/java/cc/kune/chat/client/actions src/main/java/cc/kune/common/client/actions/gxtui src/main/java/cc/kune/common/client/actions/ui src/main/java/cc/kune/common/client/notify src/main/java/cc/kune/common/client/tooltip src/main/java/cc/kune/common/client/ui src/main/java/cc/kune/common/client/ui/dialogs src/main/java/cc/kune/common/client/utils src/main/java/cc/kune/common/shared src/main/java/cc/kune/common/shared/i18n src/main/java/cc/kune/common/shared/utils src/main/java/cc/kune/core/client/actions/xml src/main/java/cc/kune/core/client/auth src/main/java/cc/kune/core/client/cnt src/main/java/cc/kune/core/client/dnd src/main/java/cc/kune/core/client/errors src/main/java/cc/kune/core/client/i18n src/main/java/cc/kune/core/client/registry src/main/java/cc/kune/core/client/services src/main/java/cc/kune/core/client/sitebar src/main/java/cc/kune/core/client/sn src/main/java/cc/kune/core/client/sub src/main/java/cc/kune/core/client/ui/dialogs/tabbed src/main/java/cc/kune/core/client/ws/entheader src/main/java/cc/kune/core/server src/main/java/cc/kune/core/server/i18n src/main/java/cc/kune/core/server/mail src/main/java/cc/kune/core/server/manager src/main/java/cc/kune/core/server/manager/file src/main/java/cc/kune/core/server/manager/impl src/main/java/cc/kune/core/server/notifier src/main/java/cc/kune/core/server/properties src/main/java/cc/kune/core/server/rpc src/main/java/cc/kune/core/server/utils src/main/java/cc/kune/core/server/xmpp src/main/java/cc/kune/core/shared src/main/java/cc/kune/core/shared/dto src/main/java/cc/kune/core/shared/utils src/main/java/cc/kune/events/client/actions src/main/java/cc/kune/gspace/client/i18n src/main/java/cc/kune/gspace/client/licensewizard/pages src/main/java/cc/kune/gspace/client/options/style src/main/java/cc/kune/gspace/client/style src/main/java/cc/kune/gspace/client/tool/selector src/main/java/cc/kune/gspace/client/viewers src/main/java/cc/kune/hspace/client src/main/java/cc/kune/msgs/client src/main/java/cc/kune/pspace/client src/main/java/cc/kune/wave/client src/main/java/cc/kune/wave/server src/main/java/com/google/wave/splash/web/template src/main/resources src/test/java/cc/kune/core/server src/test/java/cc/kune/core/server/mail src/test/java/cc/kune/core/server/notifier src/test/java/cc/kune/selenium
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Sun Jan 1 18:58:45 CET 2012
Author: vjrj_
Date: 2012-01-01 18:58:40 +0100 (Sun, 01 Jan 2012)
New Revision: 1652
Added:
trunk/src/main/java/cc/kune/common/shared/utils/
trunk/src/main/java/cc/kune/common/shared/utils/TextUtils.java
trunk/src/main/java/cc/kune/common/shared/utils/Url.java
trunk/src/main/java/cc/kune/common/shared/utils/UrlParam.java
trunk/src/main/java/cc/kune/core/client/services/ClientFileDownloadUtils.java
trunk/src/main/java/cc/kune/core/server/mail/FormatedString.java
trunk/src/main/java/cc/kune/core/server/notifier/NotifyHtmlHelper.java
trunk/src/main/java/cc/kune/core/server/notifier/NotifySender.java
trunk/src/main/java/cc/kune/core/server/notifier/NotifySenderDefault.java
trunk/src/main/java/cc/kune/core/server/notifier/NotifyService.java
trunk/src/main/java/cc/kune/core/server/utils/AbsoluteFileDownloadUtils.java
trunk/src/main/java/cc/kune/core/shared/utils/
trunk/src/main/java/cc/kune/core/shared/utils/SharedFileDownloadUtils.java
trunk/src/test/java/cc/kune/core/server/mail/FormatedStringTest.java
trunk/src/test/java/cc/kune/core/server/notifier/
trunk/src/test/java/cc/kune/core/server/notifier/NotifyHtmlHelperTest.java
Removed:
trunk/src/main/java/cc/kune/common/client/utils/TextUtils.java
trunk/src/main/java/cc/kune/common/client/utils/Url.java
trunk/src/main/java/cc/kune/common/client/utils/UrlParam.java
trunk/src/main/java/cc/kune/core/client/services/FileDownloadUtils.java
trunk/src/main/java/cc/kune/core/server/notifier/NotifyService.java
trunk/src/main/java/cc/kune/core/server/notifier/NotifyServiceDefault.java
Modified:
trunk/img/webtemplate/web_template-2011.svg
trunk/src/main/java/cc/kune/chat/client/AvatarDecoratorImpl.java
trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java
trunk/src/main/java/cc/kune/chat/client/KuneChatNotifier.java
trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java
trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java
trunk/src/main/java/cc/kune/common/client/actions/gxtui/AbstractGxtMenuItemGui.java
trunk/src/main/java/cc/kune/common/client/actions/gxtui/GxtMenuGui.java
trunk/src/main/java/cc/kune/common/client/actions/gxtui/GxtMenuTitleItemGui.java
trunk/src/main/java/cc/kune/common/client/actions/gxtui/GxtSubMenuGui.java
trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java
trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java
trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
trunk/src/main/java/cc/kune/common/client/ui/BasicThumb.java
trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicDialog.java
trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java
trunk/src/main/java/cc/kune/common/shared/i18n/I18nTranslationServiceMocked.java
trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java
trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java
trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java
trunk/src/main/java/cc/kune/core/client/auth/UserFieldFactory.java
trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPresenter.java
trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java
trunk/src/main/java/cc/kune/core/client/dnd/NotImplementedDropController.java
trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java
trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
trunk/src/main/java/cc/kune/core/client/i18n/I18nUrlUtils.java
trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java
trunk/src/main/java/cc/kune/core/client/registry/IdGenerator.java
trunk/src/main/java/cc/kune/core/client/services/MediaUtils.java
trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java
trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPresenter.java
trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java
trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java
trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java
trunk/src/main/java/cc/kune/core/client/ui/dialogs/tabbed/TabTitleGenerator.java
trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java
trunk/src/main/java/cc/kune/core/server/InitData.java
trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
trunk/src/main/java/cc/kune/core/server/i18n/I18nTranslationServiceDefault.java
trunk/src/main/java/cc/kune/core/server/mail/MailService.java
trunk/src/main/java/cc/kune/core/server/mail/MailServiceDefault.java
trunk/src/main/java/cc/kune/core/server/manager/TagUserContentManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoDownloadManager.java
trunk/src/main/java/cc/kune/core/server/manager/impl/I18nTranslationManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
trunk/src/main/java/cc/kune/core/server/properties/KuneBasicProperties.java
trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java
trunk/src/main/java/cc/kune/core/server/utils/FilenameUtils.java
trunk/src/main/java/cc/kune/core/server/xmpp/XmppManagerDefault.java
trunk/src/main/java/cc/kune/core/shared/FileConstants.java
trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java
trunk/src/main/java/cc/kune/events/client/actions/EventEditMenuItem.java
trunk/src/main/java/cc/kune/events/client/actions/EventRemoveMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java
trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFirstForm.java
trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStylePresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStylePresenter.java
trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java
trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java
trunk/src/main/java/cc/kune/gspace/client/viewers/PathToolbarUtils.java
trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.java
trunk/src/main/java/cc/kune/msgs/client/UserMessageWidget.java
trunk/src/main/java/cc/kune/pspace/client/PSpaceInDevelopment.java
trunk/src/main/java/cc/kune/pspace/client/PSpacePresenter.java
trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java
trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java
trunk/src/main/java/cc/kune/wave/server/WaveEmailNotifier.java
trunk/src/main/java/com/google/wave/splash/web/template/ThreadedWaveRenderer.java
trunk/src/main/resources/kune.properties
trunk/src/test/java/cc/kune/core/server/mail/MailServiceDefaultTest.java
trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java
Log:
Notifications and some refactorization
Modified: trunk/img/webtemplate/web_template-2011.svg
===================================================================
--- trunk/img/webtemplate/web_template-2011.svg 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/img/webtemplate/web_template-2011.svg 2012-01-01 17:58:40 UTC (rev 1652)
@@ -14,7 +14,7 @@
height="768"
id="svg3182"
version="1.1"
- inkscape:version="0.48.1 r9760"
+ inkscape:version="0.48.2 r9819"
sodipodi:docname="web_template-2011.svg"
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/webtemplate/web_template-2011.png"
inkscape:export-xdpi="90"
@@ -78,17 +78,17 @@
borderopacity="1.0"
inkscape:pageopacity="0"
inkscape:pageshadow="2"
- inkscape:zoom="0.16135477"
- inkscape:cx="512"
+ inkscape:zoom="1.1201172"
+ inkscape:cx="-265.55632"
inkscape:cy="384"
- inkscape:current-layer="g8450"
+ inkscape:current-layer="layer1"
inkscape:document-units="px"
showgrid="false"
- inkscape:window-width="1078"
- inkscape:window-height="897"
+ inkscape:window-width="1280"
+ inkscape:window-height="776"
inkscape:window-x="0"
- inkscape:window-y="947"
- inkscape:window-maximized="0"
+ inkscape:window-y="24"
+ inkscape:window-maximized="1"
inkscape:snap-bbox="false"
inkscape:bbox-paths="true"
inkscape:bbox-nodes="true"
@@ -258,7 +258,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"
@@ -268,7 +268,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"
@@ -546,7 +546,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"
@@ -2177,7 +2177,7 @@
inkscape:export-xdpi="90"
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
transform="matrix(0.475,0,0,0.95,-21.570622,377.21335)"
- d="m 110,32.362183 a 20,10 0 1 1 -40,0 20,10 0 1 1 40,0 z"
+ d="m 110,32.362183 c 0,5.522847 -8.95431,10 -20,10 -11.045695,0 -20,-4.477153 -20,-10 0,-5.522848 8.954305,-10 20,-10 11.04569,0 20,4.477152 20,10 z"
sodipodi:ry="10"
sodipodi:rx="20"
sodipodi:cy="32.362183"
@@ -2190,7 +2190,7 @@
inkscape:export-xdpi="90"
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
transform="matrix(1.8840121,0.6711918,-0.6711918,1.8840121,8.0842525,364.37023)"
- d="m 16,16.362183 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+ d="m 16,16.362183 c 0,0.552284 -0.447715,1 -1,1 -0.552285,0 -1,-0.447716 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
sodipodi:ry="1"
sodipodi:rx="1"
sodipodi:cy="16.362183"
@@ -2209,14 +2209,14 @@
sodipodi:cy="16.362183"
sodipodi:rx="1"
sodipodi:ry="1"
- d="m 16,16.362183 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+ d="m 16,16.362183 c 0,0.552284 -0.447715,1 -1,1 -0.552285,0 -1,-0.447716 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
transform="matrix(1.8840121,0.6711918,-0.6711918,1.8840121,2.7154875,362.20909)" />
<path
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
transform="matrix(1.8840121,0.6711918,-0.6711918,1.8840121,7.7663825,370.24449)"
- d="m 16,16.362183 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+ d="m 16,16.362183 c 0,0.552284 -0.447715,1 -1,1 -0.552285,0 -1,-0.447716 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
sodipodi:ry="1"
sodipodi:rx="1"
sodipodi:cy="16.362183"
@@ -2235,14 +2235,14 @@
sodipodi:cy="16.362183"
sodipodi:rx="1"
sodipodi:ry="1"
- d="m 16,16.362183 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+ d="m 16,16.362183 c 0,0.552284 -0.447715,1 -1,1 -0.552285,0 -1,-0.447716 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
transform="matrix(1.8840121,0.6711918,-0.6711918,1.8840121,2.2467045,371.75097)" />
<path
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
transform="matrix(1.8840121,0.6711918,-0.6711918,1.8840121,-0.8112855,366.96948)"
- d="m 16,16.362183 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
+ d="m 16,16.362183 c 0,0.552284 -0.447715,1 -1,1 -0.552285,0 -1,-0.447716 -1,-1 0,-0.552285 0.447715,-1 1,-1 0.552285,0 1,0.447715 1,1 z"
sodipodi:ry="1"
sodipodi:rx="1"
sodipodi:cy="16.362183"
@@ -4035,7 +4035,81 @@
x="-505.18716"
y="159.15428"
ry="3.5237386" />
- </g>
+ <image
+ style="display:inline"
+ width="50"
+ height="50"
+ xlink:href="data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/2wBDAAgGBgcGBQgHBwcJCQgKDBQNDAsLDBkSEw8UHRofHh0a HBwgJC4nICIsIxwcKDcpLDAxNDQ0Hyc5PTgyPC4zNDL/2wBDAQkJCQwLDBgNDRgyIRwhMjIyMjIy MjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjIyMjL/wAARCABkAGQDASIA AhEBAxEB/8QAHwAAAQUBAQEBAQEAAAAAAAAAAAECAwQFBgcICQoL/8QAtRAAAgEDAwIEAwUFBAQA AAF9AQIDAAQRBRIhMUEGE1FhByJxFDKBkaEII0KxwRVS0fAkM2JyggkKFhcYGRolJicoKSo0NTY3 ODk6Q0RFRkdISUpTVFVWV1hZWmNkZWZnaGlqc3R1dnd4eXqDhIWGh4iJipKTlJWWl5iZmqKjpKWm p6ipqrKztLW2t7i5usLDxMXGx8jJytLT1NXW19jZ2uHi4+Tl5ufo6erx8vP09fb3+Pn6/8QAHwEA AwEBAQEBAQEBAQAAAAAAAAECAwQFBgcICQoL/8QAtREAAgECBAQDBAcFBAQAAQJ3AAECAxEEBSEx BhJBUQdhcRMiMoEIFEKRobHBCSMzUvAVYnLRChYkNOEl8RcYGRomJygpKjU2Nzg5OkNERUZHSElK U1RVVldYWVpjZGVmZ2hpanN0dXZ3eHl6goOEhYaHiImKkpOUlZaXmJmaoqOkpaanqKmqsrO0tba3 uLm6wsPExcbHyMnK0tPU1dbX2Nna4uPk5ebn6Onq8vP09fb3+Pn6/9oADAMBAAIRAxEAPwD3+iii gAooooAKY7rGpZ2Cj1JxWZqmqfZAYoQDLjknoo9ff6Vzsksksu+RmdiTgk5IH9KuMG9SHNJ2OxS7 t5DtSeJm9A4JqeuAkQFeeTn86bZ67d6VMAXMttnDRk5x9Cen8v5hunbYFPueg0VXtbmK8to7iFw0 bjKkVYrMsKKKKACiiigAooooASmSyLFE8jfdVST9AKkqjqr+Xpk59QB+ZA/rQtxM5WSVppXlc5Zi SeeB7e1M5ySSDx+VAIx1PToKDyTxj6iuowGuODxkkevSsm+HBHBPt2rWkPB4zwayb08Ec/lQxo3v A98xe50+RjgASxg9hnDfqR+tdrXmXhCUp4ngUDiRXQ8+ik/j0Fem1zzWprHYKKKKkoKKKKACiiig AqnqieZps6+ilvy5/pVymSIJI2RujAgj60LRiZw579h/OgnoScDHAFDApIyMCHUkN7GkJGB06+vT /GuowGSnCEDIH0rFvXySMkjPY9K0rqXg9ck81hXMm44BwPek2M2fBsYl8SRt/wA80duvTIx/WvSx XDeAbbMt5dEYAVY1Prnk/wAh+ddzWE3qax2CiiipKCiiigAooooAKKKKAOL8QQGx1IygHy58sMDo 3cf1/Gsh7sADnt0B6V3er2UF9p8sNwwRfvCQn7hHQ15XK7xyFCc4OMjoa3hLQyktSzc3OSew+tZ5 JcjHJz6fp70E5JyMn3NdH4MsbS81NpZ5EMkADRxHALH+97gfzIP1G7K4Ja2Ox8OaadL0aGCQYmb9 5J/vHt+AwPwrXNFJWD1NRaKKKACiiigAoo7VSvr9LKIMRuduFUd6EribLbMEUsxAA6knisu71y3g ysX71/Y4X8+/4ZrBub2e7YtMxIB4UHAH4f1qD19cdMVtGn3Ic+xLfXlxfZEj/KOQo+6P8awbu0yT gcVs4Bzkkk+9RtGrk9CMHv1rSySsiLtnLNAwONpwT370+CGVZQ6MyuDlShIII7gjp9a3mtFJJwMC nR2ip2ANKwGxpPiK4WNYr8GUY/1q8MPqOn+e9dJb3cF2m6CVXHcA4I+o6iuLVAFHtTGDKwdGZWBy GU4I+hFQ6aexam+p6BRXH6X4meKZbfUG3RkgLMeCp/2vUe/866+smmty077C0UUUhiZwMnpXHX10 by6eTtnCj2H8v/r10uqS+Tp0zDqV2/mcVyJOBwCTjsela0l1M5voB4AGMnPbvQAc4GRkY5/zxSYx xwCBSnggDk/yrYzADgdScdh0oPAPTpQc4POKOAcZJP8AKgAI5PA6dqTqAegzwAOv+NL256+nrRwA ACSfYUABxk8frTWAK46nH+fpTiMEdc5/KkY/KcZJx2PSgDKvkwDwM57d66zwhqZvNOa1kJMtsQuT 3U9PywR+ArlrwYUjjIHNS+ErkweJI4x92ZGRvbjI/UD86zmrouL1PSaKKKwNTK14/wCgKPWQA/ka 5odvpRRW9LYxnuIOh/GjFFFaEinv9f6U0nCgiiigBcdKF+YjNFFAAOWx7Udh9KKKAM27+4341U0p jHr9gV4JuIx+bYooqHsyo7nrFFFFc5sf/9k= "
+ id="image15327-2"
+ x="-819.83234"
+ y="352.556"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/webtemplate/web_template-2011.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <image
+ style="display:inline"
+ y="493.54968"
+ x="-697.43127"
+ id="image4197-7"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAADgAAAA4CAYAAACohjseAAAABHNCSVQICAgIfAhkiAAAB71JREFU aIHVml9IXGcah5+j49SZ4zmHOOl0G4Wdtqvp0A6RqknTJt1cJNltWAiFtltKoBakgwy5sA2kF8WL QlZy6V6YSRmUtRZSJA32oliSQiBNyPonmRUJiiSkVNJEE6zOycyoM+fdC3WjiX9mnKNmX/jdfPOd 9/2eec98h/P9RhER7AhFUbyaRpeisK2ggNvJJP95+JB24Gexq8haQkRyFuBXVe7W1zM9OIh0dSGN jaR9PiZVlXtOJyeAMjtqZb02G+CK3W5Gw2HSS03p60Pq6khoGnFd5yKw6/8KUNO4EAqRXG1qIoE0 NZH2eHhoGFwG9jz1gE4nx/x+zKmpzC+bmkLCYSyvF9Mw6Ab2PZWAQJWqEh8eXluKmRmkpQWrpATT MLgOHHhqAIE8TWOotRUr1zWkUkh7O+LzETMMBoBDmw7ocBCqrMS088tOp5GODqSsjJhhMAQcBpQN BwQ8LhexaNT2u0lEEMtCOjuR8nJiuk4UqNhQQE2jLRhcfde0o6PNzViaRryoiAiwZd0BgSrDID4+ vr5wCzU2htTUkHC7mcjPpzbb2zYbOEXXGYhEct9Y1qKeHiQQwNR1BoAq2wHz86kNBDAta+Ph5mVZ SCSCZRjENY02wGMLILDF7Waip2fz4BZqfBwJBkm6XMQcDkJAXk6ARUVEampIbDbY44pGkcpKTE1j aLnbNpPuVWga8bGxzQdaTq2tWKpK3OnkWFaAcxtLtLl5czaWbDQ8jPj9mJrGBaA4U8DD5eXE0unN B8hEU1NIKETS7WYU8K8KaBgMdXZuzOJ++QX57jvkp5+Q33/PLVc4TFpVuQt4V+reobIyYuv1WLAs 5NSpPDl0SBev1yXFxars379Tqqu3S2GhQ8rLNfnwQ1UuXVpb/vp6pjWNayt1b6CjY33gbt5E3nrL La+//qqcOXNGbt68KQtjampKent7pampSZ57TpdPP3VKIpFdjcFBRNe5u1z3Dvh86/Pbi0QU8XgK 5eTJE5JKpWS1GBsbk/ff/5ts3+6W69czr9PVhXg8XF2ue9fb2+2Hu3QJ2bbNkBs3bqwK9ni0trbI iy+qEotlVquxkbSqcnqp7u0rKcFMpeyFM03kpZfccu7cuazh5uOjj/4uwWBhRvV8PiaBvUt1r7ul xf7nXl3dM/LBB4fXDCciMj4+LqWlHvnxx5Vr9fUhqso9QHm8e3u8XsyZGXvhRkcRt7tA7t+/nxOg iMjZs2elulpbsV5dHQmnkxMijz0HDYPL4bD93fvhB+TNNwM5w4mImKYpLpdDpqeXrpVIIJpGfP6g OW/+hFtRlF0OBxUff4xi16n5fPT25lFd/Wdbcqmqygsv/IGBgaU//+orLEWhW0SGgUeAus7JhgYK nU5b1rEoenqKqK7ebVu+qqqdXLv25Pj0NHz5JcnJSY7Pj+UBKIpSJsLOTz55BGxn/PorlJaW2pav pORPjIw8eaO1tiKpFFER+ff8WB6A00nNkSMohYW2rWFR7NgxQzQatS1ff/8VAoHFhlUqBQ0NxCcm HnUPIE9RFKWggNraWtYJD6qrE/T2XrItX19fP6+9tnjs66+RqSluiMjPj8/f6/MxaffOuVBXryIv v1xqyy46MjIixcXPLMqfSiElJZgs4XPkqSpHgkFU277eJWLHDnjw4D5XrlzJOdepU//k4EHHorEz Z8A0GRaRi09c4PFwtatr/bo3r2+/RbZvL5VEIrHm7nV3d4vX65LffnuUN52e9TVYxrxB17k7OLj+ gCLIe++55Nixo2uCSyQS4vf/Ub75ZvG5b0cHYhgMLFcUTeNafT3TGwE4NoY8/3yhfPHFcZmens4Y bmRkRA4e3CvvvONelM+yZs0aVnCkALyqyt3lLGi7dfs2sn+/WyoqyqS/v39VuLa2f8nWrUXy+ecF kkwuztXZiRgGQysVnKf0u92MhkIks3Frc9Hp04ps3eqSd9/9izQ2/kPOnz8vDx48kFu3bklHR4cc P/6ZvPFGQF55RZWlDpzT6VkHCji8KuAcZLGmccHvx1yra5ut7txB2tqQo0edsnu3IS6XQ559tlDe fluXhoY8+f57nujavJqbsebstRXNmCcGnE6OqSpxO9zbbJXpEcnY2P/eGFb1DpcehCpNY6iyEnO9 jM5cVFNDoqiISCaTl/8A8hwOQi4XsWCQ5EZ6giuppwdxu5kgQ0N09Qng0TTaDIN4JIK12fZZIICZ n09tphdlnB2o0nUGAgHMzbLRIhGsOQM0Y5c3qwqAkp9PrdvNRE0NiY10nMbHEcMgThbubtaAC0C3 FBUR0TTizc1YG2HOBIMkNY22rNeaS1WgQteJlpcT6+yc/Y2sB1w0irhcxMjAsrYVcA5SAQ4bBkNl ZcQ6OjJ/nmWqykpMh4PQmtZn50qAQ4bBgM9HrL199kU017StrVhzFvWyPvyGAS4APWAYXC8pwWxp wVrrQfLwMKKq2W8s6w64AHSfYdDt9WKGw1jZ/u3S78dcynd/agAXgO4xDC57PDxsaiKdidcXCpHU NC7kXHsjABeA7tJ1Lmoa8bo6En19S08Nh0nP+ezFOdfcSMAFoGVOJydUlXs+H5ONjaS7umZd2fp6 puf8db8dtZS5gpsSiqIowB5V5UhhITtmZvCJcCcW468iMmpHjf8C6MILrTFT1g8AAAAASUVORK5C YII= "
+ height="50"
+ width="50"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/webtemplate/web_template-2011.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <flowRoot
+ transform="translate(-1742.5553,146.8489)"
+ id="flowRoot22983-8"
+ xml:space="preserve"
+ style="font-size:13px;display:inline"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/webtemplate/web_template-2011.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"
+ inkscape:transform-center-x="-69.722141"
+ inkscape:transform-center-y="5.0305176"><flowRegion
+ id="flowRegion22985-0"><rect
+ y="337.25836"
+ x="1105.337"
+ height="98.930603"
+ width="725.66296"
+ id="rect22987-4"
+ style="font-size:13px" /></flowRegion><flowPara
+ id="flowPara22989-2"
+ style="font-size:13px;font-weight:bold">Some Group</flowPara></flowRoot> <flowRoot
+ style="display:inline"
+ xml:space="preserve"
+ id="flowRoot17968-64"
+ transform="translate(-1740.9728,166.94552)"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/webtemplate/web_template-2011.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90"><flowRegion
+ id="flowRegion17970-1"><rect
+ id="rect17972-2"
+ width="725.66296"
+ height="98.930603"
+ x="1105.337"
+ y="337.25836" /></flowRegion><flowPara
+ id="flowPara8076">You are now admin of this group</flowPara><flowPara
+ id="flowPara8078">You are now a collaborator of this group</flowPara><flowPara
+ id="flowPara8105">You are not a member of this group</flowPara><flowPara
+ id="flowPara8101">Your membership to this group where not accepted by the admins</flowPara><flowPara
+ id="flowPara8099">There is a pending member in this group, please accept/deny this petition</flowPara><flowPara
+ id="flowPara8097" /></flowRoot> <flowRoot
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/webtemplate/web_template-2011.png"
+ transform="translate(-1740.9728,246.55145)"
+ id="flowRoot8080"
+ xml:space="preserve"
+ style="fill:#0000ff;display:inline"><flowRegion
+ id="flowRegion8082"><rect
+ y="337.25836"
+ x="1105.337"
+ height="98.930603"
+ width="725.66296"
+ id="rect8084"
+ style="fill:#0000ff" /></flowRegion><flowPara
+ id="flowPara8090">More info</flowPara></flowRoot> </g>
<g
inkscape:groupmode="layer"
id="layer7"
Modified: trunk/src/main/java/cc/kune/chat/client/AvatarDecoratorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/AvatarDecoratorImpl.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/chat/client/AvatarDecoratorImpl.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -20,8 +20,8 @@
package cc.kune.chat.client;
import cc.kune.common.client.ui.AbstractDecorator;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.avatar.AvatarDecorator;
import com.calclab.emite.core.client.events.StateChangedEvent;
Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -37,15 +37,15 @@
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
import cc.kune.common.client.utils.SimpleResponseCallback;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.client.utils.WindowUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.events.AvatarChangedEvent;
import cc.kune.core.client.events.NewUserRegisteredEvent;
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.init.AppStopEvent;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.sitebar.SitebarActions;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.UserSignInEvent;
@@ -133,7 +133,7 @@
private final ChatOptions chatOptions;
private final ChatResources chatResources;
private Dialog dialog;
- private final FileDownloadUtils downUtils;
+ private final ClientFileDownloadUtils downUtils;
private final I18nTranslationService i18n;
private final EventBus kuneEventBus;
private final CoreResources res;
@@ -149,7 +149,7 @@
@Inject
public ChatClientDefault(final EventBus kuneEventBus, final I18nTranslationService i18n,
final SitebarActions siteActions, final Session session, final CoreResources res,
- final FileDownloadUtils downUtils, final GlobalShortcutRegister shorcutRegister,
+ final ClientFileDownloadUtils downUtils, final GlobalShortcutRegister shorcutRegister,
final ChatOptions chatOptions, final ChatResources chatResources, final ChatInstances chatInstances) {
this.kuneEventBus = kuneEventBus;
this.i18n = i18n;
Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -22,7 +22,7 @@
import static cc.kune.chat.shared.ChatConstants.NAME;
import static cc.kune.chat.shared.ChatConstants.TYPE_ROOM;
import cc.kune.chat.client.resources.ChatResources;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.i18n.I18nUITranslationService;
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.client.resources.nav.NavResources;
Modified: trunk/src/main/java/cc/kune/chat/client/KuneChatNotifier.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/KuneChatNotifier.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/chat/client/KuneChatNotifier.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -21,7 +21,7 @@
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import com.calclab.hablar.signals.client.notifications.HablarNotifier;
import com.google.gwt.event.dom.client.ClickEvent;
@@ -31,12 +31,12 @@
import com.google.gwt.regexp.shared.RegExp;
public class KuneChatNotifier implements HablarNotifier {
- private final FileDownloadUtils downUtils;
+ private final ClientFileDownloadUtils downUtils;
private final EventBus eventBus;
private final I18nTranslationService i18n;
private final RegExp regExp;
- public KuneChatNotifier(final I18nTranslationService i18n, final FileDownloadUtils downUtils,
+ public KuneChatNotifier(final I18nTranslationService i18n, final ClientFileDownloadUtils downUtils,
final EventBus eventBus) {
this.i18n = i18n;
this.downUtils = downUtils;
Modified: trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/chat/client/KuneHablarSignals.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -21,7 +21,7 @@
import cc.kune.chat.client.ChatClientDefault.ChatClientAction;
import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import com.calclab.emite.core.client.xmpp.session.XmppSession;
import com.calclab.emite.xep.storage.client.PrivateStorageManager;
@@ -72,7 +72,7 @@
@SuppressWarnings("deprecation")
public KuneHablarSignals(final EventBus kuneEventBus, final XmppSession session, final Hablar hablar,
final ChatClientAction action, final ChatInstances chatInstances,
- final I18nTranslationService i18n, final FileDownloadUtils downUtils) {
+ final I18nTranslationService i18n, final ClientFileDownloadUtils downUtils) {
final HablarEventBus hablarEventBus = hablar.getEventBus();
final PrivateStorageManager storageManager = chatInstances.privateStorageManager;
Modified: trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -24,8 +24,8 @@
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.ui.dialogs.PromptTopDialog;
import cc.kune.common.client.ui.dialogs.PromptTopDialog.Builder;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.actions.RolAction;
import cc.kune.core.client.resources.CoreMessages;
import cc.kune.core.client.resources.nav.NavResources;
Modified: trunk/src/main/java/cc/kune/common/client/actions/gxtui/AbstractGxtMenuItemGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gxtui/AbstractGxtMenuItemGui.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/common/client/actions/gxtui/AbstractGxtMenuItemGui.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -32,7 +32,7 @@
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.common.client.actions.ui.descrip.MenuRadioItemDescriptor;
import cc.kune.common.client.errors.NotImplementedException;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import com.extjs.gxt.ui.client.event.MenuEvent;
import com.extjs.gxt.ui.client.event.SelectionListener;
Modified: trunk/src/main/java/cc/kune/common/client/actions/gxtui/GxtMenuGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gxtui/GxtMenuGui.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/common/client/actions/gxtui/GxtMenuGui.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -26,7 +26,7 @@
import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
import cc.kune.common.client.errors.NotImplementedException;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import com.extjs.gxt.ui.client.Style.ButtonScale;
import com.extjs.gxt.ui.client.event.ButtonEvent;
Modified: trunk/src/main/java/cc/kune/common/client/actions/gxtui/GxtMenuTitleItemGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gxtui/GxtMenuTitleItemGui.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/common/client/actions/gxtui/GxtMenuTitleItemGui.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -24,7 +24,7 @@
import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.common.client.errors.NotImplementedException;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import com.extjs.gxt.ui.client.widget.menu.HeaderMenuItem;
Modified: trunk/src/main/java/cc/kune/common/client/actions/gxtui/GxtSubMenuGui.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/gxtui/GxtSubMenuGui.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/common/client/actions/gxtui/GxtSubMenuGui.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -22,7 +22,7 @@
import cc.kune.common.client.actions.ui.AbstractGuiItem;
import cc.kune.common.client.actions.ui.ParentWidget;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import com.extjs.gxt.ui.client.widget.menu.MenuItem;
Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -28,7 +28,7 @@
import cc.kune.common.client.actions.ui.descrip.DropTarget;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
import cc.kune.common.client.errors.NotImplementedException;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import com.google.gwt.resources.client.ImageResource;
import com.google.gwt.user.client.ui.Composite;
Modified: trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -23,8 +23,8 @@
import cc.kune.common.client.events.ProgressShowEvent;
import cc.kune.common.client.events.UserNotifyEvent;
import cc.kune.common.client.utils.SimpleResponseCallback;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.event.shared.EventBus;
Modified: trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/common/client/tooltip/Tooltip.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -19,9 +19,9 @@
*/
package cc.kune.common.client.tooltip;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.client.utils.TimerWrapper;
import cc.kune.common.client.utils.TimerWrapper.Executer;
+import cc.kune.common.shared.utils.TextUtils;
import com.google.gwt.core.client.GWT;
import com.google.gwt.dom.client.Style.Unit;
Modified: trunk/src/main/java/cc/kune/common/client/ui/BasicThumb.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/BasicThumb.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/common/client/ui/BasicThumb.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -21,7 +21,7 @@
import cc.kune.common.client.log.Log;
import cc.kune.common.client.tooltip.Tooltip;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
Modified: trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicDialog.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicDialog.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicDialog.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -20,7 +20,7 @@
package cc.kune.common.client.ui.dialogs;
import cc.kune.common.client.ui.IconLabel;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
Modified: trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/BasicTopDialog.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -21,7 +21,7 @@
import cc.kune.common.client.tooltip.Tooltip;
import cc.kune.common.client.ui.PopupTopPanel;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
Deleted: trunk/src/main/java/cc/kune/common/client/utils/TextUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/TextUtils.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/common/client/utils/TextUtils.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -1,254 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.common.client.utils;
-
-import java.util.ArrayList;
-
-import org.apache.commons.lang.WordUtils;
-
-import cc.kune.common.client.errors.NotImplementedException;
-import cc.kune.common.client.errors.UIException;
-
-import com.google.gwt.safehtml.shared.SimpleHtmlSanitizer;
-import com.google.gwt.safehtml.shared.UriUtils;
-
-public class TextUtils {
-
- // Original regexp from http://www.regular-expressions.info/email.html
- public static final String EMAIL_REGEXP = "[-!#$%&\'*+/=?_`{|}~a-z0-9^]+(\\.[-!#$%&\'*+/=?_`{|}~a-z0-9^]+)*@(localhost|([a-z0-9]([-a-z0-9]*[a-z0-9])?\\.)+[a-z0-9]([-a-z0-9]*[a-z0-9]))?";
- public static final String IN_DEVELOPMENT = "In development";
-
- public static final String IN_DEVELOPMENT_P = " (in development)";
-
- public static final String NUM_REGEXP = "^[0-9]+$";
-
- public static final String UNIX_NAME = "^[a-z0-9_\\-]+$";
-
- // Original regexp from http://snippets.dzone.com/posts/show/452
- public static final String URL_REGEXP = "((ftp|http|https|mailto):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?)";
-
- /**
- * @see WordUtils#abbreviate
- */
- public static String abbreviate(final String str, int lower, int upper, final String appendToEnd) {
- // initial parameter checks
- if (str == null) {
- return null;
- }
- if (str.length() == 0) {
- return "";
- }
-
- // if the lower value is greater than the length of the string,
- // set to the length of the string
- if (lower > str.length()) {
- lower = str.length();
- }
- // if the upper value is -1 (i.e. no limit) or is greater
- // than the length of the string, set to the length of the string
- if (upper == -1 || upper > str.length()) {
- upper = str.length();
- }
- // if upper is less than lower, raise it to lower
- if (upper < lower) {
- upper = lower;
- }
-
- final StringBuffer result = new StringBuffer();
- final int index = str.indexOf(" ", lower);
- if (index == -1) {
- result.append(str.substring(0, upper));
- // only if abbreviation has occured do we append the appendToEnd value
- if (upper != str.length()) {
- result.append(defaultString(appendToEnd));
- }
- } else if (index > upper) {
- result.append(str.substring(0, upper));
- result.append(defaultString(appendToEnd));
- } else {
- result.append(str.substring(0, index));
- result.append(defaultString(appendToEnd));
- }
- return result.toString();
- }
-
- public static String br() {
- return "<br/>";
- }
-
- public static String brbr() {
- return "<br/><br/>";
- }
-
- /**
- * @see WordUtils#capitalize(String, char[])
- * @return
- */
- public static String capitalize(final String str, final char[] delimiters) {
- final int delimLen = (delimiters == null ? -1 : delimiters.length);
- if (str == null || str.length() == 0 || delimLen == 0) {
- return str;
- }
- final int strLen = str.length();
- final StringBuffer buffer = new StringBuffer(strLen);
- boolean capitalizeNext = true;
- for (int i = 0; i < strLen; i++) {
- final char ch = str.charAt(i);
-
- if (isDelimiter(ch, delimiters)) {
- buffer.append(ch);
- capitalizeNext = true;
- } else if (capitalizeNext) {
- // Original:in WordUtils buffer.append(Character.toTitleCase(ch));
- buffer.append(String.valueOf(ch).toUpperCase());
- capitalizeNext = false;
- } else {
- buffer.append(ch);
- }
- }
- return buffer.toString();
- }
-
- /**
- * @see WordUtils#capitalizeFully(String)
- */
- public static String capitalizeFully(String str, final char[] delimiters) {
- final int delimLen = (delimiters == null ? -1 : delimiters.length);
- if (str == null || str.length() == 0 || delimLen == 0) {
- return str;
- }
- str = str.toLowerCase();
- return capitalize(str, delimiters);
- }
-
- private static String defaultString(final String str) {
- return str == null ? "" : str;
- }
-
- public static String ellipsis(final String text, final int length) {
- return text == null ? "" : length <= 0 ? text : text.length() > length ? text.substring(0,
- length - 3) + "..." : text;
- }
-
- public static boolean empty(final String string) {
- return !notEmpty(string);
- }
-
- /**
- * This method escape only some dangerous html chars
- *
- * Try to use {@link SimpleHtmlSanitizer} better
- *
- */
- public static String escapeHtmlLight(final String source) {
- String result = source;
- if (source != null) {
- result = result.replaceAll("&", "&");
- result = result.replaceAll("\"", """);
- // text = text.replaceAll("\'", "'");
- result = result.replaceAll("<", "<");
- result = result.replaceAll(">", ">");
- result = result.replaceAll("—", "—");
- }
- return result;
- }
-
- /**
- * Generates a href link (with target="_blank")
- *
- */
- public static String generateHtmlLink(final String href, final String text) {
- return generateHtmlLink(href, text, true);
- }
-
- /**
- * Generates a href link
- *
- */
- public static String generateHtmlLink(final String href, final String text, final boolean targetBlank) {
- if (!UriUtils.isSafeUri(href)) {
- throw new UIException("Unsafe href");
- }
- return "<a href=\"" + UriUtils.sanitizeUri(href) + "\"" + (targetBlank ? "target=\"_blank\"" : "")
- + ">" + text + "</a>";
- }
-
- private static boolean isDelimiter(final char ch, final char[] delimiters) {
- if (delimiters == null) {
- throw new NotImplementedException();
- // return Character.isWhitespace(ch);
- }
- for (final char delimiter : delimiters) {
- if (ch == delimiter) {
- return true;
- }
- }
- return false;
- }
-
- public static boolean notEmpty(final String string) {
- return string != null && string.length() > 0;
- }
-
- public static String removeLastSlash(final String text) {
- return text.replaceFirst("/$", "");
- }
-
- public static ArrayList<String> splitTags(final String tagsString) {
- final ArrayList<String> tagsList = new ArrayList<String>();
- String tagsCopy = tagsString;
- // remove commas and quotes
- if (tagsString == null) {
- return tagsList;
- }
- tagsCopy = tagsCopy.replaceAll(",", " ");
- tagsCopy = tagsCopy.replaceAll("\"", "");
- tagsCopy = tagsCopy.replaceAll("\'", "");
- final String[] splitted = tagsCopy.split("\\s+");
- for (String tag : splitted) {
- tag = tag.replaceAll("\\s$", "");
- if (tag.length() > 0) {
- tagsList.add(tag);
- }
- }
- return tagsList;
- }
-
- /*
- * This method unescape only some dangerous html chars for use in GWT Html
- * widget for instance
- */
- public static String unescape(final String source) {
- if (source == null) {
- return null;
- }
- String result = source;
- result = result.replaceAll("&", "&");
- result = result.replaceAll(""", "\"");
- result = result.replaceAll("'", "\'");
- result = result.replaceAll("<", "<");
- result = result.replaceAll(">", ">");
- result = result.replaceAll("—", "—");
- return result;
- }
-
- public TextUtils() {
- }
-}
Deleted: trunk/src/main/java/cc/kune/common/client/utils/Url.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/Url.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/common/client/utils/Url.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -1,63 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.common.client.utils;
-
-import java.util.ArrayList;
-
-public class Url {
- private final String base;
- private final ArrayList<UrlParam> params;
-
- public Url(final String base) {
- this.base = base;
- params = new ArrayList<UrlParam>();
- }
-
- public Url(final String base, final UrlParam... iniParams) {
- this(base);
- for (final UrlParam param : iniParams) {
- addImpl(param);
- }
- }
-
- public void add(final UrlParam param) {
- addImpl(param);
- }
-
- private void addImpl(final UrlParam param) {
- params.add(param);
- }
-
- @Override
- public String toString() {
- String paramPart = "";
- boolean first = true;
- for (final UrlParam param : params) {
- if (first) {
- paramPart = "?" + param;
- first = false;
- } else {
- paramPart += "&" + param;
- }
- }
- return base + paramPart;
- }
-
-}
Deleted: trunk/src/main/java/cc/kune/common/client/utils/UrlParam.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/UrlParam.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/common/client/utils/UrlParam.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -1,56 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.common.client.utils;
-
-import java.util.Date;
-
-public class UrlParam {
- public static String noCacheStringSuffix() {
- final String noCache = "&nocache=" + new Date().getTime();
- return noCache;
- }
- private final String name;
-
- private final String value;
-
- public UrlParam(final String name, final boolean value) {
- this.name = name;
- this.value = value ? "true" : "false";
- }
-
- public UrlParam(final String name, final String value) {
- this.name = name;
- this.value = value;
- }
-
- public String getName() {
- return name;
- }
-
- public String getValue() {
- return value;
- }
-
- @Override
- public String toString() {
- return name + "=" + value;
- }
-
-}
Modified: trunk/src/main/java/cc/kune/common/shared/i18n/I18nTranslationServiceMocked.java
===================================================================
--- trunk/src/main/java/cc/kune/common/shared/i18n/I18nTranslationServiceMocked.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/common/shared/i18n/I18nTranslationServiceMocked.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -19,7 +19,7 @@
*/
package cc.kune.common.shared.i18n;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
public class I18nTranslationServiceMocked extends I18nTranslationService {
@Override
Copied: trunk/src/main/java/cc/kune/common/shared/utils/TextUtils.java (from rev 1647, trunk/src/main/java/cc/kune/common/client/utils/TextUtils.java)
===================================================================
--- trunk/src/main/java/cc/kune/common/shared/utils/TextUtils.java (rev 0)
+++ trunk/src/main/java/cc/kune/common/shared/utils/TextUtils.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -0,0 +1,254 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.common.shared.utils;
+
+import java.util.ArrayList;
+
+import org.apache.commons.lang.WordUtils;
+
+import cc.kune.common.client.errors.NotImplementedException;
+import cc.kune.common.client.errors.UIException;
+
+import com.google.gwt.safehtml.shared.SimpleHtmlSanitizer;
+import com.google.gwt.safehtml.shared.UriUtils;
+
+public class TextUtils {
+
+ // Original regexp from http://www.regular-expressions.info/email.html
+ public static final String EMAIL_REGEXP = "[-!#$%&\'*+/=?_`{|}~a-z0-9^]+(\\.[-!#$%&\'*+/=?_`{|}~a-z0-9^]+)*@(localhost|([a-z0-9]([-a-z0-9]*[a-z0-9])?\\.)+[a-z0-9]([-a-z0-9]*[a-z0-9]))?";
+ public static final String IN_DEVELOPMENT = "In development";
+
+ public static final String IN_DEVELOPMENT_P = " (in development)";
+
+ public static final String NUM_REGEXP = "^[0-9]+$";
+
+ public static final String UNIX_NAME = "^[a-z0-9_\\-]+$";
+
+ // Original regexp from http://snippets.dzone.com/posts/show/452
+ public static final String URL_REGEXP = "((ftp|http|https|mailto):\\/\\/(\\w+:{0,1}\\w*@)?(\\S+)(:[0-9]+)?(\\/|\\/([\\w#!:.?+=&%@!\\-\\/]))?)";
+
+ /**
+ * @see WordUtils#abbreviate
+ */
+ public static String abbreviate(final String str, int lower, int upper, final String appendToEnd) {
+ // initial parameter checks
+ if (str == null) {
+ return null;
+ }
+ if (str.length() == 0) {
+ return "";
+ }
+
+ // if the lower value is greater than the length of the string,
+ // set to the length of the string
+ if (lower > str.length()) {
+ lower = str.length();
+ }
+ // if the upper value is -1 (i.e. no limit) or is greater
+ // than the length of the string, set to the length of the string
+ if (upper == -1 || upper > str.length()) {
+ upper = str.length();
+ }
+ // if upper is less than lower, raise it to lower
+ if (upper < lower) {
+ upper = lower;
+ }
+
+ final StringBuffer result = new StringBuffer();
+ final int index = str.indexOf(" ", lower);
+ if (index == -1) {
+ result.append(str.substring(0, upper));
+ // only if abbreviation has occured do we append the appendToEnd value
+ if (upper != str.length()) {
+ result.append(defaultString(appendToEnd));
+ }
+ } else if (index > upper) {
+ result.append(str.substring(0, upper));
+ result.append(defaultString(appendToEnd));
+ } else {
+ result.append(str.substring(0, index));
+ result.append(defaultString(appendToEnd));
+ }
+ return result.toString();
+ }
+
+ public static String br() {
+ return "<br/>";
+ }
+
+ public static String brbr() {
+ return "<br/><br/>";
+ }
+
+ /**
+ * @see WordUtils#capitalize(String, char[])
+ * @return
+ */
+ public static String capitalize(final String str, final char[] delimiters) {
+ final int delimLen = (delimiters == null ? -1 : delimiters.length);
+ if (str == null || str.length() == 0 || delimLen == 0) {
+ return str;
+ }
+ final int strLen = str.length();
+ final StringBuffer buffer = new StringBuffer(strLen);
+ boolean capitalizeNext = true;
+ for (int i = 0; i < strLen; i++) {
+ final char ch = str.charAt(i);
+
+ if (isDelimiter(ch, delimiters)) {
+ buffer.append(ch);
+ capitalizeNext = true;
+ } else if (capitalizeNext) {
+ // Original:in WordUtils buffer.append(Character.toTitleCase(ch));
+ buffer.append(String.valueOf(ch).toUpperCase());
+ capitalizeNext = false;
+ } else {
+ buffer.append(ch);
+ }
+ }
+ return buffer.toString();
+ }
+
+ /**
+ * @see WordUtils#capitalizeFully(String)
+ */
+ public static String capitalizeFully(String str, final char[] delimiters) {
+ final int delimLen = (delimiters == null ? -1 : delimiters.length);
+ if (str == null || str.length() == 0 || delimLen == 0) {
+ return str;
+ }
+ str = str.toLowerCase();
+ return capitalize(str, delimiters);
+ }
+
+ private static String defaultString(final String str) {
+ return str == null ? "" : str;
+ }
+
+ public static String ellipsis(final String text, final int length) {
+ return text == null ? "" : length <= 0 ? text : text.length() > length ? text.substring(0,
+ length - 3) + "..." : text;
+ }
+
+ public static boolean empty(final String string) {
+ return !notEmpty(string);
+ }
+
+ /**
+ * This method escape only some dangerous html chars
+ *
+ * Try to use {@link SimpleHtmlSanitizer} better
+ *
+ */
+ public static String escapeHtmlLight(final String source) {
+ String result = source;
+ if (source != null) {
+ result = result.replaceAll("&", "&");
+ result = result.replaceAll("\"", """);
+ // text = text.replaceAll("\'", "'");
+ result = result.replaceAll("<", "<");
+ result = result.replaceAll(">", ">");
+ result = result.replaceAll("—", "—");
+ }
+ return result;
+ }
+
+ /**
+ * Generates a href link (with target="_blank")
+ *
+ */
+ public static String generateHtmlLink(final String href, final String text) {
+ return generateHtmlLink(href, text, true);
+ }
+
+ /**
+ * Generates a href link
+ *
+ */
+ public static String generateHtmlLink(final String href, final String text, final boolean targetBlank) {
+ if (!UriUtils.isSafeUri(href)) {
+ throw new UIException("Unsafe href");
+ }
+ return "<a href=\"" + UriUtils.sanitizeUri(href) + "\"" + (targetBlank ? "target=\"_blank\"" : "")
+ + ">" + text + "</a>";
+ }
+
+ private static boolean isDelimiter(final char ch, final char[] delimiters) {
+ if (delimiters == null) {
+ throw new NotImplementedException();
+ // return Character.isWhitespace(ch);
+ }
+ for (final char delimiter : delimiters) {
+ if (ch == delimiter) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ public static boolean notEmpty(final String string) {
+ return string != null && string.length() > 0;
+ }
+
+ public static String removeLastSlash(final String text) {
+ return text.replaceFirst("/$", "");
+ }
+
+ public static ArrayList<String> splitTags(final String tagsString) {
+ final ArrayList<String> tagsList = new ArrayList<String>();
+ String tagsCopy = tagsString;
+ // remove commas and quotes
+ if (tagsString == null) {
+ return tagsList;
+ }
+ tagsCopy = tagsCopy.replaceAll(",", " ");
+ tagsCopy = tagsCopy.replaceAll("\"", "");
+ tagsCopy = tagsCopy.replaceAll("\'", "");
+ final String[] splitted = tagsCopy.split("\\s+");
+ for (String tag : splitted) {
+ tag = tag.replaceAll("\\s$", "");
+ if (tag.length() > 0) {
+ tagsList.add(tag);
+ }
+ }
+ return tagsList;
+ }
+
+ /*
+ * This method unescape only some dangerous html chars for use in GWT Html
+ * widget for instance
+ */
+ public static String unescape(final String source) {
+ if (source == null) {
+ return null;
+ }
+ String result = source;
+ result = result.replaceAll("&", "&");
+ result = result.replaceAll(""", "\"");
+ result = result.replaceAll("'", "\'");
+ result = result.replaceAll("<", "<");
+ result = result.replaceAll(">", ">");
+ result = result.replaceAll("—", "—");
+ return result;
+ }
+
+ public TextUtils() {
+ }
+}
Copied: trunk/src/main/java/cc/kune/common/shared/utils/Url.java (from rev 1647, trunk/src/main/java/cc/kune/common/client/utils/Url.java)
===================================================================
--- trunk/src/main/java/cc/kune/common/shared/utils/Url.java (rev 0)
+++ trunk/src/main/java/cc/kune/common/shared/utils/Url.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -0,0 +1,63 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.common.shared.utils;
+
+import java.util.ArrayList;
+
+public class Url {
+ private final String base;
+ private final ArrayList<UrlParam> params;
+
+ public Url(final String base) {
+ this.base = base;
+ params = new ArrayList<UrlParam>();
+ }
+
+ public Url(final String base, final UrlParam... iniParams) {
+ this(base);
+ for (final UrlParam param : iniParams) {
+ addImpl(param);
+ }
+ }
+
+ public void add(final UrlParam param) {
+ addImpl(param);
+ }
+
+ private void addImpl(final UrlParam param) {
+ params.add(param);
+ }
+
+ @Override
+ public String toString() {
+ String paramPart = "";
+ boolean first = true;
+ for (final UrlParam param : params) {
+ if (first) {
+ paramPart = "?" + param;
+ first = false;
+ } else {
+ paramPart += "&" + param;
+ }
+ }
+ return base + paramPart;
+ }
+
+}
Copied: trunk/src/main/java/cc/kune/common/shared/utils/UrlParam.java (from rev 1647, trunk/src/main/java/cc/kune/common/client/utils/UrlParam.java)
===================================================================
--- trunk/src/main/java/cc/kune/common/shared/utils/UrlParam.java (rev 0)
+++ trunk/src/main/java/cc/kune/common/shared/utils/UrlParam.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -0,0 +1,56 @@
+/*
+ *
+ * Copyright (C) 2007-2009 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.common.shared.utils;
+
+import java.util.Date;
+
+public class UrlParam {
+ public static String noCacheStringSuffix() {
+ final String noCache = "&nocache=" + new Date().getTime();
+ return noCache;
+ }
+ private final String name;
+
+ private final String value;
+
+ public UrlParam(final String name, final boolean value) {
+ this.name = name;
+ this.value = value ? "true" : "false";
+ }
+
+ public UrlParam(final String name, final String value) {
+ this.name = name;
+ this.value = value;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getValue() {
+ return value;
+ }
+
+ @Override
+ public String toString() {
+ return name + "=" + value;
+ }
+
+}
Modified: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -27,8 +27,8 @@
import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.common.client.actions.ui.descrip.SubMenuDescriptor;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.actions.ActionRegistryByType;
import cc.kune.core.client.errors.ErrorHandler;
import cc.kune.core.client.registry.NewMenusForTypeIdsRegistry;
Modified: trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -21,7 +21,7 @@
import cc.kune.common.client.events.UserNotifyEvent;
import cc.kune.common.client.notify.NotifyLevel;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.cookies.CookiesManager;
import cc.kune.core.client.i18n.I18nUITranslationService;
import cc.kune.core.client.init.AppStartEvent;
Modified: trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -24,9 +24,9 @@
import cc.kune.common.client.log.Log;
import cc.kune.common.client.notify.NotifyLevel;
import cc.kune.common.client.utils.OnAcceptCallback;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.client.utils.TimerWrapper;
import cc.kune.common.client.utils.TimerWrapper.Executer;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.auth.SignInPresenter.SignInView;
import cc.kune.core.client.cookies.CookiesManager;
import cc.kune.core.client.errors.UserAuthException;
Modified: trunk/src/main/java/cc/kune/core/client/auth/UserFieldFactory.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/UserFieldFactory.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/auth/UserFieldFactory.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -19,8 +19,8 @@
*/
package cc.kune.core.client.auth;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.resources.CoreMessages;
import cc.kune.core.client.ui.DefaultForm;
Modified: trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPresenter.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPresenter.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -22,7 +22,7 @@
import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.services.ImageSize;
import cc.kune.core.client.services.MediaUtils;
import cc.kune.core.client.state.Session;
@@ -41,7 +41,7 @@
FoldableContent {
private final GuiActionDescCollection actionRegistry;
- private final Provider<FileDownloadUtils> downloadProvider;
+ private final Provider<ClientFileDownloadUtils> downloadProvider;
private final I18nTranslationService i18n;
private final Provider<MediaUtils> mediaUtils;
protected final Session session;
@@ -52,7 +52,7 @@
public FoldableContentPresenter(final String toolName, final StateManager stateManager,
final Session session, final ActionContentToolbar toolbar,
- final GuiActionDescCollection actionRegistry, final Provider<FileDownloadUtils> downloadProvider,
+ final GuiActionDescCollection actionRegistry, final Provider<ClientFileDownloadUtils> downloadProvider,
final I18nTranslationService i18n, final Provider<MediaUtils> mediaUtils) {
this.toolName = toolName;
this.session = session;
@@ -154,7 +154,7 @@
final StateToken token = state.getStateToken();
final BasicMimeTypeDTO mimeType = state.getMimeType();
if (mimeType != null) {
- final FileDownloadUtils fileDownloadUtils = downloadProvider.get();
+ final ClientFileDownloadUtils fileDownloadUtils = downloadProvider.get();
if (mimeType.isImage()) {
view.showImage(fileDownloadUtils.getImageUrl(token),
fileDownloadUtils.getImageResizedUrl(token, ImageSize.sized), false);
Modified: trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -21,8 +21,8 @@
import cc.kune.common.client.actions.ui.descrip.DropTarget;
import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.errors.ErrorHandler;
import cc.kune.core.client.rpcservices.ContentServiceAsync;
import cc.kune.core.client.state.ContentCache;
Modified: trunk/src/main/java/cc/kune/core/client/dnd/NotImplementedDropController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/dnd/NotImplementedDropController.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/dnd/NotImplementedDropController.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -20,8 +20,8 @@
package cc.kune.core.client.dnd;
import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import com.allen_sauer.gwt.dnd.client.DragContext;
import com.allen_sauer.gwt.dnd.client.VetoDragException;
Modified: trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -27,8 +27,8 @@
import cc.kune.common.client.log.Log;
import cc.kune.common.client.notify.NotifyLevel;
import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
import cc.kune.wave.client.WaveClientProvider;
Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -32,9 +32,9 @@
import cc.kune.common.client.utils.MetaUtils;
import cc.kune.common.client.utils.Pair;
import cc.kune.common.client.utils.SimpleResponseCallback;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.client.utils.WindowUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.rpcservices.I18nServiceAsync;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.UserSignInEvent;
Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUrlUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nUrlUtils.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUrlUtils.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -19,9 +19,9 @@
*/
package cc.kune.core.client.i18n;
-import cc.kune.common.client.utils.TextUtils;
-import cc.kune.common.client.utils.Url;
-import cc.kune.common.client.utils.UrlParam;
+import cc.kune.common.shared.utils.TextUtils;
+import cc.kune.common.shared.utils.Url;
+import cc.kune.common.shared.utils.UrlParam;
public class I18nUrlUtils {
Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -21,7 +21,7 @@
import cc.kune.common.client.errors.UIException;
import cc.kune.common.client.log.Log;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
/**
* Copied some methods from org.apache.commons.lang.WordUtils
Modified: trunk/src/main/java/cc/kune/core/client/registry/IdGenerator.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/registry/IdGenerator.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/registry/IdGenerator.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -19,7 +19,7 @@
*/
package cc.kune.core.client.registry;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import com.google.gxp.com.google.common.base.Nullable;
Copied: trunk/src/main/java/cc/kune/core/client/services/ClientFileDownloadUtils.java (from rev 1647, trunk/src/main/java/cc/kune/core/client/services/FileDownloadUtils.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/services/ClientFileDownloadUtils.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/services/ClientFileDownloadUtils.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -0,0 +1,99 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.core.client.services;
+
+import cc.kune.common.shared.utils.Url;
+import cc.kune.common.shared.utils.UrlParam;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.FileConstants;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.utils.SharedFileDownloadUtils;
+
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.ui.RootPanel;
+import com.google.inject.Inject;
+
+public class ClientFileDownloadUtils extends SharedFileDownloadUtils {
+
+ private final ImageUtils imageUtils;
+ private final Session session;
+
+ @Inject
+ public ClientFileDownloadUtils(final Session session, final ImageUtils imageUtils) {
+ this.session = session;
+ this.imageUtils = imageUtils;
+ }
+
+ private String calculateUrl(final StateToken token, final boolean download, final boolean useHash) {
+ final Url url = new Url(FileConstants.DOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN,
+ token.toString()));
+ if (download) {
+ url.add(new UrlParam(FileConstants.DOWNLOAD, download));
+ }
+ if (useHash) {
+ final String hash = session.getUserHash();
+ if (hash != null) {
+ url.add(new UrlParam(FileConstants.HASH, hash));
+ }
+ }
+ return url.toString();
+ }
+
+ public void downloadFile(final StateToken token) {
+ final String url = calculateUrl(token, true, true);
+ DOM.setElementAttribute(RootPanel.get("__download").getElement(), "src", url);
+ }
+
+ public String getBackgroundImageUrl(final StateToken token) {
+ return new Url(FileConstants.BACKDOWNLOADSERVLET,
+ new UrlParam(FileConstants.TOKEN, token.toString())).toString();
+ }
+
+ public String getBackgroundResizedUrl(final StateToken token, final ImageSize imageSize) {
+ return new Url(FileConstants.BACKDOWNLOADSERVLET,
+ new UrlParam(FileConstants.TOKEN, token.toString()), new UrlParam(FileConstants.IMGSIZE,
+ imageSize.toString())).toString();
+ }
+
+ public String getImageResizedUrl(final StateToken token, final ImageSize imageSize) {
+ return calculateUrl(token, false, true) + "&"
+ + new UrlParam(FileConstants.IMGSIZE, imageSize.toString());
+ }
+
+ public String getImageUrl(final StateToken token) {
+ return calculateUrl(token, false, true);
+ }
+
+ public String getLogoAvatarHtml(final StateToken groupToken, final boolean groupHasLogo,
+ final boolean isPersonal, final int size, final int hvspace) {
+ if (groupHasLogo) {
+ return "<img hspace='" + hvspace + "' vspace='" + hvspace + "' align='left' style='width: " + size
+ + "px; height: " + size + "px;' src='" + getLogoImageUrl(groupToken.getGroup()) + "'>";
+ } else {
+ return isPersonal ? imageUtils.getImageHtml(ImageDescriptor.personDef)
+ : imageUtils.getImageHtml(ImageDescriptor.groupDefIcon);
+ }
+ }
+
+ public String getUrl(final StateToken token) {
+ return calculateUrl(token, false, false);
+ }
+
+}
Deleted: trunk/src/main/java/cc/kune/core/client/services/FileDownloadUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/services/FileDownloadUtils.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/services/FileDownloadUtils.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -1,118 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- \*/
-package cc.kune.core.client.services;
-
-import cc.kune.common.client.utils.Url;
-import cc.kune.common.client.utils.UrlParam;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.shared.FileConstants;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.core.shared.dto.UserSimpleDTO;
-
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.ui.RootPanel;
-import com.google.inject.Inject;
-
-public class FileDownloadUtils {
-
- private final ImageUtils imageUtils;
- private final Session session;
-
- @Inject
- public FileDownloadUtils(final Session session, final ImageUtils imageUtils) {
- this.session = session;
- this.imageUtils = imageUtils;
- }
-
- private String calculateUrl(final StateToken token, final boolean download, final boolean useHash) {
- final Url url = new Url(FileConstants.DOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN,
- token.toString()));
- if (download) {
- url.add(new UrlParam(FileConstants.DOWNLOAD, download));
- }
- if (useHash) {
- final String hash = session.getUserHash();
- if (hash != null) {
- url.add(new UrlParam(FileConstants.HASH, hash));
- }
- }
- return url.toString();
- }
-
- public void downloadFile(final StateToken token) {
- final String url = calculateUrl(token, true, true);
- DOM.setElementAttribute(RootPanel.get("__download").getElement(), "src", url);
- }
-
- public String getBackgroundImageUrl(final StateToken token) {
- return new Url(FileConstants.BACKDOWNLOADSERVLET,
- new UrlParam(FileConstants.TOKEN, token.toString())).toString();
- }
-
- public String getBackgroundResizedUrl(final StateToken token, final ImageSize imageSize) {
- return new Url(FileConstants.BACKDOWNLOADSERVLET,
- new UrlParam(FileConstants.TOKEN, token.toString()), new UrlParam(FileConstants.IMGSIZE,
- imageSize.toString())).toString();
- }
-
- public String getGroupLogo(final GroupDTO group) {
- return group.hasLogo() ? getLogoImageUrl(group.getStateToken())
- : group.isPersonal() ? FileConstants.PERSON_NO_AVATAR_IMAGE
- : FileConstants.GROUP_NO_AVATAR_IMAGE;
- }
-
- public String getImageResizedUrl(final StateToken token, final ImageSize imageSize) {
- return calculateUrl(token, false, true) + "&"
- + new UrlParam(FileConstants.IMGSIZE, imageSize.toString());
- }
-
- public String getImageUrl(final StateToken token) {
- return calculateUrl(token, false, true);
- }
-
- public String getLogoAvatarHtml(final StateToken groupToken, final boolean groupHasLogo,
- final boolean isPersonal, final int size, final int hvspace) {
- if (groupHasLogo) {
- return "<img hspace='" + hvspace + "' vspace='" + hvspace + "' align='left' style='width: " + size
- + "px; height: " + size + "px;' src='" + getLogoImageUrl(groupToken) + "'>";
- } else {
- return isPersonal ? imageUtils.getImageHtml(ImageDescriptor.personDef)
- : imageUtils.getImageHtml(ImageDescriptor.groupDefIcon);
- }
- }
-
- public String getLogoImageUrl(final StateToken token) {
- return new Url(FileConstants.LOGODOWNLOADSERVLET,
- new UrlParam(FileConstants.TOKEN, token.toString())).toString();
- }
-
- public String getUrl(final StateToken token) {
- return calculateUrl(token, false, false);
- }
-
- public String getUserAvatar(final String username) {
- return new Url(FileConstants.AVATARDOWNLOADSERVLET, new UrlParam(FileConstants.USERNAME, username)).toString();
- }
-
- public String getUserAvatar(final UserSimpleDTO user) {
- return user.hasLogo() ? getLogoImageUrl(user.getStateToken()) : FileConstants.PERSON_NO_AVATAR_IMAGE;
- }
-}
Modified: trunk/src/main/java/cc/kune/core/client/services/MediaUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/services/MediaUtils.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/services/MediaUtils.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -30,9 +30,9 @@
private final Session session;
- private final FileDownloadUtils downloadUtils;
+ private final ClientFileDownloadUtils downloadUtils;
- public MediaUtils(final Session session, final FileDownloadUtils downloadUtils) {
+ public MediaUtils(final Session session, final ClientFileDownloadUtils downloadUtils) {
this.session = session;
this.downloadUtils = downloadUtils;
}
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -33,7 +33,7 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.CoreMessages;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.sn.actions.GotoGroupAction;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
@@ -53,7 +53,7 @@
public static final MenuDescriptor LOGGED_USER_MENU = new MenuDescriptor();
public static final String LOGGED_USER_MENU_ID = "kune-sump-lum";
- private final Provider<FileDownloadUtils> downloadProvider;
+ private final Provider<ClientFileDownloadUtils> downloadProvider;
private final GotoGroupAction gotoGroupAction;
private final I18nTranslationService i18n;
private SubMenuDescriptor partiMenu;
@@ -65,7 +65,7 @@
@Inject
public SiteUserOptionsPresenter(final Session session, final StateManager stateManager,
- final Provider<FileDownloadUtils> downloadProvider, final I18nTranslationService i18n,
+ final Provider<ClientFileDownloadUtils> downloadProvider, final I18nTranslationService i18n,
final CoreResources img, final SitebarActions siteOptions, final GotoGroupAction gotoGroupAction) {
super();
this.session = session;
Modified: trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPresenter.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPresenter.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -22,7 +22,7 @@
import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.common.client.actions.ui.descrip.MenuTitleItemDescriptor;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.sn.actions.registry.AbstractSNMembersActionsRegistry;
import cc.kune.core.shared.dto.GroupDTO;
@@ -37,10 +37,10 @@
private static final int MAX_NUM_AVATAR_IN_A_ROW = 6;
- protected final Provider<FileDownloadUtils> downloadProvider;
+ protected final Provider<ClientFileDownloadUtils> downloadProvider;
public AbstractSNPresenter(final EventBus eventBus, final View view, final Proxy<?> proxy,
- final Provider<FileDownloadUtils> downloadProvider) {
+ final Provider<ClientFileDownloadUtils> downloadProvider) {
super(eventBus, view, proxy);
this.downloadProvider = downloadProvider;
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -23,7 +23,7 @@
import cc.kune.common.client.actions.ui.IsActionExtensible;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.sn.actions.registry.GroupSNAdminsMenuItemsRegistry;
import cc.kune.core.client.sn.actions.registry.GroupSNCollabsMenuItemsRegistry;
import cc.kune.core.client.sn.actions.registry.GroupSNConfActions;
@@ -101,7 +101,7 @@
@Inject
public GroupSNPresenter(final EventBus eventBus, final GroupSNView view, final GroupSNProxy proxy,
final StateManager stateManager, final Session session,
- final Provider<FileDownloadUtils> downloadProvider,
+ final Provider<ClientFileDownloadUtils> downloadProvider,
final GroupSNAdminsMenuItemsRegistry adminsMenuItemsRegistry,
final GroupSNCollabsMenuItemsRegistry collabsMenuItemsRegistry,
final GroupSNPendingsMenuItemsRegistry pendingsMenuItemsRegistry,
Modified: trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -24,7 +24,7 @@
import cc.kune.common.client.actions.ui.IsActionExtensible;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.sn.UserSNPresenter.UserSNProxy;
import cc.kune.core.client.sn.UserSNPresenter.UserSNView;
import cc.kune.core.client.sn.actions.registry.UserSNConfActions;
@@ -95,7 +95,7 @@
@Inject
public UserSNPresenter(final EventBus eventBus, final UserSNView view, final UserSNProxy proxy,
final I18nTranslationService i18n, final StateManager stateManager, final Session session,
- final Provider<FileDownloadUtils> downloadProvider,
+ final Provider<ClientFileDownloadUtils> downloadProvider,
final UserSNMenuItemsRegistry userMenuItemsRegistry, final UserSNConfActions confActionsRegistry) {
super(eventBus, view, proxy, downloadProvider);
this.i18n = i18n;
Modified: trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/sub/SubtitlesManager.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -21,7 +21,7 @@
import cc.kune.common.client.utils.Base64Utils;
import cc.kune.common.client.utils.SimpleCallback;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.state.StateManager;
import com.google.gwt.event.shared.EventBus;
Modified: trunk/src/main/java/cc/kune/core/client/ui/dialogs/tabbed/TabTitleGenerator.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ui/dialogs/tabbed/TabTitleGenerator.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/ui/dialogs/tabbed/TabTitleGenerator.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -21,7 +21,7 @@
import cc.kune.common.client.tooltip.Tooltip;
import cc.kune.common.client.ui.IconLabel;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import com.google.gwt.i18n.client.HasDirection.Direction;
import com.google.gwt.resources.client.ImageResource;
Modified: trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -22,10 +22,10 @@
import cc.kune.common.client.actions.ui.ActionFlowPanel;
import cc.kune.common.client.actions.ui.bind.GuiProvider;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
-import cc.kune.common.client.utils.UrlParam;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.UrlParam;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.ws.entheader.EntityHeaderPresenter.EntityHeaderView;
import cc.kune.core.shared.FileConstants;
import cc.kune.core.shared.domain.utils.StateToken;
@@ -44,7 +44,7 @@
public class EntityHeaderPanel extends ViewImpl implements EntityHeaderView {
- private final Provider<FileDownloadUtils> downloadProvider;
+ private final Provider<ClientFileDownloadUtils> downloadProvider;
private final EntityTextLogo entityTextLogo;
private final CoreResources images;
private final HorizontalPanel mainPanel;
@@ -52,7 +52,7 @@
private final VerticalPanel vpanel;
@Inject
- public EntityHeaderPanel(final Provider<FileDownloadUtils> downloadProvider,
+ public EntityHeaderPanel(final Provider<ClientFileDownloadUtils> downloadProvider,
final CoreResources images, final GuiProvider bindings, final GSpaceArmor armor,
final EntityTextLogo entityTextLogo, final I18nTranslationService i18n) {
this.entityTextLogo = entityTextLogo;
@@ -108,7 +108,7 @@
@Override
public void setLogoImage(final GroupDTO group, final boolean noCache) {
- entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(group.getStateToken())
+ entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(group.getShortName())
+ (noCache ? UrlParam.noCacheStringSuffix() : ""));
}
Modified: trunk/src/main/java/cc/kune/core/server/InitData.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/InitData.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/InitData.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -165,11 +165,6 @@
return siteCommonName;
}
- @Deprecated
- public String getSiteDomain() {
- return siteDomain;
- }
-
public String getSiteLogoUrl() {
return siteLogoUrl;
}
@@ -306,11 +301,6 @@
this.siteCommonName = siteCommonName;
}
- @Deprecated
- public void setSiteDomain(final String siteDomain) {
- this.siteDomain = siteDomain;
- }
-
public void setSiteLogoUrl(final String siteLogoUrl) {
this.siteLogoUrl = siteLogoUrl;
}
Modified: trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -86,8 +86,8 @@
import cc.kune.core.server.manager.impl.UserManagerDefault;
import cc.kune.core.server.mapper.DozerMapper;
import cc.kune.core.server.mapper.Mapper;
-import cc.kune.core.server.notifier.NotifyService;
-import cc.kune.core.server.notifier.NotifyServiceDefault;
+import cc.kune.core.server.notifier.NotifySender;
+import cc.kune.core.server.notifier.NotifySenderDefault;
import cc.kune.core.server.notifier.UsersOnline;
import cc.kune.core.server.rpc.ContentRPC;
import cc.kune.core.server.rpc.GroupRPC;
@@ -195,7 +195,7 @@
bind(UsersOnline.class).to(UserSessionManager.class).in(Singleton.class);
requestStaticInjection(AccessRightsUtils.class);
bind(CronServerTasksManager.class).in(Singleton.class);
- bind(NotifyService.class).to(NotifyServiceDefault.class).in(Singleton.class);
+ bind(NotifySender.class).to(NotifySenderDefault.class).in(Singleton.class);
bind(WaveEmailNotifier.class).in(Singleton.class);
bindInterceptor(Matchers.any(), Matchers.annotatedWith(Authenticated.class),
outermostCall(new AuthenticatedMethodInterceptor()));
Modified: trunk/src/main/java/cc/kune/core/server/i18n/I18nTranslationServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/i18n/I18nTranslationServiceDefault.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/i18n/I18nTranslationServiceDefault.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -19,8 +19,8 @@
*/
package cc.kune.core.server.i18n;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.manager.I18nTranslationManager;
import cc.kune.domain.I18nTranslation;
Added: trunk/src/main/java/cc/kune/core/server/mail/FormatedString.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/mail/FormatedString.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/mail/FormatedString.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -0,0 +1,141 @@
+package cc.kune.core.server.mail;
+
+import com.google.common.base.Preconditions;
+
+/**
+ * The Class FormatedString is used to separate, String templates (usually html)
+ * from args (indicated with %s) and also to allow the translation of this
+ * templates.
+ */
+public class FormatedString {
+
+ public static FormatedString build(final boolean shouldBeTranslated, final String template,
+ final Object... args) {
+ return new FormatedString(shouldBeTranslated, template, args);
+ }
+
+ /**
+ * Builds with only a message without args.
+ *
+ * @param plainMsg
+ * the plain msg
+ * @return the formated string
+ */
+ public static FormatedString build(final String plainMsg) {
+ return new FormatedString(plainMsg);
+ }
+
+ /**
+ * Builds the.
+ *
+ * @param template
+ * the template
+ * @param args
+ * the args
+ * @return the formated string
+ */
+ public static FormatedString build(final String template, final Object... args) {
+ return new FormatedString(template, args);
+ }
+
+ /** The args. */
+ private final Object[] args;
+
+ /** The should be translated. */
+ private boolean shouldBeTranslated;
+
+ /** The template. */
+ private String template;
+
+ /**
+ * Instantiates a new formated string.
+ *
+ * @param template
+ * the template
+ * @param shouldBeTranslated
+ * the should be translated
+ * @param args
+ * the args that will be formatted inside the template (%s, etc)
+ */
+ public FormatedString(final boolean shouldBeTranslated, final String template, final Object... args) {
+ this.template = template;
+ this.shouldBeTranslated = shouldBeTranslated;
+ this.args = args;
+ }
+
+ /**
+ * Instantiates a new formated string.
+ *
+ * @param plainMsg
+ * the plain msg
+ */
+ public FormatedString(final String plainMsg) {
+ template = plainMsg;
+ args = null;
+ shouldBeTranslated = true;
+ }
+
+ /**
+ * Instantiates a new formated string.
+ *
+ * @param template
+ * the template
+ * @param args
+ * the args that will be formatted inside the template (%s, etc)
+ */
+ public FormatedString(final String template, final Object... args) {
+ this.template = template;
+ this.args = args;
+ this.shouldBeTranslated = true;
+ }
+
+ /**
+ * Gets the string.
+ *
+ * @return the string
+ */
+ public String getString() {
+ Preconditions.checkNotNull(template, "Template of FormatedString cannot be null");
+ return args == null ? template : String.format(template, args);
+ }
+
+ /**
+ * Gets the template.
+ *
+ * @return the template
+ */
+ public String getTemplate() {
+ return template;
+ }
+
+ /**
+ * Sets the should be translated.
+ *
+ * @param shouldBeTranslated
+ * the new should be translated
+ */
+ public void setShouldBeTranslated(final boolean shouldBeTranslated) {
+ this.shouldBeTranslated = shouldBeTranslated;
+ }
+
+ /**
+ * Sets the template. Used to translate the template to the user language
+ * (when you don't know already the language of the user)
+ *
+ * @param template
+ * the new template
+ */
+ public void setTemplate(final String template) {
+ this.template = template;
+ }
+
+ /**
+ * If should be translated (sometimes the template is only html and should not
+ * be translated)
+ *
+ * @return true, if should be
+ */
+ public boolean shouldBeTranslated() {
+ return shouldBeTranslated;
+ }
+}
Modified: trunk/src/main/java/cc/kune/core/server/mail/MailService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/mail/MailService.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/mail/MailService.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -19,8 +19,6 @@
*/
package cc.kune.core.server.mail;
-import cc.kune.core.server.mail.MailServiceDefault.FormatedString;
-
public interface MailService {
/**
Modified: trunk/src/main/java/cc/kune/core/server/mail/MailServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/mail/MailServiceDefault.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/mail/MailServiceDefault.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -35,7 +35,6 @@
import cc.kune.core.server.LogThis;
import cc.kune.core.server.properties.KuneProperties;
-import com.google.common.base.Preconditions;
import com.google.inject.Inject;
import com.google.inject.Singleton;
@@ -43,46 +42,6 @@
@LogThis
public class MailServiceDefault implements MailService {
- public static class FormatedString {
- public static FormatedString build(final String plainMsg) {
- return new FormatedString(plainMsg);
- }
-
- public static FormatedString build(final String template, final Object... args) {
- return new FormatedString(template, args);
- }
-
- private final Object[] args;
- private String template;
-
- public FormatedString(final String plainMsg) {
- template = plainMsg;
- args = null;
- }
-
- public FormatedString(final String template, final Object... args) {
- this.template = template;
- this.args = args;
- }
-
- public String getString() {
- Preconditions.checkNotNull(template, "Template of FormatedString cannot be null");
- return args == null ? template : String.format(template, args);
- }
-
- public String getTemplate() {
- return template;
- }
-
- /*
- * Used to translate the template to the user language (when you don't know
- * already the language of the user)
- */
- public void setTemplate(final String template) {
- this.template = template;
- }
- }
-
Log log = LogFactory.getLog(MailServiceDefault.class);
private final Properties props;
private final String smtpDefaultFrom;
Modified: trunk/src/main/java/cc/kune/core/server/manager/TagUserContentManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/TagUserContentManagerDefault.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/manager/TagUserContentManagerDefault.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -26,7 +26,7 @@
import javax.persistence.NoResultException;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.server.manager.impl.DefaultManager;
import cc.kune.core.shared.domain.TagCloudResult;
import cc.kune.core.shared.domain.TagCount;
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoDownloadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoDownloadManager.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoDownloadManager.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -55,8 +55,9 @@
}
if (!group.hasLogo()) {
- FileDownloadManagerUtils.returnFile("src/main/webapp/others/defgroup.gif",
- resp.getOutputStream());
+ FileDownloadManagerUtils.returnFile("src/main/webapp/"
+ + (group.isPersonal() ? FileConstants.PERSON_NO_AVATAR_IMAGE
+ : FileConstants.GROUP_NO_AVATAR_IMAGE), resp.getOutputStream());
} else {
// Has logo
final byte[] logo = group.getLogo();
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/I18nTranslationManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/I18nTranslationManagerDefault.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/I18nTranslationManagerDefault.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -25,7 +25,7 @@
import javax.persistence.EntityManager;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.server.manager.I18nLanguageManager;
import cc.kune.core.server.manager.I18nTranslationManager;
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -43,8 +43,8 @@
import org.waveprotocol.wave.model.wave.ParticipantId;
import org.waveprotocol.wave.model.waveref.WaveRef;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.errors.EmailAddressInUseException;
import cc.kune.core.client.errors.GroupLongNameInUseException;
@@ -52,8 +52,8 @@
import cc.kune.core.client.errors.I18nNotFoundException;
import cc.kune.core.client.errors.UserRegistrationException;
import cc.kune.core.client.errors.WrongCurrentPasswordException;
+import cc.kune.core.server.mail.FormatedString;
import cc.kune.core.server.mail.MailService;
-import cc.kune.core.server.mail.MailServiceDefault.FormatedString;
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.manager.I18nCountryManager;
import cc.kune.core.server.manager.I18nLanguageManager;
Added: trunk/src/main/java/cc/kune/core/server/notifier/NotifyHtmlHelper.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/notifier/NotifyHtmlHelper.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/notifier/NotifyHtmlHelper.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -0,0 +1,59 @@
+package cc.kune.core.server.notifier;
+
+import cc.kune.core.server.mail.FormatedString;
+import cc.kune.core.server.utils.AbsoluteFileDownloadUtils;
+import cc.kune.core.shared.utils.SharedFileDownloadUtils;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+/**
+ * The Class NotifyHtmlHelper is used to get html snippets for email
+ * notifications.
+ */
+ at Singleton
+public class NotifyHtmlHelper {
+
+ /** The template used from messages snippets from a group */
+ private static String GROUP_TEMPLATE = "<table style=\"FIXME\" border=\"0\" cellpadding=\"2\" cellspacing=\"2\" width=\"100%%\">"
+ + "<tbody><tr>"
+ + "<td style=\"\" valign=\"top\"><a href=\"%s\">%s</a></td>"
+ + "<td style=\"\" valign=\"top\" width=\"100%%\">"
+ + "<a href=\"%s\">%s</a><br>"
+ + "%s"
+ + "</td></tr></tbody></table>";
+
+ private final SharedFileDownloadUtils fileDownloadUtils;
+
+ /**
+ * Instantiates a new notify html helper.
+ *
+ * @param fileDownloadUtils
+ * the file download utils
+ */
+ @Inject
+ public NotifyHtmlHelper(final AbsoluteFileDownloadUtils fileDownloadUtils) {
+ this.fileDownloadUtils = fileDownloadUtils;
+ }
+
+ /**
+ * Generates a group notification in html like [logo|message]
+ *
+ * @param groupName
+ * the group name you want to get the notification
+ * @param hasLogo
+ * the has logo?
+ * @param message
+ * the message to show close to the logo
+ * @param readMoreMsg
+ * the read more msg
+ * @return the html string
+ */
+ public FormatedString groupNotification(final String groupName, final boolean hasLogo,
+ final String message) {
+ final String groupUrl = fileDownloadUtils.getPrefix() + "#" + groupName;
+ return FormatedString.build(false, GROUP_TEMPLATE, groupUrl,
+ fileDownloadUtils.getLogoAvatarHtml(groupName, hasLogo, false, 50, 50), groupUrl, groupName,
+ message);
+ }
+}
Copied: trunk/src/main/java/cc/kune/core/server/notifier/NotifySender.java (from rev 1648, trunk/src/main/java/cc/kune/core/server/notifier/NotifyService.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/notifier/NotifySender.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/notifier/NotifySender.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -0,0 +1,45 @@
+package cc.kune.core.server.notifier;
+
+import cc.kune.core.server.mail.FormatedString;
+
+/**
+ * The Interface NotifySender.
+ */
+public interface NotifySender {
+
+ /**
+ * Send a message to the recipients (also translate the subject/body using the
+ * user language)
+ *
+ * @param notifyType
+ * the notify type (email, etc)
+ * @param subject
+ * the subject of the message (not translated)
+ * @param body
+ * the body of the message (not translated) but with %s
+ * {@link String.format} args
+ * @param isHtml
+ * if the body is html
+ * @param recipients
+ * the recipients shortnames (without domain)
+ */
+ void send(NotifyType notifyType, FormatedString subject, FormatedString body, boolean isHtml,
+ String... recipients);
+
+ /**
+ * Send a message to the recipients (also translate the subject/body using the
+ * user language)
+ *
+ * @param notifyType
+ * the notify type (email, etc)
+ * @param subject
+ * the subject of the message
+ * @param body
+ * the body of the message (no translated) but with some %s
+ * {@link String.format} args
+ * @param recipients
+ * the recipients shortnames (without domain)
+ */
+ void send(NotifyType notifyType, FormatedString subject, FormatedString body, String... recipients);
+
+}
Copied: trunk/src/main/java/cc/kune/core/server/notifier/NotifySenderDefault.java (from rev 1649, trunk/src/main/java/cc/kune/core/server/notifier/NotifyServiceDefault.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/notifier/NotifySenderDefault.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/notifier/NotifySenderDefault.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -0,0 +1,109 @@
+package cc.kune.core.server.notifier;
+
+import java.io.File;
+import java.io.IOException;
+
+import javax.persistence.NoResultException;
+
+import org.apache.commons.io.FileUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import cc.kune.common.shared.utils.TextUtils;
+import cc.kune.core.server.mail.FormatedString;
+import cc.kune.core.server.mail.MailService;
+import cc.kune.core.server.manager.I18nTranslationManager;
+import cc.kune.core.server.manager.UserManager;
+import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.server.xmpp.XmppManager;
+import cc.kune.core.shared.domain.dto.EmailNotificationFrequency;
+import cc.kune.domain.User;
+import cc.kune.wave.server.KuneWaveService;
+
+import com.google.common.base.Preconditions;
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class NotifySenderDefault implements NotifySender {
+ public static final Log LOG = LogFactory.getLog(NotifySenderDefault.class);
+ private final String emailTemplate;
+ private final I18nTranslationManager i18n;
+ private final MailService mailService;
+ private final UserManager userManager;
+ private final KuneWaveService waveService;
+ private final XmppManager xmppManager;
+
+ @Inject
+ public NotifySenderDefault(final MailService mailService, final KuneWaveService waveService,
+ final XmppManager xmppManager, final UserManager userManager, final I18nTranslationManager i18n,
+ final KuneProperties kuneProperties) throws IOException {
+ this.mailService = mailService;
+ this.waveService = waveService;
+ this.xmppManager = xmppManager;
+ this.userManager = userManager;
+ this.i18n = i18n;
+ emailTemplate = FileUtils.readFileToString(new File(
+ kuneProperties.get(KuneProperties.SITE_EMAIL_TEMPLATE)));
+ Preconditions.checkNotNull(emailTemplate);
+ Preconditions.checkArgument(TextUtils.notEmpty(emailTemplate));
+ }
+
+ @Override
+ public void send(final NotifyType notifyType, final FormatedString subject, final FormatedString body,
+ final boolean isHtml, final String... recipients) {
+ for (final String recipient : recipients) {
+ User user;
+ try {
+ user = userManager.findByShortname(recipient);
+ } catch (final NoResultException e) {
+ LOG.info(String.format("The recipient %s is not a local user, don't notify", recipient));
+ continue;
+ }
+ if (subject.shouldBeTranslated()) {
+ // Translate per recipient language
+ final String subjectTranslation = i18n.getTranslation(user.getLanguage().getCode(),
+ subject.getTemplate(), "");
+ if (subjectTranslation != null) {
+ // Right now commented because we are only testing
+ // subject.setTemplate(subjectTranslation);
+ }
+ }
+ if (body.shouldBeTranslated()) {
+ final String bodyTranslation = i18n.getTranslation(user.getLanguage().getCode(),
+ body.getTemplate(), "");
+ if (bodyTranslation != null) {
+ // Right now commented because we are only testing
+ // body.setTemplate(bodyTranslation);
+ }
+ }
+ switch (notifyType) {
+ case chat:
+ xmppManager.sendMessage(recipient,
+ String.format("<b>%s</b>%s", subject.getString(), body.getString()));
+ break;
+ case email:
+ if (user.getEmailNotifFreq().equals(EmailNotificationFrequency.immediately)) {
+ mailService.send(subject, FormatedString.build(emailTemplate.replace("%s", body.getString())),
+ isHtml, user.getEmail());
+ } else {
+ // TODO: handle other types of notifications frequencies
+ }
+ break;
+ case wave:
+ if (isHtml) {
+ LOG.error("Wave html messages not supported yet");
+ }
+ waveService.createWave(subject.getString(), body.getString(), recipient);
+ break;
+ }
+ }
+ }
+
+ @Override
+ public void send(final NotifyType notifyType, final FormatedString subject, final FormatedString body,
+ final String... dests) {
+ send(notifyType, subject, body, false, dests);
+ }
+
+}
Deleted: trunk/src/main/java/cc/kune/core/server/notifier/NotifyService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/notifier/NotifyService.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/notifier/NotifyService.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -1,45 +0,0 @@
-package cc.kune.core.server.notifier;
-
-import cc.kune.core.server.mail.MailServiceDefault.FormatedString;
-
-/**
- * The Interface NotifyService.
- */
-public interface NotifyService {
-
- /**
- * Send a message to the recipients (also translate the subject/body using the
- * user language)
- *
- * @param notifyType
- * the notify type (email, etc)
- * @param subject
- * the subject of the message (not translated)
- * @param body
- * the body of the message (not translated) but with %s
- * {@link String.format} args
- * @param isHtml
- * if the body is html
- * @param recipients
- * the recipients shortnames (without domain)
- */
- void send(NotifyType notifyType, FormatedString subject, FormatedString body, boolean isHtml,
- String... recipients);
-
- /**
- * Send a message to the recipients (also translate the subject/body using the
- * user language)
- *
- * @param notifyType
- * the notify type (email, etc)
- * @param subject
- * the subject of the message
- * @param body
- * the body of the message (no translated) but with some %s
- * {@link String.format} args
- * @param recipients
- * the recipients shortnames (without domain)
- */
- void send(NotifyType notifyType, FormatedString subject, FormatedString body, String... recipients);
-
-}
Copied: trunk/src/main/java/cc/kune/core/server/notifier/NotifyService.java (from rev 1649, trunk/src/main/java/cc/kune/core/server/notifier/NotifyServiceDefault.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/notifier/NotifyService.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/notifier/NotifyService.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -0,0 +1,55 @@
+package cc.kune.core.server.notifier;
+
+import java.util.Collection;
+import java.util.List;
+import java.util.Set;
+
+import org.apache.commons.collections.CollectionUtils;
+
+import cc.kune.core.server.mail.FormatedString;
+import cc.kune.domain.Group;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class NotifyService {
+
+ private final NotifyHtmlHelper helper;
+ private final NotifySender sender;
+
+ @Inject
+ NotifyService(final NotifySender sender, final NotifyHtmlHelper helper) {
+ this.sender = sender;
+ this.helper = helper;
+ }
+
+ @SuppressWarnings("unchecked")
+ public void notifyGroup(final Group groupToNotify, final Group groupSender, final String subject,
+ final String message) {
+ final Set<Group> admins = groupToNotify.getSocialNetwork().getAccessLists().getAdmins().getList();
+ final Set<Group> collabs = groupToNotify.getSocialNetwork().getAccessLists().getEditors().getList();
+ final List<Group> groups = (List<Group>) CollectionUtils.union(admins, collabs);
+ notifyToAll(groupSender, subject, message, groups);
+ }
+
+ public void notifyGroupAdmins(final Group groupToNotify, final Group groupSender,
+ final String subject, final String message) {
+ final Set<Group> admins = groupToNotify.getSocialNetwork().getAccessLists().getAdmins().getList();
+ notifyToAll(groupSender, subject, message, admins);
+ }
+
+ private void notifyToAll(final Group groupSender, final String subject, final String message,
+ final Collection<Group> groups) {
+ for (final Group to : groups) {
+ sender.send(NotifyType.email, FormatedString.build(subject),
+ helper.groupNotification(groupSender.getShortName(), groupSender.hasLogo(), message),
+ to.getShortName());
+ }
+ }
+
+ public void notifyUser(final String to, final Group group, final String subject, final String message) {
+ sender.send(NotifyType.email, FormatedString.build(subject),
+ helper.groupNotification(group.getShortName(), group.hasLogo(), message), to);
+ }
+}
Deleted: trunk/src/main/java/cc/kune/core/server/notifier/NotifyServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/notifier/NotifyServiceDefault.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/notifier/NotifyServiceDefault.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -1,105 +0,0 @@
-package cc.kune.core.server.notifier;
-
-import java.io.File;
-import java.io.IOException;
-
-import javax.persistence.NoResultException;
-
-import org.apache.commons.io.FileUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import cc.kune.common.client.utils.TextUtils;
-import cc.kune.core.server.mail.MailService;
-import cc.kune.core.server.mail.MailServiceDefault.FormatedString;
-import cc.kune.core.server.manager.I18nTranslationManager;
-import cc.kune.core.server.manager.UserManager;
-import cc.kune.core.server.properties.KuneProperties;
-import cc.kune.core.server.xmpp.XmppManager;
-import cc.kune.core.shared.domain.dto.EmailNotificationFrequency;
-import cc.kune.domain.User;
-import cc.kune.wave.server.KuneWaveService;
-
-import com.google.common.base.Preconditions;
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-
- at Singleton
-public class NotifyServiceDefault implements NotifyService {
- public static final Log LOG = LogFactory.getLog(NotifyServiceDefault.class);
- private final String emailTemplate;
- private final I18nTranslationManager i18n;
- private final MailService mailService;
- private final UserManager userManager;
- private final KuneWaveService waveService;
- private final XmppManager xmppManager;
-
- @Inject
- public NotifyServiceDefault(final MailService mailService, final KuneWaveService waveService,
- final XmppManager xmppManager, final UserManager userManager, final I18nTranslationManager i18n,
- final KuneProperties kuneProperties) throws IOException {
- this.mailService = mailService;
- this.waveService = waveService;
- this.xmppManager = xmppManager;
- this.userManager = userManager;
- this.i18n = i18n;
- emailTemplate = FileUtils.readFileToString(new File(
- kuneProperties.get(KuneProperties.SITE_EMAIL_TEMPLATE)));
- Preconditions.checkNotNull(emailTemplate);
- Preconditions.checkArgument(TextUtils.notEmpty(emailTemplate));
- }
-
- @Override
- public void send(final NotifyType notifyType, final FormatedString subject, final FormatedString body,
- final boolean isHtml, final String... recipients) {
- for (final String recipient : recipients) {
- User user;
- try {
- user = userManager.findByShortname(recipient);
- } catch (final NoResultException e) {
- LOG.info(String.format("The recipient %s is not a local user, don't notify", recipient));
- continue;
- }
- // Translate per recipient language
- final String subjectTranslation = i18n.getTranslation(user.getLanguage().getCode(),
- subject.getTemplate(), "");
- if (subjectTranslation != null) {
- // Right now commented because we are only testing
- // subject.setTemplate(subjectTranslation);
- }
- final String bodyTranslation = i18n.getTranslation(user.getLanguage().getCode(),
- body.getTemplate(), "");
- if (bodyTranslation != null) {
- // Right now commented because we are only testing
- // body.setTemplate(bodyTranslation);
- }
- switch (notifyType) {
- case chat:
- xmppManager.sendMessage(recipient,
- String.format("<b>%s</b>%s", subject.getString(), body.getString()));
- break;
- case email:
- if (user.getEmailNotifFreq().equals(EmailNotificationFrequency.immediately)) {
- mailService.send(subject, FormatedString.build(emailTemplate.replace("%s", body.getString())),
- isHtml, user.getEmail());
- } else {
- // TODO: handle other types of notifications frequencies
- }
- break;
- case wave:
- if (isHtml) {
- LOG.error("Wave html messages not supported yet");
- }
- waveService.createWave(subject.getString(), body.getString(), recipient);
- break;
- }
- }
- }
-
- @Override
- public void send(final NotifyType notifyType, final FormatedString subject, final FormatedString body,
- final String... dests) {
- send(notifyType, subject, body, false, dests);
- }
-
-}
Modified: trunk/src/main/java/cc/kune/core/server/properties/KuneBasicProperties.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/properties/KuneBasicProperties.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/properties/KuneBasicProperties.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -72,13 +72,8 @@
return properties.get(KuneProperties.SITE_COMMON_NAME);
}
- /**
- * Gets the site domain (something like example.org)
- *
- * @return the site domain
- */
- public String getSiteDomain() {
- return properties.get(KuneProperties.SITE_DOMAIN);
+ public String getSiteUrl() {
+ return properties.get(KuneProperties.SITE_URL);
}
public String getWelcomewave() {
Modified: trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -127,7 +127,6 @@
data.setTimezones(TimeZone.getAvailableIDs());
data.setChatHttpBase(chatProperties.getHttpBase());
data.setChatDomain(chatProperties.getDomain());
- data.setSiteDomain(kuneProperties.get(KuneProperties.SITE_DOMAIN));
data.setChatRoomHost(chatProperties.getRoomHost());
data.setDefaultLicense(licenseManager.getDefLicense());
data.setCurrentCCversion(this.kuneProperties.get(KuneProperties.CURRENT_CC_VERSION));
Modified: trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -28,6 +28,7 @@
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.manager.SocialNetworkManager;
import cc.kune.core.server.mapper.Mapper;
+import cc.kune.core.server.notifier.NotifyService;
import cc.kune.core.shared.domain.AccessRol;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.SocialNetworkDataDTO;
@@ -42,16 +43,19 @@
private final GroupManager groupManager;
private final Mapper mapper;
+ private final NotifyService notifyService;
private final SocialNetworkManager socialNetworkManager;
private final UserSessionManager userSessionManager;
@Inject
public SocialNetworkRPC(final UserSessionManager userSessionManager, final GroupManager groupManager,
- final SocialNetworkManager socialNetworkManager, final Mapper mapper) {
+ final SocialNetworkManager socialNetworkManager, final Mapper mapper,
+ final NotifyService notifyService) {
this.userSessionManager = userSessionManager;
this.groupManager = groupManager;
this.socialNetworkManager = socialNetworkManager;
this.mapper = mapper;
+ this.notifyService = notifyService;
}
@Override
@@ -65,6 +69,8 @@
checkIsNotPersonalGroup(group);
final Group groupToAccept = groupManager.findByShortName(groupToAcceptShortName);
socialNetworkManager.acceptJoinGroup(userLogged, groupToAccept, group);
+ notifyService.notifyGroup(groupToAccept, group, "Accepted as member",
+ "You are now member of this group");
return generateResponse(userLogged, group);
}
@@ -79,6 +85,7 @@
checkIsNotPersonalGroup(group);
final Group groupToAdd = groupManager.findByShortName(groupToAddShortName);
socialNetworkManager.addGroupToAdmins(userLogged, groupToAdd, group);
+ notifyService.notifyGroup(groupToAdd, group, "Accepted as admin", "You are now admin of this group");
return generateResponse(userLogged, group);
}
@@ -93,6 +100,8 @@
checkIsNotPersonalGroup(group);
final Group groupToAdd = groupManager.findByShortName(groupToAddShortName);
socialNetworkManager.addGroupToCollabs(userLogged, groupToAdd, group);
+ notifyService.notifyGroup(groupToAdd, group, "Accepted as collaborator",
+ "You are now a collaborator of this group");
return generateResponse(userLogged, group);
}
@@ -128,6 +137,8 @@
checkIsNotPersonalGroup(group);
final Group groupToDelete = groupManager.findByShortName(groupToDeleleShortName);
socialNetworkManager.deleteMember(userLogged, groupToDelete, group);
+ notifyService.notifyGroup(groupToDelete, group, "Removed as collaborator",
+ "You have been remove as collaborator of this group");
return generateResponse(userLogged, group);
}
@@ -142,6 +153,8 @@
checkIsNotPersonalGroup(group);
final Group groupToDenyJoin = groupManager.findByShortName(groupToDenyShortName);
socialNetworkManager.denyJoinGroup(userLogged, groupToDenyJoin, group);
+ notifyService.notifyGroup(groupToDenyJoin, group, "Membership denied",
+ "Your membership to this group has been rejected");
return generateResponse(userLogged, group);
}
@@ -170,6 +183,8 @@
final User user = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
+ notifyService.notifyGroupAdmins(group, group, "Pending collaborator",
+ "There is a pending collaborator in this group. Please accept or deny him/her");
return socialNetworkManager.requestToJoin(user, group);
}
@@ -184,6 +199,8 @@
checkIsNotPersonalGroup(group);
final Group groupToSetCollab = groupManager.findByShortName(groupToSetCollabShortName);
socialNetworkManager.setAdminAsCollab(userLogged, groupToSetCollab, group);
+ notifyService.notifyGroup(groupToSetCollab, group, "Membership changed",
+ "Your membership to this group have changed. You are now a collaborator of this group");
return generateResponse(userLogged, group);
}
@@ -198,6 +215,8 @@
checkIsNotPersonalGroup(group);
final Group groupToSetAdmin = groupManager.findByShortName(groupToSetAdminShortName);
socialNetworkManager.setCollabAsAdmin(userLogged, groupToSetAdmin, group);
+ notifyService.notifyGroup(groupToSetAdmin, group, "Membership changed",
+ "Your membership to this group have changed. You are now an admin of this group");
return generateResponse(userLogged, group);
}
@@ -209,6 +228,8 @@
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
socialNetworkManager.unJoinGroup(userLogged.getUserGroup(), group);
+ notifyService.notifyGroupAdmins(group, userLogged.getUserGroup(), "Some member left this group",
+ "Some member have left this group");
}
}
Added: trunk/src/main/java/cc/kune/core/server/utils/AbsoluteFileDownloadUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/utils/AbsoluteFileDownloadUtils.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/utils/AbsoluteFileDownloadUtils.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -0,0 +1,20 @@
+package cc.kune.core.server.utils;
+
+import cc.kune.core.server.properties.KuneBasicProperties;
+import cc.kune.core.shared.utils.SharedFileDownloadUtils;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+/**
+ * The Class AbsoluteFileDownloadUtils get url of avatars etc, with absolute
+ * urls (with domain, etc).
+ */
+ at Singleton
+public class AbsoluteFileDownloadUtils extends SharedFileDownloadUtils {
+
+ @Inject
+ public AbsoluteFileDownloadUtils(final KuneBasicProperties properties) {
+ super(properties.getSiteUrl());
+ }
+}
Modified: trunk/src/main/java/cc/kune/core/server/utils/FilenameUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/utils/FilenameUtils.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/utils/FilenameUtils.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -21,7 +21,7 @@
import org.apache.commons.lang.StringUtils;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.errors.NameNotPermittedException;
public class FilenameUtils {
Modified: trunk/src/main/java/cc/kune/core/server/xmpp/XmppManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/xmpp/XmppManagerDefault.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/server/xmpp/XmppManagerDefault.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -39,7 +39,7 @@
import org.jivesoftware.smackx.FormField;
import org.jivesoftware.smackx.muc.MultiUserChat;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.server.properties.ChatProperties;
import com.google.inject.Inject;
Modified: trunk/src/main/java/cc/kune/core/shared/FileConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/FileConstants.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/shared/FileConstants.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -29,7 +29,11 @@
public static final String DOWNLOADSERVLET = ASITE_PREFIX + "servlets/FileDownloadManager";
public final static String FILENAME = "filename";
public final static String GROUP_LOGO_FIELD = "k-glogov-ff";
- public static final String GROUP_NO_AVATAR_IMAGE = ASITE_PREFIX + "images/group-def-icon.png";
+ // public static final String GROUP_NO_AVATAR_IMAGE = ASITE_PREFIX +
+ // "images/group-def-icon.png";
+ public static final String GROUP_NO_AVATAR_IMAGE = "others/defgroup.gif";
+ public static final String GROUP_NO_AVATAR_IMAGE_PATH = ASITE_PREFIX + GROUP_NO_AVATAR_IMAGE;
+
public final static String HASH = "hash";
public final static String IMGSIZE = "imgsize";
public final static int LOGO_DEF_HEIGHT = 60;
@@ -37,7 +41,8 @@
public final static int LOGO_MIN_HEIGHT = 28;
public final static int LOGO_MIN_WIDTH = 468;
public static final String LOGODOWNLOADSERVLET = ASITE_PREFIX + "servlets/EntityLogoDownloadManager";
- public final static String PERSON_NO_AVATAR_IMAGE = ASITE_PREFIX + "images/unknown.jpg";
+ public final static String PERSON_NO_AVATAR_IMAGE = "images/unknown.jpg";
+ public final static String PERSON_NO_AVATAR_IMAGE_PATH = ASITE_PREFIX + PERSON_NO_AVATAR_IMAGE;
public final static String TOKEN = "token";
public final static String TYPE_ID = "typeid";
public final static String USER_LOGO_FIELD = "k-ulogov-ff";
Modified: trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -50,7 +50,6 @@
private String mp3EmbedObject;
private String oggEmbedObject;
private ReservedWordsRegistryDTO reservedWords;
- private String siteDomain;
private String siteLogoUrl;
private String siteLogoUrlOnOver;
private String siteShortName;
@@ -157,10 +156,6 @@
}
@Deprecated
- public String getSiteDomain() {
- return siteDomain;
- }
-
public String getSiteLogoUrl() {
return siteLogoUrl;
}
@@ -297,11 +292,6 @@
this.reservedWords = reservedWords;
}
- @Deprecated
- public void setSiteDomain(final String siteDomain) {
- this.siteDomain = siteDomain;
- }
-
public void setSiteLogoUrl(final String siteLogoUrl) {
this.siteLogoUrl = siteLogoUrl;
}
Added: trunk/src/main/java/cc/kune/core/shared/utils/SharedFileDownloadUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/utils/SharedFileDownloadUtils.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/shared/utils/SharedFileDownloadUtils.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -0,0 +1,56 @@
+package cc.kune.core.shared.utils;
+
+import cc.kune.common.shared.utils.Url;
+import cc.kune.common.shared.utils.UrlParam;
+import cc.kune.core.shared.FileConstants;
+import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.dto.UserSimpleDTO;
+
+public class SharedFileDownloadUtils {
+
+ private final String prefix;
+
+ public SharedFileDownloadUtils() {
+ this.prefix = "";
+ }
+
+ public SharedFileDownloadUtils(final String prefix) {
+ this.prefix = prefix;
+ }
+
+ public String getGroupLogo(final GroupDTO group) {
+ return prefix
+ + (group.hasLogo() ? getLogoImageUrl(group.getShortName())
+ : group.isPersonal() ? FileConstants.PERSON_NO_AVATAR_IMAGE_PATH
+ : FileConstants.GROUP_NO_AVATAR_IMAGE_PATH);
+ }
+
+ public String getLogoAvatarHtml(final String groupName, final boolean groupHasLogo,
+ final boolean isPersonal, final int size, final int hvspace) {
+ final String imgUrl = groupHasLogo ? getLogoImageUrl(groupName)
+ : isPersonal ? FileConstants.PERSON_NO_AVATAR_IMAGE : FileConstants.GROUP_NO_AVATAR_IMAGE;
+ return "<img hspace='" + hvspace + "' vspace='" + hvspace + "' align='left' style='width: " + size
+ + "px; height: " + size + "px;' src='" + prefix + imgUrl + "'>";
+ }
+
+ public String getLogoImageUrl(final String groupName) {
+ return prefix
+ + new Url(FileConstants.LOGODOWNLOADSERVLET, new UrlParam(FileConstants.TOKEN, groupName)).toString();
+ }
+
+ public String getPrefix() {
+ return prefix;
+ }
+
+ public String getUserAvatar(final String username) {
+ return prefix
+ + new Url(FileConstants.AVATARDOWNLOADSERVLET, new UrlParam(FileConstants.USERNAME, username)).toString();
+ }
+
+ public String getUserAvatar(final UserSimpleDTO user) {
+ return prefix
+ + (user.hasLogo() ? getLogoImageUrl(user.getShortName())
+ : FileConstants.PERSON_NO_AVATAR_IMAGE_PATH);
+ }
+
+}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/events/client/actions/EventEditMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/EventEditMenuItem.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/events/client/actions/EventEditMenuItem.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -4,8 +4,8 @@
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.ui.dialogs.PromptTopDialog;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.actions.RolAction;
import cc.kune.core.client.resources.nav.NavResources;
import cc.kune.core.shared.dto.AccessRolDTO;
Modified: trunk/src/main/java/cc/kune/events/client/actions/EventRemoveMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/EventRemoveMenuItem.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/events/client/actions/EventRemoveMenuItem.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -4,8 +4,8 @@
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.ui.dialogs.PromptTopDialog;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.actions.RolAction;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.shared.dto.AccessRolDTO;
Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -16,8 +16,8 @@
package cc.kune.gspace.client.i18n;
import cc.kune.common.client.tooltip.Tooltip;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
import cc.kune.core.shared.dto.I18nTranslationDTO;
Modified: trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFirstForm.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFirstForm.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/gspace/client/licensewizard/pages/LicenseWizardFirstForm.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -20,8 +20,8 @@
package cc.kune.gspace.client.licensewizard.pages;
import cc.kune.common.client.utils.SimpleCallback;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.ui.DefaultForm;
import cc.kune.core.client.ui.DefaultFormUtils;
Modified: trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePresenter.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePresenter.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -24,11 +24,11 @@
import gwtupload.client.IUploader.OnFinishUploaderHandler;
import gwtupload.client.IUploader.OnStartUploaderHandler;
import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.services.ImageSize;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateChangedEvent;
@@ -53,7 +53,7 @@
private final GSpaceBackManager backManager;
private final EntityOptions entityOptions;
private final EventBus eventBus;
- private final FileDownloadUtils fileDownloadUtils;
+ private final ClientFileDownloadUtils fileDownloadUtils;
private final Provider<GroupServiceAsync> groupService;
private final I18nTranslationService i18n;
private final Session session;
@@ -64,7 +64,7 @@
final StateManager stateManager, final EntityOptions entityOptions,
final Provider<GroupServiceAsync> groupService, final GSpaceBackManager backManager,
final GSpaceThemeSelectorPresenter styleSelector, final I18nTranslationService i18n,
- final FileDownloadUtils fileDownloadUtils) {
+ final ClientFileDownloadUtils fileDownloadUtils) {
this.eventBus = eventBus;
this.session = session;
this.stateManager = stateManager;
Modified: trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStylePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStylePresenter.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/GroupOptStylePresenter.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -21,7 +21,7 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
import cc.kune.gspace.client.options.GroupOptions;
@@ -40,7 +40,7 @@
final StateManager stateManager, final GroupOptions entityOptions,
final Provider<GroupServiceAsync> groupService, final GSpaceBackManager backManager,
final GroupOptStyleView view, final GSpaceThemeSelectorPresenter styleSelector,
- final I18nTranslationService i18n, final FileDownloadUtils fileDownUtils) {
+ final I18nTranslationService i18n, final ClientFileDownloadUtils fileDownUtils) {
super(eventBus, session, stateManager, entityOptions, groupService, backManager, styleSelector,
i18n, fileDownUtils);
init(view);
Modified: trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStylePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStylePresenter.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/UserOptStylePresenter.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -21,7 +21,7 @@
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
import cc.kune.gspace.client.options.UserOptions;
@@ -42,7 +42,7 @@
final StateManager stateManager, final UserOptions entityOptions,
final Provider<GroupServiceAsync> groupService, final GSpaceBackManager backManager,
final UserOptStyleView view, final GSpaceThemeSelectorPresenter styleSelector,
- final I18nTranslationService i18n, final FileDownloadUtils fileDownUtils) {
+ final I18nTranslationService i18n, final ClientFileDownloadUtils fileDownUtils) {
super(eventBus, session, stateManager, entityOptions, groupService, backManager, styleSelector,
i18n, fileDownUtils);
init(view);
Modified: trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -21,7 +21,7 @@
import javax.annotation.Nonnull;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.state.StateManager;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.gspace.client.GSpaceArmor;
@@ -31,13 +31,13 @@
public class GSpaceBackManagerImpl implements GSpaceBackManager {
private static final StateToken NO_TOKEN = new StateToken("none.none.0.0");
- private final FileDownloadUtils downloadUtils;
+ private final ClientFileDownloadUtils downloadUtils;
private final GSpaceArmor gSpaceArmor;
private StateToken lastToken;
private final StateManager stateManager;
@Inject
- public GSpaceBackManagerImpl(final FileDownloadUtils downloadUtils, final GSpaceArmor gSpaceArmor,
+ public GSpaceBackManagerImpl(final ClientFileDownloadUtils downloadUtils, final GSpaceArmor gSpaceArmor,
final StateManager stateManager) {
this.downloadUtils = downloadUtils;
this.gSpaceArmor = gSpaceArmor;
Modified: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -24,7 +24,7 @@
import cc.kune.common.client.errors.UIException;
import cc.kune.common.client.log.Log;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.state.GroupChangedEvent;
import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
import cc.kune.core.client.state.StateChangedEvent;
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -3,12 +3,12 @@
import javax.annotation.Nonnull;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.actions.ActionRegistryByType;
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.client.registry.IconsRegistry;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.services.ImageSize;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateManager;
@@ -36,7 +36,7 @@
private final ActionRegistryByType actionsRegistry;
private final ContentCapabilitiesRegistry capabilitiesRegistry;
- private final Provider<FileDownloadUtils> downloadUtilsProvider;
+ private final Provider<ClientFileDownloadUtils> downloadUtilsProvider;
private final I18nTranslationService i18n;
private final IconsRegistry iconsRegistry;
private final PathToolbarUtils pathToolbarUtils;
@@ -46,7 +46,7 @@
@Inject
public FolderViewerUtils(final ContentCapabilitiesRegistry capabilitiesRegistry,
- final Session session, final Provider<FileDownloadUtils> downloadUtilsProvider,
+ final Session session, final Provider<ClientFileDownloadUtils> downloadUtilsProvider,
final I18nTranslationService i18n, final ActionRegistryByType actionsRegistry,
final StateManager stateManager, final PathToolbarUtils pathToolbarUtils) {
this.capabilitiesRegistry = capabilitiesRegistry;
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/PathToolbarUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/PathToolbarUtils.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/PathToolbarUtils.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -21,8 +21,8 @@
import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.dnd.FolderViewerDropController;
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.client.registry.IconsRegistry;
Modified: trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -25,11 +25,11 @@
import cc.kune.common.client.ui.DottedTabPanel;
import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.core.client.services.FileDownloadUtils;
import cc.kune.core.client.state.SiteTokens;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.ContentSimpleDTO;
import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.utils.SharedFileDownloadUtils;
import cc.kune.gspace.client.GSpaceArmor;
import cc.kune.hspace.client.HSpacePresenter.HSpaceView;
@@ -58,7 +58,7 @@
private static HSpacePanelUiBinder uiBinder = GWT.create(HSpacePanelUiBinder.class);
- private final FileDownloadUtils downUtils;
+ private final SharedFileDownloadUtils downUtils;
@UiField
FlowPanel globalStats;
private final RootPanel globalStatsParent;
@@ -103,7 +103,7 @@
@Inject
public HSpacePanel(final I18nTranslationService i18n, final GSpaceArmor armor,
- final Provider<GroupContentHomeLink> linkProv, final FileDownloadUtils downUtils) {
+ final Provider<GroupContentHomeLink> linkProv, final SharedFileDownloadUtils downUtils) {
this.linkProv = linkProv;
this.downUtils = downUtils;
widget = uiBinder.createAndBindUi(this);
@@ -165,7 +165,7 @@
for (final ContentSimpleDTO content : lastContentsOfMyGroupsList) {
final GroupContentHomeLink link = linkProv.get();
final StateToken token = content.getStateToken();
- link.setValues(downUtils.getLogoImageUrl(token.copy().clearDocument().clearFolder()),
+ link.setValues(downUtils.getLogoImageUrl(token.getGroup()),
format(content.getModifiedOn(), content.getName()), token.toString());
lastActivityInYourGroup.add(link);
}
@@ -176,7 +176,7 @@
lastGroups.clear();
for (final GroupDTO group : lastGroupsList) {
final GroupContentHomeLink link = linkProv.get();
- link.setValues(downUtils.getLogoImageUrl(group.getStateToken()),
+ link.setValues(downUtils.getLogoImageUrl(group.getShortName()),
format(group.getCreatedOn(), group.getLongName()), group.getShortName());
lastGroups.add(link);
}
@@ -189,7 +189,7 @@
final GroupContentHomeLink link = linkProv.get();
final StateToken token = content.getStateToken();
link.setValues(
- downUtils.getLogoImageUrl(token.copy().clearDocument().clearFolder()),
+ downUtils.getLogoImageUrl(token.getGroup()),
format(content.getModifiedOn(),
"(" + content.getStateToken().getGroup() + ") " + content.getName()), token.toString());
lastPublishedContents.add(link);
Modified: trunk/src/main/java/cc/kune/msgs/client/UserMessageWidget.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/UserMessageWidget.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/msgs/client/UserMessageWidget.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -25,7 +25,7 @@
import org.adamtacy.client.ui.effects.examples.Show;
import cc.kune.common.client.notify.NotifyLevel;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.msgs.client.resources.UserMessageImagesUtil;
import com.google.gwt.core.client.GWT;
Modified: trunk/src/main/java/cc/kune/pspace/client/PSpaceInDevelopment.java
===================================================================
--- trunk/src/main/java/cc/kune/pspace/client/PSpaceInDevelopment.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/pspace/client/PSpaceInDevelopment.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -19,11 +19,11 @@
*/
package cc.kune.pspace.client;
-import cc.kune.common.client.utils.TextUtils;
-import cc.kune.common.client.utils.UrlParam;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
+import cc.kune.common.shared.utils.UrlParam;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.client.state.GroupChangedEvent;
import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
import cc.kune.core.client.state.Session;
@@ -57,7 +57,7 @@
FlowPanel container;
@UiField
FlowPanel contentPanel;
- private final Provider<FileDownloadUtils> downloadProvider;
+ private final Provider<ClientFileDownloadUtils> downloadProvider;
@UiField
Image entityLogo;
@UiField
@@ -76,7 +76,7 @@
@Inject
public PSpaceInDevelopment(final StateManager stateManager, final CoreResources images,
- final Session session, final Provider<FileDownloadUtils> downloadProvider,
+ final Session session, final Provider<ClientFileDownloadUtils> downloadProvider,
final I18nTranslationService i18n, final EventBus eventBus) {
this.images = images;
this.downloadProvider = downloadProvider;
@@ -116,7 +116,7 @@
}
private void setLogoImage(final StateToken stateToken, final boolean noCache) {
- entityLogo.setUrl(downloadProvider.get().getLogoImageUrl(stateToken)
+ entityLogo.setUrl(downloadProvider.get().getLogoImageUrl(stateToken.getGroup())
+ (noCache ? UrlParam.noCacheStringSuffix() : ""));
}
Modified: trunk/src/main/java/cc/kune/pspace/client/PSpacePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/pspace/client/PSpacePresenter.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/pspace/client/PSpacePresenter.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -20,8 +20,8 @@
package cc.kune.pspace.client;
import cc.kune.common.client.actions.ui.IsActionExtensible;
-import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.state.Session;
import cc.kune.core.client.state.StateChangedEvent;
Modified: trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -25,7 +25,7 @@
import org.waveprotocol.wave.client.account.impl.ProfileImpl;
import org.waveprotocol.wave.model.wave.ParticipantId;
-import cc.kune.core.client.services.FileDownloadUtils;
+import cc.kune.core.client.services.ClientFileDownloadUtils;
import cc.kune.core.shared.FileConstants;
import com.google.inject.Inject;
@@ -39,11 +39,11 @@
public class KuneWaveProfileManager extends AbstractProfileManager<ProfileImpl> implements
ProfileManager {
- private final FileDownloadUtils downloadUtils;
+ private final ClientFileDownloadUtils downloadUtils;
private String localDomain;
@Inject
- public KuneWaveProfileManager(final FileDownloadUtils downloadUtils) {
+ public KuneWaveProfileManager(final ClientFileDownloadUtils downloadUtils) {
this.downloadUtils = downloadUtils;
}
Modified: trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -48,7 +48,7 @@
import org.waveprotocol.wave.model.wave.ParticipantId;
import org.waveprotocol.wave.model.waveref.WaveRef;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.errors.DefaultException;
import com.google.common.collect.ImmutableMap;
Modified: trunk/src/main/java/cc/kune/wave/server/WaveEmailNotifier.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/WaveEmailNotifier.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/cc/kune/wave/server/WaveEmailNotifier.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -18,8 +18,8 @@
import org.waveprotocol.wave.model.waveref.WaveRef;
import cc.kune.core.server.LogThis;
-import cc.kune.core.server.mail.MailServiceDefault.FormatedString;
-import cc.kune.core.server.notifier.NotifyService;
+import cc.kune.core.server.mail.FormatedString;
+import cc.kune.core.server.notifier.NotifySender;
import cc.kune.core.server.notifier.NotifyType;
import cc.kune.core.server.notifier.UsersOnline;
import cc.kune.core.server.properties.KuneBasicProperties;
@@ -31,7 +31,7 @@
public static final Log LOG = LogFactory.getLog(WaveEmailNotifier.class);
@Inject
- public WaveEmailNotifier(final WaveBus waveBus, final NotifyService notifyService,
+ public WaveEmailNotifier(final WaveBus waveBus, final NotifySender notifyService,
final UsersOnline usersOnline, final KuneBasicProperties basicProperties,
final ParticipantUtils partUtils) {
waveBus.subscribe(new Subscriber() {
@@ -51,12 +51,12 @@
final ParticipantId user = ((AddParticipant) op).getParticipantId();
final String url = KuneWaveUtils.getUrl(WaveRef.of(wavelet.getWaveId(), waveletId));
final FormatedString body = FormatedString.build(
- // FIXME when SSL/ssl support
- "Hi there,<br><br>You have a new message in %s. <a href=\"http://%s/#%s\">Read more</a>.<br>",
- basicProperties.getSiteCommonName(), basicProperties.getSiteDomain(), url);
+ "Hi there,<br><br>You have a new message in %s. <a href=\"%s#%s\">Read more</a>.<br>",
+ basicProperties.getSiteCommonName(), basicProperties.getSiteUrl(), url);
final String address = user.getAddress();
if (partUtils.isLocal(address)) {
final String userName = partUtils.getAddressName(address);
+ // FIXME only for testing
if (true || !usersOnline.isLogged(userName)) {
notifyService.send(NotifyType.email, FormatedString.build("You have a new message"),
body, true, userName);
Modified: trunk/src/main/java/com/google/wave/splash/web/template/ThreadedWaveRenderer.java
===================================================================
--- trunk/src/main/java/com/google/wave/splash/web/template/ThreadedWaveRenderer.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/java/com/google/wave/splash/web/template/ThreadedWaveRenderer.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -24,8 +24,8 @@
import org.waveprotocol.box.server.CoreSettings;
-import cc.kune.common.client.utils.Url;
-import cc.kune.common.client.utils.UrlParam;
+import cc.kune.common.shared.utils.Url;
+import cc.kune.common.shared.utils.UrlParam;
import cc.kune.core.shared.FileConstants;
import com.google.common.base.Preconditions;
@@ -153,7 +153,7 @@
avatar = new Url(FileConstants.AVATARDOWNLOADSERVLET, new UrlParam(FileConstants.USERNAME,
address.split("@")[0])).toString();
} else {
- avatar = FileConstants.PERSON_NO_AVATAR_IMAGE;
+ avatar = FileConstants.PERSON_NO_AVATAR_IMAGE_PATH;
}
return avatar;
}
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/main/resources/kune.properties 2012-01-01 17:58:40 UTC (rev 1652)
@@ -2,7 +2,8 @@
### general site config
-kune.siteurl = http://localhost:8080
+# Your site url. Please end with a slash
+kune.siteurl = http://localhost:8080/
kune.sitelogourl = ws/images/kune-logo-16px.png
kune.sitelogourl.onover = ws/images/kune-logo-onover-16px.png
@@ -14,7 +15,6 @@
kune.default.site.name = Site Administration
kune.default.site.shortName = site
-kune.site.domain = localhost
# In the server side we will use this string for mention this site in messages
# like: "Thanks for joining this site"
Added: trunk/src/test/java/cc/kune/core/server/mail/FormatedStringTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/mail/FormatedStringTest.java (rev 0)
+++ trunk/src/test/java/cc/kune/core/server/mail/FormatedStringTest.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -0,0 +1,15 @@
+package cc.kune.core.server.mail;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Test;
+
+public class FormatedStringTest {
+
+ @Test
+ public void testQuotes() {
+ assertNotNull(FormatedString.build("'%s''''\"%s\"", "test", "test2kl").getString());
+ assertEquals("test 100%", FormatedString.build("%s 100%%", "test").getString());
+ }
+}
Modified: trunk/src/test/java/cc/kune/core/server/mail/MailServiceDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/mail/MailServiceDefaultTest.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/test/java/cc/kune/core/server/mail/MailServiceDefaultTest.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -5,7 +5,6 @@
import org.junit.Before;
import org.junit.Test;
-import cc.kune.core.server.mail.MailServiceDefault.FormatedString;
import cc.kune.core.server.properties.KunePropertiesDefault;
public class MailServiceDefaultTest {
Added: trunk/src/test/java/cc/kune/core/server/notifier/NotifyHtmlHelperTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/notifier/NotifyHtmlHelperTest.java (rev 0)
+++ trunk/src/test/java/cc/kune/core/server/notifier/NotifyHtmlHelperTest.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -0,0 +1,30 @@
+package cc.kune.core.server.notifier;
+
+import static org.junit.Assert.assertNotNull;
+
+import org.junit.Before;
+import org.junit.Test;
+
+import cc.kune.core.server.properties.KuneBasicProperties;
+import cc.kune.core.server.properties.KunePropertiesDefault;
+import cc.kune.core.server.utils.AbsoluteFileDownloadUtils;
+
+public class NotifyHtmlHelperTest {
+ private static final String GROUP_NAME = "groupShortName";
+ private static final String MESSAGE = "some message";
+
+ NotifyHtmlHelper helper;
+
+ @Test
+ public void basicTest() {
+ assertNotNull(helper.groupNotification(GROUP_NAME, false, MESSAGE).getString());
+ assertNotNull(helper.groupNotification(GROUP_NAME, true, MESSAGE).getString());
+ }
+
+ @Before
+ public void before() {
+ helper = new NotifyHtmlHelper(new AbsoluteFileDownloadUtils(new KuneBasicProperties(
+ new KunePropertiesDefault("kune.properties"))));
+ }
+
+}
Modified: trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java 2011-12-29 22:15:28 UTC (rev 1651)
+++ trunk/src/test/java/cc/kune/selenium/SeleniumUtils.java 2012-01-01 17:58:40 UTC (rev 1652)
@@ -34,7 +34,7 @@
import org.openqa.selenium.interactions.Actions;
import org.testng.Assert;
-import cc.kune.common.client.utils.TextUtils;
+import cc.kune.common.shared.utils.TextUtils;
public class SeleniumUtils {
More information about the kune-commits
mailing list