kune-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
March 2012
- 2 participants
- 84 discussions
Author: vjrj_
Date: 2012-03-10 08:36:46 +0100 (Sat, 10 Mar 2012)
New Revision: 1754
Added:
trunk/img/icons/world-16.png
trunk/src/main/java/cc/kune/gspace/client/actions/ActionStyles.java
trunk/src/main/java/cc/kune/gspace/client/actions/AddPublicToContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerShareMenu.java
trunk/src/main/resources/icons/add-participant.png
trunk/src/main/resources/icons/world-16.png
Removed:
trunk/src/test/java/cc/kune/core/server/auth/openfire/KuneAuthProviderTest.java.txt
Modified:
trunk/.classpath
trunk/img/icons-base.svg
trunk/img/icons/from-private-to-public.svg
trunk/img/kune-logos.svg
trunk/pom.xml
trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java
trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java
trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceHelper.java
trunk/src/main/java/cc/kune/core/client/sn/AdminsGroupSNDropController.java
trunk/src/main/java/cc/kune/core/client/sn/AllMembersGroupSNDropController.java
trunk/src/main/java/cc/kune/core/client/sn/CollabsGroupSNDropController.java
trunk/src/main/java/cc/kune/core/client/sn/GroupSNDropController.java
trunk/src/main/java/cc/kune/core/public/ws.css
trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/GroupServerUtils.java
trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java
trunk/src/main/java/cc/kune/core/server/notifier/NotificationService.java
trunk/src/main/java/cc/kune/core/shared/dto/SocialNetworkSubGroup.java
trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java
trunk/src/main/java/cc/kune/events/server/EventsServlet.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
trunk/src/main/java/cc/kune/gspace/client/actions/AbstractEditorsMenu.java
trunk/src/main/java/cc/kune/gspace/client/actions/AddAdminMembersToContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/AddAllMembersToContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/AddCollabMembersToContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/AddMembersToContentMenuItem.java
trunk/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java
trunk/src/main/java/cc/kune/tasks/client/actions/TasksClientActions.java
trunk/src/main/java/cc/kune/wave/server/ParticipantUtils.java
trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java
trunk/src/main/webapp/ws.html
Log:
Improved "share" of contents functionality
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/.classpath 2012-03-10 07:36:46 UTC (rev 1754)
@@ -11,22 +11,24 @@
<classpathentry kind="var" path="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5.jar" sourcepath="M2_REPO/javax/servlet/servlet-api/2.5/servlet-api-2.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6.jar" sourcepath="M2_REPO/antlr/antlr/2.7.6/antlr-2.7.6-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0.jar" sourcepath="M2_REPO/aopalliance/aopalliance/1.0/aopalliance-1.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/api/0.3.13/api-0.3.13.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/api-src/0.3.13/api-src-0.3.13.jar"/>
<classpathentry kind="var" path="M2_REPO/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
<classpathentry kind="var" path="M2_REPO/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar" sourcepath="M2_REPO/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box/0.3.12/box-0.3.12.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.12/box-src-0.3.12.jar" sourcepath="M2_REPO/org/waveprotocol/box-src/0.3.12/box-src-0.3.12-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box/0.3.13/box-0.3.13.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.13/box-src-0.3.13.jar" sourcepath="M2_REPO/org/waveprotocol/box-src/0.3.13/box-src-0.3.13-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar"/>
<classpathentry kind="var" path="M2_REPO/c3p0/c3p0/0.9.1/c3p0-0.9.1.jar" sourcepath="M2_REPO/c3p0/c3p0/0.9.1/c3p0-0.9.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3.jar" sourcepath="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client/0.3.12/client-0.3.12.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common/0.3.12/client-common-0.3.12.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.12/client-common-src-0.3.12.jar" sourcepath="M2_REPO/org/waveprotocol/client-common-src/0.3.12/client-common-src-0.3.12-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler/0.3.12/client-scheduler-0.3.12.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.12/client-scheduler-src-0.3.12.jar" sourcepath="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.12/client-scheduler-src-0.3.12-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.12/client-src-0.3.12.jar" sourcepath="M2_REPO/org/waveprotocol/client-src/0.3.12/client-src-0.3.12-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client/0.3.13/client-0.3.13.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common/0.3.13/client-common-0.3.13.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.13/client-common-src-0.3.13.jar" sourcepath="M2_REPO/org/waveprotocol/client-common-src/0.3.13/client-common-src-0.3.13-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler/0.3.13/client-scheduler-0.3.13.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.13/client-scheduler-src-0.3.13.jar" sourcepath="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.13/client-scheduler-src-0.3.13-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.13/client-src-0.3.13.jar" sourcepath="M2_REPO/org/waveprotocol/client-src/0.3.13/client-src-0.3.13-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/cobogw/gwt/cobogw/1.3.1/cobogw-1.3.1.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/common-src/0.3.12/common-src-0.3.12.jar" sourcepath="M2_REPO/org/waveprotocol/common-src/0.3.12/common-src-0.3.12-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/common-src/0.3.13/common-src-0.3.13.jar" sourcepath="M2_REPO/org/waveprotocol/common-src/0.3.13/common-src-0.3.13-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar" sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2.jar" sourcepath="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4-sources.jar"/>
@@ -35,8 +37,10 @@
<classpathentry kind="var" path="M2_REPO/commons-io/commons-io/1.3.1/commons-io-1.3.1.jar" sourcepath="M2_REPO/commons-io/commons-io/1.3.1/commons-io-1.3.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5.jar" sourcepath="M2_REPO/commons-lang/commons-lang/2.5/commons-lang-2.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1.jar" sourcepath="M2_REPO/commons-logging/commons-logging/1.1/commons-logging-1.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.12/communication-src-0.3.12.jar" sourcepath="M2_REPO/org/waveprotocol/communication-src/0.3.12/communication-src-0.3.12-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.12/concurrencycontrol-src-0.3.12.jar" sourcepath="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.12/concurrencycontrol-src-0.3.12-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.13/communication-src-0.3.13.jar" sourcepath="M2_REPO/org/waveprotocol/communication-src/0.3.13/communication-src-0.3.13-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.13/concurrencycontrol-src-0.3.13.jar" sourcepath="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.13/concurrencycontrol-src-0.3.13-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/crypto/0.3.13/crypto-0.3.13.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/crypto-src/0.3.13/crypto-src-0.3.13.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar" sourcepath="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/dozer/dozer/4.0/dozer-4.0.jar" sourcepath="M2_REPO/net/sf/dozer/dozer/4.0/dozer-4.0-sources.jar"/>
@@ -61,7 +65,7 @@
<classpathentry kind="var" path="M2_REPO/com/allen_sauer/gwt/log/gwt-log/gwt-log/3.0.1/gwt-log-3.0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/gwt/gwt-servlet/2.1.1/gwt-servlet-2.1.1.jar" sourcepath="M2_REPO/com/google/gwt/gwt-servlet/2.1.1/gwt-servlet-2.1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1.jar" sourcepath="M2_REPO/com/google/gwt/gwt-user/2.1.1/gwt-user-2.1.1-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/gwt-util-src/0.3.12/gwt-util-src-0.3.12.jar" sourcepath="M2_REPO/org/waveprotocol/gwt-util-src/0.3.12/gwt-util-src-0.3.12-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/gwt-util-src/0.3.13/gwt-util-src-0.3.13.jar" sourcepath="M2_REPO/org/waveprotocol/gwt-util-src/0.3.13/gwt-util-src-0.3.13-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/allen_sauer/gwt/voices/gwt-voices/gwt-voices/2.0.0/gwt-voices-2.0.0.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-all/0.5/gwtp-all-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-all/0.5/gwtp-all-0.5-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-clients-common/0.5/gwtp-clients-common-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-clients-common/0.5/gwtp-clients-common-0.5-sources.jar"/>
@@ -118,16 +122,17 @@
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-profile/2.0/maven-profile-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-profile/2.0/maven-profile-2.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-project/2.0/maven-project-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-project/2.0/maven-project-2.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0.jar" sourcepath="M2_REPO/org/apache/maven/maven-repository-metadata/2.0/maven-repository-metadata-2.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/media-src/0.3.12/media-src-0.3.12.jar" sourcepath="M2_REPO/org/waveprotocol/media-src/0.3.12/media-src-0.3.12-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/media-src/0.3.13/media-src-0.3.13.jar" sourcepath="M2_REPO/org/waveprotocol/media-src/0.3.13/media-src-0.3.13-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/mockito/mockito-core/1.8.5/mockito-core-1.8.5.jar" sourcepath="M2_REPO/org/mockito/mockito-core/1.8.5/mockito-core-1.8.5-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.12/model-src-0.3.12.jar" sourcepath="M2_REPO/org/waveprotocol/model-src/0.3.12/model-src-0.3.12-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model/0.3.13/model-0.3.13.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.13/model-src-0.3.13.jar" sourcepath="M2_REPO/org/waveprotocol/model-src/0.3.13/model-src-0.3.13-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/mvel/mvel2/2.0.16/mvel2-2.0.16.jar" sourcepath="M2_REPO/org/mvel/mvel2/2.0.16/mvel2-2.0.16-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/mysql/mysql-connector-java/5.1.13/mysql-connector-java-5.1.13.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.15/nekohtml-1.9.15.jar" sourcepath="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.15/nekohtml-1.9.15-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/objenesis/objenesis/1.0/objenesis-1.0.jar" sourcepath="M2_REPO/org/objenesis/objenesis/1.0/objenesis-1.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/proto-msg/0.3.12/proto-msg-0.3.12.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/proto-msg/0.3.13/proto-msg-0.3.13.jar"/>
<classpathentry kind="var" path="M2_REPO/org/quartz-scheduler/quartz/2.1.0/quartz-2.1.0.jar" sourcepath="M2_REPO/org/quartz-scheduler/quartz/2.1.0/quartz-2.1.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/w3c/css/sac/1.3/sac-1.3.jar" sourcepath="M2_REPO/org/w3c/css/sac/1.3/sac-1.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.12.0/selenium-android-driver-2.12.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.12.0/selenium-android-driver-2.12.0-sources.jar"/>
@@ -152,9 +157,10 @@
<classpathentry kind="var" path="M2_REPO/stax/stax-api/1.0.1/stax-api-1.0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/testng/testng/6.2.1/testng-6.2.1.jar" sourcepath="M2_REPO/org/testng/testng/6.2.1/testng-6.2.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/tigase/tigase-xmltools/3.3.5/tigase-xmltools-3.3.5.jar" sourcepath="M2_REPO/tigase/tigase-xmltools/3.3.5/tigase-xmltools-3.3.5-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/util-src/0.3.12/util-src-0.3.12.jar" sourcepath="M2_REPO/org/waveprotocol/util-src/0.3.12/util-src-0.3.12-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/util/0.3.13/util-0.3.13.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/util-src/0.3.13/util-src-0.3.13.jar" sourcepath="M2_REPO/org/waveprotocol/util-src/0.3.13/util-src-0.3.13-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.12/waveinabox-server-0.3-0.3.12.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.13/waveinabox-server-0.3-0.3.13.jar"/>
<classpathentry kind="var" path="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1.jar" sourcepath="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
<classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/>
Modified: trunk/img/icons/from-private-to-public.svg
===================================================================
--- trunk/img/icons/from-private-to-public.svg 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/img/icons/from-private-to-public.svg 2012-03-10 07:36:46 UTC (rev 1754)
@@ -14,7 +14,7 @@
height="297mm"
id="svg3010"
version="1.1"
- inkscape:version="0.48.1 r9760"
+ inkscape:version="0.48.2 r9819"
sodipodi:docname="from-private-to-public.svg">
<defs
id="defs3012" />
@@ -25,16 +25,16 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="1.2968783"
+ inkscape:zoom="0.66041902"
inkscape:cx="372.04724"
- inkscape:cy="865.45734"
+ inkscape:cy="526.18109"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
inkscape:window-width="1078"
inkscape:window-height="897"
inkscape:window-x="0"
- inkscape:window-y="947"
+ inkscape:window-y="972"
inkscape:window-maximized="0"
showguides="true"
inkscape:guide-bbox="true"
@@ -72,9 +72,9 @@
height="90"
x="301.92883"
y="67.511871"
- inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/world-90.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90" />
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/world-16.png"
+ inkscape:export-xdpi="16"
+ inkscape:export-ydpi="16" />
<path
sodipodi:type="arc"
style="color:#000000;fill:#e6e6e6;fill-opacity:1;fill-rule:nonzero;stroke:#b3b3b3;stroke-width:1.48864591000000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
@@ -301,28 +301,6 @@
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
<path
- transform="matrix(0.475,0,0,0.95,14.25,8.6181091)"
- d="m 110,32.362183 a 20,10 0 1 1 -40,0 20,10 0 1 1 40,0 z"
- sodipodi:ry="10"
- sodipodi:rx="20"
- sodipodi:cy="32.362183"
- sodipodi:cx="90"
- id="path4967"
- style="color:#000000;fill:#aaeeff;fill-opacity:1;fill-rule:nonzero;stroke:#b3b3b3;stroke-width:1.48864591000000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
- sodipodi:type="arc"
- inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90" />
- <path
- sodipodi:nodetypes="cccccccc"
- inkscape:connector-curvature="0"
- id="path4969"
- d="m 54.870524,30.509779 c -1.153029,0.318922 -2.103799,1.0872 -3.128131,1.667682 -0.588269,0.436973 -1.282465,1.630717 -0.490344,2.151434 0.627041,0.105509 1.130685,-0.428017 1.747951,-0.466712 0.720932,-0.166168 1.456986,-0.297538 2.140464,-0.591045 1.16756,-0.367925 1.16756,-0.367925 1.286901,-0.798635 0.05666,-0.648504 -0.404279,-1.249681 -0.839485,-1.692902 -0.198553,-0.16279 -0.45055,-0.315388 -0.717356,-0.269822 z"
- style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
- inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90" />
- <path
transform="matrix(2,0,0,2,-15,6.6378171)"
d="m 16,16.362183 a 1,1 0 1 1 -2,0 1,1 0 1 1 2,0 z"
sodipodi:ry="1"
@@ -400,38 +378,63 @@
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
+ <g
+ id="g9947">
+ <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"
+ sodipodi:type="arc"
+ style="color:#000000;fill:#aaeeff;fill-opacity:1;fill-rule:nonzero;stroke:#b3b3b3;stroke-width:1.48864591000000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path4967"
+ sodipodi:cx="90"
+ sodipodi:cy="32.362183"
+ sodipodi:rx="20"
+ sodipodi:ry="10"
+ d="m 110,32.362183 a 20,10 0 1 1 -40,0 20,10 0 1 1 40,0 z"
+ transform="matrix(0.475,0,0,0.95,14.25,8.6181091)" />
+ <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"
+ style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="m 54.870524,30.509779 c -1.153029,0.318922 -2.103799,1.0872 -3.128131,1.667682 -0.588269,0.436973 -1.282465,1.630717 -0.490344,2.151434 0.627041,0.105509 1.130685,-0.428017 1.747951,-0.466712 0.720932,-0.166168 1.456986,-0.297538 2.140464,-0.591045 1.16756,-0.367925 1.16756,-0.367925 1.286901,-0.798635 0.05666,-0.648504 -0.404279,-1.249681 -0.839485,-1.692902 -0.198553,-0.16279 -0.45055,-0.315388 -0.717356,-0.269822 z"
+ id="path4969"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cccccccc" />
+ <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"
+ style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="m 64,36.862183 c -1.635366,0.833939 -3.561037,1.673743 -4.270781,3.334577 -0.218268,0.510757 0.09005,1.113048 0.166644,1.657967 0.31147,0.58051 -0.449632,1.092308 -0.224964,1.674953 0.268852,0.60499 1.037105,0.513829 1.54657,0.319626 0.519221,-0.178436 -0.216522,-0.689274 0,0 0.235528,0.550919 2.168495,0.719023 2.751281,0.46881 0.560483,-0.205502 0.941907,-0.302405 1.209461,-0.770233 0.877296,-1.784781 1.30809,-3.805794 1.170202,-5.793316 -0.043,-0.535579 -0.207688,-1.053837 -0.401099,-1.54807 -0.200049,-0.65216 -0.875714,0.007 -1.141464,0.275076 -0.243481,0.172262 -0.51356,0.313709 -0.80585,0.38061 z"
+ id="path4983"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cacccccccccc" />
+ <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"
+ inkscape:connector-curvature="0"
+ id="path4985"
+ d="m 51.123421,37.285483 c -0.962787,0.365836 -2.002892,0.61665 -2.881868,1.153083 -0.728654,0.613744 -0.637957,1.734715 -0.260199,2.516018 0.463562,0.999999 0.831314,2.0464 1.38527,3.002579 0.535766,0.706283 -0.03615,0.399028 0.61473,0.997421 0.183957,0.219055 1.329994,1.326569 2,1 0.333986,-0.162789 0.25047,-0.655004 0.22155,-1.092401 0.210465,-0.907183 -0.333281,-1.774627 -0.289937,-2.688331 -0.02338,-1.147216 0.201822,-2.280691 0.338507,-3.41565 0.078,-0.629269 -0.277045,-1.800236 -1.128053,-1.472719 z"
+ style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ sodipodi:nodetypes="cccccacccc" />
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/publicSpaceEnabled.png"
+ transform="matrix(0.475,0,0,0.95,14.25,8.6181091)"
+ d="m 110,32.362183 a 20,10 0 1 1 -40,0 20,10 0 1 1 40,0 z"
+ sodipodi:ry="10"
+ sodipodi:rx="20"
+ sodipodi:cy="32.362183"
+ sodipodi:cx="90"
+ id="path4987"
+ style="color:#000000;fill:none;stroke:#002255;stroke-width:1.48864591000000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ sodipodi:type="arc" />
+ </g>
<path
- sodipodi:nodetypes="cacccccccccc"
- inkscape:connector-curvature="0"
- id="path4983"
- d="m 64,36.862183 c -1.635366,0.833939 -3.561037,1.673743 -4.270781,3.334577 -0.218268,0.510757 0.09005,1.113048 0.166644,1.657967 0.31147,0.58051 -0.449632,1.092308 -0.224964,1.674953 0.268852,0.60499 1.037105,0.513829 1.54657,0.319626 0.519221,-0.178436 -0.216522,-0.689274 0,0 0.235528,0.550919 2.168495,0.719023 2.751281,0.46881 0.560483,-0.205502 0.941907,-0.302405 1.209461,-0.770233 0.877296,-1.784781 1.30809,-3.805794 1.170202,-5.793316 -0.043,-0.535579 -0.207688,-1.053837 -0.401099,-1.54807 -0.200049,-0.65216 -0.875714,0.007 -1.141464,0.275076 -0.243481,0.172262 -0.51356,0.313709 -0.80585,0.38061 z"
- style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
- inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90" />
- <path
- sodipodi:nodetypes="cccccacccc"
- style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
- d="m 51.123421,37.285483 c -0.962787,0.365836 -2.002892,0.61665 -2.881868,1.153083 -0.728654,0.613744 -0.637957,1.734715 -0.260199,2.516018 0.463562,0.999999 0.831314,2.0464 1.38527,3.002579 0.535766,0.706283 -0.03615,0.399028 0.61473,0.997421 0.183957,0.219055 1.329994,1.326569 2,1 0.333986,-0.162789 0.25047,-0.655004 0.22155,-1.092401 0.210465,-0.907183 -0.333281,-1.774627 -0.289937,-2.688331 -0.02338,-1.147216 0.201822,-2.280691 0.338507,-3.41565 0.078,-0.629269 -0.277045,-1.800236 -1.128053,-1.472719 z"
- id="path4985"
- inkscape:connector-curvature="0"
- inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90" />
- <path
- sodipodi:type="arc"
- style="color:#000000;fill:none;stroke:#002255;stroke-width:1.48864591000000002;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
- id="path4987"
- sodipodi:cx="90"
- sodipodi:cy="32.362183"
- sodipodi:rx="20"
- sodipodi:ry="10"
- d="m 110,32.362183 a 20,10 0 1 1 -40,0 20,10 0 1 1 40,0 z"
- transform="matrix(0.475,0,0,0.95,14.25,8.6181091)"
- inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/publicSpaceEnabled.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90" />
- <path
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/publicSpaceDisabled.png"
@@ -644,9 +647,9 @@
<g
id="g6729"
transform="translate(-4.999997,-4.9999999)"
- inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/world-90.png"
- inkscape:export-xdpi="90"
- inkscape:export-ydpi="90">
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/world-16.png"
+ inkscape:export-xdpi="16"
+ inkscape:export-ydpi="16">
<path
inkscape:export-ydpi="90"
inkscape:export-xdpi="90"
@@ -833,5 +836,65 @@
inkscape:export-ydpi="90" />
</g>
</g>
+ <g
+ id="g9954"
+ transform="matrix(0.8,0,0,0.8,147.4,15.872437)"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/resources/icons/world-16.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <path
+ transform="matrix(0.475,0,0,0.95,14.25,8.6181091)"
+ 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"
+ sodipodi:cx="90"
+ id="path9956"
+ style="color:#000000;fill:#aaeeff;fill-opacity:1;fill-rule:nonzero;stroke:#b3b3b3;stroke-width:1.48864591;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ sodipodi:type="arc"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ sodipodi:nodetypes="cccccccc"
+ inkscape:connector-curvature="0"
+ id="path9958"
+ d="m 54.870524,30.509779 c -1.153029,0.318922 -2.103799,1.0872 -3.128131,1.667682 -0.588269,0.436973 -1.282465,1.630717 -0.490344,2.151434 0.627041,0.105509 1.130685,-0.428017 1.747951,-0.466712 0.720932,-0.166168 1.456986,-0.297538 2.140464,-0.591045 1.16756,-0.367925 1.16756,-0.367925 1.286901,-0.798635 0.05666,-0.648504 -0.404279,-1.249681 -0.839485,-1.692902 -0.198553,-0.16279 -0.45055,-0.315388 -0.717356,-0.269822 z"
+ style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ sodipodi:nodetypes="cacccccccccc"
+ inkscape:connector-curvature="0"
+ id="path9960"
+ d="m 64,36.862183 c -1.635366,0.833939 -3.561037,1.673743 -4.270781,3.334577 -0.218268,0.510757 0.09005,1.113048 0.166644,1.657967 0.31147,0.58051 -0.449632,1.092308 -0.224964,1.674953 0.268852,0.60499 1.037105,0.513829 1.54657,0.319626 0.519221,-0.178436 -0.216522,-0.689274 0,0 0.235528,0.550919 2.168495,0.719023 2.751281,0.46881 0.560483,-0.205502 0.941907,-0.302405 1.209461,-0.770233 0.877296,-1.784781 1.30809,-3.805794 1.170202,-5.793316 -0.043,-0.535579 -0.207688,-1.053837 -0.401099,-1.54807 -0.200049,-0.65216 -0.875714,0.007 -1.141464,0.275076 -0.243481,0.172262 -0.51356,0.313709 -0.80585,0.38061 z"
+ style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ sodipodi:nodetypes="cccccacccc"
+ style="color:#000000;fill:#2ca05a;fill-opacity:1;fill-rule:nonzero;stroke:#2ca05a;stroke-width:1;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="m 51.123421,37.285483 c -0.962787,0.365836 -2.002892,0.61665 -2.881868,1.153083 -0.728654,0.613744 -0.637957,1.734715 -0.260199,2.516018 0.463562,0.999999 0.831314,2.0464 1.38527,3.002579 0.535766,0.706283 -0.03615,0.399028 0.61473,0.997421 0.183957,0.219055 1.329994,1.326569 2,1 0.333986,-0.162789 0.25047,-0.655004 0.22155,-1.092401 0.210465,-0.907183 -0.333281,-1.774627 -0.289937,-2.688331 -0.02338,-1.147216 0.201822,-2.280691 0.338507,-3.41565 0.078,-0.629269 -0.277045,-1.800236 -1.128053,-1.472719 z"
+ id="path9962"
+ inkscape:connector-curvature="0"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/from-private-to-public.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ <path
+ sodipodi:type="arc"
+ style="color:#000000;fill:none;stroke:#002255;stroke-width:1.48864591;stroke-linecap:butt;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path9964"
+ sodipodi:cx="90"
+ sodipodi:cy="32.362183"
+ sodipodi:rx="20"
+ sodipodi:ry="10"
+ 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"
+ transform="matrix(0.475,0,0,0.95,14.25,8.6181091)"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/wspace/client/resources/publicSpaceEnabled.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90" />
+ </g>
</g>
</svg>
Added: trunk/img/icons/world-16.png
===================================================================
(Binary files differ)
Property changes on: trunk/img/icons/world-16.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/img/icons-base.svg
===================================================================
--- trunk/img/icons-base.svg 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/img/icons-base.svg 2012-03-10 07:36:46 UTC (rev 1754)
@@ -14,7 +14,7 @@
height="297mm"
id="svg21019"
sodipodi:version="0.32"
- inkscape:version="0.48.1 r9760"
+ inkscape:version="0.48.2 r9819"
sodipodi:docname="icons-base.svg"
inkscape:output_extension="org.inkscape.output.svg.inkscape"
inkscape:export-filename="/tmp/buttons.png"
@@ -35,8 +35,8 @@
inkscape:current-layer="layer1"
inkscape:window-width="1078"
inkscape:window-height="897"
- inkscape:window-x="0"
- inkscape:window-y="947"
+ inkscape:window-x="-40"
+ inkscape:window-y="957"
showgrid="false"
showguides="true"
inkscape:guide-bbox="true"
@@ -1914,7 +1914,7 @@
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
- <dc:title />
+ <dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
@@ -4695,11 +4695,11 @@
<image
sodipodi:absref="/home/vjrj/proyectos/dev/kune/trunk/img/icons/lock_break.png"
xlink:href="icons/lock_break.png"
- width="16"
+ y="450.82797"
+ x="330.84604"
+ id="image2972"
height="16"
- id="image2972"
- x="330.84604"
- y="450.82797" />
+ width="16" />
<use
x="0"
y="0"
@@ -4790,12 +4790,12 @@
<image
sodipodi:absref="/home/vjrj/proyectos/dev/kune/trunk/img/icons/lock_break.png"
xlink:href="icons/lock_break.png"
- transform="scale(-1,1)"
+ y="432.36218"
+ x="-371"
+ id="image3958"
+ height="16"
width="16"
- height="16"
- id="image3958"
- x="-371"
- y="432.36218" />
+ transform="scale(-1,1)" />
<g
id="g3962"
transform="translate(-43.509019,-21.462476)">
@@ -5711,5 +5711,34 @@
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/java/cc/kune/core/client/resources/nav/task.png"
inkscape:export-xdpi="90"
inkscape:export-ydpi="90" />
+ <image
+ y="330.36218"
+ x="321"
+ id="image11985"
+ xlink:href="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACEAAAAYCAYAAAB0kZQKAAAABHNCSVQICAgIfAhkiAAAA+JJREFU
+SIm9lk9II1ccx78vzCTjTCaaxJiooLsxQaMDWyqi0oNFe+mp0D/soYc97NJLRaQXL7304MHSgkhv
+28Me+ufc0kOhFioU6s0ENGijqIkRMpMYjZOZTEze66FE1t2oma7bDzx47/H7vff9vfd+jx/BNSST
+yX5d1z83TfPtSqXSWyqV2q6zbYbH4zEFQciKorg2Njb25CZb0mzz09PTZ6qqTgmCQAKBAHp6euD1
+euF0OkHISy4vYZomNE3D8fExNE0DpZR1dXWteTyeR4qipG8UEY/HHx4dHX0nyzKnKAp8Pl8LMd8M
+Ywz5fB6JRAKU0ove3t5PFEV51lREPB5/eHBw8KOiKGRgYACMMTDGXllEg4uLC6RSKezv72N4eHgh
+Eol8eUVEMpns39nZ2R8cHCSxWAyU0jsV8DxbW1vIZrMYHx9/1+/3/woAHACoqvpbZ2cnicViqNfr
+oJS+FgEAEI1Gkc/nsbu7+zNjLEAIOXNsbGy8VSwWoyMjI6CUolargVL62prD4cDQ0BDS6TRvWda3
+AMCZpvmZLMvo6OiAZVm2rmF+fh4AsLy8bOs0vF4vRFFEOp3+gDHWwRmGMREKhUApRb1et7VYA57n
+YVmWLZ9AIABVVWk0Gn3EmabZFQwGL6/hv8AYs+3r8/mwvb1NAExxlUqFkyQJtVrtlTLCrq8oijBN
+0wHgAccYA8/zKJfLty60sLDQdH52dvbKeGlp6VYRPM83uvc4AJdpeVd/gyiK0HX9RptarXbZ5wRB
+qOm6zhFCbr3XxcVFyLJ8OZ6bmwMArKysXLFr5Y2USiW4XK4aAAcnCIKmqmp3d3d3S9lRKpVszV9H
+sViEJEklAKcOl8v1VzabBcdxtj+eBo3I7bRCoQC/368BSHA8z3+dz+ffr1ar/1uKlstlGIaBcDjM
+A/iDAMDq6uq+JEn37t+/f+XBtILX6wXw7/G2yubmJnieT09PT/cAiHAAIIrix7lc7s/29nYiSVJL
+hUuDQqFgS7SqqjAMg83MzJwA+J0Qcni52/r6+jeZTObTSCRyJ8XMizDGkMlkoGkaGx0dfdrX1/ch
+gDeviACAZDL5NJVKPRFFEaFQCG63+04E6LqOdDoNy7LY5OTkL6FQaBLAO4SQBNCkxiwUCh8dHh7+
+sLe3xwmCALfbDVmWIYpiSzUmpRTVahXlchnn5+fQdR31ep35fL6/JyYmDJfL1Q9guiGgqQgAYIy1
+G4bxlaZpj3O5XO3k5ITous7Zib6tra3idrvPgsHgWTgcdjmdzjYA3wP4ghBy9rztjWExxtoBvAdg
+CsAbAB7YEQIgASAOYA3ATy9u3uAfDs9TNu1kEp0AAAAASUVORK5CYII=
+"
+ height="24"
+ width="33"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/resources/icons/add-participant.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45" />
</g>
</svg>
Modified: trunk/img/kune-logos.svg
===================================================================
--- trunk/img/kune-logos.svg 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/img/kune-logos.svg 2012-03-10 07:36:46 UTC (rev 1754)
@@ -878,7 +878,7 @@
</g>
</g>
<g
- style="opacity:0.2"
+ style="opacity:0.05"
inkscape:export-ydpi="1797.08"
inkscape:export-xdpi="1797.08"
inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kunecc-background.png"
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/pom.xml 2012-03-10 07:36:46 UTC (rev 1754)
@@ -22,7 +22,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<slf4j.version>1.6.1</slf4j.version>
<openjpa.version>2.0.1</openjpa.version>
- <wiab.version>0.3.12</wiab.version>
+ <wiab.version>0.3.13</wiab.version>
<jetty.version>8.0.1.v20110908</jetty.version>
<skipTests>true</skipTests>
</properties>
@@ -558,11 +558,26 @@
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
+ <artifactId>model</artifactId>
+ <version>${wiab.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.waveprotocol</groupId>
<artifactId>model-src</artifactId>
<version>${wiab.version}</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
+ <artifactId>api</artifactId>
+ <version>${wiab.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.waveprotocol</groupId>
+ <artifactId>api-src</artifactId>
+ <version>${wiab.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.waveprotocol</groupId>
<artifactId>client</artifactId>
<version>${wiab.version}</version>
</dependency>
@@ -573,11 +588,26 @@
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
+ <artifactId>crypto</artifactId>
+ <version>${wiab.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.waveprotocol</groupId>
+ <artifactId>crypto-src</artifactId>
+ <version>${wiab.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.waveprotocol</groupId>
<artifactId>common-src</artifactId>
<version>${wiab.version}</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
+ <artifactId>util</artifactId>
+ <version>${wiab.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.waveprotocol</groupId>
<artifactId>util-src</artifactId>
<version>${wiab.version}</version>
</dependency>
Modified: trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/barters/client/actions/BartersClientActions.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -32,7 +32,9 @@
import cc.kune.gspace.client.actions.AddAdminMembersToContentMenuItem;
import cc.kune.gspace.client.actions.AddAllMembersToContentMenuItem;
import cc.kune.gspace.client.actions.AddCollabMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddPublicToContentMenuItem;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
+import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
import cc.kune.gspace.client.actions.TutorialContainerBtn;
@@ -54,20 +56,24 @@
final Provider<OpenBartersMenuItem> openContentMenuItem,
final Provider<DelBartersMenuItem> delContentMenuItem,
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
+ final Provider<ContentViewerShareMenu> shareMenuContent,
final Provider<AddAllMembersToContentMenuItem> addAllMenuItem,
final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
+ final Provider<AddPublicToContentMenuItem> addPublicMenuItem,
final Provider<TutorialContainerBtn> tutorialBtn,
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<DelFolderMenuItem> delFolderMenuItem, final Provider<RefreshContentMenuItem> refresh) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, shareMenuContent, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addPublicMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, tutorialBtn, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newBartersBtn, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
@@ -79,6 +85,7 @@
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
}
@Override
Modified: trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/blogs/client/actions/BlogsClientActions.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -36,7 +36,9 @@
import cc.kune.gspace.client.actions.AddAdminMembersToContentMenuItem;
import cc.kune.gspace.client.actions.AddAllMembersToContentMenuItem;
import cc.kune.gspace.client.actions.AddCollabMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddPublicToContentMenuItem;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
+import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
import cc.kune.gspace.client.actions.SetAsHomePageMenuItem;
@@ -63,18 +65,17 @@
final Provider<DelPostMenuItem> delContentMenuItem,
final Provider<RefreshContentMenuItem> refresh, final Provider<TutorialContainerBtn> tutorialBtn,
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
+ final Provider<ContentViewerShareMenu> shareMenuContent,
final Provider<AddAllMembersToContentMenuItem> addAllMenuItem,
final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
+ final Provider<AddPublicToContentMenuItem> addPublicMenuItem,
final Provider<ParticipateInContentBtn> participateBtn, final BlogsNewMenu blogNewMenu,
final PostNewMenu postNewMenu, final NewMenusForTypeIdsRegistry newMenusRegistry,
final Provider<ChatAboutContentBtn> chatAbout, final Provider<DelBlogMenuItem> delFolderMenuItem,
final Provider<SetAsHomePageMenuItem> setAsHomePage) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newPostIconBtn, noRoot);
actionsRegistry.addAction(ActionGroups.TOOLBAR, blogNewMenu, containersNoRoot);
actionsRegistry.addAction(ActionGroups.TOOLBAR, postNewMenu, contents);
@@ -83,6 +84,11 @@
actionsRegistry.addAction(ActionGroups.TOOLBAR, newBlogBtn, TYPE_ROOT);
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, shareMenuContent, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addPublicMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, tutorialBtn, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, chatAbout, contents);
@@ -93,6 +99,7 @@
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
newMenusRegistry.register(TYPE_BLOG, blogNewMenu.get());
newMenusRegistry.register(TYPE_POST,
(MenuDescriptor) postNewMenu.get().withText(i18n.t("Add Gadget")));
Modified: trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -128,4 +128,7 @@
@Source("unchecked.png")
ImageResource unChecked();
+
+ @Source("icons/world-16.png")
+ ImageResource world16();
}
Modified: trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -539,6 +539,9 @@
@Source("wave-icon.png")
ImageResource waveIcon();
+ @Source("icons/add-participant.png")
+ ImageResource addParticipant();
+
}
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceHelper.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceHelper.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceHelper.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -6,6 +6,7 @@
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.SocialNetworkSubGroup;
+import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -25,10 +26,16 @@
public void addParticipants(final StateToken token, final SocialNetworkSubGroup subGroup) {
contentService.get().addParticipants(session.getUserHash(), token,
- session.getCurrentGroupShortName(), subGroup, new AsyncCallbackSimple<Boolean>() {
+ session.getCurrentGroupShortName(), subGroup, new AsyncCallback<Boolean>() {
@Override
+ public void onFailure(final Throwable caught) {
+ NotifyUser.important(i18n.t("Seems that the list of partipants were added partially. Please, retry"));
+ }
+
+ @Override
public void onSuccess(final Boolean result) {
- NotifyUser.info(result ? i18n.t("Shared with members")
+ NotifyUser.info(result ? subGroup.equals(SocialNetworkSubGroup.PUBLIC) ? i18n.t("Shared with general public. Now anyone can participate")
+ : i18n.t("Shared with members")
: i18n.t("All these members are already partipating"));
}
});
Modified: trunk/src/main/java/cc/kune/core/client/sn/AdminsGroupSNDropController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/AdminsGroupSNDropController.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/core/client/sn/AdminsGroupSNDropController.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -15,7 +15,7 @@
public AdminsGroupSNDropController(final KuneDragController dragController,
final ContentServiceHelper contentService, final Session session,
final I18nTranslationService i18n, final SocialNetServiceHelper sNClientUtils) {
- super(dragController, SocialNetworkSubGroup.admins, contentService, session, i18n, sNClientUtils);
+ super(dragController, SocialNetworkSubGroup.ADMINS, contentService, session, i18n, sNClientUtils);
}
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/AllMembersGroupSNDropController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/AllMembersGroupSNDropController.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/core/client/sn/AllMembersGroupSNDropController.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -15,7 +15,7 @@
public AllMembersGroupSNDropController(final KuneDragController dragController,
final ContentServiceHelper contentService, final Session session,
final I18nTranslationService i18n, final SocialNetServiceHelper sNClientUtils) {
- super(dragController, SocialNetworkSubGroup.all, contentService, session, i18n, sNClientUtils);
+ super(dragController, SocialNetworkSubGroup.ALL_GROUP_MEMBERS, contentService, session, i18n, sNClientUtils);
}
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/CollabsGroupSNDropController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/CollabsGroupSNDropController.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/core/client/sn/CollabsGroupSNDropController.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -15,7 +15,7 @@
public CollabsGroupSNDropController(final KuneDragController dragController,
final ContentServiceHelper contentService, final Session session,
final I18nTranslationService i18n, final SocialNetServiceHelper sNClientUtils) {
- super(dragController, SocialNetworkSubGroup.collabs, contentService, session, i18n, sNClientUtils);
+ super(dragController, SocialNetworkSubGroup.COLLABS, contentService, session, i18n, sNClientUtils);
}
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/GroupSNDropController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupSNDropController.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupSNDropController.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -41,10 +41,10 @@
}
if (widget instanceof BasicDragableThumb) {
final String shortName = ((BasicDragableThumb) widget).getToken().getGroup();
- if (subGroup.equals(SocialNetworkSubGroup.admins)) {
+ if (subGroup.equals(SocialNetworkSubGroup.ADMINS)) {
sNClientUtils.changeToAdmin(shortName);
}
- if (subGroup.equals(SocialNetworkSubGroup.collabs)) {
+ if (subGroup.equals(SocialNetworkSubGroup.COLLABS)) {
sNClientUtils.changeToCollab(shortName);
}
}
Modified: trunk/src/main/java/cc/kune/core/public/ws.css
===================================================================
--- trunk/src/main/java/cc/kune/core/public/ws.css 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/core/public/ws.css 2012-03-10 07:36:46 UTC (rev 1754)
@@ -1,18 +1,18 @@
GCHARSET "UTF-8 "; body {
background-color: transparent;
color: black;
- font-family: 'Ubuntu', Arial;
+ font-family: "Ubuntu Beta",UbuntuBeta,Ubuntu,"Bitstream Vera Sans","DejaVu Sans",Tahoma,sans-serif;
font-size: small;
margin: 5px;
overflow: hidden;
}
* {
- font-family: 'Ubuntu', Arial;
+ font-family: "Ubuntu Beta",UbuntuBeta,Ubuntu,"Bitstream Vera Sans","DejaVu Sans",Tahoma,sans-serif;
}
body.fontface {
- font: 'Ubuntu', Arial;
+ font-family: "Ubuntu Beta",UbuntuBeta,Ubuntu,"Bitstream Vera Sans","DejaVu Sans",Tahoma,sans-serif;
}
div,span {
@@ -784,7 +784,7 @@
.x-fieldset-header-text,.x-form-group-label,.x-form-cb-label {
font-size: 14px;
- font-family: 'Ubuntu', Arial;
+ font-family: "Ubuntu Beta",UbuntuBeta,Ubuntu,"Bitstream Vera Sans","DejaVu Sans",Tahoma,sans-serif;
}
.k-form-intro {
Modified: trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -165,7 +165,11 @@
public boolean addParticipants(final User user, final Long contentId, final Group group,
final SocialNetworkSubGroup whichOnes) {
final Set<String> members = new HashSet<String>();
- GroupServerUtils.getAllUserMembersAsString(members, group, whichOnes);
+ if (whichOnes.equals(SocialNetworkSubGroup.PUBLIC)) {
+ members.add(participantUtils.getPublicParticipantId().toString());
+ } else {
+ GroupServerUtils.getAllUserMembersAsString(members, group, whichOnes);
+ }
final Content content = finder.getContent(contentId);
return addParticipants(user, content, members.toArray(new String[members.size()]));
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/GroupServerUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/GroupServerUtils.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/GroupServerUtils.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -55,11 +55,11 @@
public static final Collection<Group> getGroupMembers(final Group ofGroup,
final SocialNetworkSubGroup subGroup) {
final Collection<Group> members = new LinkedHashSet<Group>();
- if (subGroup.equals(SocialNetworkSubGroup.admins) || subGroup.equals(SocialNetworkSubGroup.all)) {
+ if (subGroup.equals(SocialNetworkSubGroup.ADMINS) || subGroup.equals(SocialNetworkSubGroup.ALL_GROUP_MEMBERS)) {
final Set<Group> admins = ofGroup.getSocialNetwork().getAccessLists().getAdmins().getList();
members.addAll(admins);
}
- if (subGroup.equals(SocialNetworkSubGroup.collabs) || subGroup.equals(SocialNetworkSubGroup.all)) {
+ if (subGroup.equals(SocialNetworkSubGroup.COLLABS) || subGroup.equals(SocialNetworkSubGroup.ALL_GROUP_MEMBERS)) {
final Set<Group> collabs = ofGroup.getSocialNetwork().getAccessLists().getEditors().getList();
members.addAll(collabs);
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -101,8 +101,8 @@
if (!AccessRightsUtils.correctMember(user, group, AccessRol.Editor)) {
throw new AccessViolationException("You cannot write because you are not a member");
}
- GroupServerUtils.getAllUserMembers(toList, group, onlyToAdmins ? SocialNetworkSubGroup.admins
- : SocialNetworkSubGroup.all);
+ GroupServerUtils.getAllUserMembers(toList, group, onlyToAdmins ? SocialNetworkSubGroup.ADMINS
+ : SocialNetworkSubGroup.ALL_GROUP_MEMBERS);
}
return KuneWaveServerUtils.getUrl(waveService.createWave(title, message,
KuneWaveService.DO_NOTHING_CBACK, participantUtils.listFrom(toList)));
Modified: trunk/src/main/java/cc/kune/core/server/notifier/NotificationService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/notifier/NotificationService.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/core/server/notifier/NotificationService.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -36,14 +36,14 @@
public void notifyGroup(final Group groupToNotify, final Group groupSender, final String subject,
final String message) {
final Set<User> members = new HashSet<User>();
- GroupServerUtils.getAllUserMembers(members, groupToNotify, SocialNetworkSubGroup.all);
+ GroupServerUtils.getAllUserMembers(members, groupToNotify, SocialNetworkSubGroup.ALL_GROUP_MEMBERS);
notifyToAll(groupSender, subject, message, members);
}
public void notifyGroupAdmins(final Group groupToNotify, final Group groupSender,
final String subject, final String message) {
final Set<User> adminMembers = new HashSet<User>();
- GroupServerUtils.getAllUserMembers(adminMembers, groupToNotify, SocialNetworkSubGroup.admins);
+ GroupServerUtils.getAllUserMembers(adminMembers, groupToNotify, SocialNetworkSubGroup.ADMINS);
notifyToAll(groupSender, subject, message, adminMembers);
}
Modified: trunk/src/main/java/cc/kune/core/shared/dto/SocialNetworkSubGroup.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/SocialNetworkSubGroup.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/core/shared/dto/SocialNetworkSubGroup.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -27,9 +27,11 @@
*/
public enum SocialNetworkSubGroup implements IsSerializable {
/** The admins members only */
- admins,
+ ADMINS,
/** all members */
- all,
+ ALL_GROUP_MEMBERS,
/** The collabs members only */
- collabs
+ COLLABS,
+ /** Public in general **/
+ PUBLIC
}
Modified: trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/docs/client/actions/DocsClientActions.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -36,7 +36,9 @@
import cc.kune.gspace.client.actions.AddAdminMembersToContentMenuItem;
import cc.kune.gspace.client.actions.AddAllMembersToContentMenuItem;
import cc.kune.gspace.client.actions.AddCollabMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddPublicToContentMenuItem;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
+import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
import cc.kune.gspace.client.actions.SetAsHomePageMenuItem;
@@ -62,9 +64,11 @@
final Provider<OpenDocMenuItem> openContentMenuItem, final Provider<NewFolderBtn> newFolderBtn,
final Provider<DelDocMenuItem> delContentMenuItem,
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
+ final Provider<ContentViewerShareMenu> shareMenuContent,
final Provider<AddAllMembersToContentMenuItem> addAllMenuItem,
final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
+ final Provider<AddPublicToContentMenuItem> addPublicMenuItem,
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<DelFolderMenuItem> delFolderMenuItem,
final Provider<TutorialContainerBtn> tutorialBtn, final Provider<ChatAboutContentBtn> chatAbout,
@@ -75,9 +79,6 @@
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newDocIconBtn, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newFolderBtn, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, foldersNewMenu, containers);
@@ -85,6 +86,11 @@
actionsRegistry.addAction(ActionGroups.TOOLBAR, newDocMenuItem, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, shareMenuContent, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addPublicMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, tutorialBtn, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newFolderMenuItem, containers);
@@ -97,6 +103,7 @@
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
newMenusRegistry.register(TYPE_FOLDER, foldersNewMenu.get());
newMenusRegistry.register(TYPE_ROOT, foldersNewMenu.get());
newMenusRegistry.register(TYPE_DOCUMENT,
Modified: trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -31,7 +31,9 @@
import cc.kune.gspace.client.actions.AddAdminMembersToContentMenuItem;
import cc.kune.gspace.client.actions.AddAllMembersToContentMenuItem;
import cc.kune.gspace.client.actions.AddCollabMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddPublicToContentMenuItem;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
+import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
@@ -51,9 +53,11 @@
final Provider<OpenMeetingMenuItem> openContentMenuItem,
final Provider<DelMeetingMenuItem> delContentMenuItem,
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
+ final Provider<ContentViewerShareMenu> shareMenuContent,
final Provider<AddAllMembersToContentMenuItem> addAllMenuItem,
final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
+ final Provider<AddPublicToContentMenuItem> addPublicMenuItem,
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<Calendar1DayViewSelectBtn> cal1DayBtn,
final Provider<Calendar3DaysViewSelectBtn> cal3DaysBtn,
@@ -67,9 +71,6 @@
final Provider<RefreshContentMenuItem> refresh) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, goToday, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, calPrevBtn, containers);
@@ -81,6 +82,11 @@
actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, export, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, shareMenuContent, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addPublicMenuItem, contents);
// On over calendar menu
actionsRegistry.addAction(ActionGroups.TOOLBAR, onOverMenu, containers);
Modified: trunk/src/main/java/cc/kune/events/server/EventsServlet.java
===================================================================
--- trunk/src/main/java/cc/kune/events/server/EventsServlet.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/events/server/EventsServlet.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -5,6 +5,7 @@
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
+import java.util.Map.Entry;
import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
@@ -75,6 +76,9 @@
events.add(vEvent);
} catch (final Exception e) {
LOG.warn("Invalid appointments in " + token, e);
+ for (final Entry<String, String> val : props.entrySet()) {
+ LOG.warn(String.format("Prop: %s, value: %s", val.getKey(), val.getValue()));
+ }
}
}
} else {
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -30,6 +30,7 @@
import cc.kune.core.client.sn.actions.WriteToBuddyHeaderButton;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
import cc.kune.gspace.client.actions.ContentViewerOptionsShareSubMenu;
+import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.GiveUsFeedbackBtn;
import cc.kune.gspace.client.actions.RenameAction;
import cc.kune.gspace.client.armor.GSpaceArmor;
@@ -209,6 +210,7 @@
// Actions
s(ContentViewerOptionsMenu.class);
+ s(ContentViewerShareMenu.class);
s(ContentViewerOptionsShareSubMenu.class);
s(RenameAction.class);
s(GiveUsFeedbackBtn.class);
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/AbstractEditorsMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AbstractEditorsMenu.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AbstractEditorsMenu.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -28,7 +28,7 @@
public AbstractEditorsMenu(final AccessRightsClientManager rightsManager) {
super();
- this.withStyles("k-button, k-btn, k-5corners, k-def-docbtn, k-fl");
+ this.withStyles(ActionStyles.MENU_BTN_STYLE_LEFT);
rightsManager.onRightsChanged(true, new AccessRightsChangedHandler() {
@Override
public void onAccessRightsChanged(final AccessRightsChangedEvent event) {
Added: trunk/src/main/java/cc/kune/gspace/client/actions/ActionStyles.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/ActionStyles.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/ActionStyles.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -0,0 +1,8 @@
+package cc.kune.gspace.client.actions;
+
+public class ActionStyles {
+
+ // FIXME add here more styles and use then
+ public static final String MENU_BTN_STYLE_LEFT = "k-button, k-btn, k-5corners, k-def-docbtn, k-fl";
+ public static final String MENU_BTN_STYLE_RIGHT = "k-button, k-btn, k-5corners, k-def-docbtn, k-fr";
+}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/AddAdminMembersToContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AddAdminMembersToContentMenuItem.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AddAdminMembersToContentMenuItem.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -29,9 +29,8 @@
@Inject
public AddAdminMembersToContentMenuItem(final I18nTranslationService i18n,
- final AddMembersToContentAction action, final ContentViewerOptionsMenu optionsMenu,
- final CoreResources res) {
- super(i18n.t("Share with admins"), SocialNetworkSubGroup.admins, action, optionsMenu, res);
+ final AddMembersToContentAction action, final ContentViewerShareMenu menu, final CoreResources res) {
+ super(i18n.t("Share with admins"), SocialNetworkSubGroup.ADMINS, action, menu, res);
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/AddAllMembersToContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AddAllMembersToContentMenuItem.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AddAllMembersToContentMenuItem.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -29,9 +29,8 @@
@Inject
public AddAllMembersToContentMenuItem(final I18nTranslationService i18n,
- final AddMembersToContentAction action, final ContentViewerOptionsMenu optionsMenu,
- final CoreResources res) {
- super(i18n.t("Share with all group members"), SocialNetworkSubGroup.all, action, optionsMenu, res);
+ final AddMembersToContentAction action, final ContentViewerShareMenu menu, final CoreResources res) {
+ super(i18n.t("Share with all group members"), SocialNetworkSubGroup.ALL_GROUP_MEMBERS, action, menu, res);
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/AddCollabMembersToContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AddCollabMembersToContentMenuItem.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AddCollabMembersToContentMenuItem.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -29,9 +29,8 @@
@Inject
public AddCollabMembersToContentMenuItem(final I18nTranslationService i18n,
- final AddMembersToContentAction action, final ContentViewerOptionsMenu optionsMenu,
- final CoreResources res) {
- super(i18n.t("Share with collaborators"), SocialNetworkSubGroup.collabs, action, optionsMenu, res);
+ final AddMembersToContentAction action, final ContentViewerShareMenu menu, final CoreResources res) {
+ super(i18n.t("Share with collaborators"), SocialNetworkSubGroup.COLLABS, action, menu, res);
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/AddMembersToContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AddMembersToContentMenuItem.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AddMembersToContentMenuItem.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -26,11 +26,10 @@
public class AddMembersToContentMenuItem extends MenuItemDescriptor {
public AddMembersToContentMenuItem(final String text, final SocialNetworkSubGroup subGroup,
- final AddMembersToContentAction action, final ContentViewerOptionsMenu optionsMenu,
- final CoreResources res) {
+ final AddMembersToContentAction action, final ContentViewerShareMenu menu, final CoreResources res) {
super(action);
action.setSubGroup(subGroup);
- this.withText(text).withIcon(res.addGreen()).withParent(optionsMenu, false);
+ this.withText(text).withIcon(res.addParticipant()).withParent(menu, false);
}
}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/AddPublicToContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AddPublicToContentMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AddPublicToContentMenuItem.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -0,0 +1,36 @@
+/*
+ *
+ * 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.gspace.client.actions;
+
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.dto.SocialNetworkSubGroup;
+
+import com.google.inject.Inject;
+
+public class AddPublicToContentMenuItem extends AddMembersToContentMenuItem {
+
+ @Inject
+ public AddPublicToContentMenuItem(final I18nTranslationService i18n,
+ final AddMembersToContentAction action, final ContentViewerShareMenu menu, final CoreResources res) {
+ super(i18n.t("Allow any person to edit this"), SocialNetworkSubGroup.PUBLIC, action, menu, res);
+ this.withIcon(res.world16());
+ }
+}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerShareMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerShareMenu.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/ContentViewerShareMenu.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -0,0 +1,39 @@
+/*
+ *
+ * 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.gspace.client.actions;
+
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.resources.CoreResources;
+
+import com.google.inject.Inject;
+
+public class ContentViewerShareMenu extends MenuDescriptor {
+
+ private static final String ID = "k-cnt-viewer-share-menu";
+
+ @Inject
+ public ContentViewerShareMenu(final CoreResources res, final I18nTranslationService i18n) {
+ super();
+ this.withText(i18n.t("Share")).withToolTip(i18n.t("Share this with group members, etc")).withIcon(
+ res.world16()).withStyles(ActionStyles.MENU_BTN_STYLE_RIGHT).withId(ID);
+ }
+
+}
Modified: trunk/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/lists/client/actions/ListsClientActions.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -35,6 +35,8 @@
import cc.kune.gspace.client.actions.AddAdminMembersToContentMenuItem;
import cc.kune.gspace.client.actions.AddAllMembersToContentMenuItem;
import cc.kune.gspace.client.actions.AddCollabMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddPublicToContentMenuItem;
+import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
import cc.kune.gspace.client.actions.SetAsHomePageMenuItem;
import cc.kune.gspace.client.actions.TutorialContainerBtn;
@@ -59,11 +61,13 @@
final Provider<OpenFolderMenuItem> openContentMenuItem,
final Provider<RefreshListMenuItem> refresh, final Provider<SubscribeToListBtn> subscribeBtn,
final Provider<OptionsListMenu> optionsMenuContent,
+ final Provider<ContentViewerShareMenu> shareMenuContent,
final Provider<ShowSubscribersOfListBtn> subscribersCount,
final Provider<TutorialContainerBtn> tutorialBtn,
final Provider<AddAllMembersToContentMenuItem> addAllMenuItem,
final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
+ final Provider<AddPublicToContentMenuItem> addPublicMenuItem,
final Provider<SetListOpenessMenuItem> listOpenessMenuItem,
final Provider<ParticipateInContentBtn> participateBtn, final ListsNewMenu listNewMenu,
final PostNewMenu postNewMenu, final NewMenusForTypeIdsRegistry newMenusRegistry,
@@ -71,9 +75,6 @@
final Provider<SetAsHomePageMenuItem> setAsHomePage) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newPostIconBtn, noRoot);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newListBtn, TYPE_ROOT);
actionsRegistry.addAction(ActionGroups.TOOLBAR, listNewMenu, containersNoRoot);
@@ -87,6 +88,11 @@
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, tutorialBtn, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, shareMenuContent, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addPublicMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, subscribersCount, containersNoRoot);
actionsRegistry.addAction(ActionGroups.TOOLBAR, chatAbout, contents);
@@ -96,6 +102,7 @@
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
newMenusRegistry.register(TYPE_LIST, listNewMenu.get());
newMenusRegistry.register(TYPE_ROOT, listNewMenu.get());
newMenusRegistry.register(TYPE_POST,
Modified: trunk/src/main/java/cc/kune/tasks/client/actions/TasksClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/tasks/client/actions/TasksClientActions.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/tasks/client/actions/TasksClientActions.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -36,7 +36,9 @@
import cc.kune.gspace.client.actions.AddAdminMembersToContentMenuItem;
import cc.kune.gspace.client.actions.AddAllMembersToContentMenuItem;
import cc.kune.gspace.client.actions.AddCollabMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddPublicToContentMenuItem;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
+import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
import cc.kune.gspace.client.actions.SetAsHomePageMenuItem;
@@ -63,20 +65,19 @@
final Provider<MarkAsNotDoneTaskMenuItem> marksAsNotDoneMenuItem,
final Provider<RefreshContentMenuItem> refresh,
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
+ final Provider<ContentViewerShareMenu> shareMenuContent,
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<TutorialContainerBtn> tutorialBtn,
final Provider<AddAllMembersToContentMenuItem> addAllMenuItem,
final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
+ final Provider<AddPublicToContentMenuItem> addPublicMenuItem,
final TasksFolderNewMenu taskFolderNewMenu, final TasksNewMenu taskNewMenu,
final NewMenusForTypeIdsRegistry newMenusRegistry, final Provider<ChatAboutContentBtn> chatAbout,
final Provider<DelFolderMenuItem> delFolderMenuItem,
final Provider<SetAsHomePageMenuItem> setAsHomePage) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newTaskIconBtn, all);
// actionsRegistry.addAction(ActionGroups.TOOLBAR, taskFolderNewMenu,
@@ -87,6 +88,11 @@
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, tutorialBtn, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, shareMenuContent, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addPublicMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, chatAbout, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem, contents);
@@ -101,6 +107,7 @@
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
// Currently new menu in folders has no sense (because we have buttons for
// the same contents)
// newMenusRegistry.register(TYPE_FOLDER, taskFolderNewMenu.get());
Modified: trunk/src/main/java/cc/kune/wave/server/ParticipantUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/ParticipantUtils.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/wave/server/ParticipantUtils.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -60,6 +60,10 @@
return atDomain;
}
+ public ParticipantId getPublicParticipantId() {
+ return of(getAtDomain());
+ }
+
public ParticipantId getSuperAdmin() {
return superAdmin;
}
Modified: trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/java/cc/kune/wiki/client/actions/WikiClientActions.java 2012-03-10 07:36:46 UTC (rev 1754)
@@ -36,7 +36,9 @@
import cc.kune.gspace.client.actions.AddAdminMembersToContentMenuItem;
import cc.kune.gspace.client.actions.AddAllMembersToContentMenuItem;
import cc.kune.gspace.client.actions.AddCollabMembersToContentMenuItem;
+import cc.kune.gspace.client.actions.AddPublicToContentMenuItem;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
+import cc.kune.gspace.client.actions.ContentViewerShareMenu;
import cc.kune.gspace.client.actions.ParticipateInContentBtn;
import cc.kune.gspace.client.actions.RefreshContentMenuItem;
import cc.kune.gspace.client.actions.SetAsHomePageMenuItem;
@@ -61,11 +63,13 @@
final Provider<OpenWikiMenuItem> openContentMenuItem,
final Provider<DelWikiMenuItem> delContentMenuItem,
final Provider<ContentViewerOptionsMenu> optionsMenuContent,
+ final Provider<ContentViewerShareMenu> shareMenuContent,
final Provider<ParticipateInContentBtn> participateBtn,
final Provider<TutorialContainerBtn> tutorialBtn,
final Provider<AddAllMembersToContentMenuItem> addAllMenuItem,
final Provider<AddAdminMembersToContentMenuItem> addAdminMembersMenuItem,
final Provider<AddCollabMembersToContentMenuItem> addCollabMembersMenuItem,
+ final Provider<AddPublicToContentMenuItem> addPublicMenuItem,
final Provider<DelFolderMenuItem> delFolderMenuItem, final Provider<NewFolderBtn> newFolderBtn,
final Provider<ChatAboutContentBtn> chatAbout, final Provider<RefreshContentMenuItem> refresh,
final Provider<SetAsHomePageMenuItem> setAsHomePage,
@@ -73,9 +77,6 @@
final WikiPageNewMenu wikipageNewMenu) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
- actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newWikiIconBtn, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, newFolderBtn, containers);
@@ -88,6 +89,11 @@
// containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, containers);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, shareMenuContent, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addAdminMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, addPublicMenuItem, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, tutorialBtn, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
actionsRegistry.addAction(ActionGroups.TOOLBAR, chatAbout, contents);
@@ -99,6 +105,7 @@
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAllMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addAdminMembersMenuItem, contents);
actionsRegistry.addAction(ActionGroups.ITEM_MENU, addCollabMembersMenuItem, contents);
+ actionsRegistry.addAction(ActionGroups.ITEM_MENU, addPublicMenuItem, contents);
// Currently new menu in folders has no sense (because we have buttons for
// the same contents)
// newMenusRegistry.register(TYPE_FOLDER, folderNewMenu.get());
Added: trunk/src/main/resources/icons/add-participant.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/add-participant.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/world-16.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/world-16.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/webapp/ws.html
===================================================================
--- trunk/src/main/webapp/ws.html 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/main/webapp/ws.html 2012-03-10 07:36:46 UTC (rev 1754)
@@ -7,7 +7,7 @@
<meta name="gwt:property" content="locale=es" />
-->
<script type="text/javascript" language="javascript"
- src="ws/ws.nocache.js"></script>
+ src="ws/ws.nocache.js"></script>
<!--
We will use this string for mention this site in messages like: "Thanks for joining this site"
Your can use another string and the message will looks like "Thanks for joining example.org"
@@ -34,52 +34,61 @@
<meta name="hablar.height" content="400px" />
<link rel="shortcut icon" href="ws/favicon.ico" />
<link rel="stylesheet" type="text/css"
- href="http://yui.yahooapis.com/2.8.0r4/build/reset/reset-min.css">
+ href="http://yui.yahooapis.com/2.8.0r4/build/reset/reset-min.css">
<!-- FIXME: make something local -->
-<script src="//ajax.googleapis.com/ajax/libs/webfont/1/webfont.js"></script>
-<script>
- WebFont.load({
- google : {
- families : [ 'Ubuntu' ]
- }
- });
+<script type="text/javascript">
+ WebFontConfig = {
+ google : {
+ families : [ 'Ubuntu' ]
+ }
+ };
+ (function() {
+ var wf = document.createElement('script');
+ wf.src = ('https:' == document.location.protocol ? 'https' : 'http')
+ + '://ajax.googleapis.com/ajax/libs/webfont/1/webfont.js';
+ wf.type = 'text/javascript';
+ wf.async = 'true';
+ var s = document.getElementsByTagName('script')[0];
+ s.parentNode.insertBefore(wf, s);
+ })();
</script>
<link
- href='http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold,bolditalic'
- rel='stylesheet' type='text/css'>
+ href='http://fonts.googleapis.com/css?family=Ubuntu:regular,italic,bold,bolditalic'
+ rel='stylesheet' type='text/css'>
<!-- <link href='http://fonts.googleapis.com/css?family=Inconsolata'
rel='stylesheet' type='text/css'> -->
<link type="text/css" rel="stylesheet" href="ws/gxt/css/gxt-all.css">
<link type="text/css" rel="stylesheet" href="ws/gxt/css/gxt-gray.css">
<link type="text/css" rel="stylesheet"
- href="ws/gxt-custom/css/gxt-op-common.css">
+ href="ws/gxt-custom/css/gxt-op-common.css">
<link type="text/css" rel="stylesheet" href="ws/kune-hablar.css">
<link type="text/css" rel="stylesheet" href="ws/kune-chat.css">
<link type="text/css" rel="stylesheet" href="ws/kune-common.css">
<link type="text/css" rel="stylesheet"
- href="ws/fontface/ubuntufontface.css">
+ href="ws/fontface/ubuntufontface.css">
<link type="text/css" rel="stylesheet" href="ws/kune-message.css">
<link type="text/css" rel="stylesheet"
- href="others/splash/style/permalink.css">
+ href="others/splash/style/permalink.css">
<link type="text/css" rel="stylesheet"
- href="others/splash/style/stuff.css">
+ href="others/splash/style/stuff.css">
<link type="text/css" rel="stylesheet"
- href="others/splash/style/main.css">
+ href="others/splash/style/main.css">
<link type="text/css" rel="stylesheet" href="ws/ws.css">
<script type="text/javascript" src="others/splash/js/gadget.js"></script>
<script type="text/javascript" src="others/splash/js/rpc.js"></script>
<script type="text/javascript" src="others/splash/js/common_client.js"></script>
<script type="text/javascript"
- src="others/splash/js/permalink_client.js"></script>
+ src="others/splash/js/permalink_client.js"></script>
<script type="text/javascript"
- src="http://wave.google.com/gadgets/js/core:rpc.js?c=1"></script>
+ src="http://wave.google.com/gadgets/js/core:rpc.js?c=1"></script>
<style type="text/css">
body {
background-color: white;
color: black;
- font-family: 'Ubuntu', Arial;
+ font-family: "Ubuntu Beta", UbuntuBeta, Ubuntu, "Bitstream Vera Sans",
+ "DejaVu Sans", Tahoma, sans-serif;
font-size: small;
overflow: hidden;
}
@@ -220,7 +229,7 @@
}
#k-home-global-stats {
-
+
}
.k-home-title {
@@ -251,7 +260,7 @@
}
.k-home-group-inbox-link {
-
+
}
.k-home-group-inbox-link a {
@@ -281,109 +290,109 @@
<![endif]-->
</head>
<body>
- <!-- // This is only used for selenium tests (comment/remove in production) -->
- <div id="kcursor"
- style="visibility: hidden; position: absolute; z-Index: 100001; height: 0; width: 0">
- <img src="/others/cursor-orange.png">
- </div>
- <script src="others/js/fake-selenium-pointer.js"></script>
- <!-- // End : This is only used for selenium tests (comment/remove in production) -->
+ <!-- // This is only used for selenium tests (comment/remove in production) -->
+ <div id="kcursor"
+ style="visibility: hidden; position: absolute; z-Index: 100001; height: 0; width: 0">
+ <img src="/others/cursor-orange.png">
+ </div>
+ <script src="others/js/fake-selenium-pointer.js"></script>
+ <!-- // End : This is only used for selenium tests (comment/remove in production) -->
- <!-- Banner for wave errors -->
- <div class="banner" id="banner"></div>
- <!-- Autocomplete user/pass -->
- <form method="post" action="javascript:void(0)" style="display: none">
- <input type="text" id="address" name="address" value="" /> <input
- type="password" id="password" name="password" value="" /> <input
- type="submit" value="Login" id="login" /> <input type="submit"
- class="wiab le button" name="signIn" id="signIn" value="Sign in">
- </form>
- <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
- <noscript>
- <div
- style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
- Your web browser must have JavaScript enabled in order for this
- application to display correctly.</div>
- </noscript>
- <iframe id="__gwt_historyFrame" style="width: 0; height: 0; border: 0"></iframe>
- <iframe src="" id="__download" style="width: 0; height: 0; border: 0"></iframe>
- <div id="kuneinitialcurtain"></div>
- <div id="kuneloading">
- <div class="kuneloading-indicator">
- <img src="ws/images/kune-anim-g.gif" width="35" height="35"
- alt="kune-loading"
- style="margin-right: 3px; float: left; vertical-align: top;" />kune <br />
- <span id="kuneloading-msg">Starting...</span>
- </div>
- </div>
- <div id="k-home-prewrap">
- <div id="k-home-wrapper">
- <!-- This id is required for kune (you can create a different .html but preserve this id) -->
- <div id="k-home-table">
- <div id="k-home-header"></div>
- <!-- div home-header -->
- <div id="k-home-intro">
- <div id="k-home-summary-left">
- <div id="k-home-logo">
- <img src="ws/logo-big-home.png" alt="" />
- </div>
- <div id="k-home-summary">
- <ul>
- <li
- style="background-image: url(ws/images/kune-intro-user.png);">
- <a href="#inbox">Comunicate with others</a>
- </li>
- <li
- style="background-image: url(ws/images/kune-intro-group.png);">
- <!-- Put here your site default group name --> <a
- href="#site">Work in collaboration</a>
- </li>
- <li
- style="background-image: url(ws/images/kune-intro-world.png);">
- <a href="#preview()">And share with the world</a>
- </li>
- </ul>
- </div>
- <!-- k-home-summary -->
- </div>
- <!-- k-home-summary-left -->
- <div id="k-home-summary-right">
- <div id="k-home-ini">
- Welcome! This site is a Kune node. Kune, which means
- "together" in esperanto, is a network of interconnected
- sites like this one, where you can <strong>communicate,
- share, collaborate with others and create your web
- spaces easily</strong>. <a href="#signin">Join!</a>
- </div>
- <!-- div home-ini -->
- <!-- k-home-summary-right -->
- </div>
- <!-- div home-header -->
- </div>
- <div id="k-home-body">
- <div id="k-home-left">
- <div id="k-home-group-stats" style="display: none;">
- <!-- This id is optional for kune (you can create a different .html and preserve this id if you want this stats) -->
- </div>
- <!-- div home-group-stats -->
- </div>
- <!-- div k-home-left -->
- <div id="k-home-right">
- <div id="k-home-global-stats" style="display: none;">
- <!-- This id is optinal for kune (you can create a different .html but preserve this id if you want this stats) -->
- </div>
- </div>
- <!-- div k-home-right -->
- </div>
- <!-- div k-home-body -->
- <!-- <div id="k-home-footer" style="display: none;"> -->
- <!-- </div> -->
- <!-- div k-home-footer -->
- </div>
- <!-- div home-table -->
- </div>
- <!-- home-wrapper -->
- </div>
- <!-- home-prewrap -->
+ <!-- Banner for wave errors -->
+ <div class="banner" id="banner"></div>
+ <!-- Autocomplete user/pass -->
+ <form method="post" action="javascript:void(0)" style="display: none">
+ <input type="text" id="address" name="address" value="" /> <input
+ type="password" id="password" name="password" value="" /> <input
+ type="submit" value="Login" id="login" /> <input type="submit"
+ class="wiab le button" name="signIn" id="signIn" value="Sign in">
+ </form>
+ <!-- RECOMMENDED if your web app will not function without JavaScript enabled -->
+ <noscript>
+ <div
+ style="width: 22em; position: absolute; left: 50%; margin-left: -11em; color: red; background-color: white; border: 1px solid red; padding: 4px; font-family: sans-serif">
+ Your web browser must have JavaScript enabled in order for this
+ application to display correctly.</div>
+ </noscript>
+ <iframe id="__gwt_historyFrame" style="width: 0; height: 0; border: 0"></iframe>
+ <iframe src="" id="__download" style="width: 0; height: 0; border: 0"></iframe>
+ <div id="kuneinitialcurtain"></div>
+ <div id="kuneloading">
+ <div class="kuneloading-indicator">
+ <img src="ws/images/kune-anim-g.gif" width="35" height="35"
+ alt="kune-loading"
+ style="margin-right: 3px; float: left; vertical-align: top;" />kune <br />
+ <span id="kuneloading-msg">Starting...</span>
+ </div>
+ </div>
+ <div id="k-home-prewrap">
+ <div id="k-home-wrapper">
+ <!-- This id is required for kune (you can create a different .html but preserve this id) -->
+ <div id="k-home-table">
+ <div id="k-home-header"></div>
+ <!-- div home-header -->
+ <div id="k-home-intro">
+ <div id="k-home-summary-left">
+ <div id="k-home-logo">
+ <img src="ws/logo-big-home.png" alt="" />
+ </div>
+ <div id="k-home-summary">
+ <ul>
+ <li
+ style="background-image: url(ws/images/kune-intro-user.png);">
+ <a href="#inbox">Comunicate with others</a>
+ </li>
+ <li
+ style="background-image: url(ws/images/kune-intro-group.png);">
+ <!-- Put here your site default group name --> <a
+ href="#site">Work in collaboration</a>
+ </li>
+ <li
+ style="background-image: url(ws/images/kune-intro-world.png);">
+ <a href="#preview()">And share with the world</a>
+ </li>
+ </ul>
+ </div>
+ <!-- k-home-summary -->
+ </div>
+ <!-- k-home-summary-left -->
+ <div id="k-home-summary-right">
+ <div id="k-home-ini">
+ Welcome! This site is a Kune node. Kune, which means
+ "together" in esperanto, is a network of interconnected
+ sites like this one, where you can <strong>communicate,
+ share, collaborate with others and create your web
+ spaces easily</strong>. <a href="#signin">Join!</a>
+ </div>
+ <!-- div home-ini -->
+ <!-- k-home-summary-right -->
+ </div>
+ <!-- div home-header -->
+ </div>
+ <div id="k-home-body">
+ <div id="k-home-left">
+ <div id="k-home-group-stats" style="display: none;">
+ <!-- This id is optional for kune (you can create a different .html and preserve this id if you want this stats) -->
+ </div>
+ <!-- div home-group-stats -->
+ </div>
+ <!-- div k-home-left -->
+ <div id="k-home-right">
+ <div id="k-home-global-stats" style="display: none;">
+ <!-- This id is optinal for kune (you can create a different .html but preserve this id if you want this stats) -->
+ </div>
+ </div>
+ <!-- div k-home-right -->
+ </div>
+ <!-- div k-home-body -->
+ <!-- <div id="k-home-footer" style="display: none;"> -->
+ <!-- </div> -->
+ <!-- div k-home-footer -->
+ </div>
+ <!-- div home-table -->
+ </div>
+ <!-- home-wrapper -->
+ </div>
+ <!-- home-prewrap -->
</body>
</html>
Deleted: trunk/src/test/java/cc/kune/core/server/auth/openfire/KuneAuthProviderTest.java.txt
===================================================================
--- trunk/src/test/java/cc/kune/core/server/auth/openfire/KuneAuthProviderTest.java.txt 2012-03-10 06:23:34 UTC (rev 1753)
+++ trunk/src/test/java/cc/kune/core/server/auth/openfire/KuneAuthProviderTest.java.txt 2012-03-10 07:36:46 UTC (rev 1754)
@@ -1,18 +0,0 @@
-package cc.kune.core.server.auth.openfire;
-
-import org.jivesoftware.openfire.auth.ConnectionException;
-import org.jivesoftware.openfire.auth.InternalUnauthenticatedException;
-import org.jivesoftware.openfire.auth.UnauthorizedException;
-import org.junit.Ignore;
-import org.junit.Test;
-
-public class KuneAuthProviderTest {
-
- @Test
- @Ignore
- public void maintest() throws UnauthorizedException, ConnectionException,
- InternalUnauthenticatedException {
- final KuneAuthProvider auth = new KuneAuthProvider();
- auth.authenticate("admin", "169le0ik2rma81xhj4560ul7fm");
- }
-}
1
0
Author: vjrj_
Date: 2012-03-10 07:23:34 +0100 (Sat, 10 Mar 2012)
New Revision: 1753
Modified:
trunk/INSTALL
Log:
INSTALL new auth method added
Modified: trunk/INSTALL
===================================================================
--- trunk/INSTALL 2012-03-10 05:30:33 UTC (rev 1752)
+++ trunk/INSTALL 2012-03-10 06:23:34 UTC (rev 1753)
@@ -245,19 +245,35 @@
In Server > Server Settings > Registration & Login > Change Password > Disabled
so this will not conflict with kune users management.
-Change in 'Server > Server Manager > System Properties':
- provider.auth.className to org.jivesoftware.openfire.auth.JDBCAuthProvider instead of
- org.jivesoftware.openfire.auth.DefaultAuthProvider
- provider.user.className to org.jivesoftware.openfire.user.JDBCUserProvider instead of
- org.jivesoftware.openfire.user.DefaultUserProvider
+===Openfire auth via Kune===
+Download from http://kune.cc/downloads/openfireauth model-VERSION.jar and kune-openfireauth-VERSION.jar and copy to /usr/share/openfire/lib as root. Set the correct owner:
+
+chown openfire:openfire /usr/share/openfire/lib/model-VERSION.jar
+chown openfire:openfire /usr/share/openfire/lib/kune-openfireauth-VERSION.jar
+
+(do something equivalent in Windows systems in the openfire folder).
+
+Execute this:
+
+$ mysql -p -u kune kune_openfire # or mysql -p -u root
+DELETE FROM `ofProperty` WHERE name='provider.auth.className';
+DELETE FROM `ofProperty` WHERE name='hybridAuthProvider.primaryProvider.className';
+DELETE FROM `ofProperty` WHERE name='hybridAuthProvider.secondaryProvider.className';
+DELETE FROM `ofProperty` WHERE name='hybridAuthProvider.tertiaryProvider.className';
+INSERT INTO `ofProperty` VALUES ('provider.auth.className','org.jivesoftware.openfire.auth.HybridAuthProvider');
+INSERT INTO `ofProperty` VALUES('hybridAuthProvider.primaryProvider.className','cc.kune.core.server.auth.openfire.KuneAuthProvider');
+INSERT INTO `ofProperty` VALUES('hybridAuthProvider.secondaryProvider.className','org.jivesoftware.openfire.auth.JDBCAuthProvider');
+INSERT INTO `ofProperty` VALUES('hybridAuthProvider.tertiaryProvider.className','org.jivesoftware.openfire.auth.DefaultAuthProvider');
+
+Alternatively you can do this via 'Server > Server Manager > System Properties'.
+
This is used to set the database of users of openfire to kune users database table. When you do that you have to follow the next step (or you will get authentication problems).
Also in 'Server > Server Manager > System Properties' set (verify that the mysql connection user and password is the same as the password you choose to configure your database):
jdbcProvider.driver = com.mysql.jdbc.Driver
jdbcProvider.connectionString = jdbc:mysql://localhost/kune_dev?user=kune&password=db4kune&useUnicode=true&characterEncoding=utf-8
-provider.auth.className = org.jivesoftware.openfire.auth.JDBCAuthProvider
provider.user.className = org.jivesoftware.openfire.user.JDBCUserProvider
jdbcAuthProvider.passwordSQL = SELECT password FROM kune_dev.kusers WHERE shortName=?
jdbcAuthProvider.passwordType = plain
@@ -283,9 +299,6 @@
<connectionString>jdbc:mysql://localhost/kune_dev?user=kune&password=db4kune&useUnicode=true&characterEncoding=utf-8</connectionString>
</jdbcProvider>
<provider>
- <auth>
- <className>org.jivesoftware.openfire.auth.JDBCAuthProvider</className>
- </auth>
<user>
<className>org.jivesoftware.openfire.user.JDBCUserProvider</className>
</user>
1
0
Author: vjrj_
Date: 2012-03-10 06:30:33 +0100 (Sat, 10 Mar 2012)
New Revision: 1752
Added:
openfireauth/.classpath
openfireauth/.project
openfireauth/.settings/
openfireauth/.settings/org.eclipse.core.resources.prefs
openfireauth/.settings/org.eclipse.jdt.core.prefs
openfireauth/.settings/org.eclipse.jdt.ui.prefs
openfireauth/.settings/org.eclipse.m2e.core.prefs
Log:
Auth module to connect kune and openfire
Added: openfireauth/.classpath
===================================================================
--- openfireauth/.classpath (rev 0)
+++ openfireauth/.classpath 2012-03-10 05:30:33 UTC (rev 1752)
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources"/>
+ <classpathentry kind="src" output="target/test-classes" path="src/test/java"/>
+ <classpathentry excluding="**" kind="src" output="target/test-classes" path="src/test/resources"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.6"/>
+ <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
Added: openfireauth/.project
===================================================================
--- openfireauth/.project (rev 0)
+++ openfireauth/.project 2012-03-10 05:30:33 UTC (rev 1752)
@@ -0,0 +1,17 @@
+<projectDescription>
+ <name>kune-openfireauth</name>
+ <comment>The jar generated, can be installed in /lib/ directory and allow to auth openfire users throw kune session tokens (see HybridAuthProvider)</comment>
+ <projects/>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ </natures>
+</projectDescription>
\ No newline at end of file
Added: openfireauth/.settings/org.eclipse.core.resources.prefs
===================================================================
--- openfireauth/.settings/org.eclipse.core.resources.prefs (rev 0)
+++ openfireauth/.settings/org.eclipse.core.resources.prefs 2012-03-10 05:30:33 UTC (rev 1752)
@@ -0,0 +1,6 @@
+eclipse.preferences.version=1
+encoding//src/main/java=UTF-8
+encoding//src/main/resources=UTF-8
+encoding//src/test/java=UTF-8
+encoding//src/test/resources=UTF-8
+encoding/<project>=UTF-8
Added: openfireauth/.settings/org.eclipse.jdt.core.prefs
===================================================================
--- openfireauth/.settings/org.eclipse.jdt.core.prefs (rev 0)
+++ openfireauth/.settings/org.eclipse.jdt.core.prefs 2012-03-10 05:30:33 UTC (rev 1752)
@@ -0,0 +1,285 @@
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.6
+org.eclipse.jdt.core.compiler.compliance=1.6
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.6
+org.eclipse.jdt.core.formatter.align_type_members_on_columns=false
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_annotation=0
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_enum_constant=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_explicit_constructor_call=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_method_invocation=16
+org.eclipse.jdt.core.formatter.alignment_for_arguments_in_qualified_allocation_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_assignment=0
+org.eclipse.jdt.core.formatter.alignment_for_binary_expression=16
+org.eclipse.jdt.core.formatter.alignment_for_compact_if=16
+org.eclipse.jdt.core.formatter.alignment_for_conditional_expression=80
+org.eclipse.jdt.core.formatter.alignment_for_enum_constants=0
+org.eclipse.jdt.core.formatter.alignment_for_expressions_in_array_initializer=16
+org.eclipse.jdt.core.formatter.alignment_for_method_declaration=0
+org.eclipse.jdt.core.formatter.alignment_for_multiple_fields=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_parameters_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_resources_in_try=80
+org.eclipse.jdt.core.formatter.alignment_for_selector_in_method_invocation=2
+org.eclipse.jdt.core.formatter.alignment_for_superclass_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_enum_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_superinterfaces_in_type_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_constructor_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_throws_clause_in_method_declaration=16
+org.eclipse.jdt.core.formatter.alignment_for_union_type_in_multicatch=16
+org.eclipse.jdt.core.formatter.blank_lines_after_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_after_package=1
+org.eclipse.jdt.core.formatter.blank_lines_before_field=0
+org.eclipse.jdt.core.formatter.blank_lines_before_first_class_body_declaration=0
+org.eclipse.jdt.core.formatter.blank_lines_before_imports=1
+org.eclipse.jdt.core.formatter.blank_lines_before_member_type=0
+org.eclipse.jdt.core.formatter.blank_lines_before_method=1
+org.eclipse.jdt.core.formatter.blank_lines_before_new_chunk=0
+org.eclipse.jdt.core.formatter.blank_lines_before_package=0
+org.eclipse.jdt.core.formatter.blank_lines_between_import_groups=1
+org.eclipse.jdt.core.formatter.blank_lines_between_type_declarations=1
+org.eclipse.jdt.core.formatter.brace_position_for_annotation_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_anonymous_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_array_initializer=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_block_in_case=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_constructor_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_constant=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_enum_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_method_declaration=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_switch=end_of_line
+org.eclipse.jdt.core.formatter.brace_position_for_type_declaration=end_of_line
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_block_comment=false
+org.eclipse.jdt.core.formatter.comment.clear_blank_lines_in_javadoc_comment=false
+org.eclipse.jdt.core.formatter.comment.format_block_comments=true
+org.eclipse.jdt.core.formatter.comment.format_header=false
+org.eclipse.jdt.core.formatter.comment.format_html=true
+org.eclipse.jdt.core.formatter.comment.format_javadoc_comments=true
+org.eclipse.jdt.core.formatter.comment.format_line_comments=true
+org.eclipse.jdt.core.formatter.comment.format_source_code=true
+org.eclipse.jdt.core.formatter.comment.indent_parameter_description=true
+org.eclipse.jdt.core.formatter.comment.indent_root_tags=true
+org.eclipse.jdt.core.formatter.comment.insert_new_line_before_root_tags=insert
+org.eclipse.jdt.core.formatter.comment.insert_new_line_for_parameter=insert
+org.eclipse.jdt.core.formatter.comment.line_length=80
+org.eclipse.jdt.core.formatter.comment.new_lines_at_block_boundaries=true
+org.eclipse.jdt.core.formatter.comment.new_lines_at_javadoc_boundaries=true
+org.eclipse.jdt.core.formatter.comment.preserve_white_space_between_code_and_line_comments=false
+org.eclipse.jdt.core.formatter.compact_else_if=true
+org.eclipse.jdt.core.formatter.continuation_indentation=2
+org.eclipse.jdt.core.formatter.continuation_indentation_for_array_initializer=2
+org.eclipse.jdt.core.formatter.disabling_tag=@formatter\:off
+org.eclipse.jdt.core.formatter.enabling_tag=@formatter\:on
+org.eclipse.jdt.core.formatter.format_guardian_clause_on_one_line=false
+org.eclipse.jdt.core.formatter.format_line_comment_starting_on_first_column=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_annotation_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_constant_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_enum_declaration_header=true
+org.eclipse.jdt.core.formatter.indent_body_declarations_compare_to_type_header=true
+org.eclipse.jdt.core.formatter.indent_breaks_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_empty_lines=false
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_block=true
+org.eclipse.jdt.core.formatter.indent_statements_compare_to_body=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_cases=true
+org.eclipse.jdt.core.formatter.indent_switchstatements_compare_to_switch=false
+org.eclipse.jdt.core.formatter.indentation.size=2
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_field=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_local_variable=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_method=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_package=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_parameter=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_annotation_on_type=insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_label=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_after_opening_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_at_end_of_file_if_missing=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_catch_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_closing_brace_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_else_in_if_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_finally_in_try_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_before_while_in_do_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_annotation_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_block=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_method_body=insert
+org.eclipse.jdt.core.formatter.insert_new_line_in_empty_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_after_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_after_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_at_in_annotation_type_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_angle_bracket_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_after_closing_paren_in_cast=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_case=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_colon_in_labeled_statement=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_allocation_expression=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_annotation=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_constructor_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_constant_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_enum_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_explicitconstructorcall_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_increments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_for_inits=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_declaration_throws=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_method_invocation_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_field_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_multiple_local_declarations=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_parameterized_type_reference=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_superinterfaces=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_arguments=insert
+org.eclipse.jdt.core.formatter.insert_space_after_comma_in_type_parameters=insert
+org.eclipse.jdt.core.formatter.insert_space_after_ellipsis=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_opening_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_after_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_after_semicolon_in_try_resources=insert
+org.eclipse.jdt.core.formatter.insert_space_after_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_and_in_type_parameter=insert
+org.eclipse.jdt.core.formatter.insert_space_before_assignment_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_at_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_binary_operator=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_cast=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_catch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_if=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_switch=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_synchronized=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_try=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_closing_paren_in_while=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_assert=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_case=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_default=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_colon_in_labeled_statement=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_constructor_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_constant_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_enum_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_explicitconstructorcall_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_increments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_for_inits=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_declaration_throws=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_method_invocation_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_field_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_multiple_local_declarations=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_superinterfaces=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_comma_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_ellipsis=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_parameterized_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_arguments=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_angle_bracket_in_type_parameters=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_annotation_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_anonymous_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_array_initializer=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_block=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_constructor_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_constant=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_enum_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_method_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_brace_in_type_declaration=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_bracket_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_catch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_for=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_if=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_parenthesized_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_switch=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_synchronized=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_try=insert
+org.eclipse.jdt.core.formatter.insert_space_before_opening_paren_in_while=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_return=insert
+org.eclipse.jdt.core.formatter.insert_space_before_parenthesized_expression_in_throw=insert
+org.eclipse.jdt.core.formatter.insert_space_before_postfix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_prefix_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_conditional=insert
+org.eclipse.jdt.core.formatter.insert_space_before_question_in_wildcard=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_for=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_semicolon_in_try_resources=do not insert
+org.eclipse.jdt.core.formatter.insert_space_before_unary_operator=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_brackets_in_array_type_reference=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_braces_in_array_initializer=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_brackets_in_array_allocation_expression=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_annotation_type_member_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_constructor_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_enum_constant=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_declaration=do not insert
+org.eclipse.jdt.core.formatter.insert_space_between_empty_parens_in_method_invocation=do not insert
+org.eclipse.jdt.core.formatter.join_lines_in_comments=true
+org.eclipse.jdt.core.formatter.join_wrapped_lines=true
+org.eclipse.jdt.core.formatter.keep_else_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.keep_empty_array_initializer_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_imple_if_on_one_line=false
+org.eclipse.jdt.core.formatter.keep_then_statement_on_same_line=false
+org.eclipse.jdt.core.formatter.lineSplit=105
+org.eclipse.jdt.core.formatter.never_indent_block_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.never_indent_line_comments_on_first_column=false
+org.eclipse.jdt.core.formatter.number_of_blank_lines_at_beginning_of_method_body=0
+org.eclipse.jdt.core.formatter.number_of_empty_lines_to_preserve=1
+org.eclipse.jdt.core.formatter.put_empty_statement_on_new_line=true
+org.eclipse.jdt.core.formatter.tabulation.char=space
+org.eclipse.jdt.core.formatter.tabulation.size=2
+org.eclipse.jdt.core.formatter.use_on_off_tags=true
+org.eclipse.jdt.core.formatter.use_tabs_only_for_leading_indentations=false
+org.eclipse.jdt.core.formatter.wrap_before_binary_operator=true
+org.eclipse.jdt.core.formatter.wrap_before_or_operator_multicatch=true
+org.eclipse.jdt.core.formatter.wrap_outer_expressions_when_nested=true
Added: openfireauth/.settings/org.eclipse.jdt.ui.prefs
===================================================================
--- openfireauth/.settings/org.eclipse.jdt.ui.prefs (rev 0)
+++ openfireauth/.settings/org.eclipse.jdt.ui.prefs 2012-03-10 05:30:33 UTC (rev 1752)
@@ -0,0 +1,56 @@
+eclipse.preferences.version=1
+editor_save_participant_org.eclipse.jdt.ui.postsavelistener.cleanup=true
+formatter_profile=_kune-formatter
+formatter_settings_version=12
+sp_cleanup.add_default_serial_version_id=true
+sp_cleanup.add_generated_serial_version_id=false
+sp_cleanup.add_missing_annotations=true
+sp_cleanup.add_missing_deprecated_annotations=true
+sp_cleanup.add_missing_methods=false
+sp_cleanup.add_missing_nls_tags=false
+sp_cleanup.add_missing_override_annotations=true
+sp_cleanup.add_missing_override_annotations_interface_methods=true
+sp_cleanup.add_serial_version_id=false
+sp_cleanup.always_use_blocks=true
+sp_cleanup.always_use_parentheses_in_expressions=false
+sp_cleanup.always_use_this_for_non_static_field_access=false
+sp_cleanup.always_use_this_for_non_static_method_access=false
+sp_cleanup.convert_to_enhanced_for_loop=true
+sp_cleanup.correct_indentation=true
+sp_cleanup.format_source_code=true
+sp_cleanup.format_source_code_changes_only=false
+sp_cleanup.make_local_variable_final=true
+sp_cleanup.make_parameters_final=true
+sp_cleanup.make_private_fields_final=true
+sp_cleanup.make_type_abstract_if_missing_method=false
+sp_cleanup.make_variable_declarations_final=true
+sp_cleanup.never_use_blocks=false
+sp_cleanup.never_use_parentheses_in_expressions=true
+sp_cleanup.on_save_use_additional_actions=true
+sp_cleanup.organize_imports=true
+sp_cleanup.qualify_static_field_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_member_accesses_through_instances_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_through_subtypes_with_declaring_class=true
+sp_cleanup.qualify_static_member_accesses_with_declaring_class=false
+sp_cleanup.qualify_static_method_accesses_with_declaring_class=false
+sp_cleanup.remove_private_constructors=true
+sp_cleanup.remove_trailing_whitespaces=true
+sp_cleanup.remove_trailing_whitespaces_all=true
+sp_cleanup.remove_trailing_whitespaces_ignore_empty=false
+sp_cleanup.remove_unnecessary_casts=true
+sp_cleanup.remove_unnecessary_nls_tags=false
+sp_cleanup.remove_unused_imports=true
+sp_cleanup.remove_unused_local_variables=false
+sp_cleanup.remove_unused_private_fields=true
+sp_cleanup.remove_unused_private_members=false
+sp_cleanup.remove_unused_private_methods=true
+sp_cleanup.remove_unused_private_types=true
+sp_cleanup.sort_members=true
+sp_cleanup.sort_members_all=true
+sp_cleanup.use_blocks=true
+sp_cleanup.use_blocks_only_for_return_and_throw=false
+sp_cleanup.use_parentheses_in_expressions=false
+sp_cleanup.use_this_for_non_static_field_access=false
+sp_cleanup.use_this_for_non_static_field_access_only_if_necessary=true
+sp_cleanup.use_this_for_non_static_method_access=false
+sp_cleanup.use_this_for_non_static_method_access_only_if_necessary=true
Added: openfireauth/.settings/org.eclipse.m2e.core.prefs
===================================================================
--- openfireauth/.settings/org.eclipse.m2e.core.prefs (rev 0)
+++ openfireauth/.settings/org.eclipse.m2e.core.prefs 2012-03-10 05:30:33 UTC (rev 1752)
@@ -0,0 +1,4 @@
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
1
0
Author: vjrj_
Date: 2012-03-10 06:28:48 +0100 (Sat, 10 Mar 2012)
New Revision: 1751
Added:
openfireauth/
openfireauth/pom.xml
openfireauth/src/
openfireauth/src/main/
openfireauth/src/main/java/
openfireauth/src/main/java/cc/
openfireauth/src/main/java/cc/kune/
openfireauth/src/main/java/cc/kune/core/
openfireauth/src/main/java/cc/kune/core/server/
openfireauth/src/main/java/cc/kune/core/server/auth/
openfireauth/src/main/java/cc/kune/core/server/auth/openfire/
openfireauth/src/main/java/cc/kune/core/server/auth/openfire/KuneAuthProvider.java
openfireauth/src/main/resources/
openfireauth/src/main/resources/log4j.properties
openfireauth/src/test/
openfireauth/src/test/java/
openfireauth/src/test/java/cc/
openfireauth/src/test/java/cc/kune/
openfireauth/src/test/java/cc/kune/core/
openfireauth/src/test/java/cc/kune/core/server/
openfireauth/src/test/java/cc/kune/core/server/auth/
openfireauth/src/test/java/cc/kune/core/server/auth/openfire/
openfireauth/src/test/java/cc/kune/core/server/auth/openfire/KuneAuthProviderTest.java
openfireauth/src/test/resources/
openfireauth/target/
Log:
openfire alternative auth module for kune
Added: openfireauth/pom.xml
===================================================================
--- openfireauth/pom.xml (rev 0)
+++ openfireauth/pom.xml 2012-03-10 05:28:48 UTC (rev 1751)
@@ -0,0 +1,44 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>cc.kune</groupId>
+ <artifactId>kune-openfireauth</artifactId>
+ <version>0.0.1-SNAPSHOT</version>
+ <name>Kuen Openfire Auth Lib</name>
+ <description>The jar generated, can be installed in /lib/ directory and allow to auth openfire users throw kune session tokens (see HybridAuthProvider)</description>
+ <properties>
+ <maven.compiler.source>1.6</maven.compiler.source>
+ <maven.compiler.target>1.6</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <wiab.version>0.3.12</wiab.version>
+ </properties>
+ <repositories>
+ <repository>
+ <id>kune-maven</id>
+ <url>http://kune.ourproject.org/mavenrepo/</url>
+ </repository>
+ </repositories>
+ <dependencies>
+ <dependency>
+ <groupId>org.waveprotocol</groupId>
+ <artifactId>model</artifactId>
+ <version>${wiab.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.waveprotocol</groupId>
+ <artifactId>model-src</artifactId>
+ <version>${wiab.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.igniterealtime</groupId>
+ <artifactId>openfire</artifactId>
+ <version>3.7.0</version>
+ </dependency>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.9</version>
+ <scope>test</scope>
+ </dependency>
+ </dependencies>
+</project>
\ No newline at end of file
Added: openfireauth/src/main/java/cc/kune/core/server/auth/openfire/KuneAuthProvider.java
===================================================================
--- openfireauth/src/main/java/cc/kune/core/server/auth/openfire/KuneAuthProvider.java (rev 0)
+++ openfireauth/src/main/java/cc/kune/core/server/auth/openfire/KuneAuthProvider.java 2012-03-10 05:28:48 UTC (rev 1751)
@@ -0,0 +1,135 @@
+package cc.kune.core.server.auth.openfire;
+
+import java.io.DataInputStream;
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.IOException;
+import java.io.ObjectInputStream;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.jivesoftware.openfire.auth.AuthProvider;
+import org.jivesoftware.openfire.auth.ConnectionException;
+import org.jivesoftware.openfire.auth.InternalUnauthenticatedException;
+import org.jivesoftware.openfire.auth.UnauthorizedException;
+import org.jivesoftware.openfire.user.UserNotFoundException;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+
+public class KuneAuthProvider implements AuthProvider {
+
+ protected class ClassLoadingObjectInputStream extends ObjectInputStream {
+
+ /**
+ * Code copied from HashSessionManager
+ *
+ * @throws IOException
+ */
+ public ClassLoadingObjectInputStream() throws IOException {
+ super();
+ }
+
+ public ClassLoadingObjectInputStream(final java.io.InputStream in) throws IOException {
+ super(in);
+ }
+
+ @Override
+ public Class<?> resolveClass(final java.io.ObjectStreamClass cl) throws IOException,
+ ClassNotFoundException {
+ try {
+ return Class.forName(cl.getName(), false, Thread.currentThread().getContextClassLoader());
+ } catch (final ClassNotFoundException e) {
+ return super.resolveClass(cl);
+ }
+ }
+ }
+
+ public static final Log LOG = LogFactory.getLog(KuneAuthProvider.class);
+
+ private static final String USER_NOT_LOGGED = "User not logged";
+
+ @Override
+ @SuppressWarnings("unused")
+ public void authenticate(final String username, final String token) throws UnauthorizedException,
+ ConnectionException, InternalUnauthenticatedException {
+ try {
+ final File session = new File("/var/lib/kune/_sessions/" + token);
+ boolean logged = false;
+ if (session.exists()) {
+ final FileInputStream is = new FileInputStream(session);
+ final DataInputStream in = new DataInputStream(is);
+
+ final String clusterId = in.readUTF();
+ in.readUTF(); // nodeId
+ final long created = in.readLong();
+ final long accessed = in.readLong();
+ final int requests = in.readInt();
+
+ final int size = in.readInt();
+ if (size > 0) {
+ final ClassLoadingObjectInputStream ois = new ClassLoadingObjectInputStream(in);
+ for (int i = 0; i < size; i++) {
+ final String key = ois.readUTF();
+ try {
+ final Object value = ois.readObject();
+ if (value instanceof ParticipantId) {
+ if (((ParticipantId) value).getAddress().startsWith(username + "@")) {
+ logged = true;
+ break;
+ }
+ }
+ } catch (final ClassNotFoundException e) {
+ LOG.warn("Persisted in kune session unexpected object: " + e.getMessage());
+ }
+ }
+ ois.close();
+ }
+ in.close();
+ is.close();
+ if (!logged) {
+ throw new UnauthorizedException("Incorrect username");
+ }
+ } else {
+ throw new UnauthorizedException(USER_NOT_LOGGED);
+ }
+ } catch (final FileNotFoundException e) {
+ throw new UnauthorizedException(USER_NOT_LOGGED, e);
+ } catch (final IOException e) {
+ throw new UnauthorizedException(USER_NOT_LOGGED, e);
+ }
+ }
+
+ @Override
+ public void authenticate(final String username, final String token, final String digest)
+ throws UnauthorizedException, ConnectionException, InternalUnauthenticatedException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public String getPassword(final String arg0) throws UserNotFoundException,
+ UnsupportedOperationException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean isDigestSupported() {
+ return false;
+ }
+
+ @Override
+ public boolean isPlainSupported() {
+ return true;
+ }
+
+ @Override
+ public void setPassword(final String arg0, final String arg1) throws UserNotFoundException,
+ UnsupportedOperationException {
+ throw new UnsupportedOperationException();
+ }
+
+ @Override
+ public boolean supportsPasswordRetrieval() {
+ return false;
+ }
+
+}
Added: openfireauth/src/main/resources/log4j.properties
===================================================================
--- openfireauth/src/main/resources/log4j.properties (rev 0)
+++ openfireauth/src/main/resources/log4j.properties 2012-03-10 05:28:48 UTC (rev 1751)
@@ -0,0 +1,8 @@
+# Root logger option
+log4j.rootLogger=INFO, stdout
+
+# Direct log messages to stdout
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
\ No newline at end of file
Added: openfireauth/src/test/java/cc/kune/core/server/auth/openfire/KuneAuthProviderTest.java
===================================================================
--- openfireauth/src/test/java/cc/kune/core/server/auth/openfire/KuneAuthProviderTest.java (rev 0)
+++ openfireauth/src/test/java/cc/kune/core/server/auth/openfire/KuneAuthProviderTest.java 2012-03-10 05:28:48 UTC (rev 1751)
@@ -0,0 +1,17 @@
+package cc.kune.core.server.auth.openfire;
+
+import org.jivesoftware.openfire.auth.ConnectionException;
+import org.jivesoftware.openfire.auth.InternalUnauthenticatedException;
+import org.jivesoftware.openfire.auth.UnauthorizedException;
+import org.junit.Test;
+
+public class KuneAuthProviderTest {
+
+ @Test
+ public void maintest() throws UnauthorizedException, ConnectionException,
+ InternalUnauthenticatedException {
+ final KuneAuthProvider auth = new KuneAuthProvider();
+ auth.authenticate("vjrj", "6rzonw7n39p01td1p0rfujvu3");
+ auth.authenticate("admin", "x04c5575ycquu96k4kajldaq");
+ }
+}
Property changes on: openfireauth/target
___________________________________________________________________
Name: svn:ignore
+ classes
kune-openfireauth-0.0.1-SNAPSHOT.jar
maven-archiver
mvn-eclipse-cache.properties
surefire-reports
test-classes
1
0
Author: vjrj_
Date: 2012-03-09 02:22:13 +0100 (Fri, 09 Mar 2012)
New Revision: 1750
Added:
trunk/img/kunecc-avatar.png
trunk/img/kunecc-background.png
trunk/src/main/java/cc/kune/common/shared/utils/DateFormatConstants.java
trunk/src/main/java/cc/kune/events/client/actions/ExportCalendarMenuItem.java
trunk/src/main/java/cc/kune/events/server/EventsServlet.java
trunk/src/main/java/cc/kune/events/server/utils/
trunk/src/main/java/cc/kune/events/server/utils/DateUtils.java
trunk/src/main/java/cc/kune/events/server/utils/DateUtilsTest.java
trunk/src/main/java/cc/kune/events/server/utils/EventsServerConversionUtil.java
trunk/src/test/java/cc/kune/events/server/utils/
trunk/src/test/java/cc/kune/events/server/utils/BasicCalendarTest.java
trunk/src/test/java/cc/kune/events/server/utils/EventsServerConversionUtilTest.java
Removed:
trunk/src/main/java/cc/kune/events/server/CalendarServerUtils.java
trunk/src/test/java/cc/kune/events/server/CalendarServerUtilsTest.java
trunk/src/test/java/cc/kune/events/shared/BasicCalendarTest.java
trunk/src/test/java/cc/kune/events/shared/EventsServerConversionUtilTest.java
Modified:
trunk/img/kune-logos.svg
trunk/pom.xml
trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java
trunk/src/main/java/cc/kune/common/client/ui/dialogs/PromptTopDialog.java
trunk/src/main/java/cc/kune/common/client/utils/DateUtils.java
trunk/src/main/java/cc/kune/common/shared/res/ICalConstants.java
trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
trunk/src/main/java/cc/kune/core/server/content/ContainerManager.java
trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundDownloadManager.java
trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoDownloadManager.java
trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManager.java
trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManagerUtils.java
trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
trunk/src/main/java/cc/kune/core/shared/FileConstants.java
trunk/src/main/java/cc/kune/events/client/EventsClientTool.java
trunk/src/main/java/cc/kune/events/client/actions/EventAddMenuItem.java
trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java
trunk/src/main/java/cc/kune/events/client/actions/NewMeetingBtn.java
trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java
trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPresenter.java
trunk/src/main/java/cc/kune/events/shared/EventsClientConversionUtil.java
trunk/src/main/java/cc/kune/events/shared/EventsSharedConversionUtil.java
trunk/src/main/java/cc/kune/lists/client/actions/NewListAction.java
trunk/src/main/java/cc/kune/lists/client/actions/NewListPostAction.java
Log:
CLOSED - # 158: Add a Calendar view to event tool
http://kune.ourproject.org/issues/ticket/158
Modified: trunk/img/kune-logos.svg
===================================================================
--- trunk/img/kune-logos.svg 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/img/kune-logos.svg 2012-03-09 01:22:13 UTC (rev 1750)
@@ -57,15 +57,15 @@
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
- inkscape:zoom="1"
- inkscape:cx="518.29119"
- inkscape:cy="649.99995"
+ inkscape:zoom="1.27"
+ inkscape:cx="372.04724"
+ inkscape:cy="526.18109"
inkscape:document-units="px"
inkscape:current-layer="layer1"
inkscape:window-width="1078"
inkscape:window-height="1867"
- inkscape:window-x="1"
- inkscape:window-y="52"
+ inkscape:window-x="0"
+ inkscape:window-y="24"
showguides="true"
inkscape:guide-bbox="true"
inkscape:guide-points="true"
@@ -807,5 +807,113 @@
id="path4197"
transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)" />
</g>
+ <text
+ xml:space="preserve"
+ style="font-size:12px;font-style:normal;font-variant:normal;font-weight:bold;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:125%;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#a56941;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Ubuntu;-inkscape-font-specification:Ubuntu Bold"
+ x="613"
+ y="545.36218"
+ id="text3299"
+ sodipodi:linespacing="125%"><tspan
+ sodipodi:role="line"
+ id="tspan3301"
+ x="613"
+ y="545.36218"
+ style="font-size:46px;fill:#a56941;fill-opacity:1">kune</tspan></text>
+ <g
+ id="g3393"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kunecc-avatar.png"
+ inkscape:export-xdpi="90.000046"
+ inkscape:export-ydpi="90.000046">
+ <rect
+ y="501.61716"
+ x="544.79126"
+ height="60"
+ width="60"
+ id="rect3297"
+ style="color:#000000;fill:none;stroke:none;stroke-width:0.98360658;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <g
+ id="g3384">
+ <path
+ style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;opacity:0.11000001;color:#000000;fill:#dd8a3d;fill-opacity:1;fill-rule:nonzero;stroke:none;stroke-width:12.30341816;marker:none;visibility:visible;display:block;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"
+ d="m 551.98038,509.70847 a 4.489481,4.489481 0 0 0 -1.91552,8.52862 l 10.07928,5.13085 -4.72039,9.23554 a 4.4894802,4.4894802 0 0 0 -0.25084,0.50168 l -7.06917,13.81909 a 4.4924325,4.4924325 0 1 0 8.00413,4.08188 l 5.10804,-10.01086 9.646,4.90281 a 4.4924325,4.4924325 0 0 0 0.0228,0.0228 l 13.97872,7.11478 a 4.4924325,4.4924325 0 1 0 4.08188,-8.00413 l -10.07928,-5.13085 4.33272,-8.50582 a 4.4894789,4.4894789 0 0 0 1.09458,-2.16636 l 6.6131,-12.92974 a 4.4894795,4.4894795 0 0 0 -4.17309,-6.56749 4.4894795,4.4894795 0 0 0 -3.83104,2.48561 l -5.10805,10.01086 -0.72972,-0.38766 a 4.4894789,4.4894789 0 0 0 -0.72972,-0.29645 4.4894789,4.4894789 0 0 0 -0.11402,-0.0456 l -7.16038,-3.67141 a 4.4894799,4.4894799 0 0 0 -1.68748,-0.84374 l -13.249,-6.74992 a 4.489481,4.489481 0 0 0 -2.14356,-0.52449 z m 16.16788,17.74135 5.54132,2.82767 -2.82767,5.54132 -5.54132,-2.82767 2.82767,-5.54132 z"
+ id="path3318"
+ inkscape:connector-curvature="0" />
+ <g
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/ourproject.org/documentos/fsm-virtual/kune-ico.png"
+ transform="matrix(0.26464389,0,0,0.26430342,550.52866,280.17578)"
+ id="g3303">
+ <path
+ inkscape:connector-curvature="0"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path3306"
+ d="m 60.321717,411.99998 377.014613,0"
+ style="color:#000000;fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#dd8a3d;stroke-width:109.23953247;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block" />
+ <path
+ inkscape:connector-curvature="0"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path3308"
+ d="m 252.61203,788.60332 0,-377.01178"
+ style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffdb6b;stroke-width:109.23950958;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block" />
+ <path
+ inkscape:connector-curvature="0"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path3310"
+ d="m 252.86937,597.15755 377.0124,0"
+ style="color:#000000;fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#69312f;stroke-width:109.23951721;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block" />
+ <path
+ inkscape:connector-curvature="0"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path3312"
+ d="m 437.45588,596.97447 0,-377.01491"
+ style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#cc6633;stroke-width:109.23950195;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block" />
+ <path
+ inkscape:connector-curvature="0"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path3314"
+ d="m 372.87905,411.27704 64.93441,0"
+ style="color:#000000;fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#dd8a3d;stroke-width:109.23947906;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block" />
+ </g>
+ </g>
+ </g>
+ <g
+ style="opacity:0.2"
+ inkscape:export-ydpi="1797.08"
+ inkscape:export-xdpi="1797.08"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/kunecc-background.png"
+ transform="matrix(0.41681287,0,0,0.41627661,518.36566,339.18061)"
+ id="g3338">
+ <path
+ inkscape:connector-curvature="0"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path3340"
+ d="m 60.321717,411.99998 377.014613,0"
+ style="color:#000000;fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#dd8a3d;stroke-width:109.23953247000000033;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block" />
+ <path
+ inkscape:connector-curvature="0"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path3342"
+ d="m 252.61203,788.60332 0,-377.01178"
+ style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#ffdb6b;stroke-width:109.23950958000000355;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block" />
+ <path
+ inkscape:connector-curvature="0"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path3344"
+ d="m 252.86937,597.15755 377.0124,0"
+ style="color:#000000;fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#69312f;stroke-width:109.23951720999998827;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block" />
+ <path
+ inkscape:connector-curvature="0"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path3346"
+ d="m 437.45588,596.97447 0,-377.01491"
+ style="color:#000000;fill:#ffffff;fill-opacity:1;fill-rule:nonzero;stroke:#cc6633;stroke-width:109.23950195000000463;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block" />
+ <path
+ inkscape:connector-curvature="0"
+ transform="matrix(0.240856,0.12287,-0.12287,0.240856,101.5762,778.871)"
+ id="path3348"
+ d="m 372.87905,411.27704 64.93441,0"
+ style="color:#000000;fill:#69312f;fill-opacity:1;fill-rule:nonzero;stroke:#dd8a3d;stroke-width:109.23947905999999364;stroke-linecap:round;stroke-linejoin:miter;stroke-miterlimit:4;stroke-opacity:1;stroke-dashoffset:0;marker:none;visibility:visible;display:block" />
+ </g>
</g>
</svg>
Added: trunk/img/kunecc-avatar.png
===================================================================
(Binary files differ)
Property changes on: trunk/img/kunecc-avatar.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/img/kunecc-background.png
===================================================================
(Binary files differ)
Property changes on: trunk/img/kunecc-background.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/pom.xml 2012-03-09 01:22:13 UTC (rev 1750)
@@ -523,41 +523,6 @@
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
- <artifactId>gwt-util-src</artifactId>
- <version>${wiab.version}</version>
- </dependency>
- <dependency>
- <groupId>com.google.guava</groupId>
- <artifactId>guava-gwt</artifactId>
- <version>r09</version>
- </dependency>
- <dependency>
- <groupId>org.waveprotocol</groupId>
- <artifactId>box</artifactId>
- <version>${wiab.version}</version>
- </dependency>
- <dependency>
- <groupId>org.waveprotocol</groupId>
- <artifactId>box-src</artifactId>
- <version>${wiab.version}</version>
- </dependency>
- <dependency>
- <groupId>org.waveprotocol</groupId>
- <artifactId>model-src</artifactId>
- <version>${wiab.version}</version>
- </dependency>
- <dependency>
- <groupId>org.waveprotocol</groupId>
- <artifactId>client</artifactId>
- <version>${wiab.version}</version>
- </dependency>
- <dependency>
- <groupId>org.waveprotocol</groupId>
- <artifactId>client-src</artifactId>
- <version>${wiab.version}</version>
- </dependency>
- <dependency>
- <groupId>org.waveprotocol</groupId>
<artifactId>client-common</artifactId>
<version>${wiab.version}</version>
</dependency>
@@ -567,21 +532,6 @@
<version>${wiab.version}</version>
</dependency>
<dependency>
- <groupId>org.waveprotocol</groupId>
- <artifactId>waveinabox-server-0.3</artifactId>
- <version>${wiab.version}</version>
- </dependency>
- <dependency>
- <groupId>org.waveprotocol</groupId>
- <artifactId>proto-msg</artifactId>
- <version>${wiab.version}</version>
- </dependency>
- <dependency>
- <groupId>org.waveprotocol</groupId>
- <artifactId>gwt-util-src</artifactId>
- <version>${wiab.version}</version>
- </dependency>
- <dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava-gwt</artifactId>
<version>r09</version>
@@ -598,27 +548,27 @@
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
- <artifactId>model-src</artifactId>
+ <artifactId>waveinabox-server-0.3</artifactId>
<version>${wiab.version}</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
- <artifactId>client</artifactId>
+ <artifactId>gwt-util-src</artifactId>
<version>${wiab.version}</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
- <artifactId>client-src</artifactId>
+ <artifactId>model-src</artifactId>
<version>${wiab.version}</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
- <artifactId>client-common</artifactId>
+ <artifactId>client</artifactId>
<version>${wiab.version}</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
- <artifactId>client-common-src</artifactId>
+ <artifactId>client-src</artifactId>
<version>${wiab.version}</version>
</dependency>
<dependency>
@@ -725,42 +675,42 @@
<version>1.0.2</version>
</dependency>
<!-- openfire auth integration -->
-<!-- <dependency> -->
-<!-- <groupId>org.igniterealtime</groupId> -->
-<!-- <artifactId>openfire</artifactId> -->
-<!-- <version>3.7.0</version> -->
-<!-- <scope>provided</scope> -->
-<!-- <exclusions> -->
-<!-- <exclusion> -->
-<!-- <groupId>org.eclipse.jetty</groupId> -->
-<!-- <artifactId>hibernate</artifactId> -->
-<!-- </exclusion> -->
-<!-- <exclusion> -->
-<!-- <groupId>org.slf4j</groupId> -->
-<!-- <artifactId>spi</artifactId> -->
-<!-- </exclusion> -->
-<!-- <exclusion> -->
-<!-- <groupId>org.slf4j</groupId> -->
-<!-- <artifactId>slf4j-api</artifactId> -->
-<!-- </exclusion> -->
-<!-- <exclusion> -->
-<!-- <groupId>org.slf4j</groupId> -->
-<!-- <artifactId>jcl-over-slf4j</artifactId> -->
-<!-- </exclusion> -->
-<!-- <exclusion> -->
-<!-- <groupId>org.slf4j</groupId> -->
-<!-- <artifactId>jcl-over-slf4j</artifactId> -->
-<!-- </exclusion> -->
-<!-- <exclusion> -->
-<!-- <groupId>org.apache</groupId> -->
-<!-- <artifactId>commons</artifactId> -->
-<!-- </exclusion> -->
-<!-- <exclusion> -->
-<!-- <groupId>org.apache.commons</groupId> -->
-<!-- <artifactId>logging</artifactId> -->
-<!-- </exclusion> -->
-<!-- </exclusions> -->
-<!-- </dependency> -->
+ <!-- <dependency> -->
+ <!-- <groupId>org.igniterealtime</groupId> -->
+ <!-- <artifactId>openfire</artifactId> -->
+ <!-- <version>3.7.0</version> -->
+ <!-- <scope>provided</scope> -->
+ <!-- <exclusions> -->
+ <!-- <exclusion> -->
+ <!-- <groupId>org.eclipse.jetty</groupId> -->
+ <!-- <artifactId>hibernate</artifactId> -->
+ <!-- </exclusion> -->
+ <!-- <exclusion> -->
+ <!-- <groupId>org.slf4j</groupId> -->
+ <!-- <artifactId>spi</artifactId> -->
+ <!-- </exclusion> -->
+ <!-- <exclusion> -->
+ <!-- <groupId>org.slf4j</groupId> -->
+ <!-- <artifactId>slf4j-api</artifactId> -->
+ <!-- </exclusion> -->
+ <!-- <exclusion> -->
+ <!-- <groupId>org.slf4j</groupId> -->
+ <!-- <artifactId>jcl-over-slf4j</artifactId> -->
+ <!-- </exclusion> -->
+ <!-- <exclusion> -->
+ <!-- <groupId>org.slf4j</groupId> -->
+ <!-- <artifactId>jcl-over-slf4j</artifactId> -->
+ <!-- </exclusion> -->
+ <!-- <exclusion> -->
+ <!-- <groupId>org.apache</groupId> -->
+ <!-- <artifactId>commons</artifactId> -->
+ <!-- </exclusion> -->
+ <!-- <exclusion> -->
+ <!-- <groupId>org.apache.commons</groupId> -->
+ <!-- <artifactId>logging</artifactId> -->
+ <!-- </exclusion> -->
+ <!-- </exclusions> -->
+ <!-- </dependency> -->
</dependencies>
<!-- <dependency> -->
<!-- <groupId>dom4j</groupId> -->
Modified: trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/chat/client/actions/NewRoomBtn.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -24,6 +24,7 @@
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.ui.dialogs.PromptTopDialog.OnEnter;
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.actions.RolAction;
@@ -50,6 +51,7 @@
private static final String ID = "k-nrbt-dialog";
private static final String TEXTBOX_ID = "k-nrbt-textbox";
private final Provider<ContentServiceAsync> contentService;
+ private PromptTopDialog diag;
private final I18nTranslationService i18n;
private final Session session;
private final StateManager stateManager;
@@ -67,7 +69,12 @@
@Override
public void actionPerformed(final ActionEvent event) {
final Builder builder = new PromptTopDialog.Builder(ID, i18n.t("Name of the new chatroom?"),
- false, true, i18n.getDirection());
+ false, true, i18n.getDirection(), new OnEnter() {
+ @Override
+ public void onEnter() {
+ doAction();
+ }
+ });
builder.width("200px").height("50px").firstButtonTitle(i18n.t("Create")).sndButtonTitle(
i18n.t("Cancel")).firstButtonId(CREATE_ID).sndButtonId(CANCEL_ID);
builder.regex(TextUtils.UNIX_NAME).regexText(
@@ -75,7 +82,7 @@
builder.minLength(3).maxLength(15).allowBlank(false).minLengthText(
CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15_NO_CHARS).maxLengthText(
CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15_NO_CHARS);
- final PromptTopDialog diag = builder.build();
+ diag = builder.build();
diag.showCentered();
diag.focusOnTextBox();
diag.getSecondBtn().addClickHandler(new ClickHandler() {
@@ -87,26 +94,30 @@
diag.getFirstBtn().addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
- if (diag.isValid()) {
- NotifyUser.showProgress();
- final String groupShortName = session.getCurrentState().getGroup().getShortName();
- final StateToken parentToken = session.getContainerState().getRootContainer().getStateToken();
- contentService.get().addRoom(session.getUserHash(), parentToken,
- groupShortName + "-" + diag.getTextFieldValue(),
- new AsyncCallbackSimple<StateContainerDTO>() {
- @Override
- public void onSuccess(final StateContainerDTO state) {
- stateManager.removeCache(parentToken);
- stateManager.setRetrievedStateAndGo(state);
- NotifyUser.hideProgress();
- NotifyUser.info(i18n.t("Chatroom created"));
- }
- });
- diag.hide();
- }
+ doAction();
}
});
}
+
+ private void doAction() {
+ if (diag.isValid()) {
+ NotifyUser.showProgress();
+ final String groupShortName = session.getCurrentState().getGroup().getShortName();
+ final StateToken parentToken = session.getContainerState().getRootContainer().getStateToken();
+ contentService.get().addRoom(session.getUserHash(), parentToken,
+ groupShortName + "-" + diag.getTextFieldValue(),
+ new AsyncCallbackSimple<StateContainerDTO>() {
+ @Override
+ public void onSuccess(final StateContainerDTO state) {
+ stateManager.removeCache(parentToken);
+ stateManager.setRetrievedStateAndGo(state);
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Chatroom created"));
+ }
+ });
+ diag.hide();
+ }
+ }
}
@Inject
Modified: trunk/src/main/java/cc/kune/common/client/ui/dialogs/PromptTopDialog.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/PromptTopDialog.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/PromptTopDialog.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -19,81 +19,204 @@
*/
package cc.kune.common.client.ui.dialogs;
+import com.extjs.gxt.ui.client.event.Events;
+import com.extjs.gxt.ui.client.event.FieldEvent;
+import com.extjs.gxt.ui.client.event.Listener;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.google.gwt.i18n.client.HasDirection.Direction;
+/**
+ * The Class PromptTopDialog shows a top dialog with some textfield and two
+ * buttons
+ */
public class PromptTopDialog extends BasicTopDialog {
+ /**
+ * The Class Builder.
+ */
public static class Builder extends BasicTopDialog.Builder {
+ /** The allow blank. */
private boolean allowBlank = false;
+
+ /** The field width. */
private int fieldWidth;
+
+ /** The max length. */
private int maxLength = 0;
+
+ /** The max length text. */
private String maxLengthText;
+
+ /** The min length. */
private int minLength = 0;
+
+ /** The min length text. */
private String minLengthText;
+
+ /** The on enter. */
+ private final OnEnter onEnter;
+
+ /** The regex. */
private String regex;
+
+ /** The regex text. */
private String regexText;
+
+ /** The textbox id. */
private String textboxId;
+
+ /** The width. */
private int width = 0;
+ /**
+ * Instantiates a new builder.
+ *
+ * @param dialogId
+ * the dialog id (used for debuggin)
+ * @param promptText
+ * the prompt text
+ * @param autohide
+ * the autohide
+ * @param modal
+ * the modal
+ * @param direction
+ * the direction
+ * @param onEnter
+ * the on enter
+ */
public Builder(final String dialogId, final String promptText, final boolean autohide,
- final boolean modal, final Direction direction) {
+ final boolean modal, final Direction direction, final OnEnter onEnter) {
super(dialogId, autohide, modal, direction);
+ this.onEnter = onEnter;
super.title(promptText);
+ super.tabIndexStart(1);
}
+ /**
+ * Allow blank.
+ *
+ * @param allowBlank
+ * the allow blank
+ * @return the builder
+ */
public Builder allowBlank(final boolean allowBlank) {
this.allowBlank = allowBlank;
return this;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see cc.kune.common.client.ui.dialogs.BasicTopDialog.Builder#build()
+ */
@Override
public PromptTopDialog build() {
final PromptTopDialog dialog = new PromptTopDialog(this);
return dialog;
}
+ /**
+ * Field width.
+ *
+ * @param fieldWidth
+ * the field width
+ * @return the builder
+ */
public Builder fieldWidth(final int fieldWidth) {
this.fieldWidth = fieldWidth;
return this;
}
+ /**
+ * Max length.
+ *
+ * @param maxLength
+ * the max length
+ * @return the builder
+ */
public Builder maxLength(final int maxLength) {
this.maxLength = maxLength;
return this;
}
+ /**
+ * Max length text.
+ *
+ * @param maxLengthText
+ * the max length text
+ * @return the builder
+ */
public Builder maxLengthText(final String maxLengthText) {
this.maxLengthText = maxLengthText;
return this;
}
+ /**
+ * Min length.
+ *
+ * @param minLength
+ * the min length
+ * @return the builder
+ */
public Builder minLength(final int minLength) {
this.minLength = minLength;
return this;
}
+ /**
+ * Min length text.
+ *
+ * @param minLengthText
+ * the min length text
+ * @return the builder
+ */
public Builder minLengthText(final String minLengthText) {
this.minLengthText = minLengthText;
return this;
}
+ /**
+ * Regex.
+ *
+ * @param regex
+ * the regex
+ * @return the builder
+ */
public Builder regex(final String regex) {
this.regex = regex;
return this;
}
+ /**
+ * Regex text.
+ *
+ * @param regexText
+ * the regex text
+ * @return the builder
+ */
public Builder regexText(final String regexText) {
this.regexText = regexText;
return this;
}
+ /**
+ * Textbox id.
+ *
+ * @param textboxId
+ * the textbox id
+ * @return the builder
+ */
public Builder textboxId(final String textboxId) {
this.textboxId = textboxId;
return this;
}
+ /*
+ * (non-Javadoc)
+ *
+ * @see cc.kune.common.client.ui.dialogs.BasicTopDialog.Builder#width(int)
+ */
@Override
public Builder width(final int width) {
this.width = width;
@@ -101,8 +224,23 @@
}
}
+ public interface OnEnter {
+
+ /**
+ * On enter what to do
+ */
+ void onEnter();
+ }
+
+ /** The text field of the Prompt. */
private final TextField<String> textField;
+ /**
+ * Instantiates a new prompt top dialog.
+ *
+ * @param builder
+ * the builder
+ */
protected PromptTopDialog(final Builder builder) {
super(builder);
textField = new TextField<String>();
@@ -122,25 +260,55 @@
}
textField.setWidth(builder.fieldWidth);
textField.setAllowBlank(builder.allowBlank);
+ textField.addListener(Events.OnKeyPress, new Listener<FieldEvent>() {
+ @Override
+ public void handleEvent(final FieldEvent fe) {
+ if (fe.getEvent().getKeyCode() == 13) {
+ builder.onEnter.onEnter();
+ }
+ }
+ });
super.getInnerPanel().add(textField);
}
+ /**
+ * Clear text field value.
+ */
public void clearTextFieldValue() {
textField.reset();
}
+ /**
+ * Focus on text box.
+ */
public void focusOnTextBox() {
textField.focus();
}
+ /**
+ * Gets the text field value.
+ *
+ * @return the text field value
+ */
public String getTextFieldValue() {
return textField.getValue();
}
+ /**
+ * Checks if is valid.
+ *
+ * @return true, if is valid
+ */
public boolean isValid() {
return textField.isValid();
}
+ /**
+ * Sets the text field value.
+ *
+ * @param text
+ * the new text field value
+ */
public void setTextFieldValue(final String text) {
textField.setValue(text);
}
Modified: trunk/src/main/java/cc/kune/common/client/utils/DateUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/DateUtils.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/common/client/utils/DateUtils.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -2,33 +2,33 @@
import java.util.Date;
+import cc.kune.common.shared.utils.DateFormatConstants;
+
import com.google.gwt.i18n.client.DateTimeFormat;
-import com.google.gwt.i18n.client.DateTimeFormat.PredefinedFormat;
/**
* The Class DateUtils try to follow ISO_8601 (previously RFC 2445 date-time
* formats).
*/
-public class DateUtils {
+public class DateUtils extends DateFormatConstants {
- private static DateTimeFormat iso_8601 = DateTimeFormat.getFormat(PredefinedFormat.ISO_8601);
- // Sample DTSTART:19980118T230000
- private static DateTimeFormat rfcDateFormat = DateTimeFormat.getFormat("'DTSTART':yyyyMMdd'T'Hmmss");
+ private static final DateTimeFormat iso_8601 = DateTimeFormat.getFormat(DATE_EXPORT_FORMAT);
public static Date toDate(final String date) {
try {
return iso_8601.parse(date);
} catch (final IllegalArgumentException e) {
try {
- return rfcDateFormat.parse(date);
+ // try old (buggy) hour formats
+ // Sample DTSTART:19980118T230000
+ return DateTimeFormat.getFormat(OLD1_DATE_EXPORT_FORMAT).parse(date);
} catch (final IllegalArgumentException e1) {
- // try old (buggy) hour formats
// DTSTART:20120229T120000
try {
- return DateTimeFormat.getFormat("'DTSTART':yyyyMMdd'T'hhmmss").parse(date);
+ return DateTimeFormat.getFormat(OLD2_DATE_EXPORT_FORMAT).parse(date);
} catch (final IllegalArgumentException e2) {
// DTSTART:20120225T1300
- return DateTimeFormat.getFormat("'DTSTART':yyyyMMdd'T'hhmm").parse(date);
+ return DateTimeFormat.getFormat(OLD3_DATE_EXPORT_FORMAT).parse(date);
}
}
}
Modified: trunk/src/main/java/cc/kune/common/shared/res/ICalConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/common/shared/res/ICalConstants.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/common/shared/res/ICalConstants.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -12,6 +12,7 @@
public static final String LOCATION = "LOCATION";
public static final String ORGANIZER = "ORGANIZER";
public static final String SUMMARY = "SUMMARY";
- public static final String[] TOTAL_LIST = new String[] { DATE_TIME_START, DATE_TIME_END, DESCRIPTION,
- LOCATION, ORGANIZER, SUMMARY, _ALL_DAY, _INTERNAL_ID };
+ public static final String UID = "UID";
+ public static final String[] ZTOTAL_LIST = new String[] { DATE_TIME_START, DATE_TIME_END, DESCRIPTION,
+ LOCATION, ORGANIZER, SUMMARY, _ALL_DAY, _INTERNAL_ID, UID };
}
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/common/shared/utils/DateFormatConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/common/shared/utils/DateFormatConstants.java (rev 0)
+++ trunk/src/main/java/cc/kune/common/shared/utils/DateFormatConstants.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -0,0 +1,17 @@
+package cc.kune.common.shared.utils;
+
+public class DateFormatConstants {
+
+ public static final String DATE_EXPORT_FORMAT = "yyyy-MM-dd'T'HH:mm:ss.SSSZZZ";
+ @Deprecated
+ public static final String OLD1_DATE_EXPORT_FORMAT = "'DTSTART':yyyyMMdd'T'Hmmss";
+ @Deprecated
+ public static final String OLD2_DATE_EXPORT_FORMAT = "'DTSTART':yyyyMMdd'T'hhmmss";
+ @Deprecated
+ public static final String OLD3_DATE_EXPORT_FORMAT = "'DTSTART':yyyyMMdd'T'hhmm";
+
+ public DateFormatConstants() {
+ super();
+ }
+
+}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -55,8 +55,9 @@
import cc.kune.core.server.rest.UserJSONService;
import cc.kune.core.server.scheduler.CronServerTasksManager;
import cc.kune.docs.server.DocumentServerModule;
-import cc.kune.events.server.CalendarServerUtils;
+import cc.kune.events.server.EventsServlet;
import cc.kune.events.server.EventsServerModule;
+import cc.kune.events.server.utils.EventsServerConversionUtil;
import cc.kune.hspace.client.ClientStatsService;
import cc.kune.lists.client.rpc.ListsService;
import cc.kune.lists.server.ListsServerModule;
@@ -97,7 +98,7 @@
// This can be used also in Gin:
// http://code.google.com/p/google-gin/issues/detail?id=60
requestStaticInjection(KuneWaveServerUtils.class);
- requestStaticInjection(CalendarServerUtils.class);
+ requestStaticInjection(EventsServerConversionUtil.class);
requestStaticInjection(GroupServerUtils.class);
}
};
@@ -157,7 +158,7 @@
builder.installServlet("^" + suffix + "/servlets/", FileUploadManager.class,
FileDownloadManager.class, EntityLogoUploadManager.class, EntityLogoDownloadManager.class,
FileGwtUploadServlet.class, EntityBackgroundDownloadManager.class,
- EntityBackgroundUploadManager.class, UserLogoDownloadManager.class);
+ EntityBackgroundUploadManager.class, UserLogoDownloadManager.class, EventsServlet.class);
builder.at("^" + suffix + "/(.*)$").install(
new ForwardFilter("^" + suffix + "/(.*)$", suffix + "/{0}"));
Modified: trunk/src/main/java/cc/kune/core/server/content/ContainerManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContainerManager.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/core/server/content/ContainerManager.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -33,9 +33,6 @@
Container createRootFolder(Group group, String toolName, String name, String type);
- @Override
- Container find(Long id);
-
boolean findIfExistsTitle(Container container, String title);
void moveContainer(Container container, Container newContainer);
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundDownloadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundDownloadManager.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/EntityBackgroundDownloadManager.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -113,7 +113,7 @@
final OutputStream out = resp.getOutputStream();
FileDownloadManagerUtils.returnFile(absFilename, out);
} catch (final ContentNotFoundException e) {
- FileDownloadManagerUtils.returnNotFound(resp);
+ FileDownloadManagerUtils.returnNotFound404(resp);
return;
}
}
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 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/EntityLogoDownloadManager.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -69,7 +69,7 @@
resp.getOutputStream().write(logo);
}
} catch (final NoResultException e) {
- FileDownloadManagerUtils.returnNotFound(resp);
+ FileDownloadManagerUtils.returnNotFound404(resp);
return;
}
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManager.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManager.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -87,7 +87,7 @@
final OutputStream out = resp.getOutputStream();
FileDownloadManagerUtils.returnFile(absFilename, out);
} catch (final ContentNotFoundException e) {
- FileDownloadManagerUtils.returnNotFound(resp);
+ FileDownloadManagerUtils.returnNotFound404(resp);
return;
}
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManagerUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManagerUtils.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileDownloadManagerUtils.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -47,7 +47,7 @@
}
}
- public static void returnNotFound(final HttpServletResponse resp) throws IOException {
+ public static void returnNotFound404(final HttpServletResponse resp) throws IOException {
resp.getWriter().println("Content not found");
resp.setStatus(HttpServletResponse.SC_NOT_FOUND);
}
Modified: trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -35,7 +35,7 @@
import cc.kune.domain.License;
import cc.kune.domain.Revision;
import cc.kune.domain.User;
-import cc.kune.events.server.CalendarServerUtils;
+import cc.kune.events.server.utils.EventsServerConversionUtil;
import cc.kune.events.shared.EventsConstants;
import cc.kune.wave.server.kspecific.KuneWaveService;
@@ -86,7 +86,7 @@
final Group group = container.getOwner();
setCommon(state, userLogged, group, container);
if (isCalendar) {
- ((StateEventContainer) state).setAppointments(CalendarServerUtils.getAppointments(container));
+ ((StateEventContainer) state).setAppointments(EventsServerConversionUtil.getAppointments(container));
}
return state;
}
Modified: trunk/src/main/java/cc/kune/core/shared/FileConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/FileConstants.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/core/shared/FileConstants.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -27,11 +27,12 @@
+ "servlets/EntityBackgroundDownloadManager";
public final static String DOWNLOAD = "download";
public static final String DOWNLOADSERVLET = ASITE_PREFIX + "servlets/FileDownloadManager";
+ public static final String EVENTSSERVLET = ASITE_PREFIX + "servlets/EventsServlet";
public final static String FILENAME = "filename";
public final static String GROUP_LOGO_FIELD = "k-glogov-ff";
public static final String GROUP_NO_AVATAR_IMAGE = "others/defgroup.gif";
+
public final static String HASH = "hash";
-
public final static String IMGSIZE = "imgsize";
public final static int LOGO_DEF_HEIGHT = 60;
public final static int LOGO_DEF_WIDTH = 468;
Modified: trunk/src/main/java/cc/kune/events/client/EventsClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/EventsClientTool.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/events/client/EventsClientTool.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -64,7 +64,7 @@
private void registerIcons() {
registerContentTypeIcon(TYPE_ROOT, icons.events());
- registerContentTypeIcon(TYPE_MEETING, navResources.calendar());
+ registerContentTypeIcon(TYPE_MEETING, icons.events());
registerEmptyMessages(TYPE_ROOT, i18n.t("There isn't any meeting, create one"));
registerEmptyMessagesNotLogged(TYPE_ROOT, i18n.t("There isn't any meeting"));
}
Modified: trunk/src/main/java/cc/kune/events/client/actions/EventAddMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/EventAddMenuItem.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/events/client/actions/EventAddMenuItem.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -6,6 +6,7 @@
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.common.client.ui.dialogs.PromptTopDialog;
import cc.kune.common.client.ui.dialogs.PromptTopDialog.Builder;
+import cc.kune.common.client.ui.dialogs.PromptTopDialog.OnEnter;
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.nav.NavResources;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
@@ -16,8 +17,8 @@
import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.core.shared.dto.StateContentDTO;
import cc.kune.events.client.viewer.CalendarViewer;
+import cc.kune.events.shared.EventsClientConversionUtil;
import cc.kune.events.shared.EventsConstants;
-import cc.kune.events.shared.EventsClientConversionUtil;
import com.bradrydzewski.gwt.calendar.client.Appointment;
import com.bradrydzewski.gwt.calendar.client.AppointmentStyle;
@@ -35,7 +36,9 @@
private final Provider<ContentServiceAsync> contService;
private PromptTopDialog dialog;
private final I18nTranslationService i18n;
+ private boolean openAfterCreation;
private final Session session;
+ private final StateManager stateManager;
@Inject
public EventAddAction(final NavResources res, final I18nTranslationService i18n,
@@ -46,6 +49,7 @@
this.calendar = calendar;
this.contService = contService;
this.session = session;
+ this.stateManager = stateManager;
withText(i18n.t("Add an appointment")).withIcon(res.calendarAdd());
}
@@ -53,43 +57,19 @@
public void actionPerformed(final ActionEvent event) {
if (dialog == null) {
final Builder builder = new PromptTopDialog.Builder(CREATE_APP_ID,
- i18n.t("Description of the appointment"), true, true, i18n.getDirection());
+ i18n.t("Description of the appointment"), true, true, i18n.getDirection(), new OnEnter() {
+ @Override
+ public void onEnter() {
+ doAction();
+ }
+ });
builder.firstButtonTitle(i18n.t("Add")).firstButtonId(CREATE_APP_ADD_ID);
builder.sndButtonTitle(i18n.t("Cancel")).sndButtonId(CREATE_APP_CANCEL_ID);
dialog = builder.build();
dialog.getFirstBtn().addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
- if (dialog.isValid()) {
-
- final String title = dialog.getTextFieldValue();
- final Date onOverDate = calendar.get().getOnOverDate();
- final Appointment appt = new Appointment();
- appt.setStart(onOverDate);
- // http://stackoverflow.com/questions/2527845/how-to-do-calendar-operations-in…
- final Date endDate = new Date(onOverDate.getTime() + SessionConstants._AN_HOUR);
- appt.setEnd(endDate);
- appt.setTitle(title);
- appt.setStyle(AppointmentStyle.ORANGE);
-
- contService.get().addNewContentWithGadgetAndState(session.getUserHash(),
- session.getContainerState().getStateToken(),
- EventsConstants.TYPE_MEETING_DEF_GADGETNAME, EventsConstants.TYPE_MEETING, title,
- "", EventsClientConversionUtil.toMap(appt), new AsyncCallbackSimple<StateContentDTO>() {
- @Override
- public void onFailure(final Throwable caught) {
- super.onFailure(caught);
- }
-
- @Override
- public void onSuccess(final StateContentDTO result) {
- appt.setId(result.getStateToken().toString());
- // Should this be used or serialize from server side?
- calendar.get().addAppointment(appt);
- }
- });
- dialog.hide();
- }
+ doAction();
}
});
dialog.getSecondBtn().addClickHandler(new ClickHandler() {
@@ -103,6 +83,51 @@
dialog.showCentered();
dialog.focusOnTextBox();
}
+
+ private void doAction() {
+ if (dialog.isValid()) {
+
+ final String title = dialog.getTextFieldValue();
+ final Date onOverDate = calendar.get().getOnOverDate();
+ final Appointment appt = new Appointment();
+ final Date startDate = onOverDate != null ? onOverDate : new Date();
+ if (onOverDate != null) {
+ openAfterCreation = false;
+ }
+ appt.setStart(startDate);
+ // http://stackoverflow.com/questions/2527845/how-to-do-calendar-operations-in…
+ final Date endDate = new Date(startDate.getTime() + SessionConstants._AN_HOUR);
+ appt.setEnd(endDate);
+ appt.setTitle(title);
+ appt.setStyle(AppointmentStyle.ORANGE);
+
+ contService.get().addNewContentWithGadgetAndState(session.getUserHash(),
+ session.getContainerState().getStateToken(), EventsConstants.TYPE_MEETING_DEF_GADGETNAME,
+ EventsConstants.TYPE_MEETING, title, "", EventsClientConversionUtil.toMap(appt),
+ new AsyncCallbackSimple<StateContentDTO>() {
+ @Override
+ public void onFailure(final Throwable caught) {
+ super.onFailure(caught);
+ }
+
+ @Override
+ public void onSuccess(final StateContentDTO result) {
+ // FIXME this should be setted for real...
+ appt.setId(result.getStateToken().toString());
+ // Should this be used or serialize from server side?
+ calendar.get().addAppointment(appt);
+ if (openAfterCreation) {
+ stateManager.gotoHistoryToken(appt.getId());
+ }
+ }
+ });
+ dialog.hide();
+ }
+ }
+
+ public void setOpenAfterCreation(final boolean openAfterCreation) {
+ this.openAfterCreation = openAfterCreation;
+ }
}
public static final String CREATE_APP_ADD_ID = "event-add-menu-item-add-btn";
@@ -113,5 +138,6 @@
public EventAddMenuItem(final EventAddAction action, final CalendarOnOverMenu cal) {
super(action);
setParent(cal.get());
+ action.setOpenAfterCreation(false);
}
}
Modified: trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -62,8 +62,9 @@
final Provider<EventAddMenuItem> eventAddMenuItem,
final Provider<EventOpenMenuItem> eventOpenMenuItem, final Provider<CalendarGoPrevBtn> calPrevBtn,
final Provider<EventRemoveMenuItem> eventRemoveMenuItem,
- final Provider<CalendarGoNextBtn> calNextBtn, final CalendarOnOverMenu onOverMenu,
- final Provider<CalendarGoTodayBtn> goToday, final Provider<RefreshContentMenuItem> refresh) {
+ final Provider<ExportCalendarMenuItem> export, final Provider<CalendarGoNextBtn> calNextBtn,
+ final CalendarOnOverMenu onOverMenu, final Provider<CalendarGoTodayBtn> goToday,
+ final Provider<RefreshContentMenuItem> refresh) {
super(session, stateManager, i18n, registry);
actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, addAllMenuItem, contents);
@@ -78,6 +79,7 @@
actionsRegistry.addAction(ActionGroups.TOOLBAR, calMonthBtn, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, calNextBtn, containers);
actionsRegistry.addAction(ActionGroups.TOOLBAR, participateBtn, contents);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, export, all);
actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp, contents);
// On over calendar menu
actionsRegistry.addAction(ActionGroups.TOOLBAR, onOverMenu, containers);
@@ -86,9 +88,9 @@
eventAddMenuItem.get();
eventRemoveMenuItem.get();
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, newMeetingsBtn, containers);
+
// For now, commented:
- // actionsRegistry.addAction(ActionGroups.TOOLBAR, newMeetingsBtn,
- // containers);
// actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem,
// contents);
// actionsRegistry.addAction(ActionGroups.ITEM_MENU, openContentMenuItem,
Added: trunk/src/main/java/cc/kune/events/client/actions/ExportCalendarMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/ExportCalendarMenuItem.java (rev 0)
+++ trunk/src/main/java/cc/kune/events/client/actions/ExportCalendarMenuItem.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -0,0 +1,75 @@
+/*
+ *
+ * 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.events.client.actions;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
+import cc.kune.common.shared.utils.Url;
+import cc.kune.common.shared.utils.UrlParam;
+import cc.kune.core.client.actions.RolAction;
+import cc.kune.core.client.resources.nav.NavResources;
+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.AccessRolDTO;
+import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
+
+import com.google.inject.Inject;
+
+public class ExportCalendarMenuItem extends MenuItemDescriptor {
+
+ public static class ExportCalendarAction extends RolAction {
+ private final I18nTranslationService i18n;
+ private final Session session;
+
+ @Inject
+ public ExportCalendarAction(final Session session, final I18nTranslationService i18n) {
+ super(AccessRolDTO.Editor, false);
+ this.session = session;
+ this.i18n = i18n;
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ final StateToken token = session.getCurrentStateToken().copy().clearDocument();
+ final String url = new Url(session.getSiteUrl() + FileConstants.EVENTSSERVLET, new UrlParam(
+ FileConstants.TOKEN, token.toString())).toString();
+ NotifyUser.info(
+ i18n.t("Calendar exporting"),
+ i18n.t(
+ "Open or use this address in your prefered calendar program for instance in your mobile: [%s]",
+ TextUtils.generateHtmlLink(url, url, true)), ID, true);
+ }
+
+ }
+
+ public static final String ID = "k-export-cal-menuid";
+
+ @Inject
+ public ExportCalendarMenuItem(final I18nTranslationService i18n, final ExportCalendarAction action,
+ final ContentViewerOptionsMenu optionsMenu, final NavResources res) {
+ super(action);
+ this.withText(i18n.t("Export this calendar")).withIcon(res.calendar()).withParent(optionsMenu, false);
+ }
+
+}
Modified: trunk/src/main/java/cc/kune/events/client/actions/NewMeetingBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/NewMeetingBtn.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/events/client/actions/NewMeetingBtn.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -19,22 +19,22 @@
*/
package cc.kune.events.client.actions;
+import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
import cc.kune.common.client.shortcuts.GlobalShortcutRegister;
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.events.shared.EventsConstants;
-import cc.kune.gspace.client.actions.NewContentAction;
-import cc.kune.gspace.client.actions.NewContentBtn;
+import cc.kune.events.client.actions.EventAddMenuItem.EventAddAction;
import com.google.inject.Inject;
-public class NewMeetingBtn extends NewContentBtn {
+public class NewMeetingBtn extends ButtonDescriptor {
@Inject
- public NewMeetingBtn(final I18nTranslationService i18n, final NewContentAction action,
+ public NewMeetingBtn(final I18nTranslationService i18n, final EventAddAction action,
final NavResources res, final GlobalShortcutRegister shorcutReg) {
- super(i18n, action, res.calendarAdd(), shorcutReg, i18n.t("New meeting"),
- i18n.t("Create a New Meeting here"), i18n.t("New meeting"), EventsConstants.TYPE_MEETING);
+ super(i18n.t("New meeting"), action);
+ withIcon(res.calendarAdd()).withToolTip(i18n.t("Create a New Meeting"));
+ action.setOpenAfterCreation(true);
}
}
Modified: trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -22,7 +22,6 @@
import com.bradrydzewski.gwt.calendar.client.Appointment;
import com.bradrydzewski.gwt.calendar.client.Calendar;
import com.bradrydzewski.gwt.calendar.client.CalendarSettings;
-import com.bradrydzewski.gwt.calendar.client.CalendarSettings.Click;
import com.bradrydzewski.gwt.calendar.client.CalendarViews;
import com.bradrydzewski.gwt.calendar.client.event.CreateHandler;
import com.bradrydzewski.gwt.calendar.client.event.DateRequestHandler;
@@ -66,7 +65,8 @@
final CalendarSettings settings = new CalendarSettings();
settings.setIntervalsPerHour(4);
settings.setPixelsPerInterval(10);
- settings.setTimeBlockClickNumber(Click.Single);
+ // With Single is very annoying
+ // settings.setTimeBlockClickNumber(Click.Single);
// settings.setOffsetHourLabels(true);
settings.setScrollToHour(8);
calendar = new Calendar();
Modified: trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPresenter.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPresenter.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -290,14 +290,18 @@
getView().clearAppointments();
getView().suspendLayout();
for (final Map<String, String> map : eventState.getAppointments()) {
- final Appointment app = EventsClientConversionUtil.toApp(map);
- app.setId(map.get(ICalConstants._INTERNAL_ID));
- app.setStyle(AppointmentStyle.GREEN);
- if (isValid(app)) {
- getView().addAppointment(app);
-
- } else {
- Log.error("Appointment is not valid: " + app);
+ Appointment app;
+ try {
+ app = EventsClientConversionUtil.toApp(map);
+ app.setId(map.get(ICalConstants._INTERNAL_ID));
+ app.setStyle(AppointmentStyle.GREEN);
+ if (isValid(app)) {
+ getView().addAppointment(app);
+ } else {
+ Log.error("Appointment is not valid: " + app);
+ }
+ } catch (final Exception e) {
+ Log.error("Appointment is not valid");
}
}
getView().resumeLayout();
Deleted: trunk/src/main/java/cc/kune/events/server/CalendarServerUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/events/server/CalendarServerUtils.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/events/server/CalendarServerUtils.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -1,123 +0,0 @@
-package cc.kune.events.server;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import net.fortuna.ical4j.model.Date;
-import net.fortuna.ical4j.model.DateTime;
-import net.fortuna.ical4j.model.Property;
-import net.fortuna.ical4j.model.TimeZone;
-import net.fortuna.ical4j.model.component.VEvent;
-import net.fortuna.ical4j.model.parameter.Value;
-import net.fortuna.ical4j.model.property.Description;
-import net.fortuna.ical4j.model.property.DtEnd;
-import net.fortuna.ical4j.model.property.DtStart;
-import net.fortuna.ical4j.model.property.Location;
-import net.fortuna.ical4j.model.property.Summary;
-
-import org.waveprotocol.wave.model.waveref.InvalidWaveRefException;
-import org.waveprotocol.wave.util.escapers.jvm.JavaWaverefEncoder;
-
-import cc.kune.common.shared.res.ICalConstants;
-import cc.kune.domain.Container;
-import cc.kune.domain.Content;
-import cc.kune.wave.server.kspecific.KuneWaveService;
-
-import com.bradrydzewski.gwt.calendar.client.Appointment;
-import com.google.inject.Inject;
-import com.google.wave.api.Gadget;
-
-public class CalendarServerUtils {
-
- @Inject
- private static EventsServerTool eventTool;
-
- @Inject
- private static KuneWaveService kuneWaveService;
- private static final Logger LOG = Logger.getLogger(CalendarServerUtils.class.getName());
-
- public static VEvent from(final Appointment app) {
- // final TimeZoneRegistry registry =
- // TimeZoneRegistryFactory.getInstance().createRegistry();
- // final TimeZone timezone = registry.getTimeZone("GMT");
- // final VTimeZone tz = timezone.getVTimeZone();
- // FIXME here v timezone!!!
-
- final DateTime start = new DateTime(app.getStart().getTime());
- final TimeZone timezone = start.getTimeZone();
- // start.setTimeZone(timezone);
- final DateTime end = new DateTime(app.getEnd().getTime());
- // end.setTimeZone(timezone);
- VEvent event;
- if (app.isAllDay()) {
- event = new VEvent();
- final DtStart eventStart = new DtStart(new Date(app.getStart().getTime()));
- eventStart.setTimeZone(timezone);
- event.getProperties().add(eventStart);
- final DtEnd eventEnd = new DtEnd(new Date(app.getEnd().getTime()));
- eventStart.setTimeZone(timezone);
- event.getProperties().add(eventEnd);
- event.getProperties().getProperty(Property.DTSTART).getParameters().add(Value.DATE);
- event.getProperties().getProperty(Property.DTEND).getParameters().add(Value.DATE);
- } else {
- event = new VEvent(start, end, app.getTitle());
- event.getProperties().getProperty(Property.DTSTART).getParameters().add(Value.DATE_TIME);
- event.getProperties().getProperty(Property.DTEND).getParameters().add(Value.DATE_TIME);
- }
- event.getProperties().add(new Summary(app.getTitle()));
- event.getProperties().add(new Description(app.getDescription()));
- event.getProperties().add(new Location(app.getLocation()));
- // FIXME uid
- // event.getProperties().add( new UidGenerator()app.getId()));
- return event;
- }
-
- public static List<Map<String, String>> getAppointments(final Container container) {
- final List<Map<String, String>> list = new ArrayList<Map<String, String>>();
- for (final Content content : container.getContents()) {
- final String waveId = content.getWaveId();
- try {
- final Gadget gadget = kuneWaveService.getGadget(
- JavaWaverefEncoder.decodeWaveRefFromPath(waveId),
- content.getAuthors().get(0).getShortName(), eventTool.getGadgetUrl());
- final Map<String, String> gadgetProps = gadget.getProperties();
- final HashMap<String, String> map = new HashMap<String, String>();
- for (final String var : ICalConstants.TOTAL_LIST) {
- final String value = gadgetProps.get(var);
- if (value != null) {
- map.put(var, value);
- }
- }
- map.put(ICalConstants._INTERNAL_ID, content.getStateToken().toString());
- list.add(map);
- } catch (final InvalidWaveRefException e) {
- LOG.log(Level.SEVERE, "Invalid Waveref", e);
- }
- }
- return list;
- }
-
- public static Appointment to(final VEvent event) {
- final Appointment app = new Appointment();
-
- // FIXME: see spec
- app.setDescription(event.getDescription().getValue());
- app.setStart(new java.util.Date(event.getStartDate().getDate().getTime()));
- app.setEnd(new java.util.Date(event.getEndDate().getDate().getTime()));
-
- // FIXME: see spec
- app.setLocation(event.getLocation().getValue());
- // final Uid uid = event.getUid();
- // if (uid != null) {
- // app.setId(uid.getValue());
- // }
- app.setAllDay(!(event.getStartDate().getDate() instanceof DateTime));
- app.setTitle(event.getSummary().getValue());
- return app;
- }
-
-}
Added: trunk/src/main/java/cc/kune/events/server/EventsServlet.java
===================================================================
--- trunk/src/main/java/cc/kune/events/server/EventsServlet.java (rev 0)
+++ trunk/src/main/java/cc/kune/events/server/EventsServlet.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -0,0 +1,110 @@
+package cc.kune.events.server;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+
+import javax.servlet.ServletException;
+import javax.servlet.http.HttpServlet;
+import javax.servlet.http.HttpServletRequest;
+import javax.servlet.http.HttpServletResponse;
+
+import net.fortuna.ical4j.data.CalendarOutputter;
+import net.fortuna.ical4j.model.Calendar;
+import net.fortuna.ical4j.model.ValidationException;
+import net.fortuna.ical4j.model.component.VEvent;
+import net.fortuna.ical4j.model.property.CalScale;
+import net.fortuna.ical4j.model.property.ProdId;
+import net.fortuna.ical4j.model.property.Version;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import cc.kune.core.client.errors.ContentNotFoundException;
+import cc.kune.core.server.auth.ActionLevel;
+import cc.kune.core.server.auth.Authenticated;
+import cc.kune.core.server.auth.Authorizated;
+import cc.kune.core.server.content.ContainerManager;
+import cc.kune.core.server.content.ContentUtils;
+import cc.kune.core.server.manager.file.FileDownloadManagerUtils;
+import cc.kune.core.server.manager.file.FileUtils;
+import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.shared.FileConstants;
+import cc.kune.core.shared.domain.AccessRol;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.domain.Container;
+import cc.kune.events.server.utils.EventsServerConversionUtil;
+import cc.kune.events.shared.EventsConstants;
+
+import com.google.inject.Inject;
+
+public class EventsServlet extends HttpServlet {
+ private static final Log LOG = LogFactory.getLog(EventsServlet.class);
+ private static final long serialVersionUID = -5559665146847701343L;
+
+ @Inject
+ ContainerManager containerManager;
+ @Inject
+ FileUtils fileUtils;
+ @Inject
+ KuneProperties kuneProperties;
+
+ @SuppressWarnings("unchecked")
+ @Override
+ protected void doGet(final HttpServletRequest req, final HttpServletResponse resp)
+ throws ServletException, IOException {
+
+ final String userHash = req.getParameter(FileConstants.HASH);
+ final StateToken token = new StateToken(req.getParameter(FileConstants.TOKEN));
+
+ final Calendar calendar = new Calendar();
+ calendar.getProperties().add(new ProdId("-//Ben Fortuna//iCal4j 1.0//EN"));
+ calendar.getProperties().add(Version.VERSION_2_0);
+ calendar.getProperties().add(CalScale.GREGORIAN);
+ final List<VEvent> events = new ArrayList<VEvent>();
+
+ try {
+ final Container cnt = getContainer(userHash, token);
+ if (cnt.getTypeId().equals(EventsConstants.TYPE_ROOT)) {
+ final List<Map<String, String>> listOfProps = EventsServerConversionUtil.getAppointments(cnt);
+ for (final Map<String, String> props : listOfProps) {
+ try {
+ final VEvent vEvent = EventsServerConversionUtil.toVEvent(EventsServerConversionUtil.toApp(props));
+ events.add(vEvent);
+ } catch (final Exception e) {
+ LOG.warn("Invalid appointments in " + token, e);
+ }
+ }
+ } else {
+ return404(resp);
+ return;
+ }
+ calendar.getComponents().addAll(events);
+ resp.setContentType("text/calendar");
+ final OutputStream out = resp.getOutputStream();
+ final CalendarOutputter outputter = new CalendarOutputter();
+ outputter.output(calendar, out);
+
+ } catch (final ContentNotFoundException e) {
+ return404(resp);
+ return;
+ } catch (final ValidationException e) {
+ LOG.warn("Invalid calendar conversion in " + token, e);
+ }
+
+ }
+
+ @Authenticated(mandatory = false)
+ @Authorizated(accessRolRequired = AccessRol.Viewer, actionLevel = ActionLevel.container)
+ private Container getContainer(final String userHash, final StateToken stateToken)
+ throws ContentNotFoundException {
+ return containerManager.find(ContentUtils.parseId(stateToken.getFolder()));
+ }
+
+ private void return404(final HttpServletResponse resp) throws IOException {
+ FileDownloadManagerUtils.returnNotFound404(resp);
+ }
+
+}
Added: trunk/src/main/java/cc/kune/events/server/utils/DateUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/events/server/utils/DateUtils.java (rev 0)
+++ trunk/src/main/java/cc/kune/events/server/utils/DateUtils.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -0,0 +1,27 @@
+package cc.kune.events.server.utils;
+
+import java.text.ParseException;
+import java.text.SimpleDateFormat;
+import java.util.Date;
+
+import cc.kune.common.shared.utils.DateFormatConstants;
+
+public class DateUtils {
+
+ private static final SimpleDateFormat FORMATTER = new SimpleDateFormat(
+ DateFormatConstants.DATE_EXPORT_FORMAT);
+ public static final String TIMEZONE_REGEXP = "(.*)\\:([0-9][0-9])$";
+
+ public static Date toDate(final String date) throws ParseException {
+ try {
+ return FORMATTER.parse(date);
+ } catch (final ParseException e) {
+ return FORMATTER.parse(date.replaceFirst(TIMEZONE_REGEXP, "$1$2"));
+ }
+ }
+
+ public static String toString(final Date date) {
+ return FORMATTER.format(date);
+ }
+
+}
Added: trunk/src/main/java/cc/kune/events/server/utils/DateUtilsTest.java
===================================================================
--- trunk/src/main/java/cc/kune/events/server/utils/DateUtilsTest.java (rev 0)
+++ trunk/src/main/java/cc/kune/events/server/utils/DateUtilsTest.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -0,0 +1,23 @@
+package cc.kune.events.server.utils;
+
+import static org.junit.Assert.assertEquals;
+
+import java.text.ParseException;
+
+import org.junit.Test;
+
+public class DateUtilsTest {
+
+ private static final String SAMPLE = "2012-03-05T00:00:00.000+0100";
+ private static final String SAMPLE2 = "2012-03-05T00:00:00.000+01:00";
+
+ @Test
+ public void basicTest() throws ParseException {
+
+ DateUtils.toDate(SAMPLE);
+ DateUtils.toDate(SAMPLE2);
+
+ // Difference from GWT timezone and SimpleDate
+ assertEquals("foo+0100", "foo+01:00".replaceFirst(DateUtils.TIMEZONE_REGEXP, "$1$2"));
+ }
+}
Added: trunk/src/main/java/cc/kune/events/server/utils/EventsServerConversionUtil.java
===================================================================
--- trunk/src/main/java/cc/kune/events/server/utils/EventsServerConversionUtil.java (rev 0)
+++ trunk/src/main/java/cc/kune/events/server/utils/EventsServerConversionUtil.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -0,0 +1,154 @@
+package cc.kune.events.server.utils;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.logging.Level;
+import java.util.logging.Logger;
+
+import net.fortuna.ical4j.model.Date;
+import net.fortuna.ical4j.model.DateTime;
+import net.fortuna.ical4j.model.Property;
+import net.fortuna.ical4j.model.TimeZone;
+import net.fortuna.ical4j.model.component.VEvent;
+import net.fortuna.ical4j.model.parameter.Value;
+import net.fortuna.ical4j.model.property.Description;
+import net.fortuna.ical4j.model.property.DtEnd;
+import net.fortuna.ical4j.model.property.DtStart;
+import net.fortuna.ical4j.model.property.Location;
+import net.fortuna.ical4j.model.property.Summary;
+import net.fortuna.ical4j.model.property.Uid;
+
+import org.waveprotocol.wave.model.waveref.InvalidWaveRefException;
+import org.waveprotocol.wave.util.escapers.jvm.JavaWaverefEncoder;
+
+import cc.kune.common.shared.res.ICalConstants;
+import cc.kune.domain.Container;
+import cc.kune.domain.Content;
+import cc.kune.events.server.EventsServerTool;
+import cc.kune.events.shared.EventsSharedConversionUtil;
+import cc.kune.wave.server.kspecific.KuneWaveService;
+
+import com.bradrydzewski.gwt.calendar.client.Appointment;
+import com.google.inject.Inject;
+import com.google.wave.api.Gadget;
+
+/**
+ * The Class EventsConversionUtil is used to convert Appointments to Gadgets
+ * properties and viceversa
+ */
+public class EventsServerConversionUtil extends EventsSharedConversionUtil {
+
+ @Inject
+ private static EventsServerTool eventTool;
+
+ @Inject
+ private static KuneWaveService kuneWaveService;
+
+ private static final Logger LOG = Logger.getLogger(EventsServerConversionUtil.class.getName());
+
+ public static List<Map<String, String>> getAppointments(final Container container) {
+ final List<Map<String, String>> list = new ArrayList<Map<String, String>>();
+ assert eventTool != null;
+ for (final Content content : container.getContents()) {
+ final String waveId = content.getWaveId();
+ try {
+ final String shortName = content.getAuthors().get(0).getShortName();
+ final Gadget gadget = kuneWaveService.getGadget(
+ JavaWaverefEncoder.decodeWaveRefFromPath(waveId), shortName, eventTool.getGadgetUrl());
+ final Map<String, String> gadgetProps = gadget.getProperties();
+ final HashMap<String, String> map = new HashMap<String, String>();
+ for (final String var : ICalConstants.ZTOTAL_LIST) {
+ final String value = gadgetProps.get(var);
+ if (value != null) {
+ map.put(var, value);
+ }
+ }
+ map.put(ICalConstants.UID, content.getStateToken().toString());
+ map.put(ICalConstants._INTERNAL_ID, content.getStateToken().toString());
+ list.add(map);
+ } catch (final InvalidWaveRefException e) {
+ LOG.log(Level.SEVERE, "Invalid Waveref", e);
+ }
+ }
+ return list;
+ }
+
+ public static Appointment to(final VEvent event) {
+ // http://build.mnode.org/projects/ical4j/apidocs/
+ final Appointment app = new Appointment();
+ // FIXME: see spec
+ app.setDescription(event.getDescription().getValue());
+ app.setStart(new java.util.Date(event.getStartDate().getDate().getTime()));
+ app.setEnd(new java.util.Date(event.getEndDate().getDate().getTime()));
+
+ // FIXME: see spec
+ app.setLocation(event.getLocation().getValue());
+ final Uid uid = event.getUid();
+ if (uid != null) {
+ app.setId(uid.getValue());
+ }
+ app.setAllDay(!(event.getStartDate().getDate() instanceof DateTime));
+ app.setTitle(event.getSummary().getValue());
+ return app;
+ }
+
+ public static Appointment toApp(final Map<String, String> properties) throws Exception {
+ final Appointment app = EventsSharedConversionUtil.toApp(properties);
+ final String start = properties.get(ICalConstants.DATE_TIME_START);
+ if (start != null) {
+ app.setStart(DateUtils.toDate(start));
+ }
+ final String end = properties.get(ICalConstants.DATE_TIME_END);
+ if (end != null) {
+ app.setEnd(DateUtils.toDate(end));
+ }
+ return app;
+ }
+
+ public static Map<String, String> toMap(final Appointment app) {
+ final Map<String, String> properties = EventsSharedConversionUtil.toMap(app);
+ properties.put(ICalConstants.DATE_TIME_START, DateUtils.toString(app.getStart()));
+ properties.put(ICalConstants.DATE_TIME_END, DateUtils.toString(app.getEnd()));
+ return properties;
+ }
+
+ public static VEvent toVEvent(final Appointment app) {
+ // http://build.mnode.org/projects/ical4j/apidocs/
+
+ // final TimeZoneRegistry registry =
+ // TimeZoneRegistryFactory.getInstance().createRegistry();
+ // final TimeZone timezone = registry.getTimeZone("GMT");
+ // final VTimeZone tz = timezone.getVTimeZone();
+ // FIXME here v timezone!!!
+
+ final DateTime start = new DateTime(app.getStart().getTime());
+ final TimeZone timezone = start.getTimeZone();
+ // start.setTimeZone(timezone);
+ final DateTime end = new DateTime(app.getEnd().getTime());
+ // end.setTimeZone(timezone);
+ VEvent event;
+ if (app.isAllDay()) {
+ event = new VEvent();
+ event.getProperties().add(new Summary(app.getTitle()));
+ final DtStart eventStart = new DtStart(new Date(app.getStart().getTime()));
+ eventStart.setTimeZone(timezone);
+ event.getProperties().add(eventStart);
+ final DtEnd eventEnd = new DtEnd(new Date(app.getEnd().getTime()));
+ eventEnd.setTimeZone(timezone);
+ event.getProperties().add(eventEnd);
+ // event.getProperties().getProperty(Property.DTSTART).getParameters().add(Value.DATE);
+ // event.getProperties().getProperty(Property.DTEND).getParameters().add(Value.DATE);
+ } else {
+ event = new VEvent(start, end, app.getTitle());
+ event.getProperties().getProperty(Property.DTSTART).getParameters().add(Value.DATE_TIME);
+ event.getProperties().getProperty(Property.DTEND).getParameters().add(Value.DATE_TIME);
+ }
+ event.getProperties().add(new Description(app.getDescription()));
+ event.getProperties().add(new Location(app.getLocation()));
+ event.getProperties().add(new Uid(app.getId()));
+ return event;
+ }
+
+}
Modified: trunk/src/main/java/cc/kune/events/shared/EventsClientConversionUtil.java
===================================================================
--- trunk/src/main/java/cc/kune/events/shared/EventsClientConversionUtil.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/events/shared/EventsClientConversionUtil.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -13,7 +13,7 @@
*/
public class EventsClientConversionUtil extends EventsSharedConversionUtil {
- public static Appointment toApp(final Map<String, String> properties) {
+ public static Appointment toApp(final Map<String, String> properties) throws Exception {
final Appointment app = EventsSharedConversionUtil.toApp(properties);
final String start = properties.get(ICalConstants.DATE_TIME_START);
if (start != null) {
@@ -23,9 +23,6 @@
if (end != null) {
app.setEnd(DateUtils.toDate(end));
}
- String allDay = properties.get(ICalConstants._ALL_DAY);
- if (allDay != null)
- app.setAllDay(Boolean.parseBoolean(allDay));
return app;
}
@@ -33,7 +30,6 @@
final Map<String, String> properties = EventsSharedConversionUtil.toMap(app);
properties.put(ICalConstants.DATE_TIME_START, DateUtils.toString(app.getStart()));
properties.put(ICalConstants.DATE_TIME_END, DateUtils.toString(app.getEnd()));
- properties.put(ICalConstants._ALL_DAY, Boolean.toString(app.isAllDay()));
return properties;
}
Modified: trunk/src/main/java/cc/kune/events/shared/EventsSharedConversionUtil.java
===================================================================
--- trunk/src/main/java/cc/kune/events/shared/EventsSharedConversionUtil.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/events/shared/EventsSharedConversionUtil.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -13,12 +13,17 @@
*/
public abstract class EventsSharedConversionUtil {
- public static Appointment toApp(final Map<String, String> properties) {
+ public static Appointment toApp(final Map<String, String> properties) throws Exception {
final Appointment app = new Appointment();
app.setDescription(properties.get(ICalConstants.DESCRIPTION));
app.setTitle(properties.get(ICalConstants.SUMMARY));
app.setLocation(properties.get(ICalConstants.LOCATION));
app.setCreatedBy(properties.get(ICalConstants.ORGANIZER));
+ final String allDay = properties.get(ICalConstants._ALL_DAY);
+ app.setId(properties.get(ICalConstants.UID));
+ if (allDay != null) {
+ app.setAllDay(Boolean.parseBoolean(allDay));
+ }
return app;
}
@@ -28,6 +33,8 @@
properties.put(ICalConstants.DESCRIPTION, app.getDescription());
properties.put(ICalConstants.LOCATION, app.getLocation());
properties.put(ICalConstants.ORGANIZER, app.getCreatedBy());
+ properties.put(ICalConstants._ALL_DAY, Boolean.toString(app.isAllDay()));
+ properties.put(ICalConstants.UID, app.getId());
return properties;
}
Modified: trunk/src/main/java/cc/kune/lists/client/actions/NewListAction.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/client/actions/NewListAction.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/lists/client/actions/NewListAction.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -23,6 +23,7 @@
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.ui.dialogs.PromptTopDialog.OnEnter;
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.actions.RolAction;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
@@ -49,6 +50,7 @@
public static final String TEXTBOX_ID = "k-nla-textbox";
private final ContentCache cache;
+ private PromptTopDialog diag;
private final FolderViewerPresenter folderViewer;
private final I18nTranslationService i18n;
private final Provider<ListsServiceAsync> listsService;
@@ -71,11 +73,16 @@
@Override
public void actionPerformed(final ActionEvent event) {
final Builder builder = new PromptTopDialog.Builder(ID, i18n.t("Name of the new list?"), false,
- true, i18n.getDirection());
+ true, i18n.getDirection(), new OnEnter() {
+ @Override
+ public void onEnter() {
+ doAction();
+ }
+ });
builder.width("300px").height("50px").firstButtonTitle(i18n.t("Create")).sndButtonTitle(
i18n.t("Cancel")).firstButtonId(CREATE_ID).sndButtonId(CANCEL_ID).width(270);
builder.textboxId(TEXTBOX_ID);
- final PromptTopDialog diag = builder.build();
+ diag = builder.build();
diag.showCentered();
diag.focusOnTextBox();
diag.getSecondBtn().addClickHandler(new ClickHandler() {
@@ -85,28 +92,33 @@
}
});
diag.getFirstBtn().addClickHandler(new ClickHandler() {
+
@Override
public void onClick(final ClickEvent event) {
- if (diag.isValid()) {
- NotifyUser.showProgress();
- diag.hide();
- listsService.get().createList(session.getUserHash(), session.getCurrentStateToken(),
- diag.getTextFieldValue(), ListsConstants.TYPE_LIST, true,
- new AsyncCallbackSimple<StateContainerDTO>() {
- @Override
- public void onSuccess(final StateContainerDTO state) {
- stateManager.setRetrievedStateAndGo(state);
- NotifyUser.hideProgress();
-
- NotifyUser.info(i18n.t("List created"));
- folderViewer.highlightTitle();
- }
- });
- cache.remove(session.getCurrentStateToken());
- }
+ doAction();
}
});
}
+ private void doAction() {
+ if (diag.isValid()) {
+ NotifyUser.showProgress();
+ diag.hide();
+ listsService.get().createList(session.getUserHash(), session.getCurrentStateToken(),
+ diag.getTextFieldValue(), ListsConstants.TYPE_LIST, true,
+ new AsyncCallbackSimple<StateContainerDTO>() {
+ @Override
+ public void onSuccess(final StateContainerDTO state) {
+ stateManager.setRetrievedStateAndGo(state);
+ NotifyUser.hideProgress();
+
+ NotifyUser.info(i18n.t("List created"));
+ folderViewer.highlightTitle();
+ }
+ });
+ cache.remove(session.getCurrentStateToken());
+ }
+ }
+
}
Modified: trunk/src/main/java/cc/kune/lists/client/actions/NewListPostAction.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/client/actions/NewListPostAction.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/main/java/cc/kune/lists/client/actions/NewListPostAction.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -24,6 +24,7 @@
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.ui.dialogs.PromptTopDialog.OnEnter;
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.actions.RolAction;
import cc.kune.core.client.auth.SignIn;
@@ -52,6 +53,7 @@
public static final String TEXTBOX_ID = "k-nlistpa-textbox";
private final ContentCache cache;
+ private PromptTopDialog diag;
private final FolderViewerPresenter folderViewer;
private final I18nTranslationService i18n;
private final Provider<ListsServiceAsync> listsService;
@@ -77,11 +79,16 @@
public void actionPerformed(final ActionEvent event) {
if (session.isLogged()) {
final Builder builder = new PromptTopDialog.Builder(ID, i18n.t("Title of the new post?"), false,
- true, i18n.getDirection());
+ true, i18n.getDirection(), new OnEnter() {
+ @Override
+ public void onEnter() {
+ doAction();
+ }
+ });
builder.width("300px").height("50px").firstButtonTitle(i18n.t("Post")).sndButtonTitle(
i18n.t("Cancel")).firstButtonId(CREATE_ID).sndButtonId(CANCEL_ID).width(270);
builder.textboxId(TEXTBOX_ID);
- final PromptTopDialog diag = builder.build();
+ diag = builder.build();
diag.showCentered();
diag.focusOnTextBox();
diag.getSecondBtn().addClickHandler(new ClickHandler() {
@@ -93,22 +100,7 @@
diag.getFirstBtn().addClickHandler(new ClickHandler() {
@Override
public void onClick(final ClickEvent event) {
- if (diag.isValid()) {
- NotifyUser.showProgress();
- diag.hide();
- listsService.get().newPost(session.getUserHash(),
- session.getCurrentStateToken().copy().clearDocument(), diag.getTextFieldValue(),
- new AsyncCallbackSimple<StateContentDTO>() {
- @Override
- public void onSuccess(final StateContentDTO state) {
- stateManager.setRetrievedStateAndGo(state);
- NotifyUser.hideProgress();
- NotifyUser.info(i18n.t("Post created. Edit it"));
- folderViewer.highlightTitle();
- }
- });
- cache.remove(session.getCurrentStateToken());
- }
+ doAction();
}
});
} else {
@@ -119,4 +111,23 @@
}
}
+ private void doAction() {
+ if (diag.isValid()) {
+ NotifyUser.showProgress();
+ diag.hide();
+ listsService.get().newPost(session.getUserHash(),
+ session.getCurrentStateToken().copy().clearDocument(), diag.getTextFieldValue(),
+ new AsyncCallbackSimple<StateContentDTO>() {
+ @Override
+ public void onSuccess(final StateContentDTO state) {
+ stateManager.setRetrievedStateAndGo(state);
+ NotifyUser.hideProgress();
+ NotifyUser.info(i18n.t("Post created. Edit it"));
+ folderViewer.highlightTitle();
+ }
+ });
+ cache.remove(session.getCurrentStateToken());
+ }
+ }
+
}
Deleted: trunk/src/test/java/cc/kune/events/server/CalendarServerUtilsTest.java
===================================================================
--- trunk/src/test/java/cc/kune/events/server/CalendarServerUtilsTest.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/test/java/cc/kune/events/server/CalendarServerUtilsTest.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -1,65 +0,0 @@
-package cc.kune.events.server;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import java.util.Date;
-
-import net.fortuna.ical4j.model.DateTime;
-import net.fortuna.ical4j.model.component.VEvent;
-
-import org.junit.Ignore;
-import org.junit.Test;
-
-import cc.kune.events.shared.BasicCalendarTest;
-
-import com.bradrydzewski.gwt.calendar.client.Appointment;
-
-public class CalendarServerUtilsTest extends BasicCalendarTest {
-
- private void checkConversionFromAndTo(final Appointment initialApp, final boolean allDay) {
- final VEvent vevent = CalendarServerUtils.from(initialApp);
- assertEquals(initialApp.getDescription(), vevent.getDescription().getValue());
- assertEquals(initialApp.getTitle(), vevent.getSummary().getValue());
- if (allDay) {
- final Date start = initialApp.getStart();
- start.setHours(0);
- start.setMinutes(0);
- start.setSeconds(0);
- assertEquals(start, new Date(vevent.getStartDate().getDate().getTime()));
- assertEquals(initialApp.getEnd(), vevent.getEndDate().getDate());
- } else {
- assertEquals(initialApp.getStart().getTime(), vevent.getStartDate().getDate().getTime());
- assertEquals(initialApp.getEnd().getTime(), vevent.getEndDate().getDate().getTime());
- }
- assertEquals(allDay, initialApp.isAllDay());
- assertEquals(allDay, !(vevent.getStartDate().getDate() instanceof DateTime));
- // final Uid uid = vevent.getUid();
- // assertEquals(initialApp.getId(), uid != null ? uid.getValue() : null);
- final Appointment reconvertedApp = CalendarServerUtils.to(vevent);
- assertEquals(initialApp.getTitle(), reconvertedApp.getTitle());
- assertEquals(initialApp.getDescription(), reconvertedApp.getDescription());
- // assertEquals(initialApp.getId(), endApp.getId());
- assertEquals(allDay, reconvertedApp.isAllDay());
- assertEquals(initialApp.getStart().getTime(), reconvertedApp.getStart().getTime());
- assertEquals(initialApp.getEnd().getTime(), reconvertedApp.getEnd().getTime());
- assertTrue(initialApp.compareTo(reconvertedApp) == 0);
- }
-
- @Test
- public void testFromToFrom() {
- final boolean allDay = false;
- final Appointment initialApp = createAppointment(allDay);
- initialApp.setAllDay(allDay);
- checkConversionFromAndTo(initialApp, allDay);
- }
-
- @Ignore
- @Test
- public void testFromToFromAllDay() {
- final boolean allDay = true;
- final Appointment initialApp = createAppointment(allDay);
- checkConversionFromAndTo(initialApp, allDay);
- }
-
-}
Copied: trunk/src/test/java/cc/kune/events/server/utils/BasicCalendarTest.java (from rev 1747, trunk/src/test/java/cc/kune/events/shared/BasicCalendarTest.java)
===================================================================
--- trunk/src/test/java/cc/kune/events/server/utils/BasicCalendarTest.java (rev 0)
+++ trunk/src/test/java/cc/kune/events/server/utils/BasicCalendarTest.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -0,0 +1,41 @@
+package cc.kune.events.server.utils;
+
+import net.fortuna.ical4j.model.Calendar;
+import net.fortuna.ical4j.model.Date;
+import net.fortuna.ical4j.model.property.CalScale;
+import net.fortuna.ical4j.model.property.ProdId;
+import net.fortuna.ical4j.model.property.Version;
+import net.fortuna.ical4j.util.Dates;
+
+import com.bradrydzewski.gwt.calendar.client.Appointment;
+
+public class BasicCalendarTest {
+
+ protected static final String DESCRIPTION = "some description";
+ protected static final String ID = "some id";
+ protected static final String TITLE = "some title";
+
+ protected Appointment createAppointment(final boolean allDay) {
+ final Appointment initialApp = new Appointment();
+ initialApp.setTitle(TITLE);
+ initialApp.setDescription(DESCRIPTION);
+ initialApp.setStart(getNow());
+ initialApp.setEnd(getNow());
+ initialApp.setId(ID);
+ initialApp.setAllDay(allDay);
+ return initialApp;
+ }
+
+ protected Calendar createCal() {
+ final Calendar calendar = new Calendar();
+ calendar.getProperties().add(new ProdId("-//Ben Fortuna//iCal4j 1.0//EN"));
+ calendar.getProperties().add(Version.VERSION_2_0);
+ calendar.getProperties().add(CalScale.GREGORIAN);
+ return calendar;
+ }
+
+ protected Date getNow() {
+ final Date date = new Date(Dates.getCurrentTimeRounded());
+ return date;
+ }
+}
Copied: trunk/src/test/java/cc/kune/events/server/utils/EventsServerConversionUtilTest.java (from rev 1747, trunk/src/test/java/cc/kune/events/shared/EventsServerConversionUtilTest.java)
===================================================================
--- trunk/src/test/java/cc/kune/events/server/utils/EventsServerConversionUtilTest.java (rev 0)
+++ trunk/src/test/java/cc/kune/events/server/utils/EventsServerConversionUtilTest.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -0,0 +1,106 @@
+package cc.kune.events.server.utils;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.io.OutputStream;
+import java.util.Date;
+import java.util.Map;
+
+import net.fortuna.ical4j.data.CalendarOutputter;
+import net.fortuna.ical4j.model.Calendar;
+import net.fortuna.ical4j.model.DateTime;
+import net.fortuna.ical4j.model.ValidationException;
+import net.fortuna.ical4j.model.component.VEvent;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+import com.bradrydzewski.gwt.calendar.client.Appointment;
+
+public class EventsServerConversionUtilTest extends BasicCalendarTest {
+ protected static final String DESCRIPTION = "some description";
+ protected static final String ID = "some id";
+ protected static final String TITLE = "some title";
+
+ @SuppressWarnings("deprecation")
+ private void checkConversionFromAndTo(final Appointment initialApp, final boolean allDay)
+ throws IOException, ValidationException {
+ final VEvent vevent = EventsServerConversionUtil.toVEvent(initialApp);
+ assertEquals(initialApp.getDescription(), vevent.getDescription().getValue());
+ assertEquals(initialApp.getTitle(), vevent.getSummary().getValue());
+ if (allDay) {
+ final Date start = initialApp.getStart();
+ start.setHours(0);
+ start.setMinutes(0);
+ start.setSeconds(0);
+ assertEquals(start, new Date(vevent.getStartDate().getDate().getTime()));
+ assertEquals(initialApp.getEnd(), vevent.getEndDate().getDate());
+ } else {
+ assertEquals(initialApp.getStart().getTime(), vevent.getStartDate().getDate().getTime());
+ assertEquals(initialApp.getEnd().getTime(), vevent.getEndDate().getDate().getTime());
+ }
+ assertEquals(allDay, initialApp.isAllDay());
+ assertEquals(allDay, !(vevent.getStartDate().getDate() instanceof DateTime));
+ assertEquals(initialApp.getId(), vevent.getUid().getValue());
+ final Calendar cal = createCal();
+ cal.getComponents().add(vevent);
+
+ final OutputStream out = System.out;
+ final CalendarOutputter outputter = new CalendarOutputter();
+ outputter.output(cal, out);
+
+ final Appointment reconvertedApp = EventsServerConversionUtil.to(vevent);
+ assertEquals(initialApp.getTitle(), reconvertedApp.getTitle());
+ assertEquals(initialApp.getDescription(), reconvertedApp.getDescription());
+ assertEquals(initialApp.getId(), reconvertedApp.getId());
+ assertEquals(allDay, reconvertedApp.isAllDay());
+ assertEquals(initialApp.getStart().getTime(), reconvertedApp.getStart().getTime());
+ assertEquals(initialApp.getEnd().getTime(), reconvertedApp.getEnd().getTime());
+ assertTrue(initialApp.compareTo(reconvertedApp) == 0);
+ }
+
+ private void convertAndTest(final Appointment app, final boolean allDay) throws Exception {
+ final Map<String, String> map = EventsServerConversionUtil.toMap(app);
+ final Appointment appReConverted = EventsServerConversionUtil.toApp(map);
+ assertEquals(app.getStart(), appReConverted.getStart());
+ assertEquals(app.getEnd(), appReConverted.getEnd());
+ assertEquals(app.isAllDay(), appReConverted.isAllDay());
+ assertEquals(allDay, appReConverted.isAllDay());
+ assertEquals(app.getDescription(), appReConverted.getDescription());
+ assertEquals(app.getTitle(), appReConverted.getTitle());
+ assertEquals(app.getLocation(), appReConverted.getLocation());
+ assertEquals(app.getCreatedBy(), appReConverted.getCreatedBy());
+ assertEquals(app.getId(), appReConverted.getId());
+ }
+
+ @Test
+ public void testAllDay() throws Exception {
+ final Appointment app = createAppointment(true);
+ convertAndTest(app, true);
+ }
+
+ @Test
+ public void testFromToFrom() throws IOException, ValidationException {
+ final boolean allDay = false;
+ final Appointment initialApp = createAppointment(allDay);
+ initialApp.setAllDay(allDay);
+ checkConversionFromAndTo(initialApp, allDay);
+ }
+
+ @Ignore
+ @Test
+ public void testFromToFromAllDay() throws IOException, ValidationException {
+ final boolean allDay = true;
+ final Appointment initialApp = createAppointment(allDay);
+ checkConversionFromAndTo(initialApp, allDay);
+ }
+
+ @Test
+ public void testToMap() throws Exception {
+ final Appointment app = createAppointment(false);
+ convertAndTest(app, false);
+ }
+
+}
Deleted: trunk/src/test/java/cc/kune/events/shared/BasicCalendarTest.java
===================================================================
--- trunk/src/test/java/cc/kune/events/shared/BasicCalendarTest.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/test/java/cc/kune/events/shared/BasicCalendarTest.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -1,30 +0,0 @@
-package cc.kune.events.shared;
-
-import net.fortuna.ical4j.model.Date;
-import net.fortuna.ical4j.util.Dates;
-
-import com.bradrydzewski.gwt.calendar.client.Appointment;
-
-public class BasicCalendarTest {
-
- protected static final String DESCRIPTION = "some description";
- protected static final String ID = "some id";
- protected static final String TITLE = "some title";
-
- protected Appointment createAppointment(final boolean allDay) {
- final Appointment initialApp = new Appointment();
- initialApp.setTitle(TITLE);
- initialApp.setDescription(DESCRIPTION);
- initialApp.setStart(getNow());
- initialApp.setEnd(getNow());
- initialApp.setId(ID);
- initialApp.setAllDay(allDay);
- return initialApp;
- }
-
- protected Date getNow() {
- final Date date = new Date(Dates.getCurrentTimeRounded());
- return date;
- }
-
-}
Deleted: trunk/src/test/java/cc/kune/events/shared/EventsServerConversionUtilTest.java
===================================================================
--- trunk/src/test/java/cc/kune/events/shared/EventsServerConversionUtilTest.java 2012-03-08 16:07:23 UTC (rev 1749)
+++ trunk/src/test/java/cc/kune/events/shared/EventsServerConversionUtilTest.java 2012-03-09 01:22:13 UTC (rev 1750)
@@ -1,28 +0,0 @@
-package cc.kune.events.shared;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.Map;
-
-import org.junit.Test;
-
-import com.bradrydzewski.gwt.calendar.client.Appointment;
-import com.google.gwt.editor.client.Editor.Ignore;
-
-public class EventsServerConversionUtilTest extends BasicCalendarTest {
-
- @Test
- @Ignore
- public void testToMap() {
- final Appointment app = createAppointment(false);
- final Map<String, String> map = EventsClientConversionUtil.toMap(app);
- final Appointment appReConverted = EventsClientConversionUtil.toApp(map);
- assertEquals(app.getStart(), appReConverted.getStart());
- assertEquals(app.getEnd(), appReConverted.getEnd());
- assertEquals(app.getDescription(), appReConverted.getDescription());
- assertEquals(app.getTitle(), appReConverted.getTitle());
- assertEquals(app.getLocation(), appReConverted.getLocation());
- assertEquals(app.getCreatedBy(), appReConverted.getCreatedBy());
- }
-
-}
1
0
r1749 - in trunk: img/icons/custom-iconic src/main/java/cc/kune/common/client/resources src/main/java/cc/kune/core/client/resources src/main/resources/icons
by Vicente J. Ruiz Jurado 08 Mar '12
by Vicente J. Ruiz Jurado 08 Mar '12
08 Mar '12
Author: vjrj_
Date: 2012-03-08 17:07:23 +0100 (Thu, 08 Mar 2012)
New Revision: 1749
Added:
trunk/src/main/resources/icons/edit-black.png
trunk/src/main/resources/icons/edit-gray_dark.png
trunk/src/main/resources/icons/edit-white.png
trunk/src/main/resources/icons/location-black.png
trunk/src/main/resources/icons/location-grey.png
trunk/src/main/resources/icons/location-white.png
Modified:
trunk/img/icons/custom-iconic/location.svg
trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java
trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java
Log:
More icons
Modified: trunk/img/icons/custom-iconic/location.svg
===================================================================
--- trunk/img/icons/custom-iconic/location.svg 2012-03-08 15:05:45 UTC (rev 1748)
+++ trunk/img/icons/custom-iconic/location.svg 2012-03-08 16:07:23 UTC (rev 1749)
@@ -18,7 +18,10 @@
viewBox="0 0 31.999999 32"
xml:space="preserve"
inkscape:version="0.48.2 r9819"
- sodipodi:docname="link.svg"><metadata
+ sodipodi:docname="location.svg"
+ inkscape:export-filename="/tmp/location-grey.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"><metadata
id="metadata13"><rdf:RDF><cc:Work
rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
@@ -38,8 +41,8 @@
inkscape:zoom="22.40625"
inkscape:cx="16"
inkscape:cy="16"
- inkscape:window-x="0"
- inkscape:window-y="972"
+ inkscape:window-x="31"
+ inkscape:window-y="709"
inkscape:window-maximized="0"
inkscape:current-layer="Layer_1"><inkscape:grid
type="xygrid"
Modified: trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java 2012-03-08 15:05:45 UTC (rev 1748)
+++ trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java 2012-03-08 16:07:23 UTC (rev 1749)
@@ -30,12 +30,39 @@
@Source("alert.png")
ImageResource alert();
+ @Source("icons/chain-close-black.png")
+ ImageResource chainCloseBlack();
+
+ @Source("icons/chain-closed-grey.png")
+ ImageResource chainClosedGrey();
+
+ @Source("icons/chain-close-white.png")
+ ImageResource chainCloseWhite();
+
+ @Source("icons/chain-open-black.png")
+ ImageResource chainOpenBlack();
+
+ @Source("icons/chain-open-grey.png")
+ ImageResource chainOpenGrey();
+
+ @Source("icons/chain-open-white.png")
+ ImageResource chainOpenWhite();
+
@Source("checked.png")
ImageResource checked();
@Source("clear.png")
ImageResource clear();
+ @Source("icons/edit-black.png")
+ ImageResource editBlack();
+
+ @Source("icons/edit-gray_dark.png")
+ ImageResource editGrayDark();
+
+ @Source("icons/edit-white.png")
+ ImageResource editWhite();
+
@Source("error.png")
ImageResource error();
@@ -63,33 +90,15 @@
@Source("kune-close-greylight.png")
ImageResource kuneCloseGreylight();
- @Source("radiochecked.png")
- ImageResource radioChecked();
+ @Source("icons/location-black.png")
+ ImageResource locationBlack();
- @Source("radiounchecked.png")
- ImageResource radioUnChecked();
+ @Source("icons/location-grey.png")
+ ImageResource locationGrey();
- @Source("cross.png")
- ImageResource redCross();
-
- @Source("icons/chain-close-black.png")
- ImageResource chainCloseBlack();
+ @Source("icons/location-white.png")
+ ImageResource locationWhite();
- @Source("icons/chain-close-white.png")
- ImageResource chainCloseWhite();
-
- @Source("icons/chain-closed-grey.png")
- ImageResource chainClosedGrey();
-
- @Source("icons/chain-open-black.png")
- ImageResource chainOpenBlack();
-
- @Source("icons/chain-open-grey.png")
- ImageResource chainOpenGrey();
-
- @Source("icons/chain-open-white.png")
- ImageResource chainOpenWhite();
-
@Source("icons/picture-black.png")
ImageResource pictureBlack();
@@ -98,7 +107,25 @@
@Source("icons/picture-white.png")
ImageResource pictureWhite();
-
+
+ @Source("icons/pref-black.png")
+ ImageResource prefBlack();
+
+ @Source("icons/pref-grey.png")
+ ImageResource prefGrey();
+
+ @Source("icons/pref-white.png")
+ ImageResource prefWhite();
+
+ @Source("radiochecked.png")
+ ImageResource radioChecked();
+
+ @Source("radiounchecked.png")
+ ImageResource radioUnChecked();
+
+ @Source("cross.png")
+ ImageResource redCross();
+
@Source("unchecked.png")
ImageResource unChecked();
}
Modified: trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java 2012-03-08 15:05:45 UTC (rev 1748)
+++ trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java 2012-03-08 16:07:23 UTC (rev 1749)
@@ -443,18 +443,9 @@
@Source("person-def.png")
ImageResource personDef();
- @Source("icons/pref-black.png")
- ImageResource prefBlack();
-
- @Source("icons/pref-grey.png")
- ImageResource prefGrey();
-
@Source("prefs.png")
ImageResource prefs();
- @Source("icons/pref-white.png")
- ImageResource prefWhite();
-
@Source("question32.png")
ImageResource question32();
Added: trunk/src/main/resources/icons/edit-black.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/edit-black.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/edit-gray_dark.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/edit-gray_dark.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/edit-white.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/edit-white.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/location-black.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/location-black.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/location-grey.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/location-grey.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/location-white.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/location-white.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
1
0
Author: vjrj_
Date: 2012-03-08 16:05:45 +0100 (Thu, 08 Mar 2012)
New Revision: 1748
Added:
trunk/img/icons/custom-iconic/
trunk/img/icons/custom-iconic/barters.svg
trunk/img/icons/custom-iconic/blog.svg
trunk/img/icons/custom-iconic/chain-alternate.svg
trunk/img/icons/custom-iconic/chain-close.svg
trunk/img/icons/custom-iconic/chain-open.svg
trunk/img/icons/custom-iconic/document_stroke-mod.svg
trunk/img/icons/custom-iconic/lists.svg
trunk/img/icons/custom-iconic/location.svg
trunk/img/icons/custom-iconic/picture.svg
trunk/img/icons/custom-iconic/reply.svg
trunk/img/icons/custom-iconic/wiki_stroke-mod.svg
trunk/src/main/java/org/waveprotocol/wave/client/gadget/
trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/
trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/Gadget.css
trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/GadgetWidget.java
trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/GadgetWidgetUi.java
trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/GadgetWidgetUi.ui.xml
trunk/src/main/resources/icons/
trunk/src/main/resources/icons/chain-close-black.png
trunk/src/main/resources/icons/chain-close-white.png
trunk/src/main/resources/icons/chain-closed-grey.png
trunk/src/main/resources/icons/chain-open-black.png
trunk/src/main/resources/icons/chain-open-grey.png
trunk/src/main/resources/icons/chain-open-white.png
trunk/src/main/resources/icons/picture-black.png
trunk/src/main/resources/icons/picture-grey.png
trunk/src/main/resources/icons/picture-white.png
trunk/src/main/resources/icons/pref-black.png
trunk/src/main/resources/icons/pref-grey.png
trunk/src/main/resources/icons/pref-white.png
Removed:
trunk/src/main/java/cc/kune/core/client/resources/pref-black.png
trunk/src/main/java/cc/kune/core/client/resources/pref-grey.png
trunk/src/main/java/cc/kune/core/client/resources/pref-white.png
Modified:
trunk/.classpath
trunk/pom.xml
trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java
trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java
trunk/src/main/java/cc/kune/events/client/actions/EventAddMenuItem.java
trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java
trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java
trunk/src/main/java/cc/kune/events/shared/EventsClientConversionUtil.java
trunk/src/main/webapp/others/kune-client-actions.xml
Log:
Calendar improvements and fixes. Gadget width fix. New icons.
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2012-03-07 13:08:17 UTC (rev 1747)
+++ trunk/.classpath 2012-03-08 15:05:45 UTC (rev 1748)
@@ -22,6 +22,7 @@
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/client/0.3.12/client-0.3.12.jar"/>
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common/0.3.12/client-common-0.3.12.jar"/>
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.12/client-common-src-0.3.12.jar" sourcepath="M2_REPO/org/waveprotocol/client-common-src/0.3.12/client-common-src-0.3.12-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler/0.3.12/client-scheduler-0.3.12.jar"/>
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.12/client-scheduler-src-0.3.12.jar" sourcepath="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.12/client-scheduler-src-0.3.12-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.12/client-src-0.3.12.jar" sourcepath="M2_REPO/org/waveprotocol/client-src/0.3.12/client-src-0.3.12-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/cobogw/gwt/cobogw/1.3.1/cobogw-1.3.1.jar"/>
Added: trunk/img/icons/custom-iconic/barters.svg
===================================================================
--- trunk/img/icons/custom-iconic/barters.svg (rev 0)
+++ trunk/img/icons/custom-iconic/barters.svg 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ x="0px"
+ y="0px"
+ width="32px"
+ height="32px"
+ viewBox="0 0 32 32"
+ enable-background="new 0 0 32 32"
+ xml:space="preserve"
+ id="svg2"
+ inkscape:version="0.48.2 r9819"
+ sodipodi:docname="barters.svg"><metadata
+ id="metadata20"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs18" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1078"
+ inkscape:window-height="919"
+ id="namedview16"
+ showgrid="false"
+ inkscape:zoom="1"
+ inkscape:cx="16"
+ inkscape:cy="16"
+ inkscape:window-x="0"
+ inkscape:window-y="972"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="svg2" />
+<g
+ id="Layer_1">
+</g>
+<g
+ id="fullscreen_x5F_exit_x5F_32x32">
+ <g
+ id="g6">
+ <polygon
+ points="27.414,24.586 32,20 20,20 20,32 24.586,27.414 29.172,32 32,29.172 "
+ id="polygon8"
+ transform="matrix(-1,0,0,1,52,0)"
+ style="fill:#231f20" />
+ <polygon
+ points="7.414,4.586 2.875,0.043 0.047,2.871 4.586,7.414 0,12 12,12 12,0 "
+ id="polygon10"
+ transform="matrix(-1,0,0,-1,32,12)"
+ style="fill:#231f20" />
+ <polygon
+ points="0,20 4.586,24.586 0,29.172 2.828,32 7.414,27.414 12,32 12,20 "
+ id="polygon12"
+ style="fill:#231f20"
+ transform="matrix(1,0,0,-1,0,52)" />
+ <polygon
+ points="20,12 32,12 27.414,7.414 31.961,2.871 29.133,0.043 24.586,4.586 20,0 "
+ id="polygon14"
+ transform="translate(-20,0)"
+ style="fill:#231f20" />
+ </g>
+</g>
+</svg>
\ No newline at end of file
Added: trunk/img/icons/custom-iconic/blog.svg
===================================================================
--- trunk/img/icons/custom-iconic/blog.svg (rev 0)
+++ trunk/img/icons/custom-iconic/blog.svg 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,66 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="32px"
+ height="32.023px"
+ viewBox="0 0 32 32.023"
+ style="enable-background:new 0 0 32 32.023;"
+ xml:space="preserve"
+ inkscape:version="0.48.2 r9819"
+ sodipodi:docname="blog.svg"><metadata
+ id="metadata9"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
+ id="defs7" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1078"
+ inkscape:window-height="919"
+ id="namedview5"
+ showgrid="true"
+ inkscape:zoom="5.5975395"
+ inkscape:cx="16"
+ inkscape:cy="10.652002"
+ inkscape:window-x="0"
+ inkscape:window-y="972"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1"><inkscape:grid
+ type="xygrid"
+ id="grid3005" /></sodipodi:namedview>
+
+<path
+ style="fill:#231f20"
+ d="M 0 0 L 0 32.03125 L 32 32.03125 L 32 10 L 29.0625 7.0625 C 29.645385 8.2530281 29.96875 9.5850786 29.96875 11 C 29.96875 13.112978 29.25243 15.059907 28.03125 16.59375 C 28.028366 19.812263 28 28.03125 28 28.03125 L 4 28.03125 C 4 28.03125 4 6.5804999 4 3.9375 L 15.4375 3.9375 C 16.965886 2.7328831 18.902941 2.03125 21 2.03125 C 22.424999 2.03125 23.771869 2.3467994 24.96875 2.9375 L 22.03125 0 L 0 0 z "
+ id="path3" /><path
+ inkscape:connector-curvature="0"
+ style="fill:#231f20"
+ d="M 25.750001,13.115998 22.328,9.6899993 l 0,-3.6670003 -4.023,0 c 0,3.8454005 0,4.507 0,4.507 0,0.602 0.277,1.122 0.695,1.493 l 3.922001,3.921999 z"
+ id="path7"
+ sodipodi:nodetypes="ccccsccc" /><path
+ transform="matrix(3.277217,0,0,3.277217,-40.416133,-58.744255)"
+ d="m 21.480664,21.282667 a 2.7403326,2.7403326 0 1 1 -5.480665,0 2.7403326,2.7403326 0 1 1 5.480665,0 z"
+ sodipodi:ry="2.7403326"
+ sodipodi:rx="2.7403326"
+ sodipodi:cy="21.282667"
+ sodipodi:cx="18.740332"
+ id="path3005"
+ style="color:#000000;fill:none;stroke:#231f20;stroke-width:1.2205478;stroke-miterlimit:4;stroke-opacity:1;stroke-dasharray:none;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ sodipodi:type="arc" /></svg>
\ No newline at end of file
Added: trunk/img/icons/custom-iconic/chain-alternate.svg
===================================================================
--- trunk/img/icons/custom-iconic/chain-alternate.svg (rev 0)
+++ trunk/img/icons/custom-iconic/chain-alternate.svg 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,166 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="32"
+ height="32"
+ viewBox="0 0 32 32"
+ xml:space="preserve"
+ inkscape:version="0.48.2 r9819"
+ sodipodi:docname="chain-close.svg"><metadata
+ id="metadata9"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs7" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1078"
+ inkscape:window-height="919"
+ id="namedview5"
+ showgrid="true"
+ inkscape:zoom="11.313708"
+ inkscape:cx="-14.194054"
+ inkscape:cy="5.099319"
+ inkscape:window-x="0"
+ inkscape:window-y="972"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1"><inkscape:grid
+ type="xygrid"
+ id="grid2986"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" /></sodipodi:namedview>
+
+<path
+ sodipodi:nodetypes="sssssssssssccs"
+ inkscape:connector-curvature="0"
+ id="path2994"
+ d="m 22,18 -12,0 c -1.105,0 -2,0.896 -2,2 l 0,4.084746 C 8,28.501746 11.582,32 16,32 c 4.418,0 8,-3.498254 8,-7.915254 L 24,20 c 0,-1.104 -0.895,-2 -2,-2 z m -2,6.084746 c 0,0 0,3.915254 -4,3.915254 -4,0 -4,-3.656755 -4,-4 0,-0.08475 0,-0.08475 0,-2 l 8,0 c 0,0 0,1.084746 0,2.084746 z"
+ style="fill:#231f20" /><path
+ style="fill:#231f20"
+ d="M 22,14 10,14 C 8.895,14 8,13.104 8,12 L 8,7.915254 C 8,3.498254 11.582,0 16,0 c 4.418,0 8,3.498254 8,7.915254 L 24,12 c 0,1.104 -0.895,2 -2,2 z M 20,7.915254 C 20,7.915254 20,4 16,4 c -4,0 -4,3.656755 -4,4 0,0.08475 0,0.08475 0,2 l 8,0 c 0,0 0,-1.084746 0,-2.084746 z"
+ id="path2996"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="sssssssssssccs" /><rect
+ style="color:#000000;fill:#231f20;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:24;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="rect3017"
+ width="4"
+ height="12"
+ x="14"
+ y="10" /><path
+ sodipodi:type="arc"
+ style="color:#000000;fill:#231f20;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:24;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path3019"
+ sodipodi:cx="17"
+ sodipodi:cy="10"
+ sodipodi:rx="2"
+ sodipodi:ry="2"
+ d="m 19,10 a 2,2 0 1 1 -4,0 2,2 0 1 1 4,0 z"
+ transform="translate(-1,0)" /><path
+ transform="translate(-1,12)"
+ d="m 19,10 a 2,2 0 1 1 -4,0 2,2 0 1 1 4,0 z"
+ sodipodi:ry="2"
+ sodipodi:rx="2"
+ sodipodi:cy="10"
+ sodipodi:cx="17"
+ id="path3022"
+ style="color:#000000;fill:#231f20;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:24;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ sodipodi:type="arc" /><rect
+ style="color:#000000;fill:none;stroke:#231f20;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:2;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="rect3813"
+ width="12"
+ height="10"
+ x="-13"
+ y="2"
+ ry="1"
+ rx="0.5" /><rect
+ rx="0.5"
+ ry="1"
+ y="20"
+ x="-13"
+ height="10"
+ width="12"
+ id="rect3817"
+ style="color:#000000;fill:none;stroke:#231f20;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:2;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /><rect
+ y="10"
+ x="-9"
+ height="12"
+ width="4"
+ id="rect3819"
+ style="color:#000000;fill:#231f20;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:24;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /><path
+ transform="translate(-24,0)"
+ d="m 19,10 a 2,2 0 1 1 -4,0 2,2 0 1 1 4,0 z"
+ sodipodi:ry="2"
+ sodipodi:rx="2"
+ sodipodi:cy="10"
+ sodipodi:cx="17"
+ id="path3821"
+ style="color:#000000;fill:#231f20;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:24;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ sodipodi:type="arc" /><path
+ sodipodi:type="arc"
+ style="color:#000000;fill:#231f20;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:24;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path3823"
+ sodipodi:cx="17"
+ sodipodi:cy="10"
+ sodipodi:rx="2"
+ sodipodi:ry="2"
+ d="m 19,10 a 2,2 0 1 1 -4,0 2,2 0 1 1 4,0 z"
+ transform="translate(-24,12)" /><rect
+ rx="0.5"
+ ry="1"
+ y="2"
+ x="-33"
+ height="10"
+ width="12"
+ id="rect3825"
+ style="color:#000000;fill:none;stroke:#231f20;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:2;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" /><rect
+ style="color:#000000;fill:none;stroke:#231f20;stroke-width:4;stroke-linecap:round;stroke-linejoin:round;stroke-miterlimit:2;stroke-opacity:1;stroke-dasharray:none;stroke-dashoffset:0;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="rect3827"
+ width="12"
+ height="10"
+ x="-33"
+ y="20"
+ ry="1"
+ rx="0.5" /><rect
+ style="color:#000000;fill:#231f20;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:24;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="rect3829"
+ width="4"
+ height="12"
+ x="-49"
+ y="10" /><path
+ sodipodi:type="arc"
+ style="color:#000000;fill:#231f20;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:24;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path3831"
+ sodipodi:cx="17"
+ sodipodi:cy="10"
+ sodipodi:rx="2"
+ sodipodi:ry="2"
+ d="m 19,10 a 2,2 0 1 1 -4,0 2,2 0 1 1 4,0 z"
+ transform="translate(-64,0)" /><path
+ transform="translate(-64,12)"
+ d="m 19,10 a 2,2 0 1 1 -4,0 2,2 0 1 1 4,0 z"
+ sodipodi:ry="2"
+ sodipodi:rx="2"
+ sodipodi:cy="10"
+ sodipodi:cx="17"
+ id="path3833"
+ style="color:#000000;fill:#231f20;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:24;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ sodipodi:type="arc" /></svg>
\ No newline at end of file
Added: trunk/img/icons/custom-iconic/chain-close.svg
===================================================================
--- trunk/img/icons/custom-iconic/chain-close.svg (rev 0)
+++ trunk/img/icons/custom-iconic/chain-close.svg 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="32"
+ height="32"
+ viewBox="0 0 32 32"
+ xml:space="preserve"
+ inkscape:version="0.48.2 r9819"
+ sodipodi:docname="chain-close.svg"><metadata
+ id="metadata9"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
+ id="defs7" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1078"
+ inkscape:window-height="919"
+ id="namedview5"
+ showgrid="true"
+ inkscape:zoom="11.313708"
+ inkscape:cx="9.6518354"
+ inkscape:cy="14.221054"
+ inkscape:window-x="0"
+ inkscape:window-y="972"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1"><inkscape:grid
+ type="xygrid"
+ id="grid2986"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" /></sodipodi:namedview>
+
+<path
+ style="fill:#231f20"
+ d="M 16 0 C 11.582 -5.9211895e-16 8 3.48925 8 7.90625 L 8 12 C 8 13.104 8.895 14 10 14 L 14 14 L 14 18 L 10 18 C 8.895 18 8 18.896 8 20 L 8 24.09375 C 8 28.51075 11.582 32 16 32 C 20.418 32 24 28.51075 24 24.09375 L 24 20 C 24 18.896 23.105 18 22 18 L 18 18 L 18 14 L 22 14 C 23.105 14 24 13.104 24 12 L 24 7.90625 C 24 3.48925 20.418 0 16 0 z M 16 4 C 20 4 20 7.90625 20 7.90625 L 20 10 L 18 10 C 18 8.8954305 17.104569 8 16 8 C 14.895431 8 14 8.8954305 14 10 L 12 10 L 12 8 C 12 7.656755 12 4 16 4 z M 12 22 L 14 22 C 14 23.104569 14.895431 24 16 24 C 17.104569 24 18 23.104569 18 22 L 20 22 L 20 24.09375 C 20 24.09375 20 28 16 28 C 12 28 12 24.343245 12 24 L 12 22 z "
+ id="path2994" /></svg>
\ No newline at end of file
Added: trunk/img/icons/custom-iconic/chain-open.svg
===================================================================
--- trunk/img/icons/custom-iconic/chain-open.svg (rev 0)
+++ trunk/img/icons/custom-iconic/chain-open.svg 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="32"
+ height="32"
+ viewBox="0 0 32 32"
+ xml:space="preserve"
+ inkscape:version="0.48.2 r9819"
+ sodipodi:docname="chain-open.svg"><metadata
+ id="metadata9"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
+ id="defs7" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1078"
+ inkscape:window-height="919"
+ id="namedview5"
+ showgrid="true"
+ inkscape:zoom="22.40625"
+ inkscape:cx="16"
+ inkscape:cy="16"
+ inkscape:window-x="0"
+ inkscape:window-y="972"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1"><inkscape:grid
+ type="xygrid"
+ id="grid2986"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" /></sodipodi:namedview>
+
+<path
+ sodipodi:nodetypes="sssssssssssccs"
+ inkscape:connector-curvature="0"
+ id="path2994"
+ d="m 22,18 -12,0 c -1.105,0 -2,0.896 -2,2 l 0,4.084746 C 8,28.501746 11.582,32 16,32 c 4.418,0 8,-3.498254 8,-7.915254 L 24,20 c 0,-1.104 -0.895,-2 -2,-2 z m -2,6.084746 c 0,0 0,3.915254 -4,3.915254 -4,0 -4,-3.656755 -4,-4 0,-0.08475 0,-0.08475 0,-2 l 8,0 c 0,0 0,1.084746 0,2.084746 z"
+ style="fill:#231f20" /><path
+ style="fill:#231f20"
+ d="M 22,14 10,14 C 8.895,14 8,13.104 8,12 L 8,7.915254 C 8,3.498254 11.582,0 16,0 c 4.418,0 8,3.498254 8,7.915254 L 24,12 c 0,1.104 -0.895,2 -2,2 z M 20,7.915254 C 20,7.915254 20,4 16,4 c -4,0 -4,3.656755 -4,4 0,0.08475 0,0.08475 0,2 l 8,0 c 0,0 0,-1.084746 0,-2.084746 z"
+ id="path2996"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="sssssssssssccs" /></svg>
\ No newline at end of file
Added: trunk/img/icons/custom-iconic/document_stroke-mod.svg
===================================================================
--- trunk/img/icons/custom-iconic/document_stroke-mod.svg (rev 0)
+++ trunk/img/icons/custom-iconic/document_stroke-mod.svg 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="32px"
+ height="32.023px"
+ viewBox="0 0 32 32.023"
+ style="enable-background:new 0 0 32 32.023;"
+ xml:space="preserve"
+ inkscape:version="0.48.2 r9819"
+ sodipodi:docname="document_stroke-mod.svg"><metadata
+ id="metadata9"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs7" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1078"
+ inkscape:window-height="919"
+ id="namedview5"
+ showgrid="true"
+ inkscape:zoom="20.844669"
+ inkscape:cx="16"
+ inkscape:cy="16.011499"
+ inkscape:window-x="0"
+ inkscape:window-y="972"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1"><inkscape:grid
+ type="xygrid"
+ id="grid3005" /></sodipodi:namedview>
+<path
+ style="fill:#231f20"
+ d="M 22.016,0 0,0 -5.9466538e-7,32.023 C 13,32.023 19,32.023 32.000001,32.023 L 32,10.008 z M 28,28.023 c -10.907572,0 -10.783442,0 -24.0000004,0 0,0 0.006,-21.441 0.006,-24.084 2.1,0 7.807,0 12.006,0 l 0,12.01 12.01,0 C 28.021,18.682 28,28.023 28,28.023 z M 20.016,11.945 c 0,-1.543 0,-5.918 0,-8.006 1.615,1.619 6.402,6.404 8.006,8.006 -2.047,0 -6.454,0 -8.006,0 z"
+ id="path3"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccccccccccccccc" />
+</svg>
\ No newline at end of file
Added: trunk/img/icons/custom-iconic/lists.svg
===================================================================
--- trunk/img/icons/custom-iconic/lists.svg (rev 0)
+++ trunk/img/icons/custom-iconic/lists.svg 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,72 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="32px"
+ height="32px"
+ viewBox="0 0 32 32"
+ style="enable-background:new 0 0 32 32;"
+ xml:space="preserve"
+ inkscape:version="0.48.2 r9819"
+ sodipodi:docname="lists.svg"><metadata
+ id="metadata19"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
+ id="defs17">
+
+
+
+
+
+</defs><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1078"
+ inkscape:window-height="919"
+ id="namedview15"
+ showgrid="true"
+ inkscape:zoom="11.203125"
+ inkscape:cx="17.097985"
+ inkscape:cy="13.124115"
+ inkscape:window-x="0"
+ inkscape:window-y="972"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1"><inkscape:grid
+ type="xygrid"
+ id="grid3015" /></sodipodi:namedview>
+<g
+ id="g3000"><polygon
+ transform="matrix(-1,0,0,1,32,0)"
+ style="fill:#231f20"
+ points="32,0 32,4 32,4 0,4 0,0 "
+ id="polygon5" /><polygon
+ transform="matrix(-1.4,0,0,1,32,0)"
+ style="fill:#231f20"
+ points="20,12 0,12 0,8 20,8 20,12 "
+ id="polygon7" /><polygon
+ transform="matrix(-0.875,0,0,1,32,0)"
+ style="fill:#231f20"
+ points="32,24 0,24 0,20 32,20 32,24 "
+ id="polygon9" /><polygon
+ transform="matrix(-1,0,0,1,32,0)"
+ style="fill:#231f20"
+ points="24,28 24,32 24,32 0,32 0,28 "
+ id="polygon11" /></g>
+</svg>
\ No newline at end of file
Added: trunk/img/icons/custom-iconic/location.svg
===================================================================
--- trunk/img/icons/custom-iconic/location.svg (rev 0)
+++ trunk/img/icons/custom-iconic/location.svg 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,62 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="32"
+ height="32"
+ viewBox="0 0 31.999999 32"
+ xml:space="preserve"
+ inkscape:version="0.48.2 r9819"
+ sodipodi:docname="link.svg"><metadata
+ id="metadata13"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
+ id="defs11" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1078"
+ inkscape:window-height="919"
+ id="namedview9"
+ showgrid="true"
+ inkscape:zoom="22.40625"
+ inkscape:cx="16"
+ inkscape:cy="16"
+ inkscape:window-x="0"
+ inkscape:window-y="972"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1"><inkscape:grid
+ type="xygrid"
+ id="grid3009"
+ empspacing="5"
+ visible="true"
+ enabled="true"
+ snapvisiblegridlinesonly="true" /></sodipodi:namedview>
+<g
+ id="g3"
+ transform="translate(0,2)">
+ <path
+ style="fill:#231f20"
+ d="m 16.024,4.007 c 3.32,0 6.019,2.7 6.019,6.017 0,1.894 -0.867,3.636 -2.379,4.773 C 18.042084,16.123195 17,17.96875 16,19.53125 15,17.96875 14,16 12.39,14.797 10.875,13.66 10.008,11.918 10.008,10.024 c 0,-3.317 2.699,-6.017 6.016,-6.017 M 16.024,0 C 10.488,0 6,4.488 6,10.024 c 0,3.28 1.547,6.147 3.977,7.976 1.121,0.844 3.1235,4 3.57325,5 C 14,24 15.331475,26.335992 16,28 c 0.734517,-1.69468 1.812,-4 2.406,-5 0.594,-1 2.547,-4.156 3.668,-5 2.43,-1.829 3.977,-4.696 3.977,-7.976 C 26.051,4.488 21.562,0 16.024,0 z"
+ id="path5"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="cscccsccsczczcsc" />
+
+</g>
+</svg>
\ No newline at end of file
Added: trunk/img/icons/custom-iconic/picture.svg
===================================================================
--- trunk/img/icons/custom-iconic/picture.svg (rev 0)
+++ trunk/img/icons/custom-iconic/picture.svg 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="32px"
+ height="32.023px"
+ viewBox="0 0 32 32.023"
+ style="enable-background:new 0 0 32 32.023;"
+ xml:space="preserve"
+ inkscape:version="0.48.2 r9819"
+ sodipodi:docname="picture.svg"
+ inkscape:export-filename="/tmp/picture-black.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45"><metadata
+ id="metadata9"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs7" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1078"
+ inkscape:window-height="919"
+ id="namedview5"
+ showgrid="true"
+ inkscape:zoom="11.195079"
+ inkscape:cx="15.028131"
+ inkscape:cy="14.592141"
+ inkscape:window-x="0"
+ inkscape:window-y="972"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1"><inkscape:grid
+ type="xygrid"
+ id="grid3005" /></sodipodi:namedview>
+
+<path
+ style="font-size:medium;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-indent:0;text-align:start;text-decoration:none;line-height:normal;letter-spacing:normal;word-spacing:normal;text-transform:none;direction:ltr;block-progression:tb;writing-mode:lr-tb;text-anchor:start;baseline-shift:baseline;color:#000000;fill:#231f20;fill-opacity:1;stroke:none;stroke-width:4;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate;font-family:Sans;-inkscape-font-specification:Sans"
+ d="M 1.8125 0.03125 A 2.0001999 2.0001999 0 0 0 0 2.03125 L 0 30.03125 A 2.0001999 2.0001999 0 0 0 2 32.03125 L 30 32.03125 A 2.0001999 2.0001999 0 0 0 32 30.03125 L 32 2.03125 A 2.0001999 2.0001999 0 0 0 30 0.03125 L 2 0.03125 A 2.0001999 2.0001999 0 0 0 1.8125 0.03125 z M 4 4.03125 L 28 4.03125 L 28 14.03125 C 28 14.03125 26.974092 14.034149 25.65625 14.0625 C 25.581508 12.992164 25.258639 11.966366 24.71875 11.03125 C 22.797598 7.7037175 18.483783 6.5475981 15.15625 8.46875 C 12.362378 10.081793 11.133571 13.357304 11.9375 16.34375 C 9.6691205 17.30296 7.6457826 18.345626 4 19 L 4 4.03125 z M 18.875 11.5 C 19.832223 11.564262 20.72483 12.121629 21.25 13.03125 C 21.469627 13.411655 21.613234 13.817196 21.65625 14.25 C 19.617583 14.395505 17.468728 14.646833 15.71875 15.0625 C 15.483749 13.844461 16.007763 12.569329 17.15625 11.90625 C 17.702023 11.591148 18.300666 11.461443 18.875 11.5 z M 28 18.03125 L 28 28.03125 L 4 28.03125 L 4 23.03125 A 2.0001999 2.0001999 0 0 0 4.34375 23 C 10.699207 21.940757 12.956538 19.854616 16.5 18.96875 C 19.891283 18.120929 28 18.03125 28 18.03125 z "
+ id="rect3004" /></svg>
\ No newline at end of file
Added: trunk/img/icons/custom-iconic/reply.svg
===================================================================
--- trunk/img/icons/custom-iconic/reply.svg (rev 0)
+++ trunk/img/icons/custom-iconic/reply.svg 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,58 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="32px"
+ height="31.985px"
+ viewBox="0 0 32 31.985"
+ style="enable-background:new 0 0 32 31.985;"
+ xml:space="preserve"
+ inkscape:version="0.48.2 r9819"
+ sodipodi:docname="reply.svg"><metadata
+ id="metadata13"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title /></cc:Work></rdf:RDF></metadata><defs
+ id="defs11" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1078"
+ inkscape:window-height="919"
+ id="namedview9"
+ showgrid="false"
+ inkscape:zoom="20.869432"
+ inkscape:cx="16"
+ inkscape:cy="15.9925"
+ inkscape:window-x="0"
+ inkscape:window-y="972"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1" />
+<g
+ id="g3"
+ transform="matrix(-1,0,0,-1,31.98626,31.985377)">
+ <path
+ style="fill:#231f20"
+ d="M 28.156,3.72 C 23.191259,-1.3561979 13.995754,-1.2081334 9.2406719,4.087821 7.4768618,5.8148852 5.7546981,7.5837628 4,9.32 4,7.547 4,5.774 4,4.001 c -1.3333333,0 -2.6666667,0 -4,0 0,4 0,8 0,12 4,0 8,0 12,0 0,-1.333333 0,-2.666667 0,-4 -1.675,0 -3.35,0 -5.025,0 2.3669706,-2.2196714 4.439909,-4.7779711 7.05347,-6.7189446 4.151835,-2.59042 10.352865,-1.2404923 12.749396,3.1216783 2.157583,3.6209673 1.362664,8.6925193 -1.835853,11.4513573 -1.001785,0.993873 -3.033417,2.323732 -2.233621,2.558459 4.283435,-0.590885 8.428779,-3.795214 9.173842,-8.201008 C 32.416151,10.382846 30.852862,6.4282488 28.156,3.72 z"
+ id="path5"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccccccccccccc" />
+
+
+</g>
+</svg>
\ No newline at end of file
Added: trunk/img/icons/custom-iconic/wiki_stroke-mod.svg
===================================================================
--- trunk/img/icons/custom-iconic/wiki_stroke-mod.svg (rev 0)
+++ trunk/img/icons/custom-iconic/wiki_stroke-mod.svg 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!-- Generator: Adobe Illustrator 14.0.0, SVG Export Plug-In . SVG Version: 6.00 Build 43363) -->
+
+<svg
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:cc="http://creativecommons.org/ns#"
+ xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
+ xmlns:svg="http://www.w3.org/2000/svg"
+ xmlns="http://www.w3.org/2000/svg"
+ xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
+ xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
+ version="1.1"
+ id="Layer_1"
+ x="0px"
+ y="0px"
+ width="32px"
+ height="32.023px"
+ viewBox="0 0 32 32.023"
+ style="enable-background:new 0 0 32 32.023;"
+ xml:space="preserve"
+ inkscape:version="0.48.2 r9819"
+ sodipodi:docname="wiki_stroke-mod.svg"><metadata
+ id="metadata9"><rdf:RDF><cc:Work
+ rdf:about=""><dc:format>image/svg+xml</dc:format><dc:type
+ rdf:resource="http://purl.org/dc/dcmitype/StillImage" /><dc:title></dc:title></cc:Work></rdf:RDF></metadata><defs
+ id="defs7" /><sodipodi:namedview
+ pagecolor="#ffffff"
+ bordercolor="#666666"
+ borderopacity="1"
+ objecttolerance="10"
+ gridtolerance="10"
+ guidetolerance="10"
+ inkscape:pageopacity="0"
+ inkscape:pageshadow="2"
+ inkscape:window-width="1078"
+ inkscape:window-height="919"
+ id="namedview5"
+ showgrid="true"
+ inkscape:zoom="4"
+ inkscape:cx="16"
+ inkscape:cy="13.87808"
+ inkscape:window-x="0"
+ inkscape:window-y="972"
+ inkscape:window-maximized="0"
+ inkscape:current-layer="Layer_1"><inkscape:grid
+ type="xygrid"
+ id="grid3005" /></sodipodi:namedview>
+<path
+ style="fill:#231f20"
+ d="m 23,0.02299881 c 0,0 -12,0 -19.0000004,-0.02299881 C 3.9999996,8.0229991 -5.9466538e-7,32.023 -5.9466538e-7,32.023 13,32.023 21.5,32.023 28,32.023 31.000001,20.023 31.000001,18.022999 31.984,10.030999 28,7.0229991 23,0.02299881 23,0.02299881 z M 25,28.023 c -10.907572,0 -13.911982,0.09595 -20.5202614,0.09595 C 5.9999996,21.023 6.9999997,12.022999 7.4797387,4.022999 c 2.1000003,0 5.3212613,0 9.5202613,0 0,0 0,9 -0.988,11.926001 C 21,16.517683 27,16.022999 27,16.022999 26.999,18.755999 25,28.023 25,28.023 z M 20.431765,12.687182 C 21.415765,8.7651811 21,6.110999 21,4.022999 c 1,2 5.418,6.320001 7.022,7.922001 -3.022,1.077999 -6.038235,0.742182 -7.590235,0.742182 z"
+ id="path3"
+ inkscape:connector-curvature="0"
+ sodipodi:nodetypes="ccccccccccccccccc" />
+</svg>
\ No newline at end of file
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2012-03-07 13:08:17 UTC (rev 1747)
+++ trunk/pom.xml 2012-03-08 15:05:45 UTC (rev 1748)
@@ -638,6 +638,11 @@
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
+ <artifactId>client-scheduler</artifactId>
+ <version>${wiab.version}</version>
+ </dependency>
+ <dependency>
+ <groupId>org.waveprotocol</groupId>
<artifactId>client-scheduler-src</artifactId>
<version>${wiab.version}</version>
</dependency>
Modified: trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java 2012-03-07 13:08:17 UTC (rev 1747)
+++ trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java 2012-03-08 15:05:45 UTC (rev 1748)
@@ -71,7 +71,34 @@
@Source("cross.png")
ImageResource redCross();
+
+ @Source("icons/chain-close-black.png")
+ ImageResource chainCloseBlack();
+ @Source("icons/chain-close-white.png")
+ ImageResource chainCloseWhite();
+
+ @Source("icons/chain-closed-grey.png")
+ ImageResource chainClosedGrey();
+
+ @Source("icons/chain-open-black.png")
+ ImageResource chainOpenBlack();
+
+ @Source("icons/chain-open-grey.png")
+ ImageResource chainOpenGrey();
+
+ @Source("icons/chain-open-white.png")
+ ImageResource chainOpenWhite();
+
+ @Source("icons/picture-black.png")
+ ImageResource pictureBlack();
+
+ @Source("icons/picture-grey.png")
+ ImageResource pictureGrey();
+
+ @Source("icons/picture-white.png")
+ ImageResource pictureWhite();
+
@Source("unchecked.png")
ImageResource unChecked();
}
Modified: trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java 2012-03-07 13:08:17 UTC (rev 1747)
+++ trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java 2012-03-08 15:05:45 UTC (rev 1748)
@@ -19,11 +19,12 @@
*/
package cc.kune.core.client.resources;
-import com.google.gwt.resources.client.ClientBundle;
+import cc.kune.common.client.resources.CommonResources;
+
import com.google.gwt.resources.client.CssResource;
import com.google.gwt.resources.client.ImageResource;
-public interface CoreResources extends ClientBundle {
+public interface CoreResources extends CommonResources {
public interface Style extends CssResource {
String loadingSpiner();
}
@@ -442,16 +443,16 @@
@Source("person-def.png")
ImageResource personDef();
- @Source("pref-black.png")
+ @Source("icons/pref-black.png")
ImageResource prefBlack();
- @Source("pref-grey.png")
+ @Source("icons/pref-grey.png")
ImageResource prefGrey();
@Source("prefs.png")
ImageResource prefs();
- @Source("pref-white.png")
+ @Source("icons/pref-white.png")
ImageResource prefWhite();
@Source("question32.png")
@@ -547,4 +548,6 @@
@Source("wave-icon.png")
ImageResource waveIcon();
+
+
}
Deleted: trunk/src/main/java/cc/kune/core/client/resources/pref-black.png
===================================================================
(Binary files differ)
Deleted: trunk/src/main/java/cc/kune/core/client/resources/pref-grey.png
===================================================================
(Binary files differ)
Deleted: trunk/src/main/java/cc/kune/core/client/resources/pref-white.png
===================================================================
(Binary files differ)
Modified: trunk/src/main/java/cc/kune/events/client/actions/EventAddMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/EventAddMenuItem.java 2012-03-07 13:08:17 UTC (rev 1747)
+++ trunk/src/main/java/cc/kune/events/client/actions/EventAddMenuItem.java 2012-03-08 15:05:45 UTC (rev 1748)
@@ -75,7 +75,7 @@
contService.get().addNewContentWithGadgetAndState(session.getUserHash(),
session.getContainerState().getStateToken(),
EventsConstants.TYPE_MEETING_DEF_GADGETNAME, EventsConstants.TYPE_MEETING, title,
- title, EventsClientConversionUtil.toMap(appt), new AsyncCallbackSimple<StateContentDTO>() {
+ "", EventsClientConversionUtil.toMap(appt), new AsyncCallbackSimple<StateContentDTO>() {
@Override
public void onFailure(final Throwable caught) {
super.onFailure(caught);
Modified: trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java 2012-03-07 13:08:17 UTC (rev 1747)
+++ trunk/src/main/java/cc/kune/events/client/actions/EventsClientActions.java 2012-03-08 15:05:45 UTC (rev 1748)
@@ -60,8 +60,8 @@
final Provider<Calendar7DaysViewSelectBtn> cal7DaysBtn,
final Provider<CalendarMonthViewSelectBtn> calMonthBtn,
final Provider<EventAddMenuItem> eventAddMenuItem,
+ final Provider<EventOpenMenuItem> eventOpenMenuItem, final Provider<CalendarGoPrevBtn> calPrevBtn,
final Provider<EventRemoveMenuItem> eventRemoveMenuItem,
- final Provider<EventOpenMenuItem> eventOpenMenuItem, final Provider<CalendarGoPrevBtn> calPrevBtn,
final Provider<CalendarGoNextBtn> calNextBtn, final CalendarOnOverMenu onOverMenu,
final Provider<CalendarGoTodayBtn> goToday, final Provider<RefreshContentMenuItem> refresh) {
super(session, stateManager, i18n, registry);
@@ -82,8 +82,8 @@
// On over calendar menu
actionsRegistry.addAction(ActionGroups.TOOLBAR, onOverMenu, containers);
+ eventOpenMenuItem.get();
eventAddMenuItem.get();
- eventOpenMenuItem.get();
eventRemoveMenuItem.get();
// For now, commented:
Modified: trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java 2012-03-07 13:08:17 UTC (rev 1747)
+++ trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java 2012-03-08 15:05:45 UTC (rev 1748)
@@ -22,6 +22,7 @@
import com.bradrydzewski.gwt.calendar.client.Appointment;
import com.bradrydzewski.gwt.calendar.client.Calendar;
import com.bradrydzewski.gwt.calendar.client.CalendarSettings;
+import com.bradrydzewski.gwt.calendar.client.CalendarSettings.Click;
import com.bradrydzewski.gwt.calendar.client.CalendarViews;
import com.bradrydzewski.gwt.calendar.client.event.CreateHandler;
import com.bradrydzewski.gwt.calendar.client.event.DateRequestHandler;
@@ -65,6 +66,7 @@
final CalendarSettings settings = new CalendarSettings();
settings.setIntervalsPerHour(4);
settings.setPixelsPerInterval(10);
+ settings.setTimeBlockClickNumber(Click.Single);
// settings.setOffsetHourLabels(true);
settings.setScrollToHour(8);
calendar = new Calendar();
Modified: trunk/src/main/java/cc/kune/events/shared/EventsClientConversionUtil.java
===================================================================
--- trunk/src/main/java/cc/kune/events/shared/EventsClientConversionUtil.java 2012-03-07 13:08:17 UTC (rev 1747)
+++ trunk/src/main/java/cc/kune/events/shared/EventsClientConversionUtil.java 2012-03-08 15:05:45 UTC (rev 1748)
@@ -23,6 +23,9 @@
if (end != null) {
app.setEnd(DateUtils.toDate(end));
}
+ String allDay = properties.get(ICalConstants._ALL_DAY);
+ if (allDay != null)
+ app.setAllDay(Boolean.parseBoolean(allDay));
return app;
}
@@ -30,6 +33,7 @@
final Map<String, String> properties = EventsSharedConversionUtil.toMap(app);
properties.put(ICalConstants.DATE_TIME_START, DateUtils.toString(app.getStart()));
properties.put(ICalConstants.DATE_TIME_END, DateUtils.toString(app.getEnd()));
+ properties.put(ICalConstants._ALL_DAY, Boolean.toString(app.isAllDay()));
return properties;
}
Added: trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/Gadget.css
===================================================================
--- trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/Gadget.css (rev 0)
+++ trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/Gadget.css 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,136 @@
+/*
+ * StyleInjector CSS file for Gadget container.
+ * Author: vadimg(a)google.com (Vadim Gerasimov)
+ */
+
+.panel {
+ position: relative; /* Positioned container */
+ zoom: 1; /* Fixes IE positioning bug. */
+ overflow: hidden; /* Expand to size of floated contents. */
+ font-size: 0pt;
+ border: none;
+ clear: left;
+}
+
+.inline {
+ display: inline-block;
+ vertical-align: bottom;
+ width: 100%;
+}
+
+.title {
+ display: none;
+}
+
+.gadgetFrame {
+ margin-top: 0px;
+ margin-bottom: 0px;
+ font-size: 0pt;
+ display: block;
+ position: relative;
+}
+
+.loadingGadgetFrame {
+ border: 1px solid #b8c6d9;
+}
+
+.loadedGadgetFrame {
+ border: 1px solid transparent;
+}
+
+@sprite .loadingGadgetLargeThrobber {
+ gwt-image: 'loadingGadgetLarge';
+ background-color: #e6ebf2;
+ background-repeat: no-repeat;
+ line-height: value('loadingGadgetLarge.getHeight', 'px');
+ background-position: center center;
+ display: block;
+}
+
+@sprite .loadingGadgetSmallThrobber {
+ gwt-image: 'loadingGadgetSmall';
+ background-color: #e6ebf2;
+ background-repeat: no-repeat;
+ line-height: value('loadingGadgetSmall.getHeight', 'px');
+ background-position: center center;
+ display: block;
+}
+
+@url brokenGadgetUrl brokenGadget;
+.brokenGadgetIcon {
+ background-color: #e6ebf2;
+ background-image: brokenGadgetUrl;
+ background-repeat: no-repeat;
+ background-position: center center;
+ display: block;
+}
+
+.loadedGadget {
+ display: block;
+}
+
+.iframeDiv {
+ position: relative;
+ left: 0px;
+ top: 0px;
+}
+
+/* Buttons on each widget. */
+@eval metaButtonTransitionTime RESOURCES.FADE_DELAY_STRING;
+@sprite .metaButtons {
+ position: absolute;
+ right: 14px;
+ top: 6px;
+ z-index: 1;
+ gwt-image: 'metaMid';
+ overflow: visible; /* GWT's sprite rules stick in an overflow:hidden which we don't want. */
+ font-size: 0pt;
+
+ /** animate fade-in and fade-out of the meta buttons */
+ \-webkit-transition: opacity metaButtonTransitionTime ease-in-out;
+ \-moz-transition: opacity metaButtonTransitionTime ease-in-out;
+ transition: opacity metaButtonTransitionTime ease-in-out;
+}
+
+/*
+ * The left and right
+ */
+
+@eval metaLeftMargin RESOURCES.META_LEFT_WIDTH;
+@eval metaRightMargin RESOURCES.META_RIGHT_WIDTH;
+
+@sprite .metaRight {
+ gwt-image: 'metaRightImage';
+ float: left;
+ margin-right: metaRightMargin;
+}
+
+@sprite .metaLeft {
+ gwt-image: 'metaLeftImage';
+ float: left;
+ margin-left: metaLeftMargin;
+}
+
+.metaButtonsPanel {
+ float: left;
+}
+
+.metaButton {
+ /* Push the buttons down to align nicely with the mid, right and left background images. */
+ margin-top: 3px;
+ float: left;
+}
+
+.metaButton.disabled {
+ opacity: 0.5;
+}
+
+@if user.agent ie6 {
+ .metaButton.disabled {
+ filter: "alpha(opacity = 50)";
+ }
+}
+
+@sprite .more {
+ gwt-image: 'moreImage';
+}
Added: trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/GadgetWidget.java
===================================================================
--- trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/GadgetWidget.java (rev 0)
+++ trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/GadgetWidget.java 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,2036 @@
+// @formatter:off
+/**
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.waveprotocol.wave.client.gadget.renderer;
+
+import static org.waveprotocol.wave.model.gadget.GadgetConstants.AUTHOR_ATTRIBUTE;
+import static org.waveprotocol.wave.model.gadget.GadgetConstants.ID_ATTRIBUTE;
+import static org.waveprotocol.wave.model.gadget.GadgetConstants.IFRAME_URL_ATTRIBUTE;
+import static org.waveprotocol.wave.model.gadget.GadgetConstants.LAST_KNOWN_HEIGHT_ATTRIBUTE;
+import static org.waveprotocol.wave.model.gadget.GadgetConstants.LAST_KNOWN_WIDTH_ATTRIBUTE;
+import static org.waveprotocol.wave.model.gadget.GadgetConstants.PREFS_ATTRIBUTE;
+import static org.waveprotocol.wave.model.gadget.GadgetConstants.SNIPPET_ATTRIBUTE;
+import static org.waveprotocol.wave.model.gadget.GadgetConstants.STATE_ATTRIBUTE;
+import static org.waveprotocol.wave.model.gadget.GadgetConstants.TITLE_ATTRIBUTE;
+import static org.waveprotocol.wave.model.gadget.GadgetConstants.URL_ATTRIBUTE;
+
+import com.google.common.annotations.VisibleForTesting;
+import com.google.gwt.core.client.Duration;
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.core.client.JavaScriptObject;
+import com.google.gwt.dom.client.Document;
+import com.google.gwt.dom.client.ScriptElement;
+import com.google.gwt.http.client.URL;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.Random;
+import com.google.gwt.user.client.Window.Location;
+
+import org.waveprotocol.wave.client.account.ProfileManager;
+import org.waveprotocol.wave.client.common.util.UserAgent;
+import org.waveprotocol.wave.client.editor.content.AnnotationPainter;
+import org.waveprotocol.wave.client.editor.content.CMutableDocument;
+import org.waveprotocol.wave.client.editor.content.ContentElement;
+import org.waveprotocol.wave.client.editor.content.ContentNode;
+import org.waveprotocol.wave.client.gadget.GadgetLog;
+import org.waveprotocol.wave.client.gadget.StateMap;
+import org.waveprotocol.wave.client.gadget.StateMap.Each;
+import org.waveprotocol.wave.client.scheduler.ScheduleCommand;
+import org.waveprotocol.wave.client.scheduler.ScheduleTimer;
+import org.waveprotocol.wave.client.scheduler.Scheduler;
+import org.waveprotocol.wave.client.scheduler.Scheduler.Task;
+import org.waveprotocol.wave.model.conversation.ConversationBlip;
+import org.waveprotocol.wave.model.conversation.ObservableConversation;
+import org.waveprotocol.wave.model.document.util.Point;
+import org.waveprotocol.wave.model.document.util.XmlStringBuilder;
+import org.waveprotocol.wave.model.gadget.GadgetXmlUtil;
+import org.waveprotocol.wave.model.id.ModernIdSerialiser;
+import org.waveprotocol.wave.model.id.WaveletName;
+import org.waveprotocol.wave.model.supplement.ObservableSupplementedWave;
+import org.waveprotocol.wave.model.util.CollectionUtils;
+import org.waveprotocol.wave.model.util.ReadableStringMap.ProcV;
+import org.waveprotocol.wave.model.util.ReadableStringSet;
+import org.waveprotocol.wave.model.util.StringMap;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+
+import java.util.Collection;
+import java.util.Date;
+import java.util.List;
+
+/**
+ * Class to implement gadget widgets rendered in the client.
+ *
+ *
+ * TODO(user): Modularize the gadget APIs (base, Podium, Wave, etc).
+ *
+ * TODO(user): Refactor the common RPC call code.
+ */
+public class GadgetWidget extends ObservableSupplementedWave.ListenerImpl
+ implements GadgetRpcListener, GadgetWaveletListener, GadgetUiListener {
+
+ private static final String GADGET_RELAY_PATH = "gadgets/files/container/rpc_relay.html";
+ private static final int DEFAULT_HEIGHT_PX = 100;
+ private static final int DEFAULT_WIDTH_PX = -1;
+
+ /**
+ * Helper class to analyze element changes in the gadget state and prefs.
+ */
+ private abstract class ElementChangeTask {
+ /**
+ * Runs processChange() wrapped in code that detects and submits changes in
+ * the gadget state and prefs.
+ *
+ * @param node The node being processed or null if not defined.
+ */
+ void run(ContentNode node) {
+ if (!isActive()) {
+ log("Element change event in removed node: ignoring.");
+ return;
+ }
+ StateMap oldState = StateMap.create();
+ oldState.copyFrom(state);
+ final StateMap oldPrefs = StateMap.create();
+ oldPrefs.copyFrom(userPrefs);
+ processChange(node);
+ if (!state.compare(oldState)) {
+ gadgetStateSubmitter.submit();
+ }
+ // TODO(user): Optimize prefs updates.
+ if (!userPrefs.compare(oldPrefs)) {
+ userPrefs.each(new StateMap.Each() {
+ @Override
+ public void apply(String key, String value) {
+ if (!oldPrefs.has(key) || !value.equals(oldPrefs.get(key))) {
+ setGadgetPref(key, value);
+ }
+ }
+ });
+ }
+ }
+
+ /**
+ * Processes the changes in the elements.
+ *
+ * @param node The node being processed or null if not defined.
+ */
+ abstract void processChange(ContentNode node);
+ }
+
+ /**
+ * Podium state is stored as a part of the wave gadget state and can be
+ * visible to the Gadget via both Wave and Podium RPC interfaces.
+ */
+ private static final String PODIUM_STATE_NAME = "podiumState";
+
+ /**
+ * Gadget RPC path: location of the RPC JavaScript code to be loaded into the
+ * client code. This is the standard Gadget library to support RPCs.
+ */
+ static final String GADGET_RPC_PATH = "/gadgets/js/core:rpc.js";
+
+ /**
+ * Gadget name prefix: the common part of the gadget IFrame ID and name. The
+ * numeric gadget ID is appended to this prefix.
+ */
+ static final String GADGET_NAME_PREFIX = "wgadget_iframe_";
+
+ /** Primary view for gadgets. */
+ static final String GADGET_PRIMARY_VIEW = "canvas";
+
+ /** Default view for gadgets. */
+ static final String GADGET_DEFAULT_VIEW = "default";
+
+ /**
+ * Time in milliseconds to wait for the RPC script to load before logging a
+ * warning.
+ */
+ private static final int GADGET_RPC_LOAD_WARNING_TIMEOUT_MS = 30000;
+
+ /** Time granularity to check for the Gadget RPC library load state. */
+ private static final int GADGET_RPC_LOAD_TIMER_MS = 250;
+
+ /** Editing mode polling timer. */
+ private static final int EDITING_POLLING_TIMER_MS = 200;
+
+ /** Blip submit delay in milliseconds. */
+ private static final int BLIP_SUBMIT_TIMEOUT_MS = 30;
+
+ /** Gadget state send delay in milliseconds. */
+ private static final int STATE_SEND_TIMEOUT_MS = 30;
+
+ /** The Wave API version supported by the gadget container. */
+ private static final String WAVE_API_VERSION = "1";
+
+ /** The key for the playback state in the wave gadget state map. */
+ private static final String PLAYBACK_MODE_KEY = "${playback}";
+
+ /** The key for the edit state in the wave gadget state map. */
+ private static final String EDIT_MODE_KEY = "${edit}";
+
+ /** Gadget-loading frame border removal delay in ms. */
+ private static final int FRAME_BORDER_REMOVE_DELAY_MS = 3000;
+
+ /** Delay before sending one more participant information update in ms. */
+ private static final int REPEAT_PARTICIPANT_INFORMATION_SEND_DELAY_MS = 5000;
+
+ /** Object that manages Gadget UI HTML elements. */
+ private GadgetWidgetUi ui;
+
+ /** Gadget title element. */
+ private GadgetElementChild titleElement;
+
+ /** The gadget spec URL. */
+ private String source;
+
+ /** Gadget instance ID counter (local for each client). */
+ private static int nextClientInstanceId = 0;
+
+ /** Gadget instance ID. Non-final for testing. */
+ private int clientInstanceId;
+
+ /** Gadget iframe URL. */
+ private String iframeUrl;
+
+ /** Gadget RPC token.*/
+ private final String rpcToken;
+
+ /** Gadget security token. */
+ private String securityToken;
+
+ /** Gadget user preferences. */
+ private GadgetUserPrefs userPrefs;
+
+ /**
+ * Gadget state element map. Maps state keys to the corresponding elements.
+ */
+ private final StringMap<GadgetElementChild> prefElements;
+
+ /**
+ * Widget active flag: true after the widget is created, false after it is
+ * destroyed.
+ */
+ private boolean active = false;
+
+ /** ID of the gadget's wave/let. */
+ private WaveletName waveletName;
+
+ /** Host blip of this gadget. */
+ private ConversationBlip blip;
+
+ /** Blip submitter. */
+ private Submitter blipSubmitter;
+
+ /** Gadget state submitter. */
+ private Submitter gadgetStateSubmitter;
+
+ /** Private gadget state submitter. */
+ private Submitter privateGadgetStateSubmitter;
+
+ /** ContentElement in the wave that corresponds to this gadget. */
+ private ContentElement element;
+
+ /** Indicator for gadget's blip editing state. */
+ private EditingIndicator editingIndicator;
+
+ /** Participant information. */
+ private ParticipantInformation participants;
+
+ /** Gadget state. */
+ private StateMap state;
+
+ /** User id of the current logged in user. */
+ private String loginName;
+
+ /**
+ * Gadget state element map. Maps state keys to the corresponding elements.
+ */
+ private final StringMap<GadgetElementChild> stateElements;
+
+ /** Indicates whether the gadget is known to support the Wave API. */
+ private boolean waveEnabled = false;
+
+ /** Version of Wave API that is used by the gadget-side code. */
+ private String waveApiVersion = "";
+
+ /** Per-user wavelet to store private gadget data. */
+ private ObservableSupplementedWave supplement;
+
+ /** Provides profile information. */
+ private ProfileManager profileManager;
+
+ /** Wave client locale. */
+ private Locale locale;
+
+ /** Gadget library initialization flag. */
+ private static boolean initialized = false;
+
+ /**
+ * Gadget element child that defines what nodes to check for redundancy in the
+ * removeRedundantNodeTask. Only a single task can be scheduled at a time.
+ */
+ private GadgetElementChild redundantNodeCheckChild = null;
+
+ /**
+ * Indicates whether the gadget has performed a document mutation on behalf of
+ * the user. This flag is checked when the gadget tries to perform
+ * non-essential modifications of the document such as duplicate node cleanup
+ * or height attribute update. Performing such operations may generate
+ * unnecessary playback frames and attribute modifications to a user who did
+ * not use the gadget. The flag is set when the gadget modifies state, prefs,
+ * title, or any other elements that normally are linked to user actions in
+ * the gadget.
+ */
+ private boolean documentModified = false;
+
+ /**
+ * Indicates that the iframe URL attribute should be updated when the gadget
+ * modifies the document in response to a user action.
+ */
+ private boolean toUpdateIframeUrl = false;
+
+ private final String clientInstanceLogLabel;
+
+ // Note that the following regex expressions are strings rather than compiled patterns because GWT
+ // does not (yet) support those. Consider using the new GWT RegExp class in the future.
+
+ /**
+ * Pattern to match rpc token, security token, and user preference parameters
+ * in a URL fragment. Used to remove all these parameters.
+ */
+ private final static String FRAGMENT_CLEANING_PATTERN = "(^|&)(rpctoken=|st=|up_)[^&]*";
+
+ /**
+ * Pattern to match module ID and security token parameters a URL. Used to
+ * remove all these parameters.
+ */
+ private final static String URL_CLEANING_PATTERN = "&(mid=|st=|lang=|country=|debug=)[^&]*";
+
+ /**
+ * Pattern to match and remove URL fragment including the #.
+ */
+ private final static String FRAGMENT_PATTERN = "#.*";
+
+ /**
+ * Pattern to match and remove URL part before fragment including the #.
+ */
+ private final static String BEFORE_FRAGMENT_PATTERN = "[^#]*#";
+
+ /**
+ * Pattern to validate URL fragment.
+ */
+ private final static String FRAGMENT_VALIDATION_PATTERN =
+ "([\\w~!&(a)\\$\\-\\.\\'\\(\\)\\*\\+\\,\\;\\=\\?\\:]|%[0-9a-fA-F]{2})+";
+
+ /**
+ * Pattern to match iframe host in the beginning of a URL. This is not a
+ * validation check. The user can choose their own host. This simply serves
+ * to extract the iframe segment of the URL
+ */
+ private final static String IFRAME_HOST_PATTERN =
+ "^\\/\\/(https?:\\/\\/)?[^\\/]+\\/";
+
+ /**
+ * Pattern to remove XML-unsafe characters. Snippeting fails on some of those
+ * symbol combinations due to a potential bug in XML attribute processing.
+ * Theoretically all those symbols should be tolerated and displayed in
+ * snippets without any special processing in this class.
+ *
+ * TODO(user): Investigate/test this later to remove sanitization.
+ */
+ private final static String SNIPPET_SANITIZER_PATTERN = "[<>\\\"\\'\\&]";
+
+
+ /**
+ * Constructs GadgetWidget for testing.
+ */
+ private GadgetWidget() {
+ clientInstanceId = nextClientInstanceId++;
+ clientInstanceLogLabel = "[" + clientInstanceId + "]";
+ prefElements = CollectionUtils.createStringMap();
+ stateElements = CollectionUtils.createStringMap();
+ rpcToken = "" +
+ ((Long.valueOf(Random.nextInt()) << 32) | (Long.valueOf(Random.nextInt()) & 0xFFFFFFFFL));
+ }
+
+ private static native boolean gadgetLibraryLoaded() /*-{
+ return ($wnd.gadgets && $wnd.gadgets.rpc) ? true : false;
+ }-*/;
+
+ /**
+ * Preloads the libraries and initializes them on the first use.
+ */
+ private static void initializeGadgets() {
+ if (!initialized && !gadgetLibraryLoaded()) {
+ GadgetLog.log("Initializing Gadget RPC script tag.");
+ loadGadgetRpcScript();
+ initialized = true;
+ GadgetLog.log("Gadgets RPC script tag initialized.");
+ }
+ // TODO(user): Remove the css hacks once CAJA is fixed.
+ if (!initialized && !gadgetLibraryLoaded()) {
+ // HACK(user): NOT reachable, but GWT thinks it is.
+ excludeCssName();
+ }
+ }
+
+ /**
+ * Utility function to convert a Gadget StateMap to a string to be stored as
+ * an attribute value.
+ *
+ * @param state JSON object to be converted to string.
+ * @return string to be saved as an attribute value.
+ */
+ private static String stateToAttribute(StateMap state) {
+ if (state == null) {
+ return URL.encodeComponent("{}");
+ }
+ return URL.encodeComponent(state.toJson());
+ }
+
+ /**
+ * Utility function to convert an attribute string to a Gadget StateMap.
+ *
+ * @param attribute attribute value string.
+ * @return StateMap constructed from the attribute value.
+ */
+ private StateMap attributeToState(String attribute) {
+ StateMap result = StateMap.create();
+ if ((attribute != null) && !attribute.equals("")) {
+ log("Unescaped attribute: ", URL.decodeComponent(attribute));
+ result.fromJson(URL.decodeComponent(attribute));
+ log("State map: ", result.toJson());
+ }
+ return result;
+ }
+
+ /**
+ * Returns the gadget name that identifies the gadget and its frame.
+ *
+ * @return gadget name.
+ */
+ private String getGadgetName() {
+ return GADGET_NAME_PREFIX + clientInstanceId;
+ }
+
+ private void updatePrefsFromAttribute(String prefAttribute) {
+ if (!stateToAttribute(userPrefs).equals(prefAttribute)) {
+ StateMap prefState = attributeToState(prefAttribute);
+ userPrefs.parse(prefState, true);
+ log("Updating user prefs: ", userPrefs.toJson());
+ prefState.each(new StateMap.Each() {
+ @Override
+ public void apply(String key, String value) {
+ setGadgetPref(key, value);
+ }
+ });
+ }
+ }
+
+ /**
+ * Processes changes in the gadget element attributes.
+ * TODO(user): move some of this code to the handler.
+ *
+ * @param name attribute name.
+ * @param value new attribute value.
+ */
+ public void onAttributeModified(String name, String value) {
+ log("Attribute '", name, "' changed to '", value, "'");
+ if (userPrefs == null) {
+ log("Attribute changed before the gadget is initialized.");
+ return;
+ }
+
+ if (name.equals(URL_ATTRIBUTE)) {
+ source = (value == null) ? "" : value;
+ } else if (name.equals(TITLE_ATTRIBUTE)) {
+ String title = (value == null) ? "" : URL.decodeComponent(value);
+ if (!title.equals(ui.getTitleLabelText())) {
+ log("Updating title: ", title);
+ ui.setTitleLabelText(title);
+ }
+ } else if (name.equals(PREFS_ATTRIBUTE)) {
+ updatePrefsFromAttribute(value);
+ } else if (name.equals(STATE_ATTRIBUTE)) {
+ StateMap newState = attributeToState(value);
+ if (!state.compare(newState)) {
+ String podiumState = newState.get(PODIUM_STATE_NAME);
+ if ((podiumState != null) && (!podiumState.equals(state.get(PODIUM_STATE_NAME)))) {
+ sendPodiumOnStateChangedRpc(getGadgetName(), podiumState);
+ }
+ state.clear();
+ state.copyFrom(newState);
+ log("Updating gadget state: ", state.toJson());
+ gadgetStateSubmitter.submit();
+ }
+ }
+ }
+
+ /**
+ * Loads Gadget RPC library script.
+ */
+ private static void loadGadgetRpcScript() {
+ ScriptElement script = Document.get().createScriptElement();
+ script.setType("text/javascript");
+ script.setSrc(GADGET_RPC_PATH);
+ Document.get().getBody().appendChild(script);
+ }
+
+ /**
+ * Appends tokens to the iframe URI fragment.
+ *
+ * @param fragment Original parameter fragment of the gadget URI.
+ * @return Updated parameter fragment with new RPC and security tokens.
+ */
+ private String updateGadgetUriFragment(String fragment) {
+ fragment = "rpctoken=" + rpcToken +
+ (fragment.isEmpty() || (fragment.charAt(0) == '&') ? "" : "&") + fragment;
+ if ((securityToken != null) && !securityToken.isEmpty()) {
+ fragment += "&st=" + URL.encodeComponent(securityToken);
+ }
+ return fragment;
+ }
+
+ @VisibleForTesting
+ static String cleanUrl(String url) {
+ String baseUrl = url;
+ String fragment = "";
+ int fragmentIndex = url.indexOf("#");
+ if (fragmentIndex >= 0) {
+ fragment = (url.substring(fragmentIndex + 1)).replaceAll(FRAGMENT_CLEANING_PATTERN, "");
+ if (fragment.startsWith("&")) {
+ fragment = fragment.substring(1);
+ }
+ baseUrl = url.substring(0, fragmentIndex);
+ }
+ baseUrl = baseUrl.replaceAll(URL_CLEANING_PATTERN, "");
+ return baseUrl + (fragment.isEmpty() ? "" : "#" + fragment);
+ }
+
+ /**
+ * Constructs IFrame URI of this gadget.
+ *
+ * @param instanceId instance to encode in the URI.
+ * @param url URL template.
+ * @return IFrame URI of this gadget.
+ */
+ String buildIframeUrl(int instanceId, String url) {
+ final StringBuilder builder = new StringBuilder();
+ String fragment = "";
+ int fragmentIndex = url.indexOf("#");
+ if (fragmentIndex >= 0) {
+ fragment = url.substring(fragmentIndex + 1);
+ url = url.substring(0, fragmentIndex);
+ }
+ builder.append(url);
+
+ boolean enableGadgetCache = false;
+
+ builder.append("&nocache=" + (enableGadgetCache ? "0" : "1"));
+ builder.append("&mid=" + instanceId);
+ builder.append("&lang=" + locale.getLanguage());
+ builder.append("&country=" + locale.getCountry());
+ String href = getUrlPrefix();
+ // TODO(user): Parent is normally the last non-hash parameter. It is moved
+ // as a temp fix for kitchensinky. Move it back when the kitchensinky is
+ // working wihout this workaround.
+ builder.append("&parent=" + URL.encode(href));
+ builder.append("&wave=" + WAVE_API_VERSION);
+ builder.append("&waveId=" + URL.encodeQueryString(
+ ModernIdSerialiser.INSTANCE.serialiseWaveId(waveletName.waveId)));
+ fragment = updateGadgetUriFragment(fragment);
+ if (!fragment.isEmpty()) {
+ builder.append("#" + fragment);
+ log("Appended fragment: ", fragment);
+ }
+ if (userPrefs != null) {
+ userPrefs.each(new StateMap.Each() {
+ @Override
+ public void apply(String key, String value) {
+ if (value != null) {
+ builder.append("&up_");
+ builder.append(URL.encodeQueryString(key));
+ builder.append('=');
+ builder.append(URL.encodeQueryString(value));
+ }
+ }
+ });
+ }
+ return builder.toString();
+ }
+
+ /**
+ * Verifies that the gadget has non-empty attribute.
+ *
+ * @param name attribute name.
+ * @return true if non-empty height attribute exists, flase otherwise.
+ */
+ private boolean hasAttribute(String name) {
+ if (element.hasAttribute(name)) {
+ String value = element.getAttribute(name);
+ if (!"".equals(value)) {
+ return true;
+ }
+ }
+ return false;
+ }
+
+ /**
+ * Updates the gadget attribute in a deferred command if the panel is
+ * editable.
+ *
+ * @param attributeName attribute name.
+ * @param value new attribute value.
+ */
+ private void scheduleGadgetAttributeUpdate(final String attributeName, final String value) {
+ ScheduleCommand.addCommand(new Scheduler.Task() {
+ @Override
+ public void execute() {
+ if (canModifyDocument() && documentModified) {
+ String oldValue = element.getAttribute(attributeName);
+ if (!value.equals(oldValue)) {
+ element.getMutableDoc().setElementAttribute(element, attributeName, value);
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * Updates gadget IFrame attributes.
+ *
+ * @param url URL template for the iframe.
+ * @param width preferred width of the iframe.
+ * @param height preferred height of the iframe.
+ */
+ private void updateGadgetIframe(String url, long width, long height) {
+ if (!isActive()) {
+ return;
+ }
+ iframeUrl = url;
+ if (hasAttribute(LAST_KNOWN_WIDTH_ATTRIBUTE)) {
+ setSavedIframeWidth();
+ } else if (width != 0) {
+ ui.setIframeWidth(width + "px");
+ ui.makeInline();
+ scheduleGadgetAttributeUpdate(LAST_KNOWN_WIDTH_ATTRIBUTE, Long.toString(width));
+ } else {
+ ui.setIframeWidth("100%");
+ }
+ if (!hasAttribute(LAST_KNOWN_HEIGHT_ATTRIBUTE) && (height != 0)) {
+ ui.setIframeHeight(height);
+ scheduleGadgetAttributeUpdate(LAST_KNOWN_HEIGHT_ATTRIBUTE, Long.toString(height));
+ }
+ String ifr = buildIframeUrl(getInstanceId(), url);
+ log("ifr: ", ifr);
+ ui.setIframeSource(ifr);
+ }
+
+ private int parseSizeString(String heightString) throws NumberFormatException {
+ if (heightString.endsWith("px")) {
+ return Integer.parseInt(heightString.substring(0, heightString.length() - 2));
+ } else {
+ return Integer.parseInt(heightString);
+ }
+ }
+
+ /**
+ * Updates gadget iframe height if the gadget has the height attribute.
+ */
+ private void setSavedIframeHeight() {
+ if (hasAttribute(LAST_KNOWN_HEIGHT_ATTRIBUTE)) {
+ String savedHeight = element.getAttribute(LAST_KNOWN_HEIGHT_ATTRIBUTE);
+ try {
+ int height = parseSizeString(savedHeight);
+ ui.setIframeHeight(height);
+ } catch (NumberFormatException e) {
+ log("Invalid saved height attribute (ignored): ", savedHeight);
+ }
+ }
+ }
+
+ /**
+ * Updates gadget iframe height if the gadget has the height attribute.
+ */
+ private void setSavedIframeWidth() {
+ if (hasAttribute(LAST_KNOWN_WIDTH_ATTRIBUTE)) {
+ String savedWidth = element.getAttribute(LAST_KNOWN_WIDTH_ATTRIBUTE);
+ try {
+ int width = parseSizeString(savedWidth);
+ ui.setIframeWidth(width + "px");
+ ui.makeInline();
+ } catch (NumberFormatException e) {
+ log("Invalid saved width attribute (ignored): ", savedWidth);
+ }
+ }
+ }
+
+ /**
+ * Creates a display widget for the gadget.
+ *
+ * @param element ContentElement from the wave.
+ * @param blip gadget blip.
+ * @return display widget for the gadget.
+ */
+ public static GadgetWidget createGadgetWidget(ContentElement element, WaveletName waveletName,
+ ConversationBlip blip, ObservableSupplementedWave supplement,
+ ProfileManager profileManager, Locale locale, String loginName) {
+
+ final GadgetWidget widget = GWT.create(GadgetWidget.class);
+
+ widget.element = element;
+ widget.editingIndicator =
+ new BlipEditingIndicator(element.getRenderedContentView().getDocumentElement());
+ widget.ui = new GadgetWidgetUi(widget.getGadgetName(), widget.editingIndicator);
+ widget.state = StateMap.create();
+ initializeGadgets();
+ widget.blip = blip;
+ widget.initializeGadgetContainer();
+ widget.ui.setGadgetUiListener(widget);
+ widget.waveletName = waveletName;
+ widget.supplement = supplement;
+ widget.profileManager = profileManager;
+ widget.locale = locale;
+ widget.loginName = loginName;
+ supplement.addListener(widget);
+ return widget;
+ }
+
+ /**
+ * @return the actual GWT widget
+ */
+ public GadgetWidgetUi getWidget() {
+ return ui;
+ }
+
+ @Override
+ public void setTitle(String title) {
+ if (!isActive()) {
+ return;
+ }
+ final String newTitle = (title == null) ? "" : title;
+ log("Set title '", XmlStringBuilder.createText(newTitle), "'");
+ if (titleElement == null) {
+ onModifyingDocument();
+ GadgetElementChild.create(element.getMutableDoc().insertXml(
+ Point.end((ContentNode) element), GadgetXmlUtil.constructTitleXml(newTitle)));
+ blipSubmitter.submit();
+ } else {
+ if (!title.equals(titleElement.getValue())) {
+ onModifyingDocument();
+ titleElement.setValue(newTitle);
+ blipSubmitter.submit();
+ }
+ }
+ }
+
+ @Override
+ public void logMessage(String message) {
+ GadgetLog.developerLog(message);
+ }
+
+ private String sanitizeSnippet(String snippet) {
+ return snippet.replaceAll(SNIPPET_SANITIZER_PATTERN, " ");
+ }
+
+ @Override
+ public void setSnippet(String snippet) {
+ if (!canModifyDocument()) {
+ return;
+ }
+ String safeSnippet = sanitizeSnippet(snippet);
+ log("Snippet changed: " + safeSnippet);
+ scheduleGadgetAttributeUpdate(SNIPPET_ATTRIBUTE, safeSnippet);
+ }
+
+ /**
+ * Gets the attribute value from the mutable document associated with the
+ * gadget.
+ *
+ * @param attributeName name of the attribute
+ * @return attribute value or empty string if attribute is missing
+ */
+ private String getAttribute(String attributeName) {
+ return element.hasAttribute(attributeName) ? element.getAttribute(attributeName) : "";
+ }
+
+ @VisibleForTesting
+ static String getIframeHost(String url) {
+ // Ideally this should be done with regex matcher which is not supported in GWT.
+ String iframeHostMatcher = url.replaceFirst(IFRAME_HOST_PATTERN, "");
+ if (iframeHostMatcher.length() != url.length()) {
+ return url.substring(0, url.length() - iframeHostMatcher.length());
+ } else {
+ return "";
+ }
+ }
+
+ /**
+ * Controller registration task.
+ *
+ * @param url URL template of the gadget iframe.
+ * @param width preferred iframe width.
+ * @param height preferred iframe height.
+ */
+ private void controllerRegistration(String url, long width, long height) {
+ Controller controller = Controller.getInstance();
+ String iframeHost = getIframeHost(url);
+ String relayUrl = iframeHost + GADGET_RELAY_PATH;
+ controller.setRelayUrl(getGadgetName(), relayUrl);
+ controller.registerGadgetListener(getGadgetName(), GadgetWidget.this);
+ controller.setRpcToken(getGadgetName(), rpcToken);
+ updateGadgetIframe(url, width, height);
+ removeFrameBorder();
+
+ delayedPodiumInitialization();
+ log("Gadget ", getGadgetName(), " is registered, relayUrl=", relayUrl,
+ ", RPC token=", rpcToken);
+ }
+
+ private void registerWithController(String url, long width, long height) {
+ if (gadgetLibraryLoaded()) {
+ controllerRegistration(url, width, height);
+ } else {
+ scheduleControllerRegistration(url, width, height);
+ }
+ }
+
+ /**
+ * Registers the Gadget object as RPC event listener with the Gadget RPC
+ * Controller after waiting for the Gadget RPC library to load.
+ */
+ private void scheduleControllerRegistration(
+ final String url, final long width, final long height) {
+ new ScheduleTimer() {
+ private double loadWarningTime =
+ Duration.currentTimeMillis() + GADGET_RPC_LOAD_WARNING_TIMEOUT_MS;
+ @Override
+ public void run() {
+ if (!isActive()) {
+ cancel();
+ log("Not active.");
+ return;
+ } else if (gadgetLibraryLoaded()) {
+ cancel();
+ controllerRegistration(url, width, height);
+ } else {
+ if (Duration.currentTimeMillis() > loadWarningTime) {
+ log("Gadget RPC script failed to load on time.");
+ loadWarningTime += GADGET_RPC_LOAD_WARNING_TIMEOUT_MS;
+ }
+ }
+ }
+ }.scheduleRepeating(GADGET_RPC_LOAD_TIMER_MS);
+ }
+
+ private void initializeGadgetContainer() {
+ userPrefs = GadgetUserPrefs.create();
+ blipSubmitter = new Submitter(BLIP_SUBMIT_TIMEOUT_MS, new Submitter.SubmitTask() {
+ @Override public void doSubmit() {
+ // TODO: send a playback frame signal.
+ log("Blip submitted.");
+ }
+ });
+ gadgetStateSubmitter = new Submitter(STATE_SEND_TIMEOUT_MS, new Submitter.SubmitTask() {
+ @Override public void doSubmit() {
+ sendGadgetState();
+ log("Gadget state sent.");
+ }
+ });
+ privateGadgetStateSubmitter = new Submitter(STATE_SEND_TIMEOUT_MS, new Submitter.SubmitTask() {
+ @Override public void doSubmit() {
+ sendPrivateGadgetState();
+ log("Private gadget state sent.");
+ }
+ });
+ }
+
+ private void initializePodium() {
+ if (!isActive()) {
+ // If the widget does not exist, exit.
+ return;
+ }
+ for (ParticipantId participant : blip.getConversation().getParticipantIds()) {
+ String myId = participants.getMyId();
+ if ((myId != null) && !participant.getAddress().equals(myId)) {
+ String opponentId = participant.getAddress();
+ try {
+ sendPodiumOnInitializedRpc(getGadgetName(), myId, opponentId);
+ log("Sent Podium initialization: " + myId + " " + opponentId);
+ String podiumState = state.get(PODIUM_STATE_NAME);
+ if (podiumState != null) {
+ sendPodiumOnStateChangedRpc(getGadgetName(), podiumState);
+ log("Sent Podium state update.");
+ }
+ } catch (Exception e) {
+ // This is a catch to avoid sending RPCs to deleted gadgets.
+ log("Podium initialization failure");
+ }
+ return;
+ }
+ }
+ log("Podium is not initialized: less than two participants.");
+ }
+
+ private void delayedPodiumInitialization() {
+ // TODO(user): This is a hack to delay Podium initialization.
+ // Define an initialization protocol for Podium to avoid this.
+ new ScheduleTimer() {
+ @Override
+ public void run() {
+ initializePodium();
+ }
+ }.schedule(3000);
+ }
+
+ private void removeFrameBorder() {
+ new ScheduleTimer() {
+ @Override
+ public void run() {
+ ui.removeThrobber();
+ }
+ }.schedule(FRAME_BORDER_REMOVE_DELAY_MS);
+ }
+
+ private void constructGadgetFromMetadata(GadgetMetadata metadata, String view, String token) {
+ log("Received metadata: ", metadata.getIframeUrl(view));
+ String url = cleanUrl(metadata.getIframeUrl(view));
+ if (url.equals(iframeUrl) && ((token == null) || token.isEmpty())) {
+ log("Received metadata matches the cached information.");
+ constructGadgetSizeFromMetadata(metadata, view, url);
+ return;
+ }
+ // NOTE(user): Technically we should not save iframe URLs for gadgets with security tokens,
+ // but some gadgets, such as YNM, that depend on opensocial libraries get security tokens they
+ // never use. Also to enable gadgets in Ripple and other light Wave clients it's desirable to
+ // to always have the iframe URL at least for rudimentary rendering.
+ if (canModifyDocument() && documentModified) {
+ scheduleGadgetAttributeUpdate(IFRAME_URL_ATTRIBUTE, url);
+ } else {
+ toUpdateIframeUrl = true;
+ }
+ securityToken = token;
+ if ("".equals(ui.getTitleLabelText()) && metadata.hasTitle()) {
+ ui.setTitleLabelText(metadata.getTitle());
+ }
+ constructGadgetSizeFromMetadata(metadata, view, url);
+ }
+
+ private void constructGadgetSizeFromMetadata(GadgetMetadata metadata, String view, String url) {
+ int height =
+ (int) (metadata.hasHeight() ? metadata.getHeight() : metadata.getPreferredHeight(view));
+ int width =
+ (int) (metadata.hasWidth() ? metadata.getWidth() : metadata.getPreferredWidth(view));
+ registerWithController(url, width, height);
+ if (height > 0) {
+ setIframeHeight(String.valueOf(height));
+ } else {
+ setIframeHeight(String.valueOf(DEFAULT_HEIGHT_PX));
+ }
+ if (width > 0){
+ setIframeWidth(String.valueOf(width));
+ } else {
+ setIframeWidth(String.valueOf(DEFAULT_WIDTH_PX));
+ }
+ }
+
+ /**
+ * This function generates a gadget instance ID for generating gadget metadata
+ * and security tokens. The ID should be 1. hard to guess; 2. same for the
+ * same gadget element for the same participant in the same wave every time
+ * the wave is rendered in the same client; 3. preferably, but not necessarily
+ * different for different gadget elements and different participants.
+ *
+ * Condition 2 is needed to achieve consistent behavior in gadgets that, for
+ * example, request special permissions using OAuth/OpenSocial.
+ *
+ * This function satisfies those conditions, except the ID is going to be
+ * always the same for the same type of the gadget in the same wavelet for the
+ * same participant. This poses minimal risk (in terms of matching domains and
+ * security tokens) because the gadgets with matching IDs would be rendered
+ * for the same person in the same wave.
+ *
+ * NOTE(user): Instance ID should be non-negative number to work around a
+ * bug in GGS and/or Linux libraries that produces non-renderable iframe URLs
+ * for negative instance IDs. The domain name starts with dash "-". Browsers
+ * in Windows and Mac OS tolerate this, but browsers in Linux fail to render
+ * such URLs.
+ *
+ * @return instance ID for the gadget.
+ */
+ private int getInstanceId() {
+ String name = ModernIdSerialiser.INSTANCE.serialiseWaveletName(waveletName);
+ String instanceDescriptor = name + loginName + source;
+ int hash = instanceDescriptor.hashCode();
+ return (hash < 0) ? ~hash : hash;
+ }
+
+ private void showBrokenGadget(String message) {
+ ui.showBrokenGadget(message);
+ log("Broken gadget: ", message);
+ }
+
+ private boolean validIframeUrl(String url) {
+ return (url != null) && !url.isEmpty() && !getIframeHost(url).isEmpty();
+ }
+
+ private void scheduleGadgetIdUpdate() {
+ ScheduleCommand.addCommand(new Scheduler.Task() {
+ @Override
+ public void execute() {
+ generateAndSetGadgetId();
+ }
+ });
+ }
+
+ private void allowModificationOfNewlyCreatedGadget() {
+ // Missing height attribute indicates freshly added gadget. Assume that the
+ // document is modified for the purpose of updating attributes.
+ if (!hasAttribute(LAST_KNOWN_HEIGHT_ATTRIBUTE) && editingIndicator.isEditing()) {
+ scheduleGadgetIdUpdate();
+ onModifyingDocument();
+ }
+ }
+
+ /**
+ * Creates a widget to render the gadget.
+ */
+ public void createWidget() {
+ if (isActive()) {
+ log("Repeated attempt to create gadget widget.");
+ return;
+ }
+
+ active = true;
+ log("Creating Gadget Widget ", getGadgetName());
+
+ ui.enableMenu();
+ allowModificationOfNewlyCreatedGadget();
+ setSavedIframeHeight();
+ setSavedIframeWidth();
+
+ source = getAttribute(URL_ATTRIBUTE);
+ String title = getAttribute(TITLE_ATTRIBUTE);
+ ui.setTitleLabelText((title == null) ? "" : URL.decodeComponent(title));
+ updatePrefsFromAttribute(getAttribute(PREFS_ATTRIBUTE));
+ refreshParticipantInformation();
+
+ // HACK(anorth): This event routing should happen outside the widget.
+ ObservableConversation conv = (ObservableConversation) blip.getConversation();
+ conv.addListener(new WaveletListenerAdapter(blip, this));
+ log("Requesting Gadget metadata: ", source);
+ String cachedIframeUrl = getAttribute(IFRAME_URL_ATTRIBUTE);
+ if (validIframeUrl(cachedIframeUrl)) {
+ registerWithController(cleanUrl(cachedIframeUrl), 0, 0);
+ }
+ GadgetDataStoreImpl.getInstance().getGadgetData(source, waveletName, getInstanceId(),
+ new GadgetDataStore.DataCallback() {
+ @Override
+ public void onError(String message, Throwable t) {
+ if ((t != null) && (t.getMessage() != null)) {
+ message += " " + t.getMessage();
+ }
+ showBrokenGadget(message);
+ }
+
+ @Override
+ public void onDataReady(GadgetMetadata metadata, String securityToken) {
+ if (isActive()) {
+ ReadableStringSet views = metadata.getViewSet();
+ String view = null;
+ if (views.contains(GADGET_PRIMARY_VIEW)) {
+ view = GADGET_PRIMARY_VIEW;
+ } else if (views.contains(GADGET_DEFAULT_VIEW)) {
+ view = GADGET_DEFAULT_VIEW;
+ } else if (!views.isEmpty()) {
+ view = views.someElement();
+ } else {
+ showBrokenGadget("Gadget has no view to render.");
+ return;
+ }
+ String url = metadata.getIframeUrl(view);
+ if (validIframeUrl(url)) {
+ constructGadgetFromMetadata(metadata, view, securityToken);
+ } else {
+ showBrokenGadget("Invalid IFrame URL " + url);
+ }
+ }
+ }
+ });
+ }
+
+ /**
+ * Utility function to send setPref RPC to the gadget.
+ *
+ * @param target the gadget frame ID.
+ * @param name name of the preference to set.
+ * @param value value of the preference.
+ */
+ public native void sendGadgetPrefRpc(String target, String name, String value) /*-{
+ try {
+ $wnd.gadgets.rpc.call(target, 'set_pref', null, 0, name, value);
+ } catch (e) {
+ // HACK(user): Ignoring any failure for now.
+ @org.waveprotocol.wave.client.gadget.GadgetLog::log(Ljava/lang/String;)
+ ('set_pref RPC failed');
+ }
+ }-*/;
+
+ /**
+ * Utility function to send initialization RPC to Podium gadget.
+ *
+ * @param target the gadget frame ID.
+ * @param id Podium ID of this client.
+ * @param otherId Podium ID of the opponent client.
+ */
+ public native void sendPodiumOnInitializedRpc(String target, String id, String otherId) /*-{
+ try {
+ $wnd.gadgets.rpc.call(target, 'onInitialized', null, id, otherId);
+ } catch (e) {
+ // HACK(user): Ignoring any failure for now.
+ @org.waveprotocol.wave.client.gadget.GadgetLog::log(Ljava/lang/String;)
+ ('onInitialized RPC failed');
+ }
+ }-*/;
+
+ /**
+ * Utility function to send state change RPC to Podium gadget.
+ *
+ * @param target the gadget frame ID.
+ * @param state Podium gadget state.
+ */
+ public native void sendPodiumOnStateChangedRpc(String target, String state) /*-{
+ try {
+ $wnd.gadgets.rpc.call(target, 'onStateChanged', null, state);
+ } catch (e) {
+ // HACK(user): Ignoring any failure for now.
+ @org.waveprotocol.wave.client.gadget.GadgetLog::log(Ljava/lang/String;)
+ ('onStateChanged RPC failed');
+ }
+ }-*/;
+
+ /**
+ * Utility function to send title to the embedding container.
+ *
+ * @param title the title value for the container.
+ */
+ public native void sendEmbeddedRpc(String title) /*-{
+ try {
+ $wnd.gadgets.rpc.call(null, 'set_title', null, title);
+ } catch (e) {
+ // HACK(user): Ignoring any failure for now.
+ @org.waveprotocol.wave.client.gadget.GadgetLog::log(Ljava/lang/String;)
+ ('set_title RPC failed');
+ }
+ }-*/;
+
+ /**
+ * Utility function to send participant information to Wave gadget.
+ *
+ * @param target the gadget frame ID.
+ * @param participants JSON string of Wavelet participants.
+ */
+ public native void sendParticipantsRpc(String target, JavaScriptObject participants) /*-{
+ try {
+ $wnd.gadgets.rpc.call(target, 'wave_participants', null, participants);
+ } catch (e) {
+ // HACK(user): Ignoring any failure for now.
+ @org.waveprotocol.wave.client.gadget.GadgetLog::log(Ljava/lang/String;)
+ ('wave_participants RPC failed');
+ }
+ }-*/;
+
+ /**
+ * Utility function to send Gadget state to Wave gadget.
+ *
+ * @param target the gadget frame ID.
+ * @param state JSON string of Gadget state.
+ */
+ public native void sendGadgetStateRpc(String target, JavaScriptObject state) /*-{
+ try {
+ $wnd.gadgets.rpc.call(target, 'wave_gadget_state', null, state);
+ } catch (e) {
+ // HACK(user): Ignoring any failure for now.
+ @org.waveprotocol.wave.client.gadget.GadgetLog::log(Ljava/lang/String;)
+ ('wave_gadget_state RPC failed');
+ }
+ }-*/;
+
+ /**
+ * Utility function to send private Gadget state to Wave gadget.
+ *
+ * @param target the gadget frame ID.
+ * @param state JSON string of Gadget state.
+ */
+ public native void sendPrivateGadgetStateRpc(String target, JavaScriptObject state) /*-{
+ try {
+ $wnd.gadgets.rpc.call(target, 'wave_private_gadget_state', null, state);
+ } catch (e) {
+ // HACK(user): Ignoring any failure for now.
+ @org.waveprotocol.wave.client.gadget.GadgetLog::log(Ljava/lang/String;)
+ ('wave_private_gadget_state RPC failed');
+ }
+ }-*/;
+
+ /**
+ * Utility function to send Gadget mode to Wave gadget.
+ *
+ * @param target the gadget frame ID.
+ * @param mode JSON string of Gadget state.
+ */
+ public native void sendModeRpc(String target, JavaScriptObject mode) /*-{
+ try {
+ $wnd.gadgets.rpc.call(target, 'wave_gadget_mode', null, mode);
+ } catch (e) {
+ // HACK(user): Ignoring any failure for now.
+ @org.waveprotocol.wave.client.gadget.GadgetLog::log(Ljava/lang/String;)
+ ('wave_gadget_mode RPC failed');
+ }
+ }-*/;
+
+ /**
+ * Sends the gadget state to the wave gadget. Injects the playback state value
+ * into the state.
+ */
+ public void sendGadgetState() {
+ if (waveEnabled) {
+ log("Sending gadget state: ", state.toJson());
+ sendGadgetStateRpc(getGadgetName(), state.asJavaScriptObject());
+ }
+ }
+
+ /**
+ * Sends the private gadget state to the wave gadget.
+ */
+ public void sendPrivateGadgetState() {
+ if (waveEnabled) {
+ String gadgetId = getGadgetId();
+ StateMap privateState = StateMap.createFromStringMap(gadgetId != null ?
+ supplement.getGadgetState(gadgetId) : CollectionUtils.<String> emptyMap());
+ log("Sending private gadget state: ", privateState.toJson());
+ sendPrivateGadgetStateRpc(getGadgetName(), privateState.asJavaScriptObject());
+ }
+ }
+
+ /**
+ * Sends the gadget mode to the wave gadget.
+ */
+ public void sendMode() {
+ if (waveEnabled) {
+ StateMap mode = StateMap.create();
+ mode.put(PLAYBACK_MODE_KEY, "0");
+ mode.put(EDIT_MODE_KEY, editingIndicator.isEditing() ? "1" : "0");
+ log("Sending gadget mode: ", mode.toJson());
+ sendModeRpc(getGadgetName(), mode.asJavaScriptObject());
+ }
+ }
+
+ /**
+ * Returns the ID of the user who added the gadget as defined in the author
+ * attribute. If the attribute is not defined returns the blip author instead
+ * (as the best guess for the author for backward compatibility).
+ *
+ * @return author ID of the user who added the gadget to the wave
+ */
+ private String getAuthor() {
+ String author = element.getAttribute(AUTHOR_ATTRIBUTE);
+ return (author != null) ? author : blip.getAuthorId().getAddress();
+ }
+
+ /**
+ * Builds a map of participants from two lists of participant ids.
+ */
+ private StringMap<ParticipantId> getParticipantsForIds(
+ Collection<ParticipantId> list1, Collection<ParticipantId> list2) {
+ StringMap<ParticipantId> mergedMap = CollectionUtils.createStringMap();
+ for (ParticipantId p : list1) {
+ mergedMap.put(p.getAddress(), p);
+ }
+ for (ParticipantId p : list2) {
+ mergedMap.put(p.getAddress(), p);
+ }
+ return mergedMap;
+ }
+
+ /**
+ * Refreshes the participant information.
+ */
+ private void refreshParticipantInformation() {
+ StringMap<ParticipantId> waveletParticipants = getParticipantsForIds(
+ blip.getConversation().getParticipantIds(), blip.getContributorIds());
+ ParticipantId viewerId = new ParticipantId(loginName);
+ waveletParticipants.put(viewerId.getAddress(), viewerId);
+ List<ParticipantId> participantList = CollectionUtils.newJavaList(waveletParticipants);
+ participants = ParticipantInformation.create(
+ viewerId.getAddress(), getAuthor(), participantList, getUrlPrefix(), profileManager);
+ final StringBuilder builder = new StringBuilder();
+ builder.append("Participants: ");
+ builder.append("I am " + participants.getMyId());
+ for (ParticipantId participant : participantList) {
+ builder.append("; " + participant);
+ }
+
+ log(builder.toString());
+ }
+
+ /**
+ * Refreshes and sends participant information to wave-enabled gadget.
+ */
+ private void sendCurrentParticipantInformation() {
+ if (waveEnabled) {
+ refreshParticipantInformation();
+ sendParticipantsRpc(getGadgetName(), participants);
+ log("Sent participants: ", participants);
+ }
+ }
+
+ /**
+ * Utility function to perform setPref RPC to the gadget.
+ *
+ * @param name name of the preference to set.
+ * @param value value of the preference.
+ */
+ public void setGadgetPref(final String name, final String value) {
+ ScheduleCommand.addCommand(new Task() {
+ @Override
+ public void execute() {
+ if (isActive()) {
+ sendGadgetPrefRpc(getGadgetName(), name, value);
+ }
+ }
+ });
+ }
+
+ /**
+ * Marks the Widget as inactive after the gadget node is removed from the
+ * parent.
+ */
+ public void setInactive() {
+ log("Gadget node removed.");
+ supplement.removeListener(this);
+ active = false;
+ }
+
+ @Override
+ public void setIframeHeight(String height) {
+ if (!isActive()) {
+ return;
+ }
+ log("Set IFrame height ", height);
+ try {
+ int heightValue = parseSizeString(height);
+ ui.setIframeHeight(heightValue);
+ scheduleGadgetAttributeUpdate(LAST_KNOWN_HEIGHT_ATTRIBUTE, Long.toString(heightValue));
+ } catch (NumberFormatException e) {
+ log("Invalid height (ignored): ", height);
+ }
+ }
+
+ public void setIframeWidth(String width) {
+ if (!isActive()) {
+ return;
+ }
+ log("Set IFrame width ", width);
+ try {
+ int widthValue = parseSizeString(width);
+ if (widthValue <= 0) {
+ ui.setIframeWidth("100%");
+ } else {
+ ui.setIframeWidth(widthValue + "px");
+ }
+ ui.makeInline();
+ scheduleGadgetAttributeUpdate(LAST_KNOWN_WIDTH_ATTRIBUTE, Long.toString(widthValue));
+ } catch (NumberFormatException e) {
+ log("Invalid width (ignored): ", width);
+ }
+ }
+
+ @Override
+ public void requestNavigateTo(String url) {
+ log("Requested navigate to: ", url);
+ // NOTE(user): Currently only allow the gadgets to change the fragment part of the URL.
+ String newFragment = url.replaceFirst(BEFORE_FRAGMENT_PATTERN, "");
+ if (newFragment.matches(FRAGMENT_VALIDATION_PATTERN)) {
+ Location.replace(Location.getHref().replaceFirst(FRAGMENT_PATTERN, "") + "#" + newFragment);
+ } else {
+ log("Navigate request denied.");
+ }
+ }
+
+ @Override
+ public void updatePodiumState(String podiumState) {
+ if (isActive()) {
+ modifyState(PODIUM_STATE_NAME, podiumState);
+ blipSubmitter.submit();
+ }
+ }
+
+ private void setPref(String key, String value) {
+ if (!canModifyDocument() || (key == null) || (value == null)) {
+ return;
+ }
+ userPrefs.put(key, value);
+ if (prefElements.containsKey(key)) {
+ if (!prefElements.get(key).getValue().equals(value)) {
+ log("Updating preference '", key, "'='", value, "'");
+ onModifyingDocument();
+ prefElements.get(key).setValue(value);
+ blipSubmitter.submit();
+ }
+ } else {
+ log("New preference '", key, "'='", value, "'");
+ onModifyingDocument();
+ element.getMutableDoc().insertXml(
+ Point.end((ContentNode)element), GadgetXmlUtil.constructPrefXml(key, value));
+ blipSubmitter.submit();
+ }
+
+ }
+
+ @Override
+ public void setPrefs(String ... keyValue) {
+ // Ignore callbacks from the gadget in playback mode.
+ if (!canModifyDocument()) {
+ return;
+ }
+ // Ignore the last key if its value is missing.
+ for (int i = 0; i < keyValue.length - 1; i+=2) {
+ setPref(keyValue[i], keyValue[i + 1]);
+ }
+ }
+
+ /**
+ * Sets up a polling loop to check the edit mode state and send it to the
+ * gadget.
+ *
+ * TODO(user): Add edit mode change events to the client and find a way to
+ * relay them to the gadget containers.
+ */
+ private void setupModePolling() {
+ new ScheduleTimer() {
+ private boolean wasEditing = editingIndicator.isEditing();
+
+ @Override
+ public void run() {
+ if (!isActive()) {
+ cancel();
+ return;
+ } else {
+ boolean newEditing = editingIndicator.isEditing();
+ if (wasEditing != newEditing) {
+ sendMode();
+ wasEditing = newEditing;
+ }
+ }
+ }
+ }.scheduleRepeating(EDITING_POLLING_TIMER_MS);
+ }
+
+ /**
+ * HACK: This is a workaround for Firefox bug
+ * https://bugzilla.mozilla.org/show_bug.cgi?id=498904 Due to this bug the
+ * gadget RPCs may be sent to a dead iframe. Changing the iframe ID fixes
+ * container-to-gadget communication. Non-wave gadgets may have other issues
+ * associated with this bug. But most wave-enabled gadgets should work when
+ * the iframe ID is updated in the waveEnable call.
+ */
+ private void substituteIframeId() {
+ clientInstanceId = nextClientInstanceId++;
+ ui.setIframeId(getGadgetName());
+ controllerRegistration(iframeUrl, 0, 0);
+ }
+
+ @Override
+ public void waveEnable(String waveApiVersion) {
+ if (!isActive()) {
+ return;
+ }
+
+ // HACK: See substituteIframeId() description.
+ // TODO(user): Remove when the Firefox bug is fixed.
+ if (UserAgent.isFirefox()) {
+ substituteIframeId();
+ }
+
+ waveEnabled = true;
+ this.waveApiVersion = waveApiVersion;
+ log("Wave-enabled gadget registered with API version ", waveApiVersion);
+ sendWaveGadgetInitialization();
+ setupModePolling();
+ }
+
+ @Override
+ public void waveGadgetStateUpdate(final JavaScriptObject delta) {
+ // Return if in playback mode. isEditable indicates playback.
+ if (!canModifyDocument()) {
+ return;
+ }
+
+ final StateMap deltaState = StateMap.create();
+ deltaState.fromJsonObject(delta);
+ // Defer state modifications to avoid RPC failure in Safari 3. The
+ // intermittent failure is caused by RPC called from received RPC
+ // callback.
+ // TODO(user): Remove this workaround once this is fixed in GGS.
+ ScheduleCommand.addCommand(new Task() {
+ @Override
+ public void execute() {
+ deltaState.each(new Each() {
+ @Override
+ public void apply(final String key, final String value) {
+ if (value != null) {
+ modifyState(key, value);
+ } else {
+ deleteState(key);
+ }
+ }
+ });
+ log("Applied delta ", delta.toString(), " new state ", state.toJson());
+ gadgetStateSubmitter.triggerScheduledSubmit();
+ blipSubmitter.submitImmediately();
+ }
+ });
+ }
+
+ /**
+ * Generates a unique gadget ID.
+ * TODO(user): Replace with proper MD5-based UUID.
+ *
+ * @return a unique gadget ID.
+ */
+ private String generateGadgetId() {
+ String name = ModernIdSerialiser.INSTANCE.serialiseWaveletName(waveletName);
+ String instanceDescriptor = name + getAuthor() + source;
+ String prefix = Integer.toHexString(instanceDescriptor.hashCode());
+ String time = Integer.toHexString(new Date().hashCode());
+ String version = Long.toHexString(blip.getLastModifiedVersion());
+ return prefix + time + version;
+ }
+
+ private String generateAndSetGadgetId() {
+ if (!canModifyDocument()) {
+ return null;
+ }
+ String id = generateGadgetId();
+ element.getMutableDoc().setElementAttribute(element, ID_ATTRIBUTE, id);
+ return id;
+ }
+
+ private String getGadgetId() {
+ return element.getAttribute(ID_ATTRIBUTE);
+ }
+
+ private String getOrGenerateGadgetId() {
+ String id = getGadgetId();
+ if ((id == null) || id.isEmpty()) {
+ id = generateAndSetGadgetId();
+ }
+ return id;
+ }
+
+ @Override
+ public void wavePrivateGadgetStateUpdate(JavaScriptObject delta) {
+ // Return if in playback mode. isEditable indicates playback.
+ if (!canModifyDocument()) {
+ return;
+ }
+
+ StateMap deltaState = StateMap.create();
+ deltaState.fromJsonObject(delta);
+ final String gadgetId = getOrGenerateGadgetId();
+ if (gadgetId != null) {
+ deltaState.each(new Each() {
+ @Override
+ public void apply(final String key, final String value) {
+ supplement.setGadgetState(gadgetId, key, value);
+ }
+ });
+ log("Applied private delta ", deltaState.toJson());
+ privateGadgetStateSubmitter.triggerScheduledSubmit();
+ } else {
+ log("Unable to get gadget ID to update private state. Delta ", deltaState.toJson());
+ }
+ }
+
+ private void modifyState(String key, String value) {
+ if (!canModifyDocument()) {
+ log("Unable to modify state ", key, " ", value);
+ } else {
+ log("Modifying state ", key, " ", value);
+ if (stateElements.containsKey(key)) {
+ if (!stateElements.get(key).getValue().equals(value)) {
+ onModifyingDocument();
+ stateElements.get(key).setValue(value);
+ }
+ } else {
+ onModifyingDocument();
+ element.getMutableDoc().insertXml(
+ Point.end((ContentNode)element), GadgetXmlUtil.constructStateXml(key, value));
+ }
+ }
+ }
+
+ private void deleteState(String key) {
+ if (!canModifyDocument()) {
+ log("Unable to remove state ", key);
+ } else {
+ log("Removing state ", key);
+ if (stateElements.containsKey(key)) {
+ onModifyingDocument();
+ element.getMutableDoc().deleteNode(stateElements.get(key).getElement());
+ }
+ }
+ }
+
+ private void sendWaveGadgetInitialization() {
+ sendMode();
+ sendCurrentParticipantInformation();
+ gadgetStateSubmitter.submitImmediately();
+ privateGadgetStateSubmitter.submitImmediately();
+ // Send participant information one more time as participant pictures may be
+ // loaded with a delay. There is no callback to get the picture update
+ // event.
+ new ScheduleTimer() {
+ @Override
+ public void run() {
+ if (isActive()) {
+ sendCurrentParticipantInformation();
+ }
+ }
+ }.schedule(REPEAT_PARTICIPANT_INFORMATION_SEND_DELAY_MS);
+ }
+
+ private void updateElementMaps(
+ GadgetElementChild child, StringMap<GadgetElementChild> childMap, StateMap stateMap) {
+ if (child.getKey() == null) {
+ log("Missing key attribute: element ignored.");
+ return;
+ }
+ if (childMap.containsKey(child.getKey())) {
+ logFine("Old value: ", childMap.get(child.getKey()));
+ }
+ childMap.put(child.getKey(), child);
+ stateMap.put(child.getKey(), child.getValue());
+ logFine("Updated element ", child.getKey(), " : ", child.getValue());
+ }
+
+ private void processTitleChild(GadgetElementChild child) {
+ titleElement = child;
+ String newTitleValue = child.getValue();
+ if (newTitleValue == null) {
+ newTitleValue = "";
+ }
+ if (!newTitleValue.equals(ui.getTitleLabelText())) {
+ ui.setTitleLabelText(newTitleValue);
+ }
+ }
+
+ private void removeChildFromMaps(
+ GadgetElementChild child, StringMap<GadgetElementChild> childMap, StateMap stateMap) {
+ String key = child.getKey();
+ if (childMap.containsKey(key)) {
+ stateMap.remove(key);
+ childMap.remove(key);
+ logFine("Removed element ", key);
+ }
+ }
+
+ private void processChild(GadgetElementChild child) {
+ if (child == null) {
+ return;
+ }
+ logFine("Processing: ", child);
+ switch (child.getType()) {
+ case STATE:
+ updateElementMaps(child, stateElements, state);
+ break;
+ case PREF:
+ updateElementMaps(child, prefElements, userPrefs);
+ break;
+ case TITLE:
+ processTitleChild(child);
+ break;
+ case CATEGORIES:
+ logFine("Categories element ignored.");
+ break;
+ default:
+ // Note(user): editor may add/remove selection and cursor nodes.
+ logFine("Unexpected gadget node ", child.getTag());
+ }
+ }
+
+ /**
+ * Finds the first copy of the given child in the sibling sequence starting at
+ * the given node.
+ *
+ * @param child Child to find next copy of.
+ * @param node Node to scan from.
+ * @return Next copy of the child or null if not found.
+ */
+ private static GadgetElementChild findNextChildCopy(GadgetElementChild child, ContentNode node) {
+ if (child == null) {
+ return null;
+ }
+ while (node != null) {
+ GadgetElementChild gadgetChild = GadgetElementChild.create(node);
+ if (child.isDuplicate(gadgetChild)) {
+ return gadgetChild;
+ }
+ node = node.getNextSibling();
+ }
+ return null;
+ }
+
+ /**
+ * Task removes redundant nodes that match redundantNodeCheckChild.
+ */
+ private final Scheduler.Task removeRedundantNodesTask = new Scheduler.Task() {
+ @Override
+ public void execute() {
+ if (!canModifyDocument()) {
+ return;
+ }
+ if (redundantNodeCheckChild != null) {
+ GadgetElementChild firstMatchingNode = findNextChildCopy(
+ redundantNodeCheckChild, element.getFirstChild());
+ GadgetElementChild lastSeenNode = firstMatchingNode;
+ while (lastSeenNode != null) {
+ lastSeenNode = findNextChildCopy(
+ redundantNodeCheckChild, firstMatchingNode.getElement().getNextSibling());
+ if (lastSeenNode != null) {
+ log("Removing: ", lastSeenNode);
+ element.getMutableDoc().deleteNode(lastSeenNode.getElement());
+ }
+ }
+ } else {
+ log("Undefined redundant node check child.");
+ }
+ redundantNodeCheckChild = null;
+ }
+ };
+
+ /**
+ * Scans nodes and removes duplicate copies of the given child leaving only
+ * the first copy.
+ * TODO(user): Unit test for node manipulations.
+ *
+ * @param child Child to delete the duplicates of.
+ */
+ private void removeRedundantNodes(final GadgetElementChild child) {
+ if (!documentModified || (child == null)) {
+ return;
+ }
+ if (redundantNodeCheckChild == null) {
+ redundantNodeCheckChild = child;
+ ScheduleCommand.addCommand(removeRedundantNodesTask);
+ } else {
+ log("Overlapping redundant node check requests.");
+ }
+ }
+
+ private final ElementChangeTask childAddedTask = new ElementChangeTask() {
+ @Override
+ void processChange(ContentNode node) {
+ GadgetElementChild child = GadgetElementChild.create(node);
+ log("Added: ", child);
+ if (child != null) {
+ removeRedundantNodes(child);
+ processChild(child);
+ }
+ }
+ };
+
+ /**
+ * Processes an add child event.
+ *
+ * @param node the child added to the gadget node.
+ */
+ public void onChildAdded(ContentNode node) {
+ childAddedTask.run(node);
+ }
+
+ private final ElementChangeTask childRemovedTask = new ElementChangeTask() {
+ @Override
+ void processChange(ContentNode node) {
+ GadgetElementChild child = GadgetElementChild.create(node);
+ log("Removed: ", child);
+ switch (child.getType()) {
+ case STATE:
+ removeChildFromMaps(child, stateElements, state);
+ break;
+ case PREF:
+ removeChildFromMaps(child, prefElements, userPrefs);
+ break;
+ case TITLE:
+ log("Removing title is not supported");
+ break;
+ case CATEGORIES:
+ log("Removing categories is not supported");
+ break;
+ default:
+ // Note(user): editor may add/remove selection and cursor nodes.
+ log("Unexpected gadget node removed ", child.getTag());
+ }
+ }
+ };
+
+ /**
+ * Processes a remove child event.
+ *
+ * @param node
+ */
+ public void onRemovingChild(ContentNode node) {
+ childRemovedTask.run(node);
+ }
+
+ /**
+ * Rescans all gadget children to update the values stored in the gadget
+ * object.
+ */
+ private void rescanGadgetXmlElements() {
+ log("Rescanning elements");
+ ContentNode childNode = element.getFirstChild();
+ while (childNode != null) {
+ processChild(GadgetElementChild.create(childNode));
+ childNode = childNode.getNextSibling();
+ }
+ }
+
+ private final ElementChangeTask descendantsMutatedTask = new ElementChangeTask() {
+ @Override
+ void processChange(ContentNode node) {
+ rescanGadgetXmlElements();
+ }
+ };
+
+ private final Scheduler.Task schedulableMutationTask = new Scheduler.Task() {
+ @Override
+ public void execute() {
+ descendantsMutatedTask.run(null);
+ }
+ };
+
+ /**
+ * Processes a mutation event.
+ */
+ public void onDescendantsMutated() {
+ log("Descendants mutated.");
+ ScheduleCommand.addCommand(schedulableMutationTask);
+ }
+
+ @Override
+ public void onBlipContributorAdded(ParticipantId contributor) {
+ if (isActive()) {
+ log("Contributor added ", contributor);
+ sendCurrentParticipantInformation();
+ } else {
+ log("Contributor added event in deleted node.");
+ }
+ }
+
+ @Override
+ public void onBlipContributorRemoved(ParticipantId contributor) {
+ if (isActive()) {
+ log("Contributor removed ", contributor);
+ sendCurrentParticipantInformation();
+ } else {
+ log("Contributor removed event in deleted node.");
+ }
+ }
+
+ @Override
+ public void onParticipantAdded(ParticipantId participant) {
+ if (isActive()) {
+ log("Participant added ", participant);
+ sendCurrentParticipantInformation();
+ } else {
+ log("Participant added event in deleted node.");
+ }
+ }
+
+ @Override
+ public void onParticipantRemoved(ParticipantId participant) {
+ if (isActive()) {
+ log("Participant removed ", participant);
+ sendCurrentParticipantInformation();
+ } else {
+ log("Participant removed event in deleted node.");
+ }
+ }
+
+ private Object[] expandArgs(Object object, Object ... objects) {
+ Object[] args = new Object[objects.length + 1];
+ args[0] = object;
+ System.arraycopy(objects, 0, args, 1, objects.length);
+ return args;
+ }
+
+ private void log(Object ... objects) {
+ if (GadgetLog.shouldLog()) {
+ GadgetLog.logLazy(expandArgs(clientInstanceLogLabel, objects));
+ }
+ }
+
+ private void logFine(Object ... objects) {
+ if (GadgetLog.shouldLogFine()) {
+ GadgetLog.logFineLazy(expandArgs(clientInstanceLogLabel, objects));
+ }
+ }
+
+ /**
+ * Returns the URL of the client including protocol and host.
+ *
+ * @return URL of the client.
+ */
+ private String getUrlPrefix() {
+ return Location.getProtocol() + "//" + Location.getHost();
+ }
+
+ /**
+ * Returns the UI element.
+ *
+ * @return UI element.
+ */
+ Element getElement() {
+ return ui.getElement();
+ }
+
+ private boolean isActive() {
+ return active;
+ }
+
+ private boolean canModifyDocument() {
+ return isActive();
+ }
+
+ @Override
+ public void deleteGadget() {
+ if (canModifyDocument()) {
+ element.getMutableDoc().deleteNode(element);
+ }
+ }
+
+ @Override
+ public void selectGadget() {
+ if (isActive()) {
+ CMutableDocument doc = element.getMutableDoc();
+ element.getSelectionHelper().setSelectionPoints(
+ Point.before(doc, element), Point.after(doc, element));
+ }
+ }
+
+ @Override
+ public void resetGadget() {
+ if (canModifyDocument()) {
+ state.each(new Each() {
+ @Override
+ public void apply(String key, String value) {
+ deleteState(key);
+ }
+ });
+ gadgetStateSubmitter.submit();
+ final String gadgetId = getGadgetId();
+ if (gadgetId != null) {
+ supplement.getGadgetState(gadgetId).each(new ProcV<String>() {
+ @Override
+ public void apply(String key, String value) {
+ supplement.setGadgetState(gadgetId, key, null);
+ }
+ });
+ privateGadgetStateSubmitter.submit();
+ }
+ }
+ }
+
+ private static native void excludeCssName() /*-{
+ css();
+ }-*/;
+
+ private static class BlipEditingIndicator implements EditingIndicator {
+ private final ContentElement element;
+
+ /**
+ * Constructs editing indicator for the gadget's blip.
+ */
+ BlipEditingIndicator(ContentElement element) {
+ this.element = element;
+ }
+
+ /**
+ * Returns the current edit state of the blip.
+ * TODO(user): add event-driven update of the edit state.
+ *
+ * @return whether the blip is in edit state.
+ */
+ @Override
+ public boolean isEditing() {
+ return (element != null)
+ ? AnnotationPainter.isInEditingDocument(ContentElement.ELEMENT_MANAGER, element) : false;
+ }
+ }
+
+ @Override
+ public void onMaybeGadgetStateChanged(String gadgetId) {
+ if (gadgetId != null) {
+ String myId = getGadgetId();
+ if (gadgetId.equals(myId)) {
+ privateGadgetStateSubmitter.submitImmediately();
+ }
+ }
+ }
+
+ /**
+ * Executes when the document is being modified in response to a user action.
+ */
+ private void onModifyingDocument() {
+ documentModified = true;
+ if (toUpdateIframeUrl) {
+ scheduleGadgetAttributeUpdate(IFRAME_URL_ATTRIBUTE, iframeUrl);
+ toUpdateIframeUrl = false;
+ }
+ }
+
+ /**
+ * Creates GadgetWidget instance with preset fields for testing.
+ *
+ * TODO(user): Refactor to remove test code.
+ *
+ * @param id client instance ID
+ * @param userPrefs user prederences
+ * @param waveletName wavelet name
+ * @param securityToken security token
+ * @param locale locale
+ * @return test instance of the widget
+ */
+ @VisibleForTesting
+ static GadgetWidget createForTesting(int id, GadgetUserPrefs userPrefs, WaveletName waveletName,
+ String securityToken, Locale locale) {
+ GadgetWidget widget = new GadgetWidget();
+ widget.clientInstanceId = id;
+ widget.userPrefs = userPrefs;
+ widget.waveletName = waveletName;
+ widget.securityToken = securityToken;
+ widget.locale = locale;
+ return widget;
+ }
+
+ /**
+ * @return RPC token for testing
+ */
+ @VisibleForTesting
+ String getRpcToken() {
+ return rpcToken;
+ }
+}
Added: trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/GadgetWidgetUi.java
===================================================================
--- trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/GadgetWidgetUi.java (rev 0)
+++ trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/GadgetWidgetUi.java 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,499 @@
+// @formatter:off
+/**
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+package org.waveprotocol.wave.client.gadget.renderer;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.Element;
+import com.google.gwt.dom.client.IFrameElement;
+import com.google.gwt.dom.client.Style.Display;
+import com.google.gwt.dom.client.StyleInjector;
+import com.google.gwt.event.dom.client.DomEvent;
+import com.google.gwt.event.dom.client.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOutHandler;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.event.dom.client.MouseOverHandler;
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.CssResource;
+import com.google.gwt.resources.client.DataResource;
+import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.resources.client.ImageResource.ImageOptions;
+import com.google.gwt.resources.client.ImageResource.RepeatStyle;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.NamedFrame;
+import com.google.gwt.user.client.ui.Widget;
+
+import org.waveprotocol.wave.client.common.util.DomHelper;
+import org.waveprotocol.wave.client.editor.EditorStaticDeps;
+import org.waveprotocol.wave.client.scheduler.ScheduleTimer;
+import org.waveprotocol.wave.client.widget.common.ClickableDivPanel;
+import org.waveprotocol.wave.client.widget.common.HoverHelper;
+import org.waveprotocol.wave.client.widget.common.HoverHelper.Hoverable;
+import org.waveprotocol.wave.client.widget.menu.MenuButton;
+
+/**
+ * GadgetWidget UI implementation.
+ *
+ */
+public class GadgetWidgetUi extends Composite implements Hoverable {
+ /**
+ * Class that exposes protected addDomHandler method from NamedFrame as
+ * addHandler. Serves as the Gadget IFrame widget class.
+ */
+ private static class GadgetIFrame extends NamedFrame {
+ GadgetIFrame(String name) {
+ super(name);
+ }
+
+ <H extends EventHandler> HandlerRegistration addHandler(
+ final H handler, DomEvent.Type<H> type) {
+ return addDomHandler(handler, type);
+ }
+ }
+
+ /**
+ * CSS resource for the style injector.
+ */
+ public interface Resources extends ClientBundle {
+ /** The singleton instance of our CSS resources. */
+ static final Resources RESOURCES = GWT.<Resources> create(Resources.class);
+
+ @Source("Gadget.css")
+ public Css css();
+
+ @Source("broken_gadget.png")
+ DataResource brokenGadget();
+
+ @Source("loading_gadget.gif")
+ ImageResource loadingGadgetLarge();
+
+ @Source("loading_gadget_small.gif")
+ ImageResource loadingGadgetSmall();
+
+ @Source("meta_more.png")
+ ImageResource moreImage();
+
+ // Normal
+ @Source("meta_left.png")
+ ImageResource metaLeftImage();
+
+ @Source("meta_right.png")
+ ImageResource metaRightImage();
+
+ static final String META_LEFT_WIDTH = "-" + RESOURCES.metaLeftImage().getWidth() + "px";
+ static final String META_RIGHT_WIDTH = "-" + RESOURCES.metaRightImage().getWidth() + "px";
+ static final String FADE_DELAY_STRING = FADE_DELAY_MS + "ms";
+
+ @Source("meta_mid.png")
+ @ImageOptions(repeatStyle = RepeatStyle.Horizontal)
+ ImageResource metaMid();
+
+ // Down
+ @Source("meta_left_down.png")
+ ImageResource metaLeftDown();
+
+ @Source("meta_right_down.png")
+ ImageResource metaRightDown();
+
+ @Source("meta_mid_down.png")
+ ImageResource metaMidDown();
+
+ // Hover
+ @Source("meta_left_hover.png")
+ ImageResource metaLeftHover();
+
+ @Source("meta_right_hover.png")
+ ImageResource metaRightHover();
+
+ @Source("meta_mid_hover.png")
+ ImageResource metaMidHover();
+ }
+
+ /** CSS interface with style string methods. */
+ interface Css extends CssResource {
+ String panel();
+ String inline();
+ String title();
+ String gadgetFrame();
+ String iframeDiv();
+ String loadedGadgetFrame();
+ String loadingGadgetFrame();
+ String loadingGadgetSmallThrobber();
+ String loadingGadgetLargeThrobber();
+ String loadedGadget();
+ String brokenGadgetIcon();
+ String more();
+ String metaButton();
+ String metaRight();
+ String metaButtonsPanel();
+ String metaLeft();
+ String metaButtons();
+ String disabled();
+ }
+
+ /** The singleton instance of our CSS resources. */
+ static final Css CSS = Resources.RESOURCES.css();
+
+ /**
+ * Static initializer: injects stylesheet.
+ */
+ static {
+ StyleInjector.inject(CSS.getText());
+ }
+
+ @UiField ClickableDivPanel enclosingBox;
+
+ @UiField ClickableDivPanel metaButtons;
+
+ @UiField ClickableDivPanel metaLeft;
+
+ @UiField ClickableDivPanel metaButtonsPanel;
+
+ @UiField ClickableDivPanel metaRight;
+
+ @UiField Label titleLabel;
+
+ @UiField ClickableDivPanel gadgetFrame;
+
+ @UiField ClickableDivPanel iframeDiv;
+
+ interface Binder extends UiBinder<ClickableDivPanel, GadgetWidgetUi> {}
+
+ private static final Binder BINDER = GWT.create(Binder.class);
+
+ /**
+ * The maximum height of the gadget frame that should use the small throbber
+ * icon.
+ */
+ private static final int MAX_SMALL_GADGET_HEIGHT = 63;
+
+ private static final int FADE_DELAY_MS = 300;
+
+ /** Gadget IFrame. */
+ private final GadgetIFrame gadgetIframe;
+
+ private GadgetUiListener listener = null;
+
+ private MenuButton menu;
+
+ private boolean menuEnabled;
+
+ private final EditingIndicator editingIndicator;
+
+ private static enum ThrobberState {
+ SMALL,
+ LARGE,
+ BROKEN,
+ DISABLED
+ }
+
+ private ThrobberState throbberState = ThrobberState.SMALL;
+
+ /**
+ * Constructs gadget widget UI.
+ */
+ public GadgetWidgetUi(String gadgetName, EditingIndicator editingIndicator) {
+ this.editingIndicator = editingIndicator;
+ menuEnabled = false;
+ initWidget(BINDER.createAndBindUi(this));
+ gadgetIframe = new GadgetIFrame(gadgetName);
+ buildIFrame(gadgetName);
+ buildMenu();
+ hideMetaButtons();
+ gadgetFrame.addStyleName(CSS.loadingGadgetFrame());
+ makeWidgetsUnselectable();
+ HoverHelper.getInstance().setup(this);
+ }
+
+ private void makeWidgetsUnselectable() {
+ makeUnselectable(enclosingBox);
+ makeUnselectable(titleLabel);
+ makeUnselectable(gadgetFrame);
+ makeUnselectable(gadgetIframe);
+ makeUnselectable(metaButtons);
+ makeUnselectable(metaLeft);
+ makeUnselectable(metaButtonsPanel);
+ makeUnselectable(metaRight);
+ makeUnselectable(menu.getButton());
+ }
+
+ private void makeUnselectable(Widget widget) {
+ DomHelper.setContentEditable(widget.getElement(), false, false);
+ DomHelper.makeUnselectable(widget.getElement());
+ }
+
+ private void buildIFrame(String gadgetName) {
+ gadgetIframe.getElement().setId(gadgetName);
+
+ int height = 0;
+ switch (throbberState) {
+ case SMALL:
+ gadgetIframe.addStyleName(CSS.loadingGadgetSmallThrobber());
+ height = Resources.RESOURCES.loadingGadgetSmall().getHeight();
+ break;
+ case LARGE:
+ gadgetIframe.addStyleName(CSS.loadingGadgetLargeThrobber());
+ height = Resources.RESOURCES.loadingGadgetLarge().getHeight();
+ break;
+ }
+
+ IFrameElement iframe = getIframeElement();
+ iframe.setAttribute("vspace", "0");
+ iframe.setAttribute("hspace", "0");
+ iframe.setAttribute("frameBorder", "no");
+ iframe.setAttribute("moduleId", gadgetName);
+ iframe.setAttribute("display", "block");
+ iframe.setAttribute("height", height + "px");
+ // TODO(user): scrolling policy/settings for the wave gadgets.
+ iframe.setScrolling("no");
+ iframeDiv.add(gadgetIframe);
+ }
+
+ private void buildMenu() {
+ // TODO(user): Use menu builder.
+ menu = new MenuButton(CSS.metaButton() + " " + CSS.more(), "Gadget menu");
+ menu.addItem("Delete gadget", new Command() {
+ @Override
+ public void execute() {
+ if (listener != null) {
+ listener.deleteGadget();
+ }
+ }
+ }, true);
+ menu.addItem("Select", new Command() {
+ @Override
+ public void execute() {
+ if (listener != null) {
+ listener.selectGadget();
+ }
+ }
+ }, true);
+ menu.addItem("Reset", new Command() {
+ @Override
+ public void execute() {
+ if (listener != null) {
+ listener.resetGadget();
+ }
+ }
+ }, true);
+ metaButtonsPanel.add(menu.getButton());
+ }
+
+ /**
+ * Task to set display:none to deactivate the menu. Note that opacity 0 leaves
+ * invisible, but active element.
+ */
+ private final ScheduleTimer disableMenuTask = new ScheduleTimer() {
+ @Override
+ public void run() {
+ metaButtons.getElement().getStyle().setDisplay(Display.NONE);
+ }
+ };
+
+ private void hideMetaButtons() {
+ metaButtons.getElement().getStyle().setOpacity(0);
+ disableMenuTask.schedule(FADE_DELAY_MS);
+ }
+
+ private void showMetaButtons() {
+ disableMenuTask.cancel();
+ metaButtons.getElement().getStyle().clearDisplay();
+ metaButtons.getOffsetWidth(); // Force the browser to render the first frame.
+ metaButtons.getElement().getStyle().clearOpacity();
+ }
+
+ /**
+ * Gets the gadget iframe element.
+ *
+ * @return Gadget iframe element.
+ */
+ public IFrameElement getIframeElement() {
+ return IFrameElement.as(gadgetIframe.getElement());
+ }
+
+ /**
+ * Sets the iframe height attribute.
+ *
+ * @param height New iframe height.
+ */
+ public void setIframeHeight(long height) {
+ getIframeElement().setAttribute("height", height + "px");
+ if (height > MAX_SMALL_GADGET_HEIGHT) {
+ if (throbberState == ThrobberState.SMALL) {
+ gadgetIframe.removeStyleName(CSS.loadingGadgetSmallThrobber());
+ gadgetIframe.addStyleName(CSS.loadingGadgetLargeThrobber());
+ throbberState = ThrobberState.LARGE;
+ }
+ } else {
+ if (throbberState == ThrobberState.LARGE) {
+ gadgetIframe.removeStyleName(CSS.loadingGadgetLargeThrobber());
+ gadgetIframe.addStyleName(CSS.loadingGadgetSmallThrobber());
+ throbberState = ThrobberState.SMALL;
+ }
+ }
+ }
+
+ /**
+ * Sets the iframe width attribute.
+ *
+ * @param width New iframe width.
+ */
+ public void setIframeWidth(String width) {
+ getIframeElement().setAttribute("width", width);
+ iframeDiv.setWidth(width);
+ gadgetFrame.setWidth(width);
+ }
+
+ /**
+ * Sets gadget iframe ID.
+ *
+ * @param newId new gadget iframe id.
+ */
+ public void setIframeId(String newId) {
+ gadgetIframe.getElement().setId(newId);
+ }
+
+ /**
+ * Sets the iframe source attribute.
+ *
+ * @param source New iframe source.
+ */
+ public void setIframeSource(String source) {
+ if ((source != null) && !source.equals(getIframeElement().getSrc())) {
+ getIframeElement().setSrc(source);
+ }
+ }
+
+ /**
+ * Removes the gadget loading throbber by replacing the iframe CSS.
+ */
+ public void removeThrobber() {
+ switch (throbberState) {
+ case SMALL:
+ gadgetIframe.removeStyleName(CSS.loadingGadgetSmallThrobber());
+ break;
+ case LARGE:
+ gadgetIframe.removeStyleName(CSS.loadingGadgetLargeThrobber());
+ break;
+ }
+ throbberState = ThrobberState.DISABLED;
+ gadgetIframe.addStyleName(CSS.loadedGadget());
+ gadgetFrame.removeStyleName(CSS.loadingGadgetFrame());
+ gadgetFrame.addStyleName(CSS.loadedGadgetFrame());
+ }
+
+ /**
+ * Shows broken gadget icon and error message.
+ */
+ public void showBrokenGadget(String error) {
+ switch (throbberState) {
+ case SMALL:
+ gadgetIframe.removeStyleName(CSS.loadingGadgetSmallThrobber());
+ getIframeElement().setAttribute("height", (MAX_SMALL_GADGET_HEIGHT + 1) + "px");
+ break;
+ case LARGE:
+ gadgetIframe.removeStyleName(CSS.loadingGadgetLargeThrobber());
+ break;
+ }
+ throbberState = ThrobberState.BROKEN;
+ gadgetIframe.addStyleName(CSS.brokenGadgetIcon());
+ }
+
+ public String getTitleLabelText() {
+ return titleLabel.getText();
+ }
+
+ /**
+ * Sets the text of the title label.
+ *
+ * @param text New title label text.
+ */
+ public void setTitleLabelText(String text) {
+ // TODO(user): Remove when the editor ignores mutations from doodads.
+ EditorStaticDeps.startIgnoreMutations();
+ try {
+ titleLabel.setText(text);
+ } finally {
+ EditorStaticDeps.endIgnoreMutations();
+ }
+ }
+
+ public void setGadgetUiListener(GadgetUiListener listener) {
+ this.listener = listener;
+ }
+
+ /**
+ * Enables the overlay Gadget menu.
+ */
+ public void enableMenu() {
+ menuEnabled = true;
+ }
+
+ /**
+ * Disables the overlay Gadget menu.
+ */
+ public void disableMenu() {
+ hideMetaButtons();
+ menu.onOff(menu.getButton());
+ menuEnabled = false;
+ }
+
+ public void makeInline() {
+ enclosingBox.addStyleName(CSS.inline());
+ }
+
+ @Override
+ public void onMouseEnter() {
+ if (!menuEnabled || !editingIndicator.isEditing()) {
+ return;
+ }
+ showMetaButtons();
+ }
+
+ @Override
+ public void onMouseLeave() {
+ hideMetaButtons();
+ }
+
+ @Override
+ public void addHandlers(MouseOverHandler mouseOverHandler, MouseOutHandler mouseOutHandler) {
+ // TODO(user): Investigate why the event propagation does not work and
+ // remove unnecessary handler setup.
+ addDomHandler(mouseOverHandler, MouseOverEvent.getType());
+ addDomHandler(mouseOutHandler, MouseOutEvent.getType());
+ enclosingBox.addMouseOverHandler(mouseOverHandler);
+ gadgetFrame.addMouseOverHandler(mouseOverHandler);
+ iframeDiv.addMouseOverHandler(mouseOverHandler);
+ gadgetIframe.addHandler(mouseOverHandler, MouseOverEvent.getType());
+ metaButtons.addMouseOverHandler(mouseOverHandler);
+ metaLeft.addMouseOverHandler(mouseOverHandler);
+ metaButtonsPanel.addMouseOverHandler(mouseOverHandler);
+ metaRight.addMouseOverHandler(mouseOverHandler);
+ menu.getButton().addMouseOverHandler(mouseOverHandler);
+ }
+
+ @Override
+ public boolean isOrHasChild(Element e) {
+ return enclosingBox.getElement().isOrHasChild(e);
+ }
+}
Added: trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/GadgetWidgetUi.ui.xml
===================================================================
--- trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/GadgetWidgetUi.ui.xml (rev 0)
+++ trunk/src/main/java/org/waveprotocol/wave/client/gadget/renderer/GadgetWidgetUi.ui.xml 2012-03-08 15:05:45 UTC (rev 1748)
@@ -0,0 +1,49 @@
+<!--
+ UI binder for Gadget Container.
+ Author: vadimg(a)google.com (Vadim Gerasimov)
+-->
+<ui:UiBinder
+ xmlns:ui='urn:ui:com.google.gwt.uibinder'
+ xmlns:gwt='urn:import:com.google.gwt.user.client.ui'
+ xmlns:wb='urn:import:org.waveprotocol.wave.client.widget.common'
+>
+ <ui:with
+ field='res'
+ type='org.waveprotocol.wave.client.gadget.renderer.GadgetWidgetUi.Resources'
+ />
+ <wb:ClickableDivPanel
+ ui:field='enclosingBox'
+ addStyleNames='{res.css.panel}'
+ >
+ <!-- Gadget title label. -->
+ <gwt:Label ui:field='titleLabel' addStyleNames='{res.css.title}'/>
+ <wb:ClickableDivPanel
+ ui:field='gadgetFrame'
+ addStyleNames='{res.css.gadgetFrame}'
+ >
+ <!-- Main gadget iframe. -->
+ <wb:ClickableDivPanel
+ ui:field='iframeDiv'
+ addStyleNames='{res.css.iframeDiv}'
+ />
+ <!-- Mouse-over overlay menu. -->
+ <wb:ClickableDivPanel
+ ui:field='metaButtons'
+ addStyleNames='{res.css.metaButtons}'
+ >
+ <wb:ClickableDivPanel
+ ui:field='metaLeft'
+ addStyleNames='{res.css.metaLeft}'
+ />
+ <wb:ClickableDivPanel
+ ui:field='metaButtonsPanel'
+ addStyleNames='{res.css.metaButtonsPanel}'
+ />
+ <wb:ClickableDivPanel
+ ui:field='metaRight'
+ addStyleNames='{res.css.metaRight}'
+ />
+ </wb:ClickableDivPanel>
+ </wb:ClickableDivPanel>
+ </wb:ClickableDivPanel>
+</ui:UiBinder>
Added: trunk/src/main/resources/icons/chain-close-black.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/chain-close-black.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/chain-close-white.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/chain-close-white.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/chain-closed-grey.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/chain-closed-grey.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/chain-open-black.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/chain-open-black.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/chain-open-grey.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/chain-open-grey.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/chain-open-white.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/chain-open-white.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/picture-black.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/picture-black.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/picture-grey.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/picture-grey.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/picture-white.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/picture-white.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Copied: trunk/src/main/resources/icons/pref-black.png (from rev 1747, trunk/src/main/java/cc/kune/core/client/resources/pref-black.png)
===================================================================
(Binary files differ)
Copied: trunk/src/main/resources/icons/pref-grey.png (from rev 1747, trunk/src/main/java/cc/kune/core/client/resources/pref-grey.png)
===================================================================
(Binary files differ)
Copied: trunk/src/main/resources/icons/pref-white.png (from rev 1747, trunk/src/main/java/cc/kune/core/client/resources/pref-white.png)
===================================================================
(Binary files differ)
Modified: trunk/src/main/webapp/others/kune-client-actions.xml
===================================================================
--- trunk/src/main/webapp/others/kune-client-actions.xml 2012-03-07 13:08:17 UTC (rev 1747)
+++ trunk/src/main/webapp/others/kune-client-actions.xml 2012-03-08 15:05:45 UTC (rev 1748)
@@ -424,39 +424,6 @@
</guiActionDescriptor>
- <guiActionDescriptor>
- <type>wave-gadget</type>
- <extensionName>WavePlan</extensionName>
- <name>New meet planer</name>
- <path>New Gadget»Calendar</path>
- <description>This gadget helps you to coordinate multi-participant schedules and make decisions in an intuitive manner.
- </description>
- <new-content-title>New meet planner</new-content-title>
- <new-content-textintro></new-content-textintro>
- <enabled>true</enabled>
- <typeIds>
- <typeId origTypeId="docs.folder" destTypeId="docs.doc"/>
- <typeId origTypeId="docs.root" destTypeId="docs.doc"/>
- <typeId origTypeId="blogs.blog" destTypeId="blogs.post"/>
- <typeId origTypeId="lists.list" destTypeId="lists.post"/>
- <!-- Add gadget in docs directly: -->
- <typeId origTypeId="docs.doc" destTypeId="docs.doc"/>
- <typeId origTypeId="blogs.post" destTypeId="blogs.post"/>
- <typeId origTypeId="lists.post" destTypeId="lists.post"/>
- <typeId origTypeId="wiki.wikipage" destTypeId="wiki.wikipage"/>
- <typeId origTypeId="tasks.task" destTypeId="tasks.task"/>
- </typeIds>
- <rol>
- <!-- Administrator, Editor, Viewer -->
- <rolRequired>Editor</rolRequired>
- <authNeed>true</authNeed>
- </rol>
- <!-- only for new waves: anyone, onlymembers, onlyadmins, ask (not
- used yet) -->
- <participants>ask</participants>
- </guiActionDescriptor>
-
-
<!-- Media ================================================== -->
<guiActionDescriptor>
1
0
r1747 - in trunk: . src/main/java/cc/kune/core/server/init src/main/java/cc/kune/core/server/persist src/main/java/com/google src/main/java/com/google/inject src/main/java/com/google/inject/persist src/main/java/com/google/inject/persist/jpa src/test/java/com/google/inject/persist/jpa
by Vicente J. Ruiz Jurado 07 Mar '12
by Vicente J. Ruiz Jurado 07 Mar '12
07 Mar '12
Author: vjrj_
Date: 2012-03-07 14:08:17 +0100 (Wed, 07 Mar 2012)
New Revision: 1747
Added:
trunk/src/main/java/com/google/inject/
trunk/src/main/java/com/google/inject/persist/
trunk/src/main/java/com/google/inject/persist/jpa/
trunk/src/main/java/com/google/inject/persist/jpa/KuneJpaLocalTxnInterceptor.java
Removed:
trunk/CHANGING_DOMAIN_DOES_NOT_WORK
trunk/src/main/java/cc/kune/core/server/init/KuneJpaPersistModule.java
trunk/src/test/java/com/google/inject/persist/jpa/KuneJpaLocalTxnInterceptor.java
Modified:
trunk/src/main/java/cc/kune/core/server/persist/DataSourceKunePersistModule.java
Log:
NEW - # 201: Add Openfire to the persist system so we can connect and get xmpp users info
http://kune.ourproject.org/issues/ticket/201
Deleted: trunk/CHANGING_DOMAIN_DOES_NOT_WORK
===================================================================
--- trunk/CHANGING_DOMAIN_DOES_NOT_WORK 2012-03-07 12:19:26 UTC (rev 1746)
+++ trunk/CHANGING_DOMAIN_DOES_NOT_WORK 2012-03-07 13:08:17 UTC (rev 1747)
@@ -1,42 +0,0 @@
-=CHANGING THE DOMAIN OF A KUNE SERVER=
-
-Suppose that we want to change from domain.old to domain.new in a kune server deployment.
-
-==Prerrequisites==
-
-* Make a backup of /var/lib/kune/, your db and any other location for wave info (_accounts, _deltas, etc)
-* Be sure that domain.new can be resolved correctly ($ dig domain.new), also the SRV records (see INSTALL)
-* stop kune
-
-==Do the job==
-
-===Update configurations and stores===
-* in _accounts, _deltas
-
-for i in `grep -ril domain.old /var/lib/kune/_accounts`; do perl -p -i -e 's/domain.old/domain.new/g' $i ; done
-for i in `grep -ril domain.old /var/lib/kune/_deltas`; do perl -p -i -e 's/domain.old/domain.new/g' $i ; done
-
-perl -p -i -e 's/domain.old/domain.new/g' src/main/resources/kune.properties # or in /etc/kune
-perl -p -i -e 's/domain.old/domain.new/g' src/main/resources/wave-server.properties # or in /etc/kune
-perl -p -i -e 's/domain.old/domain.new/g' src/main/webapp/ws.html
-or in production
-perl -p -i -e 's/domain.old/domain.new/g' /var/www/kune/ws.html
-
-rename 's/domain.old/domain.new/g' /var/lib/kune/_accounts/*
-
-Remove old persisted sessions:
-rm /var/lib/kune/_sessions/*
-
-===Update the openfire configuration===
-Update your new domain in:
-Server > Server Manager > Edit Server Properties
-Restart the openfire server
- /etc/init.d/openfire restart
-
-===Update your SMTP configuration (and MX record) ===
-So emails like someone(a)domain.new are propertly sended.
-
-===Certificates===
-Update your ssl certificates (openfire, wave keystore, wave federation, etc), if you have configured before with domain.old
-
-Restart kune and check if all it's ok.
Deleted: trunk/src/main/java/cc/kune/core/server/init/KuneJpaPersistModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/init/KuneJpaPersistModule.java 2012-03-07 12:19:26 UTC (rev 1746)
+++ trunk/src/main/java/cc/kune/core/server/init/KuneJpaPersistModule.java 2012-03-07 13:08:17 UTC (rev 1747)
@@ -1,5 +0,0 @@
-package cc.kune.core.server.init;
-
-public class KuneJpaPersistModule {
-
-}
Modified: trunk/src/main/java/cc/kune/core/server/persist/DataSourceKunePersistModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/persist/DataSourceKunePersistModule.java 2012-03-07 12:19:26 UTC (rev 1746)
+++ trunk/src/main/java/cc/kune/core/server/persist/DataSourceKunePersistModule.java 2012-03-07 13:08:17 UTC (rev 1747)
@@ -111,7 +111,6 @@
// final KuneJpaLocalTxnInterceptor transactionInterceptor = new
// KuneJpaLocalTxnInterceptor();
// requestInjection(transactionInterceptor);
- //
// bindInterceptor(annotatedWith(KuneTransactional.class), any(),
// transactionInterceptor);
// bindInterceptor(any(), annotatedWith(KuneTransactional.class),
Copied: trunk/src/main/java/com/google/inject/persist/jpa/KuneJpaLocalTxnInterceptor.java (from rev 1746, trunk/src/test/java/com/google/inject/persist/jpa/KuneJpaLocalTxnInterceptor.java)
===================================================================
--- trunk/src/main/java/com/google/inject/persist/jpa/KuneJpaLocalTxnInterceptor.java (rev 0)
+++ trunk/src/main/java/com/google/inject/persist/jpa/KuneJpaLocalTxnInterceptor.java 2012-03-07 13:08:17 UTC (rev 1747)
@@ -0,0 +1,171 @@
+/**
+ * Copyright (C) 2010 Google, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package com.google.inject.persist.jpa;
+
+import java.lang.reflect.Method;
+
+import javax.persistence.EntityManager;
+import javax.persistence.EntityTransaction;
+
+import org.aopalliance.intercept.MethodInterceptor;
+import org.aopalliance.intercept.MethodInvocation;
+
+import cc.kune.core.server.persist.KuneTransactional;
+
+import com.google.inject.Inject;
+import com.google.inject.persist.UnitOfWork;
+
+/**
+ * @author Dhanji R. Prasanna (dhanji(a)gmail.com)
+ */
+public class KuneJpaLocalTxnInterceptor implements MethodInterceptor {
+
+ @KuneTransactional
+ private static class Internal {
+ }
+
+ // Tracks if the unit of work was begun implicitly by this transaction.
+ private final ThreadLocal<Boolean> didWeStartWork = new ThreadLocal<Boolean>();
+
+ @Inject
+ private final JpaPersistService emProvider = null;
+
+ @Inject
+ private final UnitOfWork unitOfWork = null;
+
+ @Override
+ public Object invoke(final MethodInvocation methodInvocation) throws Throwable {
+
+ // Should we start a unit of work?
+ if (!emProvider.isWorking()) {
+ emProvider.begin();
+ didWeStartWork.set(true);
+ }
+
+ final KuneTransactional transactional = readTransactionMetadata(methodInvocation);
+ final EntityManager em = this.emProvider.get();
+
+ // Allow 'joining' of transactions if there is an enclosing
+ // @KuneTransactional method.
+ if (em.getTransaction().isActive()) {
+ return methodInvocation.proceed();
+ }
+
+ final EntityTransaction txn = em.getTransaction();
+ txn.begin();
+
+ Object result;
+ try {
+ result = methodInvocation.proceed();
+
+ } catch (final Exception e) {
+ // commit transaction only if rollback didnt occur
+ if (rollbackIfNecessary(transactional, e, txn)) {
+ txn.commit();
+ }
+
+ // propagate whatever exception is thrown anyway
+ throw e;
+ } finally {
+ // Close the em if necessary (guarded so this code doesn't run unless
+ // catch fired).
+ if (null != didWeStartWork.get() && !txn.isActive()) {
+ didWeStartWork.remove();
+ unitOfWork.end();
+ }
+ }
+
+ // everything was normal so commit the txn (do not move into try block above
+ // as it
+ // interferes with the advised method's throwing semantics)
+ try {
+ txn.commit();
+ } finally {
+ // close the em if necessary
+ if (null != didWeStartWork.get()) {
+ didWeStartWork.remove();
+ unitOfWork.end();
+ }
+ }
+
+ // or return result
+ return result;
+ }
+
+ // TODO(dhanji): Cache this method's results.
+ private KuneTransactional readTransactionMetadata(final MethodInvocation methodInvocation) {
+ KuneTransactional transactional;
+ final Method method = methodInvocation.getMethod();
+ final Class<?> targetClass = methodInvocation.getThis().getClass();
+
+ transactional = method.getAnnotation(KuneTransactional.class);
+ if (null == transactional) {
+ // If none on method, try the class.
+ transactional = targetClass.getAnnotation(KuneTransactional.class);
+ }
+ if (null == transactional) {
+ // If there is no transactional annotation present, use the default
+ transactional = Internal.class.getAnnotation(KuneTransactional.class);
+ }
+
+ return transactional;
+ }
+
+ /**
+ * Returns True if rollback DID NOT HAPPEN (i.e. if commit should continue).
+ *
+ * @param transactional
+ * The metadata annotaiton of the method
+ * @param e
+ * The exception to test for rollback
+ * @param txn
+ * A JPA Transaction to issue rollbacks on
+ */
+ private boolean rollbackIfNecessary(final KuneTransactional transactional, final Exception e,
+ final EntityTransaction txn) {
+ boolean commit = true;
+
+ // check rollback clauses
+ for (final Class<? extends Exception> rollBackOn : transactional.rollbackOn()) {
+
+ // if one matched, try to perform a rollback
+ if (rollBackOn.isInstance(e)) {
+ commit = false;
+
+ // check ignore clauses (supercedes rollback clause)
+ for (final Class<? extends Exception> exceptOn : transactional.ignore()) {
+ // An exception to the rollback clause was found, DON'T rollback
+ // (i.e. commit and throw anyway)
+ if (exceptOn.isInstance(e)) {
+ commit = true;
+ break;
+ }
+ }
+
+ // rollback only if nothing matched the ignore check
+ if (!commit) {
+ txn.rollback();
+ }
+ // otherwise continue to commit
+
+ break;
+ }
+ }
+
+ return commit;
+ }
+}
Deleted: trunk/src/test/java/com/google/inject/persist/jpa/KuneJpaLocalTxnInterceptor.java
===================================================================
--- trunk/src/test/java/com/google/inject/persist/jpa/KuneJpaLocalTxnInterceptor.java 2012-03-07 12:19:26 UTC (rev 1746)
+++ trunk/src/test/java/com/google/inject/persist/jpa/KuneJpaLocalTxnInterceptor.java 2012-03-07 13:08:17 UTC (rev 1747)
@@ -1,171 +0,0 @@
-/**
- * Copyright (C) 2010 Google, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package com.google.inject.persist.jpa;
-
-import java.lang.reflect.Method;
-
-import javax.persistence.EntityManager;
-import javax.persistence.EntityTransaction;
-
-import org.aopalliance.intercept.MethodInterceptor;
-import org.aopalliance.intercept.MethodInvocation;
-
-import cc.kune.core.server.persist.KuneTransactional;
-
-import com.google.inject.Inject;
-import com.google.inject.persist.UnitOfWork;
-
-/**
- * @author Dhanji R. Prasanna (dhanji(a)gmail.com)
- */
-public class KuneJpaLocalTxnInterceptor implements MethodInterceptor {
-
- @KuneTransactional
- private static class Internal {
- }
-
- // Tracks if the unit of work was begun implicitly by this transaction.
- private final ThreadLocal<Boolean> didWeStartWork = new ThreadLocal<Boolean>();
-
- @Inject
- private final JpaPersistService emProvider = null;
-
- @Inject
- private final UnitOfWork unitOfWork = null;
-
- @Override
- public Object invoke(final MethodInvocation methodInvocation) throws Throwable {
-
- // Should we start a unit of work?
- if (!emProvider.isWorking()) {
- emProvider.begin();
- didWeStartWork.set(true);
- }
-
- final KuneTransactional transactional = readTransactionMetadata(methodInvocation);
- final EntityManager em = this.emProvider.get();
-
- // Allow 'joining' of transactions if there is an enclosing
- // @KuneTransactional method.
- if (em.getTransaction().isActive()) {
- return methodInvocation.proceed();
- }
-
- final EntityTransaction txn = em.getTransaction();
- txn.begin();
-
- Object result;
- try {
- result = methodInvocation.proceed();
-
- } catch (final Exception e) {
- // commit transaction only if rollback didnt occur
- if (rollbackIfNecessary(transactional, e, txn)) {
- txn.commit();
- }
-
- // propagate whatever exception is thrown anyway
- throw e;
- } finally {
- // Close the em if necessary (guarded so this code doesn't run unless
- // catch fired).
- if (null != didWeStartWork.get() && !txn.isActive()) {
- didWeStartWork.remove();
- unitOfWork.end();
- }
- }
-
- // everything was normal so commit the txn (do not move into try block above
- // as it
- // interferes with the advised method's throwing semantics)
- try {
- txn.commit();
- } finally {
- // close the em if necessary
- if (null != didWeStartWork.get()) {
- didWeStartWork.remove();
- unitOfWork.end();
- }
- }
-
- // or return result
- return result;
- }
-
- // TODO(dhanji): Cache this method's results.
- private KuneTransactional readTransactionMetadata(final MethodInvocation methodInvocation) {
- KuneTransactional transactional;
- final Method method = methodInvocation.getMethod();
- final Class<?> targetClass = methodInvocation.getThis().getClass();
-
- transactional = method.getAnnotation(KuneTransactional.class);
- if (null == transactional) {
- // If none on method, try the class.
- transactional = targetClass.getAnnotation(KuneTransactional.class);
- }
- if (null == transactional) {
- // If there is no transactional annotation present, use the default
- transactional = Internal.class.getAnnotation(KuneTransactional.class);
- }
-
- return transactional;
- }
-
- /**
- * Returns True if rollback DID NOT HAPPEN (i.e. if commit should continue).
- *
- * @param transactional
- * The metadata annotaiton of the method
- * @param e
- * The exception to test for rollback
- * @param txn
- * A JPA Transaction to issue rollbacks on
- */
- private boolean rollbackIfNecessary(final KuneTransactional transactional, final Exception e,
- final EntityTransaction txn) {
- boolean commit = true;
-
- // check rollback clauses
- for (final Class<? extends Exception> rollBackOn : transactional.rollbackOn()) {
-
- // if one matched, try to perform a rollback
- if (rollBackOn.isInstance(e)) {
- commit = false;
-
- // check ignore clauses (supercedes rollback clause)
- for (final Class<? extends Exception> exceptOn : transactional.ignore()) {
- // An exception to the rollback clause was found, DON'T rollback
- // (i.e. commit and throw anyway)
- if (exceptOn.isInstance(e)) {
- commit = true;
- break;
- }
- }
-
- // rollback only if nothing matched the ignore check
- if (!commit) {
- txn.rollback();
- }
- // otherwise continue to commit
-
- break;
- }
- }
-
- return commit;
- }
-}
1
0
07 Mar '12
Author: vjrj_
Date: 2012-03-07 13:19:26 +0100 (Wed, 07 Mar 2012)
New Revision: 1746
Added:
trunk/src/main/java/cc/kune/core/server/persist/
trunk/src/main/java/cc/kune/core/server/persist/CustomPersistFilter.java
trunk/src/main/java/cc/kune/core/server/persist/DataSourceKune.java
trunk/src/main/java/cc/kune/core/server/persist/DataSourceKunePersistModule.java
trunk/src/main/java/cc/kune/core/server/persist/DataSourceKuneSessionProvider.java
trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfire.java
trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfirePersistModule.java
trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfireSessionProvider.java
trunk/src/main/java/cc/kune/core/server/persist/GenericPersistenceInitializer.java
trunk/src/main/java/cc/kune/core/server/persist/KunePersistenceService.java
trunk/src/main/java/cc/kune/core/server/persist/KuneTransactional.java
trunk/src/test/java/cc/kune/core/server/persist/
Removed:
trunk/src/main/java/cc/kune/core/server/CustomPersistFilter.java
trunk/src/main/java/cc/kune/core/server/DataSourceKune.java
trunk/src/main/java/cc/kune/core/server/DataSourceKunePersistModule.java
trunk/src/main/java/cc/kune/core/server/DataSourceKuneSessionProvider.java
trunk/src/main/java/cc/kune/core/server/DataSourceOpenfire.java
trunk/src/main/java/cc/kune/core/server/DataSourceOpenfirePersistModule.java
trunk/src/main/java/cc/kune/core/server/DataSourceOpenfireSessionProvider.java
trunk/src/main/java/cc/kune/core/server/GenericPersistenceInitializer.java
trunk/src/main/java/cc/kune/core/server/KunePersistenceService.java
trunk/src/main/java/cc/kune/core/server/KuneTransactional.java
Modified:
trunk/src/main/java/cc/kune/core/server/KuneContainerListener.java
trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java
trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/ExtMediaDescripManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/I18nCountryManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/I18nLanguageManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/I18nTranslationManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/LicenseManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/RateManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/SocialNetworkManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/TagManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/TagUserContentManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/ToolConfigurationManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
trunk/src/main/java/cc/kune/core/server/xmpp/OpenfireXmppRosterProvider.java
trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java
trunk/src/test/java/cc/kune/core/server/PersistenceTest.java
trunk/src/test/java/cc/kune/core/server/TestHelper.java
trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java
trunk/src/test/java/com/google/inject/persist/jpa/KuneJpaLocalTxnInterceptor.java
Log:
NEW - # 201: Add Openfire to the persist system so we can connect and get xmpp users info
http://kune.ourproject.org/issues/ticket/201
Deleted: trunk/src/main/java/cc/kune/core/server/CustomPersistFilter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/CustomPersistFilter.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/CustomPersistFilter.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -1,111 +0,0 @@
-/**
- * Copyright (C) 2010 Google, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package cc.kune.core.server;
-
-import java.io.IOException;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-import com.google.inject.persist.PersistService;
-import com.google.inject.persist.UnitOfWork;
-
-/**
- * Apply this filter to enable the HTTP Request unit of work and to have
- * guice-persist manage the lifecycle of active units of work. The filter
- * automatically starts and stops the relevant {@link PersistService} upon
- * {@link javax.servlet.Filter#init(javax.servlet.FilterConfig)} and
- * {@link javax.servlet.Filter#destroy()} respectively.
- *
- * <p>
- * To be able to use the open session-in-view pattern (i.e. work per request),
- * register this filter <b>once</b> in your Guice {@code ServletModule}. It is
- * important that you register this filter before any other filter.
- *
- * For multiple providers, you should register this filter once per provider,
- * inside a private module for each persist module installed (this must be the
- * same private module where the specific persist module is itself installed).
- *
- * <p>
- * Example configuration:
- *
- * <pre>
- * {
- * @code
- * public class MyModule extends ServletModule {
- * public void configureServlets() {
- * filter("/*").through(PersistFilter.class);
- *
- * serve("/index.html").with(MyHtmlServlet.class);
- * // Etc.
- * }
- * }
- * }
- * </pre>
- * <p>
- * This filter is thread safe and allows you to create injectors concurrently
- * and deploy multiple guice-persist modules within the same injector, or even
- * multiple injectors with persist modules withing the same JVM or web app.
- * <p>
- * This filter requires the Guice Servlet extension.
- *
- * @author Dhanji R. Prasanna (dhanji(a)gmail.com)
- *
- * (Custom PersistFilter.class modified for kune needs without
- * persistence start/stop)
- */
-
-@Singleton
-public class CustomPersistFilter implements Filter {
- private final PersistService persistService;
- private final UnitOfWork unitOfWork;
-
- @Inject
- public CustomPersistFilter(final UnitOfWork unitOfWork, final PersistService persistService) {
- this.unitOfWork = unitOfWork;
- this.persistService = persistService;
- }
-
- @Override
- public void destroy() {
- // Commented in kune
- // persistService.stop();
- }
-
- @Override
- public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse,
- final FilterChain filterChain) throws IOException, ServletException {
-
- unitOfWork.begin();
- try {
- filterChain.doFilter(servletRequest, servletResponse);
- } finally {
- unitOfWork.end();
- }
- }
-
- @Override
- public void init(final FilterConfig filterConfig) throws ServletException {
- // Commented in kune
- // persistService.start();
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/cc/kune/core/server/DataSourceKune.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/DataSourceKune.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/DataSourceKune.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -1,17 +0,0 @@
-package cc.kune.core.server;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import com.google.inject.BindingAnnotation;
-
-(a)Retention(RetentionPolicy.RUNTIME)
-@Target({ FIELD, PARAMETER, METHOD })
-@BindingAnnotation
-public @interface DataSourceKune {
-}
\ No newline at end of file
Deleted: trunk/src/main/java/cc/kune/core/server/DataSourceKunePersistModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/DataSourceKunePersistModule.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/DataSourceKunePersistModule.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -1,138 +0,0 @@
-package cc.kune.core.server;
-
-import java.util.Properties;
-
-import javax.persistence.EntityManager;
-
-import org.apache.commons.configuration.SystemConfiguration;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.hibernate.Session;
-
-import cc.kune.core.server.properties.KuneProperties;
-import cc.kune.core.server.properties.KunePropertiesDefault;
-import cc.kune.domain.finders.ContainerFinder;
-import cc.kune.domain.finders.ContentFinder;
-import cc.kune.domain.finders.ExtMediaDescripFinder;
-import cc.kune.domain.finders.GroupFinder;
-import cc.kune.domain.finders.I18nCountryFinder;
-import cc.kune.domain.finders.I18nLanguageFinder;
-import cc.kune.domain.finders.I18nTranslationFinder;
-import cc.kune.domain.finders.LicenseFinder;
-import cc.kune.domain.finders.RateFinder;
-import cc.kune.domain.finders.TagFinder;
-import cc.kune.domain.finders.TagUserContentFinder;
-import cc.kune.domain.finders.UserFinder;
-
-import com.google.inject.AbstractModule;
-import com.google.inject.Key;
-import com.google.inject.Provider;
-import com.google.inject.persist.jpa.JpaPersistModule;
-
-public class DataSourceKunePersistModule extends AbstractModule {
- public static final Log LOG = LogFactory.getLog(DataSourceKunePersistModule.class);
- public static final Key<CustomPersistFilter> MY_DATA_SOURCE_ONE_FILTER_KEY = Key.get(
- CustomPersistFilter.class, DataSourceKune.class);
- private String settedJpaUnit = null;
- private String settedProperties = null;
-
- public DataSourceKunePersistModule() {
- }
-
- /**
- * Instantiates this module during tests
- *
- * @param settedProperties
- * the setted properties
- * @param settedJpaUnit
- * the setted jpa unit
- */
- public DataSourceKunePersistModule(final String settedProperties, final String settedJpaUnit) {
- this.settedProperties = settedProperties;
- this.settedJpaUnit = settedJpaUnit;
- }
-
- @Override
- public void configure() {
- final SystemConfiguration sysConf = new SystemConfiguration();
- final String kuneConfig = settedProperties != null ? settedProperties
- : sysConf.getString("kune.server.config");
-
- final KunePropertiesDefault kuneProperties = new KunePropertiesDefault(kuneConfig);
- bind(KuneProperties.class).toInstance(kuneProperties);
-
- // precedence method param > properties
- final String configuredJpaUnit = kuneProperties.get(KuneProperties.SITE_DB_PERSISTENCE_NAME);
- final String jpaUnit = settedJpaUnit != null ? settedJpaUnit
- : configuredJpaUnit != null ? configuredJpaUnit : "development";
- LOG.info(String.format("Using persistence unit '%s' and properties '%s'", jpaUnit, kuneConfig));
-
- final JpaPersistModule jpm = new JpaPersistModule(jpaUnit);
-
- if (!jpaUnit.equals("test")) {
- // In tests (and development) we don't override this db info)
- final Properties dbProperties = new Properties();
- dbProperties.setProperty("hibernate.connection.url",
- kuneProperties.get(KuneProperties.SITE_DB_URL));
- dbProperties.setProperty("hibernate.connection.username",
- kuneProperties.get(KuneProperties.SITE_DB_USER));
- dbProperties.setProperty("hibernate.connection.password",
- kuneProperties.get(KuneProperties.SITE_DB_PASSWORD));
- jpm.properties(dbProperties);
- }
-
- jpm.addFinder(ContainerFinder.class);
- jpm.addFinder(ContentFinder.class);
- jpm.addFinder(ExtMediaDescripFinder.class);
- jpm.addFinder(GroupFinder.class);
- jpm.addFinder(I18nCountryFinder.class);
- jpm.addFinder(I18nLanguageFinder.class);
- jpm.addFinder(I18nTranslationFinder.class);
- jpm.addFinder(LicenseFinder.class);
- jpm.addFinder(RateFinder.class);
- jpm.addFinder(TagFinder.class);
- jpm.addFinder(TagUserContentFinder.class);
- jpm.addFinder(UserFinder.class);
- install(jpm);
-
- bind(Session.class).annotatedWith(DataSourceKune.class).toProvider(
- DataSourceKuneSessionProvider.class);
-
- // bind(UnitOfWork.class).annotatedWith(DataSourceKune.class).toProvider(
- // DataSourceKuneUnitOfWorkProvider.class);
- // expose(UnitOfWork.class).annotatedWith(DataSourceKune.class);
-
- // final KuneJpaLocalTxnInterceptor transactionInterceptor = new
- // KuneJpaLocalTxnInterceptor();
- // requestInjection(transactionInterceptor);
- //
- // bindInterceptor(annotatedWith(KuneTransactional.class), any(),
- // transactionInterceptor);
- // bindInterceptor(any(), annotatedWith(KuneTransactional.class),
- // transactionInterceptor);
-
- final Provider<EntityManager> entityManagerProvider = binder().getProvider(EntityManager.class);
- bind(EntityManager.class).annotatedWith(DataSourceKune.class).toProvider(entityManagerProvider);
-
- bind(MY_DATA_SOURCE_ONE_FILTER_KEY).to(CustomPersistFilter.class);
-
- // expose(EntityManager.class).annotatedWith(DataSourceKune.class);
- // expose(Session.class).annotatedWith(DataSourceKune.class);
- // expose(KuneProperties.class);
- // expose(ContainerFinder.class);
- // expose(ContentFinder.class);
- // expose(ExtMediaDescripFinder.class);
- // expose(GroupFinder.class);
- // expose(I18nCountryFinder.class);
- // expose(I18nLanguageFinder.class);
- // expose(I18nTranslationFinder.class);
- // expose(LicenseFinder.class);
- // expose(RateFinder.class);
- // expose(TagFinder.class);
- // expose(TagUserContentFinder.class);
- // expose(UserFinder.class);
- // expose(MY_DATA_SOURCE_ONE_FILTER_KEY);
-
- bind(GenericPersistenceInitializer.class).asEagerSingleton();
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/cc/kune/core/server/DataSourceKuneSessionProvider.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/DataSourceKuneSessionProvider.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/DataSourceKuneSessionProvider.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -1,26 +0,0 @@
-package cc.kune.core.server;
-
-import javax.persistence.EntityManager;
-
-import org.hibernate.Session;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class DataSourceKuneSessionProvider implements Provider<Session> {
- /** The entity manger to retrieve the session from. */
- @Inject
- @DataSourceKune
- private Provider<EntityManager> entityManagerProvider;
-
- /**
- * @return the Hibernate session, being the delegate of the entity manager
- * provided by the injected entity manager provider.
- */
- @Override
- public Session get() {
- final Session session = (Session) entityManagerProvider.get().getDelegate();
- // configure session i.e. flush mode or filtering
- return session;
- }
-};
\ No newline at end of file
Deleted: trunk/src/main/java/cc/kune/core/server/DataSourceOpenfire.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/DataSourceOpenfire.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/DataSourceOpenfire.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -1,17 +0,0 @@
-package cc.kune.core.server;
-
-import static java.lang.annotation.ElementType.FIELD;
-import static java.lang.annotation.ElementType.METHOD;
-import static java.lang.annotation.ElementType.PARAMETER;
-
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-import com.google.inject.BindingAnnotation;
-
-(a)Retention(RetentionPolicy.RUNTIME)
-@Target({ FIELD, PARAMETER, METHOD })
-@BindingAnnotation
-public @interface DataSourceOpenfire {
-}
\ No newline at end of file
Deleted: trunk/src/main/java/cc/kune/core/server/DataSourceOpenfirePersistModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/DataSourceOpenfirePersistModule.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/DataSourceOpenfirePersistModule.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -1,60 +0,0 @@
-package cc.kune.core.server;
-
-import java.util.Properties;
-
-import javax.persistence.EntityManager;
-
-import org.hibernate.Session;
-
-import cc.kune.core.server.xmpp.OpenfireXmppRosterFinder;
-import cc.kune.core.server.xmpp.OpenfireXmppRosterProvider;
-import cc.kune.core.server.xmpp.XmppRosterProvider;
-
-import com.google.inject.Key;
-import com.google.inject.PrivateModule;
-import com.google.inject.Provider;
-import com.google.inject.Singleton;
-import com.google.inject.persist.jpa.JpaPersistModule;
-
-public class DataSourceOpenfirePersistModule extends PrivateModule {
- public static final Key<CustomPersistFilter> MY_DATA_SOURCE_TWO_FILTER_KEY = Key.get(
- CustomPersistFilter.class, DataSourceOpenfire.class);
-
- @Override
- public void configure() {
- final JpaPersistModule jpm = new JpaPersistModule("openfire");
- // jpm.properties(new Properties());
-
- final Properties dbProperties = new Properties();
- dbProperties.setProperty(
- "hibernate.connection.url",
- "jdbc:mysql://localhost/openfire4?createDatabaseIfNotExist=false&useUnicode=true&characterEncoding=UTF-8");
- // kuneProperties.get(KuneProperties.SITE_DB_URL));
- dbProperties.setProperty("hibernate.connection.username", "openfire");
- // kuneProperties.get(KuneProperties.SITE_DB_USER));
- dbProperties.setProperty("hibernate.connection.password", "easyeasy");
- dbProperties.setProperty("exclude-unlisted-classes", "true");
-
- // kuneProperties.get(KuneProperties.SITE_DB_PASSWORD));
-
- jpm.properties(dbProperties);
- install(jpm.addFinder(OpenfireXmppRosterFinder.class));
- expose(OpenfireXmppRosterFinder.class);
-
- bind(XmppRosterProvider.class).to(OpenfireXmppRosterProvider.class).in(Singleton.class);
- expose(XmppRosterProvider.class);
-
- bind(Session.class).annotatedWith(DataSourceOpenfire.class).toProvider(
- DataSourceOpenfireSessionProvider.class);
- expose(Session.class).annotatedWith(DataSourceOpenfire.class);
-
- final Provider<EntityManager> entityManagerProvider = binder().getProvider(EntityManager.class);
- bind(EntityManager.class).annotatedWith(DataSourceOpenfire.class).toProvider(entityManagerProvider);
- expose(EntityManager.class).annotatedWith(DataSourceOpenfire.class);
-
- bind(MY_DATA_SOURCE_TWO_FILTER_KEY).to(CustomPersistFilter.class);
- expose(MY_DATA_SOURCE_TWO_FILTER_KEY);
-
- // bind(KunePersistenceInitializer.class).asEagerSingleton();
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/cc/kune/core/server/DataSourceOpenfireSessionProvider.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/DataSourceOpenfireSessionProvider.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/DataSourceOpenfireSessionProvider.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -1,26 +0,0 @@
-package cc.kune.core.server;
-
-import javax.persistence.EntityManager;
-
-import org.hibernate.Session;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class DataSourceOpenfireSessionProvider implements Provider<Session> {
- /** The entity manger to retrieve the session from. */
- @Inject
- @DataSourceOpenfire
- private Provider<EntityManager> entityManagerProvider;
-
- /**
- * @return the Hibernate session, being the delegate of the entity manager
- * provided by the injected entity manager provider.
- */
- @Override
- public Session get() {
- final Session session = (Session) entityManagerProvider.get().getDelegate();
- // configure session i.e. flush mode or filtering
- return session;
- }
-};
\ No newline at end of file
Deleted: trunk/src/main/java/cc/kune/core/server/GenericPersistenceInitializer.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/GenericPersistenceInitializer.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/GenericPersistenceInitializer.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -1,12 +0,0 @@
-package cc.kune.core.server;
-
-import com.google.inject.Inject;
-import com.google.inject.persist.PersistService;
-
-public class GenericPersistenceInitializer {
- @Inject
- GenericPersistenceInitializer(final PersistService service) {
- service.start();
- // At this point JPA is started and ready.
- }
-}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/server/KuneContainerListener.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneContainerListener.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/KuneContainerListener.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -31,6 +31,7 @@
import org.apache.log4j.PropertyConfigurator;
+import cc.kune.core.server.persist.KunePersistenceService;
import cc.kune.core.server.rack.ContainerListener;
import com.google.inject.Inject;
Deleted: trunk/src/main/java/cc/kune/core/server/KunePersistenceService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KunePersistenceService.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/KunePersistenceService.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -1,41 +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.server;
-
-import cc.kune.core.server.error.ServerException;
-import cc.kune.core.server.init.DatabaseInitializer;
-
-import com.google.inject.Inject;
-import com.google.inject.Singleton;
-
-@Singleton
-public class KunePersistenceService {
- @Inject
- DatabaseInitializer databaseInitializer;
-
- public void start() {
- try {
- databaseInitializer.initConditional();
- } catch (final Exception e) {
- throw new ServerException("Error starting persistence service", e);
- }
- }
-
-}
Modified: trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -40,6 +40,7 @@
import cc.kune.core.server.manager.file.FileUploadManager;
import cc.kune.core.server.manager.file.UserLogoDownloadManager;
import cc.kune.core.server.manager.impl.GroupServerUtils;
+import cc.kune.core.server.persist.DataSourceKunePersistModule;
import cc.kune.core.server.rack.RackBuilder;
import cc.kune.core.server.rack.RackModule;
import cc.kune.core.server.rack.filters.ForwardFilter;
Deleted: trunk/src/main/java/cc/kune/core/server/KuneTransactional.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneTransactional.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/KuneTransactional.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -1,29 +0,0 @@
-package cc.kune.core.server;
-
-import java.lang.annotation.ElementType;
-import java.lang.annotation.Inherited;
-import java.lang.annotation.Retention;
-import java.lang.annotation.RetentionPolicy;
-import java.lang.annotation.Target;
-
-@Target({ ElementType.METHOD, ElementType.TYPE })
-(a)Retention(RetentionPolicy.RUNTIME)
-@Inherited
-public @interface KuneTransactional {
-
- /**
- * A list of exceptions to <b>not<b> rollback on. A caveat to the rollbackOn
- * clause. The disjunction of rollbackOn and ignore represents the list of
- * exceptions that will trigger a rollback. The complement of rollbackOn and
- * the universal set plus any exceptions in the ignore set represents the list
- * of exceptions that will trigger a commit. Note that ignore exceptions take
- * precedence over rollbackOn, but with subtype granularity.
- */
- Class<? extends Exception>[] ignore() default {};
-
- /**
- * A list of exceptions to rollback on, if thrown by the transactional method.
- * These exceptions are propagated correctly after a rollback.
- */
- Class<? extends Exception>[] rollbackOn() default RuntimeException.class;
-}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -91,6 +91,7 @@
import cc.kune.core.server.notifier.NotificationSenderDefault;
import cc.kune.core.server.notifier.PendingNotificationSender;
import cc.kune.core.server.notifier.UsersOnline;
+import cc.kune.core.server.persist.KunePersistenceService;
import cc.kune.core.server.rpc.ContentRPC;
import cc.kune.core.server.rpc.GroupRPC;
import cc.kune.core.server.rpc.I18nRPC;
Modified: trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -30,11 +30,11 @@
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.errors.MoveOnSameContainerException;
import cc.kune.core.client.errors.NameInUseException;
-import cc.kune.core.server.DataSourceKune;
import cc.kune.core.server.manager.SearchResult;
import cc.kune.core.server.manager.file.FileUtils;
import cc.kune.core.server.manager.impl.DefaultManager;
import cc.kune.core.server.manager.impl.ServerManagerException;
+import cc.kune.core.server.persist.DataSourceKune;
import cc.kune.core.server.utils.FilenameUtils;
import cc.kune.domain.AccessLists;
import cc.kune.domain.Container;
Modified: trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -46,7 +46,6 @@
import cc.kune.core.client.errors.MoveOnSameContainerException;
import cc.kune.core.client.errors.NameInUseException;
import cc.kune.core.client.errors.UserNotFoundException;
-import cc.kune.core.server.DataSourceKune;
import cc.kune.core.server.access.FinderService;
import cc.kune.core.server.manager.SearchResult;
import cc.kune.core.server.manager.TagUserContentManager;
@@ -54,6 +53,7 @@
import cc.kune.core.server.manager.impl.DefaultManager;
import cc.kune.core.server.manager.impl.GroupServerUtils;
import cc.kune.core.server.manager.impl.ServerManagerException;
+import cc.kune.core.server.persist.DataSourceKune;
import cc.kune.core.server.tool.ServerTool;
import cc.kune.core.server.tool.ServerToolRegistry;
import cc.kune.core.server.utils.FilenameUtils;
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/ExtMediaDescripManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/ExtMediaDescripManagerDefault.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/ExtMediaDescripManagerDefault.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -23,8 +23,8 @@
import javax.persistence.EntityManager;
-import cc.kune.core.server.DataSourceKune;
import cc.kune.core.server.manager.ExtMediaDescripManager;
+import cc.kune.core.server.persist.DataSourceKune;
import cc.kune.domain.ExtMediaDescrip;
import cc.kune.domain.finders.ExtMediaDescripFinder;
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -39,12 +39,12 @@
import cc.kune.core.client.errors.GroupLongNameInUseException;
import cc.kune.core.client.errors.GroupShortNameInUseException;
import cc.kune.core.client.errors.UserMustBeLoggedException;
-import cc.kune.core.server.DataSourceKune;
import cc.kune.core.server.manager.FileManager;
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.manager.LicenseManager;
import cc.kune.core.server.manager.SearchResult;
import cc.kune.core.server.manager.file.FileUtils;
+import cc.kune.core.server.persist.DataSourceKune;
import cc.kune.core.server.properties.KuneBasicProperties;
import cc.kune.core.server.properties.KuneProperties;
import cc.kune.core.server.tool.ServerTool;
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/I18nCountryManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/I18nCountryManagerDefault.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/I18nCountryManagerDefault.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -23,8 +23,8 @@
import javax.persistence.EntityManager;
-import cc.kune.core.server.DataSourceKune;
import cc.kune.core.server.manager.I18nCountryManager;
+import cc.kune.core.server.persist.DataSourceKune;
import cc.kune.domain.I18nCountry;
import cc.kune.domain.finders.I18nCountryFinder;
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/I18nLanguageManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/I18nLanguageManagerDefault.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/I18nLanguageManagerDefault.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -23,8 +23,8 @@
import javax.persistence.EntityManager;
-import cc.kune.core.server.DataSourceKune;
import cc.kune.core.server.manager.I18nLanguageManager;
+import cc.kune.core.server.persist.DataSourceKune;
import cc.kune.domain.I18nLanguage;
import cc.kune.domain.finders.I18nLanguageFinder;
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 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/I18nTranslationManagerDefault.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -27,9 +27,9 @@
import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.errors.DefaultException;
-import cc.kune.core.server.DataSourceKune;
import cc.kune.core.server.manager.I18nLanguageManager;
import cc.kune.core.server.manager.I18nTranslationManager;
+import cc.kune.core.server.persist.DataSourceKune;
import cc.kune.core.shared.dto.I18nTranslationDTO;
import cc.kune.core.shared.dto.SearchResultDTO;
import cc.kune.domain.I18nLanguage;
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/LicenseManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/LicenseManagerDefault.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/LicenseManagerDefault.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -23,8 +23,8 @@
import javax.persistence.EntityManager;
-import cc.kune.core.server.DataSourceKune;
import cc.kune.core.server.manager.LicenseManager;
+import cc.kune.core.server.persist.DataSourceKune;
import cc.kune.core.server.properties.KuneBasicProperties;
import cc.kune.domain.License;
import cc.kune.domain.finders.LicenseFinder;
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/RateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/RateManagerDefault.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/RateManagerDefault.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -22,8 +22,8 @@
import javax.persistence.EntityManager;
import javax.persistence.NoResultException;
-import cc.kune.core.server.DataSourceKune;
import cc.kune.core.server.manager.RateManager;
+import cc.kune.core.server.persist.DataSourceKune;
import cc.kune.domain.Content;
import cc.kune.domain.Rate;
import cc.kune.domain.User;
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/SocialNetworkManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/SocialNetworkManagerDefault.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/SocialNetworkManagerDefault.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -30,11 +30,11 @@
import cc.kune.core.client.errors.InvalidSNOperationException;
import cc.kune.core.client.errors.LastAdminInGroupException;
import cc.kune.core.client.errors.UserMustBeLoggedException;
-import cc.kune.core.server.DataSourceKune;
import cc.kune.core.server.access.AccessRightsService;
import cc.kune.core.server.error.ServerException;
import cc.kune.core.server.manager.SocialNetworkManager;
import cc.kune.core.server.manager.UserManager;
+import cc.kune.core.server.persist.DataSourceKune;
import cc.kune.core.shared.domain.AdmissionType;
import cc.kune.core.shared.domain.GroupListMode;
import cc.kune.core.shared.domain.SocialNetworkVisibility;
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/TagManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/TagManagerDefault.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/TagManagerDefault.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -21,8 +21,8 @@
import javax.persistence.EntityManager;
-import cc.kune.core.server.DataSourceKune;
import cc.kune.core.server.manager.TagManager;
+import cc.kune.core.server.persist.DataSourceKune;
import cc.kune.domain.Tag;
import cc.kune.domain.finders.TagFinder;
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/TagUserContentManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/TagUserContentManagerDefault.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/TagUserContentManagerDefault.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -26,9 +26,9 @@
import javax.persistence.NoResultException;
import cc.kune.common.shared.utils.TextUtils;
-import cc.kune.core.server.DataSourceKune;
import cc.kune.core.server.manager.TagManager;
import cc.kune.core.server.manager.TagUserContentManager;
+import cc.kune.core.server.persist.DataSourceKune;
import cc.kune.core.shared.domain.TagCloudResult;
import cc.kune.core.shared.domain.TagCount;
import cc.kune.domain.Content;
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/ToolConfigurationManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/ToolConfigurationManagerDefault.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/ToolConfigurationManagerDefault.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -21,8 +21,8 @@
import javax.persistence.EntityManager;
-import cc.kune.core.server.DataSourceKune;
import cc.kune.core.server.manager.ToolConfigurationManager;
+import cc.kune.core.server.persist.DataSourceKune;
import cc.kune.domain.ToolConfiguration;
import com.google.inject.Inject;
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 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -58,7 +58,6 @@
import cc.kune.core.client.errors.WrongCurrentPasswordException;
import cc.kune.core.client.state.SiteTokens;
import cc.kune.core.client.state.TokenUtils;
-import cc.kune.core.server.DataSourceKune;
import cc.kune.core.server.i18n.I18nTranslationServiceMultiLang;
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.manager.I18nCountryManager;
@@ -66,6 +65,7 @@
import cc.kune.core.server.manager.SearchResult;
import cc.kune.core.server.manager.UserManager;
import cc.kune.core.server.notifier.NotificationService;
+import cc.kune.core.server.persist.DataSourceKune;
import cc.kune.core.server.properties.ChatProperties;
import cc.kune.core.server.properties.KuneBasicProperties;
import cc.kune.core.server.xmpp.ChatConnection;
Copied: trunk/src/main/java/cc/kune/core/server/persist/CustomPersistFilter.java (from rev 1742, trunk/src/main/java/cc/kune/core/server/CustomPersistFilter.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/persist/CustomPersistFilter.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/persist/CustomPersistFilter.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -0,0 +1,111 @@
+/**
+ * Copyright (C) 2010 Google, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+package cc.kune.core.server.persist;
+
+import java.io.IOException;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+import com.google.inject.persist.PersistService;
+import com.google.inject.persist.UnitOfWork;
+
+/**
+ * Apply this filter to enable the HTTP Request unit of work and to have
+ * guice-persist manage the lifecycle of active units of work. The filter
+ * automatically starts and stops the relevant {@link PersistService} upon
+ * {@link javax.servlet.Filter#init(javax.servlet.FilterConfig)} and
+ * {@link javax.servlet.Filter#destroy()} respectively.
+ *
+ * <p>
+ * To be able to use the open session-in-view pattern (i.e. work per request),
+ * register this filter <b>once</b> in your Guice {@code ServletModule}. It is
+ * important that you register this filter before any other filter.
+ *
+ * For multiple providers, you should register this filter once per provider,
+ * inside a private module for each persist module installed (this must be the
+ * same private module where the specific persist module is itself installed).
+ *
+ * <p>
+ * Example configuration:
+ *
+ * <pre>
+ * {
+ * @code
+ * public class MyModule extends ServletModule {
+ * public void configureServlets() {
+ * filter("/*").through(PersistFilter.class);
+ *
+ * serve("/index.html").with(MyHtmlServlet.class);
+ * // Etc.
+ * }
+ * }
+ * }
+ * </pre>
+ * <p>
+ * This filter is thread safe and allows you to create injectors concurrently
+ * and deploy multiple guice-persist modules within the same injector, or even
+ * multiple injectors with persist modules withing the same JVM or web app.
+ * <p>
+ * This filter requires the Guice Servlet extension.
+ *
+ * @author Dhanji R. Prasanna (dhanji(a)gmail.com)
+ *
+ * (Custom PersistFilter.class modified for kune needs without
+ * persistence start/stop)
+ */
+
+@Singleton
+public class CustomPersistFilter implements Filter {
+ private final PersistService persistService;
+ private final UnitOfWork unitOfWork;
+
+ @Inject
+ public CustomPersistFilter(final UnitOfWork unitOfWork, final PersistService persistService) {
+ this.unitOfWork = unitOfWork;
+ this.persistService = persistService;
+ }
+
+ @Override
+ public void destroy() {
+ // Commented in kune
+ // persistService.stop();
+ }
+
+ @Override
+ public void doFilter(final ServletRequest servletRequest, final ServletResponse servletResponse,
+ final FilterChain filterChain) throws IOException, ServletException {
+
+ unitOfWork.begin();
+ try {
+ filterChain.doFilter(servletRequest, servletResponse);
+ } finally {
+ unitOfWork.end();
+ }
+ }
+
+ @Override
+ public void init(final FilterConfig filterConfig) throws ServletException {
+ // Commented in kune (because if not this is started twice)
+ // persistService.start();
+ }
+}
\ No newline at end of file
Copied: trunk/src/main/java/cc/kune/core/server/persist/DataSourceKune.java (from rev 1742, trunk/src/main/java/cc/kune/core/server/DataSourceKune.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/persist/DataSourceKune.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/persist/DataSourceKune.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -0,0 +1,17 @@
+package cc.kune.core.server.persist;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import com.google.inject.BindingAnnotation;
+
+(a)Retention(RetentionPolicy.RUNTIME)
+@Target({ FIELD, PARAMETER, METHOD })
+@BindingAnnotation
+public @interface DataSourceKune {
+}
\ No newline at end of file
Copied: trunk/src/main/java/cc/kune/core/server/persist/DataSourceKunePersistModule.java (from rev 1744, trunk/src/main/java/cc/kune/core/server/DataSourceKunePersistModule.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/persist/DataSourceKunePersistModule.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/persist/DataSourceKunePersistModule.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -0,0 +1,144 @@
+package cc.kune.core.server.persist;
+
+import java.util.Properties;
+
+import javax.persistence.EntityManager;
+
+import org.apache.commons.configuration.SystemConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.hibernate.Session;
+
+import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.server.properties.KunePropertiesDefault;
+import cc.kune.domain.finders.ContainerFinder;
+import cc.kune.domain.finders.ContentFinder;
+import cc.kune.domain.finders.ExtMediaDescripFinder;
+import cc.kune.domain.finders.GroupFinder;
+import cc.kune.domain.finders.I18nCountryFinder;
+import cc.kune.domain.finders.I18nLanguageFinder;
+import cc.kune.domain.finders.I18nTranslationFinder;
+import cc.kune.domain.finders.LicenseFinder;
+import cc.kune.domain.finders.RateFinder;
+import cc.kune.domain.finders.TagFinder;
+import cc.kune.domain.finders.TagUserContentFinder;
+import cc.kune.domain.finders.UserFinder;
+
+import com.google.inject.AbstractModule;
+import com.google.inject.Key;
+import com.google.inject.Provider;
+import com.google.inject.persist.jpa.JpaPersistModule;
+
+public class DataSourceKunePersistModule extends AbstractModule {
+ // FIXME Trying to make this PrivateModule so we can have two Persist sources
+ // http://code.google.com/p/google-guice/wiki/GuicePersistMultiModules
+
+ public static final Log LOG = LogFactory.getLog(DataSourceKunePersistModule.class);
+ public static final Key<CustomPersistFilter> MY_DATA_SOURCE_ONE_FILTER_KEY = Key.get(
+ CustomPersistFilter.class, DataSourceKune.class);
+ private String settedJpaUnit = null;
+ private String settedProperties = null;
+
+ /**
+ * Instantiates this module (main constructor)
+ */
+ public DataSourceKunePersistModule() {
+ }
+
+ /**
+ * Instantiates this module only during tests
+ *
+ * @param settedProperties
+ * the setted properties
+ * @param settedJpaUnit
+ * the setted jpa unit
+ */
+ public DataSourceKunePersistModule(final String settedProperties, final String settedJpaUnit) {
+ this.settedProperties = settedProperties;
+ this.settedJpaUnit = settedJpaUnit;
+ }
+
+ @Override
+ public void configure() {
+ final SystemConfiguration sysConf = new SystemConfiguration();
+ final String kuneConfig = settedProperties != null ? settedProperties
+ : sysConf.getString("kune.server.config");
+
+ final KunePropertiesDefault kuneProperties = new KunePropertiesDefault(kuneConfig);
+ bind(KuneProperties.class).toInstance(kuneProperties);
+
+ // precedence method param > properties
+ final String configuredJpaUnit = kuneProperties.get(KuneProperties.SITE_DB_PERSISTENCE_NAME);
+ final String jpaUnit = settedJpaUnit != null ? settedJpaUnit
+ : configuredJpaUnit != null ? configuredJpaUnit : "development";
+ LOG.info(String.format("Using persistence unit '%s' and properties '%s'", jpaUnit, kuneConfig));
+
+ final JpaPersistModule jpm = new JpaPersistModule(jpaUnit);
+
+ if (!jpaUnit.equals("test")) {
+ // In tests (and development) we don't override this db info)
+ final Properties dbProperties = new Properties();
+ dbProperties.setProperty("hibernate.connection.url",
+ kuneProperties.get(KuneProperties.SITE_DB_URL));
+ dbProperties.setProperty("hibernate.connection.username",
+ kuneProperties.get(KuneProperties.SITE_DB_USER));
+ dbProperties.setProperty("hibernate.connection.password",
+ kuneProperties.get(KuneProperties.SITE_DB_PASSWORD));
+ jpm.properties(dbProperties);
+ }
+
+ jpm.addFinder(ContainerFinder.class);
+ jpm.addFinder(ContentFinder.class);
+ jpm.addFinder(ExtMediaDescripFinder.class);
+ jpm.addFinder(GroupFinder.class);
+ jpm.addFinder(I18nCountryFinder.class);
+ jpm.addFinder(I18nLanguageFinder.class);
+ jpm.addFinder(I18nTranslationFinder.class);
+ jpm.addFinder(LicenseFinder.class);
+ jpm.addFinder(RateFinder.class);
+ jpm.addFinder(TagFinder.class);
+ jpm.addFinder(TagUserContentFinder.class);
+ jpm.addFinder(UserFinder.class);
+ install(jpm);
+
+ bind(Session.class).annotatedWith(DataSourceKune.class).toProvider(
+ DataSourceKuneSessionProvider.class);
+
+ // FIXME: Trying to use a custom JpaLocalTxnInterceptor because when this
+ // module is private the objects are not persisted with the guice-persist
+ // @Transactional
+
+ // final KuneJpaLocalTxnInterceptor transactionInterceptor = new
+ // KuneJpaLocalTxnInterceptor();
+ // requestInjection(transactionInterceptor);
+ //
+ // bindInterceptor(annotatedWith(KuneTransactional.class), any(),
+ // transactionInterceptor);
+ // bindInterceptor(any(), annotatedWith(KuneTransactional.class),
+ // transactionInterceptor);
+
+ final Provider<EntityManager> entityManagerProvider = binder().getProvider(EntityManager.class);
+ bind(EntityManager.class).annotatedWith(DataSourceKune.class).toProvider(entityManagerProvider);
+
+ bind(MY_DATA_SOURCE_ONE_FILTER_KEY).to(CustomPersistFilter.class);
+
+ // expose(EntityManager.class).annotatedWith(DataSourceKune.class);
+ // expose(Session.class).annotatedWith(DataSourceKune.class);
+ // expose(KuneProperties.class);
+ // expose(ContainerFinder.class);
+ // expose(ContentFinder.class);
+ // expose(ExtMediaDescripFinder.class);
+ // expose(GroupFinder.class);
+ // expose(I18nCountryFinder.class);
+ // expose(I18nLanguageFinder.class);
+ // expose(I18nTranslationFinder.class);
+ // expose(LicenseFinder.class);
+ // expose(RateFinder.class);
+ // expose(TagFinder.class);
+ // expose(TagUserContentFinder.class);
+ // expose(UserFinder.class);
+ // expose(MY_DATA_SOURCE_ONE_FILTER_KEY);
+
+ bind(GenericPersistenceInitializer.class).asEagerSingleton();
+ }
+}
\ No newline at end of file
Copied: trunk/src/main/java/cc/kune/core/server/persist/DataSourceKuneSessionProvider.java (from rev 1742, trunk/src/main/java/cc/kune/core/server/DataSourceKuneSessionProvider.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/persist/DataSourceKuneSessionProvider.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/persist/DataSourceKuneSessionProvider.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -0,0 +1,26 @@
+package cc.kune.core.server.persist;
+
+import javax.persistence.EntityManager;
+
+import org.hibernate.Session;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class DataSourceKuneSessionProvider implements Provider<Session> {
+ /** The entity manger to retrieve the session from. */
+ @Inject
+ @DataSourceKune
+ private Provider<EntityManager> entityManagerProvider;
+
+ /**
+ * @return the Hibernate session, being the delegate of the entity manager
+ * provided by the injected entity manager provider.
+ */
+ @Override
+ public Session get() {
+ final Session session = (Session) entityManagerProvider.get().getDelegate();
+ // configure session i.e. flush mode or filtering
+ return session;
+ }
+};
\ No newline at end of file
Copied: trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfire.java (from rev 1742, trunk/src/main/java/cc/kune/core/server/DataSourceOpenfire.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfire.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfire.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -0,0 +1,17 @@
+package cc.kune.core.server.persist;
+
+import static java.lang.annotation.ElementType.FIELD;
+import static java.lang.annotation.ElementType.METHOD;
+import static java.lang.annotation.ElementType.PARAMETER;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+import com.google.inject.BindingAnnotation;
+
+(a)Retention(RetentionPolicy.RUNTIME)
+@Target({ FIELD, PARAMETER, METHOD })
+@BindingAnnotation
+public @interface DataSourceOpenfire {
+}
\ No newline at end of file
Copied: trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfirePersistModule.java (from rev 1742, trunk/src/main/java/cc/kune/core/server/DataSourceOpenfirePersistModule.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfirePersistModule.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfirePersistModule.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -0,0 +1,60 @@
+package cc.kune.core.server.persist;
+
+import java.util.Properties;
+
+import javax.persistence.EntityManager;
+
+import org.hibernate.Session;
+
+import cc.kune.core.server.xmpp.OpenfireXmppRosterFinder;
+import cc.kune.core.server.xmpp.OpenfireXmppRosterProvider;
+import cc.kune.core.server.xmpp.XmppRosterProvider;
+
+import com.google.inject.Key;
+import com.google.inject.PrivateModule;
+import com.google.inject.Provider;
+import com.google.inject.Singleton;
+import com.google.inject.persist.jpa.JpaPersistModule;
+
+public class DataSourceOpenfirePersistModule extends PrivateModule {
+ public static final Key<CustomPersistFilter> MY_DATA_SOURCE_TWO_FILTER_KEY = Key.get(
+ CustomPersistFilter.class, DataSourceOpenfire.class);
+
+ @Override
+ public void configure() {
+ final JpaPersistModule jpm = new JpaPersistModule("openfire");
+ // jpm.properties(new Properties());
+
+ final Properties dbProperties = new Properties();
+ dbProperties.setProperty(
+ "hibernate.connection.url",
+ "jdbc:mysql://localhost/openfire4?createDatabaseIfNotExist=false&useUnicode=true&characterEncoding=UTF-8");
+ // kuneProperties.get(KuneProperties.SITE_DB_URL));
+ dbProperties.setProperty("hibernate.connection.username", "openfire");
+ // kuneProperties.get(KuneProperties.SITE_DB_USER));
+ dbProperties.setProperty("hibernate.connection.password", "easyeasy");
+ dbProperties.setProperty("exclude-unlisted-classes", "true");
+
+ // kuneProperties.get(KuneProperties.SITE_DB_PASSWORD));
+
+ jpm.properties(dbProperties);
+ install(jpm.addFinder(OpenfireXmppRosterFinder.class));
+ expose(OpenfireXmppRosterFinder.class);
+
+ bind(XmppRosterProvider.class).to(OpenfireXmppRosterProvider.class).in(Singleton.class);
+ expose(XmppRosterProvider.class);
+
+ bind(Session.class).annotatedWith(DataSourceOpenfire.class).toProvider(
+ DataSourceOpenfireSessionProvider.class);
+ expose(Session.class).annotatedWith(DataSourceOpenfire.class);
+
+ final Provider<EntityManager> entityManagerProvider = binder().getProvider(EntityManager.class);
+ bind(EntityManager.class).annotatedWith(DataSourceOpenfire.class).toProvider(entityManagerProvider);
+ expose(EntityManager.class).annotatedWith(DataSourceOpenfire.class);
+
+ bind(MY_DATA_SOURCE_TWO_FILTER_KEY).to(CustomPersistFilter.class);
+ expose(MY_DATA_SOURCE_TWO_FILTER_KEY);
+
+ // bind(KunePersistenceInitializer.class).asEagerSingleton();
+ }
+}
\ No newline at end of file
Copied: trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfireSessionProvider.java (from rev 1742, trunk/src/main/java/cc/kune/core/server/DataSourceOpenfireSessionProvider.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfireSessionProvider.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/persist/DataSourceOpenfireSessionProvider.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -0,0 +1,26 @@
+package cc.kune.core.server.persist;
+
+import javax.persistence.EntityManager;
+
+import org.hibernate.Session;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class DataSourceOpenfireSessionProvider implements Provider<Session> {
+ /** The entity manger to retrieve the session from. */
+ @Inject
+ @DataSourceOpenfire
+ private Provider<EntityManager> entityManagerProvider;
+
+ /**
+ * @return the Hibernate session, being the delegate of the entity manager
+ * provided by the injected entity manager provider.
+ */
+ @Override
+ public Session get() {
+ final Session session = (Session) entityManagerProvider.get().getDelegate();
+ // configure session i.e. flush mode or filtering
+ return session;
+ }
+};
\ No newline at end of file
Copied: trunk/src/main/java/cc/kune/core/server/persist/GenericPersistenceInitializer.java (from rev 1742, trunk/src/main/java/cc/kune/core/server/GenericPersistenceInitializer.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/persist/GenericPersistenceInitializer.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/persist/GenericPersistenceInitializer.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -0,0 +1,12 @@
+package cc.kune.core.server.persist;
+
+import com.google.inject.Inject;
+import com.google.inject.persist.PersistService;
+
+public class GenericPersistenceInitializer {
+ @Inject
+ GenericPersistenceInitializer(final PersistService service) {
+ service.start();
+ // At this point JPA is started and ready.
+ }
+}
\ No newline at end of file
Copied: trunk/src/main/java/cc/kune/core/server/persist/KunePersistenceService.java (from rev 1742, trunk/src/main/java/cc/kune/core/server/KunePersistenceService.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/persist/KunePersistenceService.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/persist/KunePersistenceService.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -0,0 +1,41 @@
+/*
+ *
+ * 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.server.persist;
+
+import cc.kune.core.server.error.ServerException;
+import cc.kune.core.server.init.DatabaseInitializer;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+@Singleton
+public class KunePersistenceService {
+ @Inject
+ DatabaseInitializer databaseInitializer;
+
+ public void start() {
+ try {
+ databaseInitializer.initConditional();
+ } catch (final Exception e) {
+ throw new ServerException("Error starting persistence service", e);
+ }
+ }
+
+}
Copied: trunk/src/main/java/cc/kune/core/server/persist/KuneTransactional.java (from rev 1744, trunk/src/main/java/cc/kune/core/server/KuneTransactional.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/persist/KuneTransactional.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/persist/KuneTransactional.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -0,0 +1,29 @@
+package cc.kune.core.server.persist;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Inherited;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+@Target({ ElementType.METHOD, ElementType.TYPE })
+(a)Retention(RetentionPolicy.RUNTIME)
+@Inherited
+public @interface KuneTransactional {
+
+ /**
+ * A list of exceptions to <b>not<b> rollback on. A caveat to the rollbackOn
+ * clause. The disjunction of rollbackOn and ignore represents the list of
+ * exceptions that will trigger a rollback. The complement of rollbackOn and
+ * the universal set plus any exceptions in the ignore set represents the list
+ * of exceptions that will trigger a commit. Note that ignore exceptions take
+ * precedence over rollbackOn, but with subtype granularity.
+ */
+ Class<? extends Exception>[] ignore() default {};
+
+ /**
+ * A list of exceptions to rollback on, if thrown by the transactional method.
+ * These exceptions are propagated correctly after a rollback.
+ */
+ Class<? extends Exception>[] rollbackOn() default RuntimeException.class;
+}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/server/xmpp/OpenfireXmppRosterProvider.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/xmpp/OpenfireXmppRosterProvider.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/core/server/xmpp/OpenfireXmppRosterProvider.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -5,8 +5,8 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import cc.kune.core.server.DataSourceOpenfire;
import cc.kune.core.server.manager.impl.DefaultManager;
+import cc.kune.core.server.persist.DataSourceOpenfire;
import com.google.inject.Inject;
import com.google.inject.Provider;
Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -43,7 +43,7 @@
public class UserOptGeneralPresenter extends EntityOptGeneralPresenter implements UserOptGeneral {
- private boolean changeLanguage = true;
+ private boolean askChangeLanguage = true;
private final Provider<UserServiceAsync> userService;
private final UserOptGeneralView userView;
@@ -128,8 +128,8 @@
@Override
public void onSuccess(final StateAbstractDTO result) {
NotifyUser.hideProgress();
- if (changeLanguage) {
- i18n.changeToLanguageIfNecessary(lang.getCode(), lang.getEnglishName(), true,
+ if (askChangeLanguage) {
+ i18n.changeToLanguageIfNecessary(lang.getCode(), i18n.t(lang.getEnglishName()), true,
new I18nLanguageChangeNeeded() {
@Override
public void onChangeNeeded() {
@@ -137,7 +137,7 @@
@Override
public void onChangeNotNeeded() {
- changeLanguage = false;
+ askChangeLanguage = false;
stateManager.setRetrievedStateAndGo(result);
sendChangeEntityEvent();
}
Modified: trunk/src/test/java/cc/kune/core/server/PersistenceTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/PersistenceTest.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/test/java/cc/kune/core/server/PersistenceTest.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -24,6 +24,8 @@
import org.junit.Before;
+import cc.kune.core.server.persist.DataSourceKune;
+
import com.google.inject.Inject;
import com.google.inject.Injector;
import com.google.inject.Provider;
Modified: trunk/src/test/java/cc/kune/core/server/TestHelper.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/TestHelper.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/test/java/cc/kune/core/server/TestHelper.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -34,6 +34,7 @@
import org.waveprotocol.wave.federation.noop.NoOpFederationModule;
import cc.kune.core.server.integration.HttpServletRequestMocked;
+import cc.kune.core.server.persist.DataSourceKunePersistModule;
import cc.kune.wave.server.CustomSettingsBinder;
import com.google.inject.Binder;
Modified: trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/test/java/cc/kune/core/server/integration/IntegrationTestHelper.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -32,10 +32,10 @@
import cc.kune.barters.server.BarterServerModule;
import cc.kune.chat.server.ChatServerModule;
-import cc.kune.core.server.KunePersistenceService;
-import cc.kune.core.server.DataSourceKunePersistModule;
import cc.kune.core.server.PlatformServerModule;
import cc.kune.core.server.TestConstants;
+import cc.kune.core.server.persist.DataSourceKunePersistModule;
+import cc.kune.core.server.persist.KunePersistenceService;
import cc.kune.docs.server.DocumentServerModule;
import cc.kune.events.server.EventsServerModule;
import cc.kune.lists.server.ListsServerModule;
Modified: trunk/src/test/java/com/google/inject/persist/jpa/KuneJpaLocalTxnInterceptor.java
===================================================================
--- trunk/src/test/java/com/google/inject/persist/jpa/KuneJpaLocalTxnInterceptor.java 2012-03-07 04:59:48 UTC (rev 1745)
+++ trunk/src/test/java/com/google/inject/persist/jpa/KuneJpaLocalTxnInterceptor.java 2012-03-07 12:19:26 UTC (rev 1746)
@@ -24,7 +24,7 @@
import org.aopalliance.intercept.MethodInterceptor;
import org.aopalliance.intercept.MethodInvocation;
-import cc.kune.core.server.KuneTransactional;
+import cc.kune.core.server.persist.KuneTransactional;
import com.google.inject.Inject;
import com.google.inject.persist.UnitOfWork;
1
0
r1745 - in trunk/src/main/java/cc/kune: common/client/ui common/public core/client/auth core/client/errors core/client/i18n core/client/resources core/client/rpcservices core/server/manager/impl core/server/rpc core/shared/dto gspace/client/options gspace/client/options/general gspace/client/options/logo
by Vicente J. Ruiz Jurado 07 Mar '12
by Vicente J. Ruiz Jurado 07 Mar '12
07 Mar '12
Author: vjrj_
Date: 2012-03-07 05:59:48 +0100 (Wed, 07 Mar 2012)
New Revision: 1745
Added:
trunk/src/main/java/cc/kune/core/client/resources/pref-black.png
trunk/src/main/java/cc/kune/core/client/resources/pref-grey.png
trunk/src/main/java/cc/kune/core/client/resources/pref-white.png
Modified:
trunk/src/main/java/cc/kune/common/client/ui/IconLabel.java
trunk/src/main/java/cc/kune/common/public/kune-common.css
trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPresenter.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/resources/CoreResources.java
trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java
trunk/src/main/java/cc/kune/core/server/manager/impl/EmailConfirmationType.java
trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java
trunk/src/main/java/cc/kune/core/shared/dto/UserSimpleDTO.java
trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralView.java
trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java
Log:
Email change from UI. Pref Icon changed. Some ccs fix. Language change optional.
Modified: trunk/src/main/java/cc/kune/common/client/ui/IconLabel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/IconLabel.java 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/common/client/ui/IconLabel.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -22,6 +22,7 @@
import java.util.Iterator;
import cc.kune.common.client.tooltip.Tooltip;
+import cc.kune.common.shared.utils.TextUtils;
import com.google.gwt.core.client.GWT;
import com.google.gwt.event.dom.client.HasClickHandlers;
@@ -74,7 +75,8 @@
initWidget(uiBinder.createAndBindUi(this));
label.setText(text);
label.addStyleName("k-space-nowrap");
- label.addStyleName("k-iconlabel-text");
+ label.setStylePrimaryName("k-iconlabel");
+ setTextStyle(text);
iconLeft.setVisible(false);
iconRight.setVisible(false);
}
@@ -202,13 +204,20 @@
@Override
public void setText(final String text) {
label.setText(text, Direction.LTR);
+ setTextStyle(text);
}
@Override
public void setText(final String text, final Direction dir) {
label.setText(text, dir);
+ setTextStyle(text);
}
+ private void setTextStyle(final String text) {
+ label.setStyleDependentName("notext", TextUtils.empty(text));
+ label.setStyleDependentName("text", !TextUtils.empty(text));
+ }
+
public void setTooltip(final String text) {
Tooltip.to(label, text);
}
Modified: trunk/src/main/java/cc/kune/common/public/kune-common.css
===================================================================
--- trunk/src/main/java/cc/kune/common/public/kune-common.css 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/common/public/kune-common.css 2012-03-07 04:59:48 UTC (rev 1745)
@@ -471,11 +471,19 @@
.k-iconlabel-text {
vertical-align: top;
+ float: right;
+}
+
+.k-iconlabel-text {
padding-left: 3px;
padding-right: 3px;
- float: right;
}
+.k-iconlabel-notext {
+ padding-left: 0px;
+ padding-right: 0px;
+}
+
.k-iconlabel-left {
float: left;
}
Modified: trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPresenter.java 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPresenter.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -94,7 +94,7 @@
session.setCurrentUserInfo(userInfoDTO);
final I18nLanguageDTO language = userInfoDTO.getLanguage();
session.setCurrentLanguage(language);
- i18n.changeToLanguageIfNecessary(language.getCode(), language.getEnglishName(),
+ i18n.changeToLanguageIfNecessary(language.getCode(), language.getEnglishName(), true,
new I18nLanguageChangeNeeded() {
@Override
Modified: trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -24,11 +24,11 @@
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.notify.ProgressHideEvent;
import cc.kune.common.client.notify.UserNotifyEvent;
-import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.events.GoHomeEvent;
import cc.kune.core.client.events.StackErrorEvent;
import cc.kune.core.client.events.UserMustBeLoggedEvent;
+import cc.kune.core.client.i18n.I18nUITranslationService;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.rpc.IncompatibleRemoteServiceException;
@@ -37,10 +37,10 @@
public class ErrorHandler {
private final EventBus eventBus;
- private final I18nTranslationService i18n;
+ private final I18nUITranslationService i18n;
@Inject
- public ErrorHandler(final I18nTranslationService i18n, final EventBus eventBus) {
+ public ErrorHandler(final I18nUITranslationService i18n, final EventBus eventBus) {
this.i18n = i18n;
this.eventBus = eventBus;
}
@@ -122,6 +122,9 @@
logException(caught);
eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error,
i18n.t("This user is already a group member")));
+ } else if (caught instanceof EmailAddressInUseException) {
+ eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, i18n.t(
+ "This email is already used in [%s]. Please choose another.", i18n.getSiteCommonName())));
} else if (caught instanceof EmailHashInvalidException) {
logException(caught);
eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error,
Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -110,7 +110,7 @@
+ shouldIuseProperties());
changeToLanguageIfNecessary(getCurrentGWTlanguage(), currentLang.getCode(),
- currentLang.getEnglishName(), new I18nLanguageChangeNeeded() {
+ currentLang.getEnglishName(), false, new I18nLanguageChangeNeeded() {
@Override
public void onChangeNeeded() {
@@ -181,8 +181,8 @@
}
public void changeToLanguageIfNecessary(final String wantedLang, final String wantedLangEnglishName,
- final I18nLanguageChangeNeeded listener) {
- changeToLanguageIfNecessary(currentLang.getCode(), wantedLang, wantedLangEnglishName, listener);
+ final boolean ask, final I18nLanguageChangeNeeded listener) {
+ changeToLanguageIfNecessary(currentLang.getCode(), wantedLang, wantedLangEnglishName, ask, listener);
}
/**
@@ -192,25 +192,31 @@
* @return true if we should reload the client with the new language
*/
private void changeToLanguageIfNecessary(final String currentLangCode, final String wantedLang,
- final String wantedLangEnglishName, final I18nLanguageChangeNeeded listener) {
+ final String wantedLangEnglishName, final boolean ask, final I18nLanguageChangeNeeded listener) {
if (!currentLangCode.equals(wantedLang) && isInConstantProperties(wantedLang)) {
- NotifyUser.askConfirmation(t("Confirm please"),
- t("Do you want to reload this page to use '[%s]' language?", wantedLangEnglishName),
- new SimpleResponseCallback() {
- @Override
- public void onCancel() {
- // User no accepted to change the language...
- listener.onChangeNotNeeded();
- }
+ if (!ask) {
+ listener.onChangeNeeded();
+ setCurrentLanguage(wantedLang);
+ changeLanguageInUrl(wantedLang);
+ } else {
+ NotifyUser.askConfirmation(t("Confirm please"),
+ t("Do you want to reload this page to use '[%s]' language?", wantedLangEnglishName),
+ new SimpleResponseCallback() {
+ @Override
+ public void onCancel() {
+ // User no accepted to change the language...
+ listener.onChangeNotNeeded();
+ }
- @Override
- public void onSuccess() {
- // User accepted to change the language...
- listener.onChangeNeeded();
- setCurrentLanguage(wantedLang);
- changeLanguageInUrl(wantedLang);
- }
- });
+ @Override
+ public void onSuccess() {
+ // User accepted to change the language...
+ listener.onChangeNeeded();
+ setCurrentLanguage(wantedLang);
+ changeLanguageInUrl(wantedLang);
+ }
+ });
+ }
} else {
listener.onChangeNotNeeded();
}
Modified: trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/core/client/resources/CoreResources.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -442,9 +442,18 @@
@Source("person-def.png")
ImageResource personDef();
+ @Source("pref-black.png")
+ ImageResource prefBlack();
+
+ @Source("pref-grey.png")
+ ImageResource prefGrey();
+
@Source("prefs.png")
ImageResource prefs();
+ @Source("pref-white.png")
+ ImageResource prefWhite();
+
@Source("question32.png")
ImageResource question32();
Added: trunk/src/main/java/cc/kune/core/client/resources/pref-black.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/pref-black.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/core/client/resources/pref-grey.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/pref-grey.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/cc/kune/core/client/resources/pref-white.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/cc/kune/core/client/resources/pref-white.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -20,9 +20,11 @@
package cc.kune.core.client.rpcservices;
import cc.kune.core.client.errors.DefaultException;
+import cc.kune.core.client.errors.EmailAddressInUseException;
import cc.kune.core.client.errors.EmailHashExpiredException;
import cc.kune.core.client.errors.EmailHashInvalidException;
import cc.kune.core.client.errors.EmailNotFoundException;
+import cc.kune.core.client.errors.GroupLongNameInUseException;
import cc.kune.core.shared.domain.UserSNetVisibility;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
@@ -62,7 +64,8 @@
void setBuddiesVisibility(String userHash, StateToken groupToken, UserSNetVisibility visibility);
- StateAbstractDTO updateUser(String userHash, UserDTO user, I18nLanguageSimpleDTO lang);
+ StateAbstractDTO updateUser(String userHash, UserDTO user, I18nLanguageSimpleDTO lang)
+ throws DefaultException, EmailAddressInUseException, GroupLongNameInUseException;
void verifyPasswordHash(String userHash, String emailReceivedHash) throws EmailHashInvalidException,
EmailHashExpiredException;
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/EmailConfirmationType.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/EmailConfirmationType.java 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/EmailConfirmationType.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -5,6 +5,6 @@
* types of email confirmation/verification
*/
public enum EmailConfirmationType {
- emailVerification, fstTimeEmailVerification, passwordReset
+ emailVerification, passwordReset
}
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 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -152,7 +152,6 @@
switch (type) {
case emailVerification:
- case fstTimeEmailVerification:
notifyService.sendEmailToWithLink(user, "Please verify your email",
"Please click in the following link to verify your email at %s:",
TokenUtils.addRedirect(SiteTokens.VERIFY_EMAIL, hash));
@@ -461,6 +460,8 @@
if (email != null && !email.equals(user.getEmail())) {
checkIfEmailAreInUse(email);
user.setEmail(email);
+ user.setEmailVerified(false);
+ askForEmailConfirmation(user, EmailConfirmationType.emailVerification);
}
user.setLanguage(findLanguage(lang.getCode()));
persist(user);
Modified: trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -29,9 +29,11 @@
import cc.kune.core.client.errors.AccessViolationException;
import cc.kune.core.client.errors.DefaultException;
+import cc.kune.core.client.errors.EmailAddressInUseException;
import cc.kune.core.client.errors.EmailHashExpiredException;
import cc.kune.core.client.errors.EmailHashInvalidException;
import cc.kune.core.client.errors.EmailNotFoundException;
+import cc.kune.core.client.errors.GroupLongNameInUseException;
import cc.kune.core.client.errors.UserAuthException;
import cc.kune.core.client.rpcservices.UserService;
import cc.kune.core.server.UserSession;
@@ -239,7 +241,8 @@
@Authenticated
@Transactional
public StateAbstractDTO updateUser(final String userHash, final UserDTO user,
- final I18nLanguageSimpleDTO lang) throws DefaultException {
+ final I18nLanguageSimpleDTO lang) throws DefaultException, EmailAddressInUseException,
+ GroupLongNameInUseException {
final Long id = userSessionManager.getUser().getId();
if (!id.equals(user.getId())) {
throw new AccessViolationException();
Modified: trunk/src/main/java/cc/kune/core/shared/dto/UserSimpleDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/UserSimpleDTO.java 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/core/shared/dto/UserSimpleDTO.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -26,6 +26,7 @@
public class UserSimpleDTO implements IsSerializable {
private String compoundName;
private I18nCountryDTO country;
+ private String email;
private EmailNotificationFrequency emailNotifFreq;
private boolean emailVerified;
private boolean hasLogo;
@@ -89,6 +90,10 @@
return country;
}
+ public String getEmail() {
+ return email;
+ }
+
public EmailNotificationFrequency getEmailNotifFreq() {
return emailNotifFreq;
}
@@ -146,6 +151,10 @@
this.country = country;
}
+ public void setEmail(final String email) {
+ this.email = email;
+ }
+
public void setEmailNotifFreq(final EmailNotificationFrequency emailNotifFreq) {
this.emailNotifFreq = emailNotifFreq;
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -80,7 +80,7 @@
}
};
// groupPrefsAction.putValue(Action.NAME, i18n.t("Group options"));
- groupPrefsAction.putValue(Action.SMALL_ICON, img.prefs());
+ groupPrefsAction.putValue(Action.SMALL_ICON, img.prefGrey());
prefsItem = new ButtonDescriptor(groupPrefsAction);
prefsItem.withStyles("k-ent-header-btn, k-btn-min");
// k-noborder,
Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -43,12 +43,15 @@
private static final String BIG_FIELD_SIZE = "310px";
public static final String DAILY_TYPE_ID = "k-ngp-type_daily";
+ public static final String EMAIL_FIELD = "k-ngp-emial";
public static final String HOURLY_TYPE_ID = "k-ngp-type_hourly";
public static final String IMMEDIATE_TYPE_ID = "k-ngp-type_immedi";
- private static final String LONG_NAME_FIELD = "k-uogp-lname";
+ public static final String LONG_NAME_FIELD = "k-uogp-lname";
public static final String NO_TYPE_ID = "k-ngp-type_no";
public static final String TYPEOFEMAILNOTIF_FIELD = "k-ngp-type_of_email_notif";
+
private final Radio dailyRadio;
+ private final TextField<String> email;
private final FieldSet emailNotifTypeFieldSet;
private final Radio hourlyRadio;
private final Radio immediateRadio;
@@ -57,7 +60,6 @@
private final Radio noRadio;
private final AdapterField notVerifLabelAdapter;
private final AdapterField resendEmailVerifAdapter;
-
private final Button resendEmailVerifBtn;
@Inject
@@ -73,6 +75,9 @@
langSelector.setLangSeparator(":");
add(langSelector);
+ email = userFieldFactory.createUserEmail(EMAIL_FIELD);
+ add(email);
+
emailNotifTypeFieldSet = new FieldSet();
emailNotifTypeFieldSet.setHeading(i18n.t("How often do you want to receive email notifications?"));
emailNotifTypeFieldSet.addStyleName("k-form-fieldset");
@@ -131,6 +136,11 @@
}
@Override
+ public String getEmail() {
+ return email.getValue();
+ }
+
+ @Override
public EmailNotificationFrequency getEmailNotif() {
if (immediateRadio.getValue()) {
return EmailNotificationFrequency.immediately;
@@ -161,6 +171,11 @@
}
@Override
+ public void setEmail(final String email) {
+ this.email.setValue(email);
+ }
+
+ @Override
public void setEmailNotifChecked(final EmailNotificationFrequency freq) {
switch (freq) {
case no:
Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -43,7 +43,9 @@
public class UserOptGeneralPresenter extends EntityOptGeneralPresenter implements UserOptGeneral {
+ private boolean changeLanguage = true;
private final Provider<UserServiceAsync> userService;
+
private final UserOptGeneralView userView;
@Inject
@@ -101,6 +103,7 @@
userView.setEmailNotifChecked(currentUser.getEmailNotifFreq());
userView.setEmailVerified(currentUser.isEmailVerified());
userView.setResendEmailVerifEnabled(!currentUser.isEmailVerified());
+ userView.setEmail(currentUser.getEmail());
}
@Override
@@ -117,6 +120,7 @@
user.setId(currentUser.getId());
final String longName = userView.getLongName();
user.setName(longName);
+ user.setEmail(userView.getEmail());
final I18nLanguageSimpleDTO lang = userView.getLanguage();
user.setEmailNotifFreq(userView.getEmailNotif());
userService.get().updateUser(session.getUserHash(), user, userView.getLanguage(),
@@ -124,19 +128,21 @@
@Override
public void onSuccess(final StateAbstractDTO result) {
NotifyUser.hideProgress();
- // Change language to new one if needed
- i18n.changeToLanguageIfNecessary(lang.getCode(), lang.getEnglishName(),
- new I18nLanguageChangeNeeded() {
- @Override
- public void onChangeNeeded() {
- }
+ if (changeLanguage) {
+ i18n.changeToLanguageIfNecessary(lang.getCode(), lang.getEnglishName(), true,
+ new I18nLanguageChangeNeeded() {
+ @Override
+ public void onChangeNeeded() {
+ }
- @Override
- public void onChangeNotNeeded() {
- stateManager.setRetrievedStateAndGo(result);
- sendChangeEntityEvent();
- }
- });
+ @Override
+ public void onChangeNotNeeded() {
+ changeLanguage = false;
+ stateManager.setRetrievedStateAndGo(result);
+ sendChangeEntityEvent();
+ }
+ });
+ }
};
});
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralView.java 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralView.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -26,6 +26,8 @@
public interface UserOptGeneralView extends EntityOptGeneralView {
+ String getEmail();
+
EmailNotificationFrequency getEmailNotif();
I18nLanguageSimpleDTO getLanguage();
@@ -34,10 +36,12 @@
HasClickHandlers getResendEmailVerif();
- void setEmailVerified(boolean verified);
+ void setEmail(String email);
void setEmailNotifChecked(EmailNotificationFrequency freq);
+ void setEmailVerified(boolean verified);
+
void setLanguage(I18nLanguageSimpleDTO language);
void setLongName(String longName);
Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java 2012-03-07 02:43:00 UTC (rev 1744)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityUploaderForm.java 2012-03-07 04:59:48 UTC (rev 1745)
@@ -44,7 +44,7 @@
public EntityUploaderForm(final String servlet, final String btnText) {
btn = new EntityOptUploadButton(btnText);
- uploader = new MultiUploader(FileInputType.CUSTOM.with(btn));
+ uploader = new MultiUploader(FileInputType.CUSTOM.with(btn, true));
uploader.setServletPath(servlet);
uploader.setMaximumFiles(1);
uploader.setValidExtensions("png", "jpg", "gif", "jpeg", "bmp");
1
0