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
September 2011
- 2 participants
- 57 discussions
Author: vjrj_
Date: 2011-09-24 20:46:13 +0200 (Sat, 24 Sep 2011)
New Revision: 1531
Added:
trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java
trunk/src/test/java/cc/kune/selenium/PageObjectModule.java
trunk/src/test/java/cc/kune/selenium/SeleniumModule.java
trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java
trunk/src/test/java/cc/kune/selenium/login/EntityHeaderPageObject.java
trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java
trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java
Removed:
trunk/src/main/java/org/ourproject/kune/app/public/
trunk/src/main/java/org/ourproject/kune/chat/
trunk/src/main/java/org/ourproject/kune/gallery/KuneGallery.gwt.xml
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java
trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryMessages.java
trunk/src/main/java/org/ourproject/kune/gallery/client/cnt/
trunk/src/main/java/org/ourproject/kune/gallery/client/ctx/
trunk/src/main/java/org/ourproject/kune/gallery/public/
trunk/src/main/java/org/ourproject/kune/gallery/server/
trunk/src/main/java/org/ourproject/kune/platf/KunePlatform.gwt.xml
trunk/src/main/java/org/ourproject/kune/platf/RichText.gwt.xml
trunk/src/main/java/org/ourproject/kune/platf/client/View.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractExtendedAction.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/Action.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionAddCondition.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCheckedCondition.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEnableCondition.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEvent.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItemCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionMenuItemDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionPressedCondition.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionRegistry.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonAndItemDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonSeparator.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuAndItemDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuCheckItemDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuRadioDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPosition.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPushButtonDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ChangebleObject.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListenerProxy.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/InputMap.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/KeyStroke.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/MenuItemsContainer.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/OldAbstractAction.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeEvent.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListenerProxy.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeSupport.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/RadioMustBeChecked.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/Shortcut.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/common/
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/
trunk/src/main/java/org/ourproject/kune/platf/client/actions/ui/
trunk/src/main/java/org/ourproject/kune/platf/client/app/
trunk/src/main/java/org/ourproject/kune/platf/client/i18n/
trunk/src/main/java/org/ourproject/kune/platf/client/services/
trunk/src/main/java/org/ourproject/kune/platf/client/shortcuts/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractLabel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/ContextPropertyPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultGrid.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableClickListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/HasColor.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/HorizontalLine.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconHyperlink.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneStringUtils.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneUiUtils.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/LabelWrapper.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItemCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/AbstractPopupPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicPopupPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultFormUtils.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultTabbedForm.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/ExtendedDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/InfoDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/tabbed/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/form/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/imgchooser/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/noti/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/palette/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplIE6.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplMozilla.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplOpera.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplSafari.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/basic/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlAgent.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/editor/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/preview/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/img/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/impl/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/abstractimg/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ext/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkExecutableUtils.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/abstractlink/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/email/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/ext/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/abstractmedia/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ext/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialog.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/asian/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/occidental/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/utf8/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/inserttable/
trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/saving/
trunk/src/main/java/org/ourproject/kune/platf/public/
trunk/src/main/java/org/ourproject/kune/wiki/
trunk/src/main/java/org/ourproject/kune/workspace/client/ActionsModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceMessages.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalimg/
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocallink/
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/insertlocalmedia/
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeader.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderButton.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityTextLogo.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/maxmin/
trunk/src/main/java/org/ourproject/kune/workspace/client/hello/
trunk/src/main/java/org/ourproject/kune/workspace/client/rate/
trunk/src/main/java/org/ourproject/kune/workspace/client/search/
trunk/src/main/java/org/ourproject/kune/workspace/client/site/
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/
trunk/src/main/java/org/ourproject/kune/workspace/client/tool/
trunk/src/main/java/org/ourproject/kune/workspace/client/upload/
trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java
trunk/src/test/java/cc/kune/selenium/tools/GenericWebDriver.java
trunk/src/test/java/cc/kune/selenium/tools/PageObjectModule.java
trunk/src/test/java/cc/kune/selenium/tools/SeleniumModule.java
trunk/src/test/java/org/ourproject/kune/gallery/server/
trunk/src/test/java/org/ourproject/kune/platf/client/actions/
trunk/src/test/java/org/ourproject/kune/platf/client/dto/
trunk/src/test/java/org/ourproject/kune/platf/client/ui/KuneStringUtilsTest.java
trunk/src/test/java/org/ourproject/kune/platf/client/ui/TextUtilsTest.java
trunk/src/test/java/org/ourproject/kune/platf/client/ui/dialogs/upload/
trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/
trunk/src/test/java/org/ourproject/kune/platf/client/ui/rte/saving/
trunk/src/test/java/org/ourproject/kune/platf/client/utils/
trunk/src/test/java/org/ourproject/kune/workspace/client/entityheader/
trunk/src/test/java/org/ourproject/kune/workspace/client/socialnet/
Modified:
trunk/.classpath
trunk/pom.xml
trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java
trunk/src/main/java/cc/kune/common/client/actions/AbstractExtendedAction.java
trunk/src/main/java/cc/kune/common/client/actions/Action.java
trunk/src/main/java/cc/kune/common/client/actions/BaseAction.java
trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java
trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java
trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java
trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java
trunk/src/main/java/cc/kune/core/client/sitebar/SitebarNewGroupLink.java
trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java
trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java
trunk/src/main/java/cc/kune/msgs/client/UserMessage.java
trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
trunk/src/test/java/cc/kune/selenium/PageObject.java
trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java
trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java
trunk/src/test/java/cc/kune/selenium/tools/SeleniumConstants.java
Log:
NEW - # 53: Add Selenium Framework testing
http://kune.ourproject.org/issues/ticket/53
And some clean-up of org.ourproject package
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/.classpath 2011-09-24 18:46:13 UTC (rev 1531)
@@ -154,5 +154,6 @@
<classpathentry kind="var" path="M2_REPO/com/thoughtworks/xstream/xstream/1.2.2/xstream-1.2.2.jar" sourcepath="M2_REPO/com/thoughtworks/xstream/xstream/1.2.2/xstream-1.2.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/xwiki/platform/xwiki-web-gwt-dom/2.3-rc-1/xwiki-web-gwt-dom-2.3-rc-1.jar" sourcepath="M2_REPO/org/xwiki/platform/xwiki-web-gwt-dom/2.3-rc-1/xwiki-web-gwt-dom-2.3-rc-1-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
+
<classpathentry kind="src" path=".apt_generated" including="**/*.java"/> <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
</classpath>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/pom.xml 2011-09-24 18:46:13 UTC (rev 1531)
@@ -562,17 +562,17 @@
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>waveinabox-server-0.3</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>proto-msg</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>gwt-util-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@@ -582,67 +582,67 @@
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>box</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>box-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>model-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-common</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-common-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>common-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>util-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>concurrencycontrol-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-scheduler-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>media-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>communication-src</artifactId>
- <version>0.3.2-SNAPSHOT</version>
+ <version>0.3.2</version>
</dependency>
<dependency>
<groupId>net.sourceforge.findbugs</groupId>
Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -255,7 +255,7 @@
chatIcon.setId(CHAT_CLIENT_ICON_ID);
chatIcon.setStyles("k-no-backimage, k-btn-sitebar, k-chat-icon");
chatIcon.putValue(Action.NAME, i18n.t(CHAT_TITLE));
- chatIcon.putValue(Action.SHORT_DESCRIPTION, i18n.t("Show/hide the chat window"));
+ chatIcon.putValue(Action.TOOLTIP, i18n.t("Show/hide the chat window"));
final KeyStroke shortcut = Shortcut.getShortcut(false, true, false, false, Character.valueOf('C'));
shorcutRegister.put(shortcut, action);
action.setShortcut(shortcut);
Modified: trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -71,7 +71,7 @@
}
});
putValue(Action.NAME, i18n.t("Group's public room"));
- putValue(Action.SHORT_DESCRIPTION, i18n.t("Enter to this group public chat room"));
+ putValue(Action.TOOLTIP, i18n.t("Enter to this group public chat room"));
putValue(Action.SMALL_ICON, res.groupChat());
setInviteMembersImpl(false);
}
Modified: trunk/src/main/java/cc/kune/common/client/actions/AbstractExtendedAction.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/AbstractExtendedAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/common/client/actions/AbstractExtendedAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -40,17 +40,17 @@
public AbstractExtendedAction(final String text, final String tooltip, final String iconCls) {
super();
super.putValue(Action.NAME, text);
- super.putValue(Action.SHORT_DESCRIPTION, tooltip);
+ super.putValue(Action.TOOLTIP, tooltip);
super.putValue(Action.SMALL_ICON, iconCls);
}
public AbstractExtendedAction withIcon(final ImageResource icon) {
- super.putValue(Action.SHORT_DESCRIPTION, icon);
+ super.putValue(Action.TOOLTIP, icon);
return this;
}
public AbstractExtendedAction withIconCls(final String icon) {
- super.putValue(Action.SHORT_DESCRIPTION, icon);
+ super.putValue(Action.TOOLTIP, icon);
return this;
}
@@ -60,7 +60,7 @@
}
public AbstractExtendedAction withToolTip(final String tooltip) {
- super.putValue(Action.SHORT_DESCRIPTION, tooltip);
+ super.putValue(Action.TOOLTIP, tooltip);
return this;
}
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/common/client/actions/Action.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/Action.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/common/client/actions/Action.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -87,7 +87,7 @@
* A key to access the short description for the action (the short description
* is typically used as the tool tip text).
*/
- String SHORT_DESCRIPTION = "ShortDescription";
+ String TOOLTIP = "ShortDescription";
/**
* A key to access the icon for the action.
@@ -129,7 +129,7 @@
/**
* Sets the value associated with the specified key and sends a
* {@link PropertyChangeEvent} to all registered listeners. The standard keys
- * are defined in this interface: {@link #NAME}, {@link #SHORT_DESCRIPTION},
+ * are defined in this interface: {@link #NAME}, {@link #TOOLTIP},
* {@link #LONG_DESCRIPTION}, {@link #SMALL_ICON}, {@link #ACTION_COMMAND_KEY}
* , {@link #ACCELERATOR_KEY} and {@link #MNEMONIC_KEY}. Any existing value
* associated with the key will be overwritten.
Modified: trunk/src/main/java/cc/kune/common/client/actions/BaseAction.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/BaseAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/common/client/actions/BaseAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -25,20 +25,20 @@
public BaseAction(final String text, final String tooltip) {
super();
super.putValue(Action.NAME, text);
- super.putValue(Action.SHORT_DESCRIPTION, tooltip);
+ super.putValue(Action.TOOLTIP, tooltip);
}
public BaseAction(final String text, final String tooltip, final ImageResource icon) {
super();
super.putValue(Action.NAME, text);
- super.putValue(Action.SHORT_DESCRIPTION, tooltip);
+ super.putValue(Action.TOOLTIP, tooltip);
super.putValue(Action.SMALL_ICON, icon);
}
public BaseAction(final String text, final String tooltip, final String icon) {
super();
super.putValue(Action.NAME, text);
- super.putValue(Action.SHORT_DESCRIPTION, tooltip);
+ super.putValue(Action.TOOLTIP, tooltip);
super.putValue(Action.SMALL_ICON, icon);
}
Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/AbstractGuiItem.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -75,7 +75,7 @@
private void configureProperties() {
setText((String) (descriptor.getValue(Action.NAME)));
- setToolTipText((String) (descriptor.getValue(Action.SHORT_DESCRIPTION)));
+ setToolTipText((String) (descriptor.getValue(Action.TOOLTIP)));
setIcon(descriptor.getValue(Action.SMALL_ICON));
setEnabled((Boolean) descriptor.getValue(AbstractAction.ENABLED));
setVisible((Boolean) descriptor.getValue(GuiActionDescrip.VISIBLE));
@@ -97,7 +97,7 @@
setText((String) newValue);
} else if (event.getPropertyName().equals(Action.SMALL_ICON)) {
setIcon(newValue);
- } else if (event.getPropertyName().equals(Action.SHORT_DESCRIPTION)) {
+ } else if (event.getPropertyName().equals(Action.TOOLTIP)) {
setToolTipText((String) newValue);
} else if (event.getPropertyName().equals(GuiActionDescrip.VISIBLE)) {
setVisible((Boolean) newValue);
Modified: trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/common/client/actions/ui/descrip/AbstractGuiActionDescrip.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -253,7 +253,7 @@
@Override
public String toString() {
final String name = (String) getValue(Action.NAME);
- final String tooltip = (String) getValue(Action.SHORT_DESCRIPTION);
+ final String tooltip = (String) getValue(Action.TOOLTIP);
return "[GuiActionDescrip: " + getClass().getName() + (name == null ? "" : " " + name)
+ (tooltip == null ? "" : " " + tooltip) + "]";
}
@@ -308,7 +308,7 @@
@Override
public GuiActionDescrip withToolTip(final String tooltip) {
- putValue(Action.SHORT_DESCRIPTION, tooltip);
+ putValue(Action.TOOLTIP, tooltip);
return this;
}
}
Modified: trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/common/client/notify/NotifyUser.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -61,11 +61,9 @@
eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error, message, title, closeable));
}
- public static void error(final String message, final String title, final String id,
+ public static void error(final String title, final String message, final String id,
final boolean closeable) {
- final UserNotifyEvent event = new UserNotifyEvent(NotifyLevel.error, message, id, closeable);
- event.setId(id);
- eventBus.fireEvent(event);
+ sendEventImpl(title, message, id, closeable, NotifyLevel.error);
}
public static void hideProgress() {
@@ -84,6 +82,11 @@
eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.info, message, closeable));
}
+ public static void info(final String title, final String message, final String id,
+ final boolean closeable) {
+ sendEventImpl(title, message, id, closeable, NotifyLevel.info);
+ }
+
public static void init(final EventBus eventBus, final I18nTranslationService i18n) {
NotifyUser.eventBus = eventBus;
NotifyUser.i18n = i18n;
@@ -106,6 +109,13 @@
eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.log, message));
}
+ private static void sendEventImpl(final String title, final String message, final String id,
+ final boolean closeable, final NotifyLevel level) {
+ final UserNotifyEvent event = new UserNotifyEvent(level, title, message, closeable);
+ event.setId(id);
+ eventBus.fireEvent(event);
+ }
+
public static void showAlertMessage(final String title, final String message) {
showAlertMessage(title, message, onOk);
}
Modified: trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -15,6 +15,8 @@
public class AnonUsersManager {
+ public static final String ANON_MESSAGE_CLOSE_ICON = "k-anon-um-close-btn";
+
@Inject
public AnonUsersManager(final Session session, final CookiesManager cookiesManager,
final I18nTranslationService i18n) {
@@ -31,11 +33,12 @@
final String signin = TextUtils.generateHtmlLink("#" + SiteTokens.SIGNIN,
i18n.tWithNT("sign in", "register, in lowercase"), false);
NotifyUser.info(
+ "",
i18n.tWithNT(
"You did not sign-in, so you can just see some public contents in this website, "
+ "but not edit or collaborate with others. Please [%s] or [%s] in order to get full access to this site tools and contents",
"This will be something like 'Please register or sign in', but instead of %s some links",
- register, signin), true);
+ register, signin), ANON_MESSAGE_CLOSE_ICON, true);
} else {
if (Boolean.valueOf(anonCookie)) {
// Registered already: we set the cookie for some big period again
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarNewGroupLink.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarNewGroupLink.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarNewGroupLink.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -40,6 +40,9 @@
super();
this.stateManager = stateManager;
putValue(Action.NAME, i18n.t("Create New Group"));
+ putValue(Action.TOOLTIP,
+ i18n.t("Create a new group for your initiative or organization "
+ + "(NGO, collective, academic group...)"));
}
@Override
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -46,6 +46,8 @@
super();
this.stateManager = stateManager;
putValue(Action.NAME, i18n.t("Sign in to collaborate"));
+ putValue(Action.TOOLTIP,
+ i18n.t("Please sign in or register to get full access to this site tools and contents"));
}
@Override
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -53,7 +53,7 @@
false, true, false);
this.signIn = signIn;
putValue(NAME, i18n.t("Participate"));
- putValue(SHORT_DESCRIPTION, i18n.t("Request to participate in this group"));
+ putValue(TOOLTIP, i18n.t("Request to participate in this group"));
putValue(Action.SMALL_ICON, res.addGreen());
putValue(Action.STYLES, "k-sn-join");
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromCurrentGroupAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -45,7 +45,7 @@
super(stateManager, session, i18n, res, snServiceProvider, rightsClientManager, AccessRolDTO.Editor,
true, false, true);
putValue(NAME, i18n.t("Leave this group"));
- putValue(SHORT_DESCRIPTION, i18n.t("Do not participate anymore in this group"));
+ putValue(TOOLTIP, i18n.t("Do not participate anymore in this group"));
putValue(Action.SMALL_ICON, res.del());
putValue(Action.STYLES, "k-sn-join");
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/UnJoinFromThisGroupAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -55,7 +55,7 @@
this.i18n = i18n;
this.snServiceProvider = snServiceProvider;
putValue(NAME, i18n.t("Leave this group"));
- putValue(SHORT_DESCRIPTION, i18n.t("Do not participate anymore in this group"));
+ putValue(TOOLTIP, i18n.t("Do not participate anymore in this group"));
putValue(Action.SMALL_ICON, res.del());
putValue(Action.STYLES, "k-sn-join");
}
Modified: trunk/src/main/java/cc/kune/msgs/client/UserMessage.java
===================================================================
--- trunk/src/main/java/cc/kune/msgs/client/UserMessage.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/cc/kune/msgs/client/UserMessage.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -93,7 +93,7 @@
this.closeCallback = closeCallback;
initWidget(uiBinder.createAndBindUi(this));
if (TextUtils.notEmpty(id)) {
- super.ensureDebugId(id);
+ close.ensureDebugId(id);
}
if (TextUtils.notEmpty(message)) {
if (TextUtils.notEmpty(title)) {
Deleted: trunk/src/main/java/org/ourproject/kune/gallery/KuneGallery.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/KuneGallery.gwt.xml 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/gallery/KuneGallery.gwt.xml 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,7 +0,0 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/…">
-<module>
- <inherits name="cc.kune.core.Core" />
- <inherits name='org.ourproject.kune.platf.KunePlatform' />
- <inherits name='org.ourproject.kune.workspace.KuneWorkspace' />
- <source path="client" />
-</module>
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientActions.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,111 +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 org.ourproject.kune.gallery.client;
-
-import static org.ourproject.kune.gallery.client.GalleryClientTool.TYPE_ALBUM;
-import static org.ourproject.kune.gallery.client.GalleryClientTool.TYPE_ROOT;
-import static org.ourproject.kune.gallery.client.GalleryClientTool.TYPE_UPLOADEDFILE;
-
-import org.ourproject.kune.gallery.client.cnt.GalleryViewer;
-import org.ourproject.kune.workspace.client.OldAbstractFoldableContentActions;
-import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
-import org.ourproject.kune.workspace.client.editor.ContentEditor;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.upload.FileUploader;
-
-import cc.kune.common.client.utils.SchedulerManager;
-import cc.kune.core.client.cnt.ContentActionRegistry;
-import cc.kune.core.client.errors.ErrorHandler;
-import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.gspace.client.style.GSpaceBackManager;
-
-import com.calclab.suco.client.ioc.Provider;
-
-public class GalleryClientActions extends OldAbstractFoldableContentActions {
- public GalleryClientActions(final I18nUITranslationService i18n,
- final ContextNavigator contextNavigator, final Session session, final StateManager stateManager,
- final SchedulerManager deferredCommandWrapper,
- final Provider<ContentServiceAsync> contentServiceProvider,
- final Provider<GroupServiceAsync> groupServiceProvider,
- final Provider<FileUploader> fileUploaderProvider,
- final ContentActionRegistry contentActionRegistry,
- final Provider<FileDownloadUtils> fileDownloadProvider, final EntityHeader entityLogo,
- final Provider<ContentEditor> textEditorProvider, final ErrorHandler errorHandler,
- final GalleryViewer documentViewer, final GSpaceBackManager wsBackManager) {
- super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
- contentServiceProvider, fileUploaderProvider, contextNavigator, contentActionRegistry,
- fileDownloadProvider, textEditorProvider, documentViewer, entityLogo, wsBackManager);
- }
-
- @Override
- protected void createActions() {
- final String[] all = { TYPE_ROOT, TYPE_ALBUM, TYPE_UPLOADEDFILE };
- final String[] containers = { TYPE_ROOT, TYPE_ALBUM };
- final String[] contentsModerated = { TYPE_UPLOADEDFILE };
- final String[] containersNoRoot = { TYPE_ALBUM };
- final String[] contents = { TYPE_UPLOADEDFILE };
-
- final String parentMenuTitle = i18n.t("File");
- final String parentMenuTitleCtx = i18n.t("Album");
-
- createNewContainerAction(TYPE_ALBUM, "images/nav/gallery_add.png", i18n.t("New sub-album"),
- parentMenuTitleCtx, i18n.t("New"), i18n.t("New sub-album"), Position.ctx, TYPE_ALBUM);
- createNewContainerAction(TYPE_ALBUM, "images/nav/gallery_add.png", i18n.t("New album"),
- parentMenuTitleCtx, i18n.t("New"), i18n.t("New album"), Position.ctx, TYPE_ROOT);
-
- createContentRenameAction(parentMenuTitle, i18n.t("Rename"), contents);
- createContentModeratedActions(parentMenuTitle, contentsModerated);
- createRenameContentInCtxAction(parentMenuTitleCtx, i18n.t("Rename"), containersNoRoot);
-
- // final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt =
- // createSetAsDefContent(parentMenuTitleCtx);
-
- createRefreshCntAction(parentMenuTitle, contents);
- createRefreshCxtAction(parentMenuTitleCtx, containers);
-
- createSetAsDefContent(parentMenuTitle, contents);
- // createSetGroupBackImageAction(parentMenuTitle, TYPE_UPLOADEDFILE);
-
- // createUploadAction(i18n.t("Upload file"), "images/nav/upload.png",
- // i18n.t("Upload some files (images, PDFs, ...)"), null, containers);
-
- createDownloadActions(TYPE_UPLOADEDFILE);
-
- createGoAction(all);
-
- createGoHomeAction(containers);
-
- // createTranslateAction(TYPE_ALBUM, TYPE_UPLOADEDFILE);
-
- createDelContainerAction("Delete folder", parentMenuTitleCtx, containersNoRoot);
- createDelContentAction(parentMenuTitle, i18n.t("Delete"), contents);
- createShowDeletedItems(parentMenuTitleCtx, all);
- }
-
- @Override
- protected void createPostSessionInitActions() {
- super.createUploadMediaAction(TYPE_ALBUM);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryClientTool.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,63 +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 org.ourproject.kune.gallery.client;
-
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.tool.OldFoldableAbstractClientTool;
-
-import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
-import cc.kune.gspace.client.themes.GSpaceThemeManager;
-import cc.kune.gspace.client.tool.selector.ToolSelector;
-
-public class GalleryClientTool extends OldFoldableAbstractClientTool {
- public static final String NAME = "gallery";
- public static final String TYPE_ROOT = NAME + "." + "root";
- public static final String TYPE_ALBUM = NAME + "." + "album";
- public static final String TYPE_UPLOADEDFILE = NAME + "." + OldFoldableAbstractClientTool.UPLOADEDFILE_SUFFIX;
-
- public GalleryClientTool(final I18nUITranslationService i18n, final ToolSelector toolSelector,
- final GSpaceThemeManager wsThemePresenter, final WorkspaceSkeleton ws,
- final ContentCapabilitiesRegistry cntCapabReg) {
- super(NAME, i18n.t("gallery"), toolSelector, wsThemePresenter, ws, cntCapabReg);
-
- // registerAclEditableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
- registerAuthorableTypes(TYPE_UPLOADEDFILE);
- registerDragableTypes(TYPE_ALBUM, TYPE_UPLOADEDFILE);
- registerDropableTypes(TYPE_ROOT, TYPE_ALBUM);
- registerPublishModerableTypes(TYPE_UPLOADEDFILE);
- registerRateableTypes(TYPE_UPLOADEDFILE);
- registerRenamableTypes(TYPE_ALBUM, TYPE_UPLOADEDFILE);
- registerTageableTypes(TYPE_UPLOADEDFILE);
- // registerTranslatableTypes();
-
- registerIcons();
- }
-
- public String getName() {
- return NAME;
- }
-
- private void registerIcons() {
- registerContentTypeIcon(TYPE_ALBUM, "images/nav/gallery.png");
- registerUploadTypesAndMimes(TYPE_UPLOADEDFILE);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryMessages.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryMessages.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/gallery/client/GalleryMessages.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,23 +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 org.ourproject.kune.gallery.client;
-
-public interface GalleryMessages {
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/KunePlatform.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/KunePlatform.gwt.xml 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/KunePlatform.gwt.xml 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,63 +0,0 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/…">
-<module>
- <!-- Inherit the core Web Toolkit stuff. -->
- <inherits name="cc.kune.core.Core" />
- <inherits name='com.google.gwt.user.User' />
- <inherits name='com.google.gwt.i18n.I18N' />
- <inherits name="com.google.gwt.user.UserAgent" />
- <inherits name="org.ourproject.kune.platf.RichText" />
- <inherits name="org.ourproject.kune.workspace.KuneWorkspace" />
- <inherits name="com.google.gwt.resources.Resources" />
- <public path="public" />
- <inherits name="com.google.gwt.user.UserAgent" />
- <!-- RTE css inject -->
- <!-- See gwt-user: com/google/gwt/user/RichText.gwt.xml -->
- <!-- IE-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.WrappedRichTextAreaImplIE6">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="ie6" />
- <when-property-is name="user.agent" value="ie8" />
- </any>
- </replace-with>
- <!-- Mozilla-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.WrappedRichTextAreaImplMozilla">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <when-property-is name="user.agent" value="gecko1_8" />
- </replace-with>
- <!-- Old Mozilla-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplOldMozilla">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <when-property-is name="user.agent" value="gecko" />
- </replace-with>
- <!-- Safari-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.WrappedRichTextAreaImplSafari">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="safari" />
- </any>
- </replace-with>
- <!-- Opera-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.WrappedRichTextAreaImplOpera">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="opera" />
- </any>
- </replace-with>
- <inherits name="com.calclab.suco.Suco" />
- <inherits name="com.gwtext.GwtExt" />
-<!-- <inherits name="com.calclab.emiteuimodule.EmiteUIModule" />-->
- <inherits name="org.xwiki.gwt.dom.DOM" />
- <inherits name="com.calclab.suco.Suco"/>
- <source path='client' excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java"/>
-</module>
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/RichText.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/RichText.gwt.xml 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/RichText.gwt.xml 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,60 +0,0 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/…">
-<!-- Copyright 2008 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 -->
-<!-- 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. License for the specific language governing permissions and -->
-<!-- limitations under the License. -->
-
-<!-- Deferred binding rules for browser selection. -->
-<!-- -->
-<module>
- <inherits name="com.google.gwt.core.Core" />
- <inherits name="com.google.gwt.user.UserAgent" />
-
- <!-- IE-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplIE6">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <when-property-is name="user.agent" value="ie6" />
- <when-property-is name="user.agent" value="ie8" />
- </replace-with>
-
- <!-- Mozilla-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplMozilla">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="gecko1_8" />
- <when-property-is name="user.agent" value="gecko" />
- </any>
- </replace-with>
-
- <!-- Safari-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplSafari">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="safari" />
- </any>
- </replace-with>
-
- <!-- Opera-specific implementation -->
- <replace-with
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplOpera">
- <when-type-is
- class="org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl" />
- <any>
- <when-property-is name="user.agent" value="opera" />
- </any>
- </replace-with>
-</module>
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/View.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/View.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/View.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,31 +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 org.ourproject.kune.platf.client;
-
-import com.google.gwt.user.client.ui.IsWidget;
-
-/**
- * For make tests without dependencies to gwt. Use casting to use the widget.
- * Use #{@link com.gwtplatform.mvp.client.View} 0r #{@link IsWidget}
- */
-@Deprecated
-public interface View {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractExtendedAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractExtendedAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractExtendedAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,46 +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 org.ourproject.kune.platf.client.actions;
-
-import com.google.gwt.resources.client.ImageResource;
-
-public abstract class AbstractExtendedAction extends OldAbstractAction {
- public static final String NO_TEXT = null;
- public static final ImageResource NO_ICON = null;
-
- public AbstractExtendedAction() {
- super();
- }
-
- public AbstractExtendedAction(final String text) {
- this(text, null, null);
- }
-
- public AbstractExtendedAction(final String text, final ImageResource icon) {
- this(text, null, icon);
- }
-
- public AbstractExtendedAction(final String text, final String tooltip, final ImageResource icon) {
- super();
- super.putValue(Action.NAME, text);
- super.putValue(Action.SHORT_DESCRIPTION, tooltip);
- super.putValue(Action.SMALL_ICON, icon);
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/Action.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/Action.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/Action.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,159 +0,0 @@
-/* Action.java --
- Copyright (C) 2002, 2004, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-/**
- * Provides a convenient central point of control for some task that can be
- * triggered by more than one control in a Swing user interface (for example, a
- * menu item and a toolbar button).
- *
- * @author Ronald Veldema (rveldema(a)cs.vu.nl)
- * @author Adapted version for GWT (C) The kune development team
- * @author Andrew Selkirk
- */
-public interface Action extends ActionListener {
-
- /**
- * A key to access the default property for the action (this is not used).
- */
- String DEFAULT = "Default";
-
- /**
- * A key to access the long description for the action.
- */
- String LONG_DESCRIPTION = "LongDescription";
-
- /**
- * A key to access the name for the action.
- */
- String NAME = "Name";
-
- /**
- * A key to access the enabled property for the action.
- */
- String ENABLED = "enabled";
-
- /**
- * A key to access the short description for the action (the short
- * description is typically used as the tool tip text).
- */
- String SHORT_DESCRIPTION = "ShortDescription";
-
- /**
- * A key to access the icon for the action.
- */
- String SMALL_ICON = "SmallIcon";
-
- /**
- * A key to access the KeyStroke used as the accelerator for the action.
- */
- String ACCELERATOR_KEY = "AcceleratorKey";
-
- /**
- * A key to access the action command string for the action.
- */
- String ACTION_COMMAND_KEY = "ActionCommandKey";
-
- /**
- * A key to access the mnemonic for the action.
- */
- String MNEMONIC_KEY = "MnemonicKey";
-
- /**
- * Registers a listener to receive notification whenever one of the action's
- * properties is modified.
- *
- * @param listener
- * the listener.
- */
- void addPropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * Returns the value associated with the specified key.
- *
- * @param key
- * the key (not <code>null</code>).
- *
- * @return The value associated with the specified key, or <code>null</code>
- * if the key is not found.
- */
- Object getValue(String key);
-
- /**
- * Returns the flag that indicates whether or not this action is enabled.
- *
- * @return The flag.
- */
- boolean isEnabled();
-
- /**
- * Sets the value associated with the specified key and sends a
- * {@link PropertyChangeEvent} to all registered listeners. The standard
- * keys are defined in this interface: {@link #NAME},
- * {@link #SHORT_DESCRIPTION}, {@link #LONG_DESCRIPTION},
- * {@link #SMALL_ICON}, {@link #ACTION_COMMAND_KEY},
- * {@link #ACCELERATOR_KEY} and {@link #MNEMONIC_KEY}. Any existing value
- * associated with the key will be overwritten.
- *
- * @param key
- * the key (not <code>null</code>).
- * @param value
- * the value (<code>null</code> permitted).
- */
- void putValue(String key, Object value);
-
- /**
- * Deregisters a listener so that it no longer receives notification of
- * changes to the action's properties.
- *
- * @param listener
- * the listener.
- */
- void removePropertyChangeListener(PropertyChangeListener listener);
-
- /**
- * Sets the flag that indicates whether or not this action is enabled. If
- * the value changes, a {@link java.beans.PropertyChangeEvent} is sent to
- * all registered listeners.
- *
- * @param b
- * the new value of the flag.
- */
- void setEnabled(boolean b);
-
-} // Action
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionAddCondition.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionAddCondition.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionAddCondition.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,24 +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 org.ourproject.kune.platf.client.actions;
-
-public interface ActionAddCondition<T> {
- boolean mustBeAdded(T param);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCheckedCondition.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCheckedCondition.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCheckedCondition.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,24 +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 org.ourproject.kune.platf.client.actions;
-
-public interface ActionCheckedCondition {
- boolean mustBeChecked();
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCollection.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionCollection.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,29 +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 org.ourproject.kune.platf.client.actions;
-
-import java.util.ArrayList;
-
-@Deprecated
-public class ActionCollection<T> extends ArrayList<ActionDescriptor<T>> {
-
- private static final long serialVersionUID = -3308296009308246636L;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,501 +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 org.ourproject.kune.platf.client.actions;
-
-import org.ourproject.kune.platf.client.shortcuts.ShortcutDescriptor;
-
-import cc.kune.core.client.services.ImageDescriptor;
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-/**
- * The Class ActionDescriptor.
- */
-@Deprecated
-public class ActionDescriptor<T> {
-
- public static final int NO_POSITION = -1;
-
- /** The access rol. */
- private AccessRolDTO accessRol;
-
- /** The must be added condition. */
- private ActionAddCondition<T> addCondition;
-
- /** The confirmation text. */
- private String confirmationText;
-
- /** The confirmation title. */
- private String confirmationTitle;
-
- /** The enable condition. */
- private ActionEnableCondition<T> enableCondition;
-
- /** The icon cls. */
- private String iconCls;
-
- /** The icon descriptor. */
- private ImageDescriptor iconDescriptor;
-
- /** The icon url. */
- private String iconUrl;
-
- /** The id. */
- private String id;
-
- /** The must be authenticated. */
- private boolean mustBeAuthenticated;
-
- /** The must be confirmed. */
- private boolean mustBeConfirmed;
-
- /** The on not confirmed. */
- private Listener<T> onNotConfirmed;
-
- /** The on perform call. */
- private final Listener<T> onPerformCall;
-
- private int position = NO_POSITION;
-
- private ShortcutDescriptor shortcut;
-
- /** The text description. */
- private String textDescription;
-
- /** The tool tip. */
- private String toolTip;
-
- public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener<T> onPerformCall) {
- this.accessRol = accessRolDTO;
- this.onPerformCall = onPerformCall;
- this.mustBeConfirmed = false;
- this.onNotConfirmed = null;
- this.mustBeAuthenticated = true;
- }
-
- public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener<T> onPerformCall,
- final ActionAddCondition<T> addCondition) {
- this(accessRolDTO, onPerformCall);
- this.addCondition = addCondition;
- }
-
- /**
- * Instantiates a new action descriptor.
- *
- * @param accessRolDTO
- * the access rol dto
- * @param onPerformCall
- * the on perform call
- * @param enableCondition
- * the enable condition
- */
- public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener<T> onPerformCall,
- final ActionEnableCondition<T> enableCondition) {
- this(accessRolDTO, onPerformCall);
- this.enableCondition = enableCondition;
- }
-
- /**
- * Instantiates a new action descriptor.
- *
- * @param accessRolDTO
- * the access rol dto
- * @param onPerformCall
- * the on perform call
- */
-
- public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener0 onPerformCall) {
- this(accessRolDTO, new Listener<T>() {
- @Override
- public void onEvent(final T parameter) {
- onPerformCall.onEvent();
- }
- });
- }
-
- public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener0 onPerformCall,
- final ActionAddCondition<T> addCondition) {
- this(accessRolDTO, onPerformCall);
- this.addCondition = addCondition;
- }
-
- public ActionDescriptor(final AccessRolDTO accessRolDTO, final Listener0 onPerformCall,
- final ActionEnableCondition<T> enableCondition) {
- this(accessRolDTO, onPerformCall);
- this.enableCondition = enableCondition;
- }
-
- public ActionDescriptor(final ActionDescriptor<T> copy) {
- this(copy.getAccessRol(), copy.getOnPerformCall());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setAddCondition(copy.getAddCondition());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:22
- setConfirmationText(copy.getConfirmationText());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:22
- setConfirmationTitle(copy.getConfirmationTitle());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setEnableCondition(copy.getEnableCondition());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setIconCls(copy.getIconCls());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setIconDescriptor(copy.getIconDescriptor());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setIconUrl(copy.getIconUrl());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setMustBeAuthenticated(copy.mustBeAuthenticated());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setMustBeConfirmed(copy.mustBeConfirmed());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setOnNotConfirmed(copy.getOnNotConfirmed());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setPosition(copy.getPosition());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setShortcut(copy.getShortcut());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setTextDescription(copy.getTextDescription());
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:21
- setToolTip(copy.getToolTip());
- }
-
- /**
- * Fire on not confirmed.
- *
- * @param parameter
- * the parameter
- */
- @SuppressWarnings("unchecked")
- public void fireOnNotConfirmed(final Object parameter) {
- if (onNotConfirmed != null) {
- onNotConfirmed.onEvent((T) parameter);
- }
- }
-
- /**
- * Fire on perform call.
- *
- * @param parameter
- * the parameter
- */
- @SuppressWarnings("unchecked")
- public void fireOnPerformCall(final Object parameter) {
- onPerformCall.onEvent((T) parameter);
- }
-
- /**
- * Gets the access rol.
- *
- * @return the access rol
- */
- public AccessRolDTO getAccessRol() {
- return accessRol;
- }
-
- private ActionAddCondition<T> getAddCondition() {
- return addCondition;
- }
-
- /**
- * Gets the confirmation text.
- *
- * @return the confirmation text
- */
- public String getConfirmationText() {
- return confirmationText;
- }
-
- /**
- * Gets the confirmation title.
- *
- * @return the confirmation title
- */
- public String getConfirmationTitle() {
- return confirmationTitle;
- }
-
- private ActionEnableCondition<T> getEnableCondition() {
- return enableCondition;
- }
-
- public String getIconCls() {
- return iconCls;
- }
-
- /**
- * Gets the icon descriptor.
- *
- * @return the icon descriptor
- */
- public ImageDescriptor getIconDescriptor() {
- return iconDescriptor;
- }
-
- /**
- * Gets the icon url.
- *
- * @return the icon url
- */
- public String getIconUrl() {
- return iconUrl;
- }
-
- /**
- * Gets the DOM unique id (used for debug)
- *
- * @return the id
- */
- public String getId() {
- return id;
- }
-
- private Listener<T> getOnNotConfirmed() {
- return onNotConfirmed;
- }
-
- private Listener<T> getOnPerformCall() {
- return onPerformCall;
- }
-
- /**
- * Get the index position where this action will be inserted
- *
- * @param position
- */
- public int getPosition() {
- return position;
- }
-
- public ShortcutDescriptor getShortcut() {
- return shortcut;
- }
-
- public String getShortcutToS() {
- return shortcut == null ? "" : shortcut.toString();
- }
-
- /**
- * Gets the text.
- *
- * @return the text
- */
- public String getText() {
- return textDescription;
- }
-
- private String getTextDescription() {
- return textDescription;
- }
-
- /**
- * Gets the tool tip.
- *
- * @return the tool tip
- */
- public String getToolTip() {
- return toolTip;
- }
-
- public boolean hasShortcut() {
- return shortcut != null;
- }
-
- public boolean mustBeAdded(final T item) {
- return addCondition != null ? addCondition.mustBeAdded(item) : true;
- }
-
- /**
- * Must be authenticated.
- *
- * @return true, if successful
- */
- public boolean mustBeAuthenticated() {
- return mustBeAuthenticated;
- }
-
- /**
- * Checks if is must be confirmed.
- *
- * @return true, if is must be confirmed
- */
- public boolean mustBeConfirmed() {
- return mustBeConfirmed;
- }
-
- public boolean mustBeEnabled(final T item) {
- return enableCondition != null ? enableCondition.mustBeEnabled(item) : true;
- }
-
- /**
- * Sets the access rol.
- *
- * @param accessRol
- * the new access rol
- */
- public void setAccessRol(final AccessRolDTO accessRol) {
- this.accessRol = accessRol;
- }
-
- /**
- * Sets the add condition.
- *
- * @param addCondition
- * the new add condition
- */
- public void setAddCondition(final ActionAddCondition<T> addCondition) {
- this.addCondition = addCondition;
- }
-
- /**
- * Sets the confirmation text.
- *
- * @param confirmationText
- * the new confirmation text
- */
- public void setConfirmationText(final String confirmationText) {
- this.confirmationText = confirmationText;
- }
-
- /**
- * Sets the confirmation title.
- *
- * @param confirmationTitle
- * the new confirmation title
- */
- public void setConfirmationTitle(final String confirmationTitle) {
- this.confirmationTitle = confirmationTitle;
- }
-
- /**
- * Sets the enable condition.
- *
- * @param enableCondition
- * the new enable condition
- */
- public void setEnableCondition(final ActionEnableCondition<T> enableCondition) {
- this.enableCondition = enableCondition;
- }
-
- public void setIconCls(final String iconCls) {
- this.iconCls = iconCls;
- }
-
- /**
- * Sets the icon descriptor.
- *
- * @param iconDescriptor
- * the new icon descriptor
- */
- public void setIconDescriptor(final ImageDescriptor iconDescriptor) {
- this.iconDescriptor = iconDescriptor;
- }
-
- /**
- * Sets the icon url.
- *
- * @param iconUrl
- * the new icon url
- */
- public void setIconUrl(final String iconUrl) {
- this.iconUrl = iconUrl;
- }
-
- /**
- * Sets the DOM unique id (used for debug)
- *
- * @param id
- * the new id
- */
- public void setId(final String id) {
- this.id = id;
- }
-
- /**
- * Sets the must be authenticated.
- *
- * @param mustBeAuthenticated
- * the new must be authenticated
- */
- public void setMustBeAuthenticated(final boolean mustBeAuthenticated) {
- this.mustBeAuthenticated = mustBeAuthenticated;
- }
-
- /**
- * Sets the must be confirmed.
- *
- * @param mustBeConfirmed
- * the new must be confirmed
- */
- public void setMustBeConfirmed(final boolean mustBeConfirmed) {
- this.mustBeConfirmed = mustBeConfirmed;
- }
-
- private void setOnNotConfirmed(final Listener<T> onNotConfirmed) {
- this.onNotConfirmed = onNotConfirmed;
- }
-
- /**
- * Index position where this action will be inserted
- *
- * @param position
- */
- public void setPosition(final int position) {
- this.position = position;
- }
-
- public void setShortcut(final ShortcutDescriptor shortcut) {
- this.shortcut = shortcut;
- }
-
- /**
- * Sets the text description.
- *
- * @param textDescription
- * the new text description
- */
- public void setTextDescription(final String textDescription) {
- this.textDescription = textDescription;
- }
-
- /**
- * Sets the tool tip.
- *
- * @param toolTip
- * the new tool tip
- */
- public void setToolTip(final String toolTip) {
- this.toolTip = toolTip;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEnableCondition.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEnableCondition.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEnableCondition.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,24 +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 org.ourproject.kune.platf.client.actions;
-
-public interface ActionEnableCondition<T> {
- boolean mustBeEnabled(T param);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEvent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEvent.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionEvent.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,69 +0,0 @@
-/* ActionEvent.java -- an action has been triggered
- Copyright (C) 1999, 2002, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-import com.google.gwt.user.client.Event;
-
-/**
- * This event is generated when an action on a component (such as a button
- * press) occurs.
- *
- * @author Aaron M. Renn (arenn(a)urbanophile.com)
- * @author Adapted version for GWT (C) The kune development team
- * @see ActionListener
- * @since 1.1
- * @status updated to 1.4
- */
-public class ActionEvent {
-
- private final Event event;
- private final Object source;
-
- public ActionEvent(final Object source, final Event event) {
- this.source = source;
- this.event = event;
- }
-
- public Event getEvent() {
- return event;
- }
-
- public Object getSource() {
- return source;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItem.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,66 +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 org.ourproject.kune.platf.client.actions;
-
-
-import com.allen_sauer.gwt.log.client.Log;
-
-/**
- * And action description and a item (for instance a StateToken, a XmmpURI) over
- * the action takes place
- *
- * @param <T>
- */
-public class ActionItem<T> {
-
- ActionDescriptor<T> action;
- T item;
-
- public ActionItem(final ActionDescriptor<T> action, final T item) {
- this.action = action;
- this.item = item;
- }
-
- public ActionDescriptor<T> getAction() {
- return action;
- }
-
- public T getItem() {
- return item;
- }
-
- public boolean mustBeAdded() {
- return action.mustBeAdded(getItem());
- }
-
- public boolean mustBeEnabled() {
- return action.mustBeEnabled(getItem());
- }
-
- public boolean mustBePressed() {
- if (action instanceof ActionToolbarPushButtonDescriptor<?>) {
- final ActionPressedCondition<T> mustIniPressed = ((ActionToolbarPushButtonDescriptor<T>) action).getMustInitialyPressed();
- return mustIniPressed == null ? false : mustIniPressed.mustBePressed(getItem());
- } else {
- Log.error("This action is not a push button");
- return false;
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItemCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItemCollection.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionItemCollection.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,56 +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 org.ourproject.kune.platf.client.actions;
-
-import java.util.ArrayList;
-import java.util.Collection;
-
-import com.allen_sauer.gwt.log.client.Log;
-
-public class ActionItemCollection<T> extends ArrayList<ActionItem<T>> {
-
- private static final long serialVersionUID = 1127359948648860754L;
-
- @Override
- public boolean add(final ActionItem<T> actionItem) {
- ActionDescriptor<T> action = actionItem.getAction();
- int position = action.getPosition();
- if (position == ActionDescriptor.NO_POSITION) {
- super.add(actionItem);
- } else {
- try {
- super.add(position, actionItem);
- return true;
- } catch (IndexOutOfBoundsException e) {
- Log.error("Trying to add an action in a position out of bounds");
- super.add(actionItem);
- }
- }
- return false;
- }
-
- @Override
- public boolean addAll(final Collection<? extends ActionItem<T>> actionItems) {
- for (ActionItem<T> actionItem : actionItems) {
- add(actionItem);
- }
- return true;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionListener.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionListener.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,57 +0,0 @@
-/* ActionListener.java -- listens for action events
- Copyright (C) 1999, 2002 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-/**
- * This interface is for classes that listen for action events.
- *
- * @author Aaron M. Renn (arenn(a)urbanophile.com)
- * @author Adapted version for GWT (C) The kune development team
- * @see ActionEvent
- * @since 1.1
- * @status updated to 1.4
- */
-public interface ActionListener extends EventListener {
- /**
- * This method is invoked when an action occurs.
- *
- * @param event
- * the <code>ActionEvent</code> that occurred
- */
- void actionPerformed(ActionEvent event);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionManager.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,53 +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 org.ourproject.kune.platf.client.actions;
-
-import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser;
-
-import com.calclab.suco.client.events.Listener0;
-
-public class ActionManager {
-
- public ActionManager() {
- }
-
- public void doAction(final ActionItem<?> actionItem) {
- final ActionDescriptor<?> action = actionItem.getAction();
- final Object item = actionItem.getItem();
- if (action.mustBeConfirmed()) {
- OldNotifyUser.askConfirmation(action.getConfirmationTitle(), action.getConfirmationText(), new Listener0() {
- public void onEvent() {
- fire(action, item);
- }
- }, new Listener0() {
- public void onEvent() {
- action.fireOnNotConfirmed(item);
- }
- });
- } else {
- fire(action, item);
- }
- }
-
- private void fire(final ActionDescriptor<?> action, final Object parameter) {
- action.fireOnPerformCall(parameter);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionMenuItemDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionMenuItemDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionMenuItemDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,33 +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 org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener;
-
-public class ActionMenuItemDescriptor<T> extends ActionDescriptor<T> {
-
- public ActionMenuItemDescriptor(final AccessRolDTO accessRolDTO, final Listener<T> onPerformCall) {
- super(accessRolDTO, onPerformCall);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionPressedCondition.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionPressedCondition.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionPressedCondition.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,24 +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 org.ourproject.kune.platf.client.actions;
-
-public interface ActionPressedCondition<T> {
- boolean mustBePressed(T param);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionRegistry.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionRegistry.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,116 +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 org.ourproject.kune.platf.client.actions;
-
-import java.util.HashMap;
-
-import cc.kune.core.shared.domain.utils.AccessRights;
-
-import com.allen_sauer.gwt.log.client.Log;
-
-public class ActionRegistry<T> {
- private static final String GENERIC = "kgenacts";
-
- private final HashMap<String, ActionCollection<T>> actions;
-
- public ActionRegistry() {
- actions = new HashMap<String, ActionCollection<T>>();
- }
-
- public void addAction(final ActionDescriptor<T> action) {
- addAction(action, GENERIC);
- }
-
- public void addAction(final ActionDescriptor<T> action, final String... typeIds) {
- assert action != null;
- for (final String typeId : typeIds) {
- String text = action.getText();
- Log.debug("Registering action " + (text == null ? "with icon" : "'" + text + "'") + " for " + typeId);
- final ActionCollection<T> actionColl = getActions(typeId);
- actionColl.add(action);
- }
- }
-
- public ActionItemCollection<T> getCurrentActions(final T item, final boolean isLogged, final AccessRights rights,
- final boolean toolbarItems) {
- return getCurrentActions(item, GENERIC, isLogged, rights, toolbarItems);
- }
-
- public ActionItemCollection<T> getCurrentActions(final T item, final String typeId, final boolean isLogged,
- final AccessRights rights, final boolean toolbarItems) {
- final ActionItemCollection<T> collection = new ActionItemCollection<T>();
-
- for (final ActionDescriptor<T> action : getActions(typeId)) {
- if (mustAdd(isLogged, rights, action)) {
- if (toolbarItems) {
- if (action instanceof ActionToolbarButtonDescriptor<?>
- || action instanceof ActionToolbarMenuDescriptor<?>) {
- collection.add(new ActionItem<T>(action, item));
- }
- } else {
- if (action instanceof ActionMenuItemDescriptor<?>
- || action instanceof ActionToolbarMenuAndItemDescriptor<?>
- || action instanceof ActionToolbarButtonAndItemDescriptor<?>) {
- collection.add(new ActionItem<T>(action, item));
- }
- }
- }
- }
- return collection;
- }
-
- public void removeAction(final ActionDescriptor<T> action) {
- removeAction(GENERIC, action);
- }
-
- public void removeAction(final String typeId, final ActionDescriptor<T> action) {
- actions.get(typeId).remove(action);
- }
-
- public int size() {
- return actions.size();
- }
-
- private ActionCollection<T> getActions(final String typeId) {
- ActionCollection<T> actionColl = actions.get(typeId);
- if (actionColl == null) {
- actionColl = new ActionCollection<T>();
- actions.put(typeId, actionColl);
- }
- return actionColl;
- }
-
- private boolean mustAdd(final boolean isLogged, final AccessRights rights, final ActionDescriptor<T> action) {
- if (action.mustBeAuthenticated()) {
- if (!isLogged) {
- return false;
- }
- }
- switch (action.getAccessRol()) {
- case Administrator:
- return rights.isAdministrable();
- case Editor:
- return rights.isEditable();
- case Viewer:
- default:
- return rights.isVisible();
- }
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonAndItemDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonAndItemDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonAndItemDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,40 +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 org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class ActionToolbarButtonAndItemDescriptor<T> extends ActionToolbarButtonDescriptor<T> {
-
- public ActionToolbarButtonAndItemDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
- public ActionToolbarButtonAndItemDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,91 +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 org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class ActionToolbarButtonDescriptor<T> extends ActionToolbarDescriptor<T> {
-
- private ActionToolbarButtonSeparator leftSeparator;
- private ActionToolbarButtonSeparator rightSeparator;
-
- public ActionToolbarButtonDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
- public ActionToolbarButtonDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall,
- final ActionAddCondition<T> addCondition) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall, addCondition);
- }
-
- public ActionToolbarButtonDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall,
- final ActionEnableCondition<T> enableCondition) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
- }
-
- public ActionToolbarButtonDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
- public ActionToolbarButtonDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall,
- final ActionAddCondition<T> addCondition) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall, addCondition);
- }
-
- public ActionToolbarButtonDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall,
- final ActionEnableCondition<T> enableCondition) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
- }
-
- public ActionToolbarButtonSeparator getLeftSeparator() {
- return leftSeparator;
- }
-
- public ActionToolbarButtonSeparator getRightSeparator() {
- return rightSeparator;
- }
-
- public boolean hasLeftSeparator() {
- return leftSeparator != null;
- }
-
- public boolean hasRightSeparator() {
- return rightSeparator != null;
- }
-
- public void setLeftSeparator(final ActionToolbarButtonSeparator leftSeparator) {
- this.leftSeparator = leftSeparator;
- }
-
- public void setRightSeparator(final ActionToolbarButtonSeparator rightSeparator) {
- this.rightSeparator = rightSeparator;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonSeparator.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonSeparator.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarButtonSeparator.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,24 +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 org.ourproject.kune.platf.client.actions;
-
-public enum ActionToolbarButtonSeparator {
- spacer, separator, fill
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,85 +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 org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public abstract class ActionToolbarDescriptor<T> extends ActionDescriptor<T> {
-
- private ActionToolbarPosition actionToolbarPosition;
-
- public ActionToolbarDescriptor(final AccessRolDTO accessRolDTO, final ActionToolbarPosition actionToolbarPosition,
- final Listener<T> onPerformCall) {
- super(accessRolDTO, onPerformCall);
- this.actionToolbarPosition = actionToolbarPosition;
- }
-
- public ActionToolbarDescriptor(final AccessRolDTO accessRolDTO, final ActionToolbarPosition actionToolbarPosition,
- final Listener<T> onPerformCall, final ActionAddCondition<T> addCondition) {
- super(accessRolDTO, onPerformCall, addCondition);
- this.actionToolbarPosition = actionToolbarPosition;
- }
-
- public ActionToolbarDescriptor(final AccessRolDTO accessRolDTO, final ActionToolbarPosition actionToolbarPosition,
- final Listener<T> onPerformCall, final ActionEnableCondition<T> enableCondition) {
- super(accessRolDTO, onPerformCall, enableCondition);
- this.actionToolbarPosition = actionToolbarPosition;
- }
-
- public ActionToolbarDescriptor(final AccessRolDTO accessRolDTO, final ActionToolbarPosition actionToolbarPosition,
- final Listener0 onPerformCall) {
- super(accessRolDTO, onPerformCall);
- this.actionToolbarPosition = actionToolbarPosition;
- }
-
- public ActionToolbarDescriptor(final AccessRolDTO accessRolDTO, final ActionToolbarPosition actionToolbarPosition,
- final Listener0 onPerformCall, final ActionAddCondition<T> addCondition) {
- super(accessRolDTO, onPerformCall, addCondition);
- this.actionToolbarPosition = actionToolbarPosition;
- }
-
- public ActionToolbarDescriptor(final AccessRolDTO accessRolDTO, final ActionToolbarPosition actionToolbarPosition,
- final Listener0 onPerformCall, final ActionEnableCondition<T> enableCondition) {
- super(accessRolDTO, onPerformCall, enableCondition);
- this.actionToolbarPosition = actionToolbarPosition;
- }
-
- public ActionToolbarDescriptor(final ActionDescriptor<T> copy) {
- super(copy);
- }
-
- public ActionToolbarDescriptor(final ActionToolbarDescriptor<T> copy) {
- super(copy);
- this.actionToolbarPosition = copy.getActionPosition();
- }
-
- public ActionToolbarPosition getActionPosition() {
- return actionToolbarPosition;
- }
-
- public void setActionPosition(final ActionToolbarPosition actionToolbarPosition) {
- this.actionToolbarPosition = actionToolbarPosition;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuAndItemDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuAndItemDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuAndItemDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,40 +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 org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class ActionToolbarMenuAndItemDescriptor<T> extends ActionToolbarMenuDescriptor<T> {
-
- public ActionToolbarMenuAndItemDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
- public ActionToolbarMenuAndItemDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuCheckItemDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuCheckItemDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuCheckItemDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,42 +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 org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener0;
-
-public class ActionToolbarMenuCheckItemDescriptor<T> extends ActionToolbarMenuDescriptor<T> {
-
- private final ActionCheckedCondition mustBeChecked;
-
- public ActionToolbarMenuCheckItemDescriptor(final AccessRolDTO accessRol,
- final ActionToolbarPosition toolbarPosition, final Listener0 onPerformCall,
- final ActionCheckedCondition mustBeChecked) {
- super(accessRol, toolbarPosition, onPerformCall);
- this.mustBeChecked = mustBeChecked;
- }
-
- public ActionCheckedCondition getMustBeChecked() {
- return mustBeChecked;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,123 +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 org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class ActionToolbarMenuDescriptor<T> extends ActionToolbarDescriptor<T> {
-
- private String parentMenuTitle;
- private String parentMenuIconUrl;
- private String parentMenuIconCls;
- private String parentSubMenuTitle;
- private String parentMenuTooltip;
- private boolean topSeparator = false;
- private boolean bottomSeparator = false;
-
- public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
- public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener<T> onPerformCall,
- final ActionEnableCondition<T> enableCondition) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
- }
-
- public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
- public ActionToolbarMenuDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall,
- final ActionEnableCondition<T> enableCondition) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall, enableCondition);
- }
-
- public ActionToolbarMenuDescriptor(final ActionDescriptor<T> copy) {
- super(copy);
- }
-
- public String getParentMenuIconCls() {
- return parentMenuIconCls;
- }
-
- public String getParentMenuIconUrl() {
- return parentMenuIconUrl;
- }
-
- public String getParentMenuTitle() {
- return parentMenuTitle;
- }
-
- public String getParentMenuTooltip() {
- return parentMenuTooltip;
- }
-
- public String getParentSubMenuTitle() {
- return parentSubMenuTitle;
- }
-
- public boolean hasBottomSeparator() {
- return bottomSeparator;
- }
-
- public boolean hasTopSeparator() {
- return topSeparator;
- }
-
- public void setBottomSeparator(final boolean bottomSeparator) {
- this.bottomSeparator = bottomSeparator;
- }
-
- public void setParentMenuIconCls(final String parentMenuIconCls) {
- this.parentMenuIconCls = parentMenuIconCls;
- }
-
- public void setParentMenuIconUrl(final String parentMenuIconUrl) {
- this.parentMenuIconUrl = parentMenuIconUrl;
- }
-
- public void setParentMenuTitle(final String parentMenuTitle) {
- this.parentMenuTitle = parentMenuTitle;
- }
-
- public void setParentMenuTooltip(final String parentMenuTooltip) {
- this.parentMenuTooltip = parentMenuTooltip;
- }
-
- public void setParentSubMenuTitle(final String parentSubMenuTitle) {
- if (parentMenuTitle == null) {
- Log.warn("Please set parentMenuTitle before");
- }
- this.parentSubMenuTitle = parentSubMenuTitle;
- }
-
- public void setTopSeparator(final boolean topSeparator) {
- this.topSeparator = topSeparator;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuRadioDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuRadioDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarMenuRadioDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,45 +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 org.ourproject.kune.platf.client.actions;
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener;
-
-public class ActionToolbarMenuRadioDescriptor<T> extends ActionToolbarMenuDescriptor<T> {
- private final String group;
- private final RadioMustBeChecked mustBeChecked;
-
- public ActionToolbarMenuRadioDescriptor(final AccessRolDTO accessRol, final ActionToolbarPosition toolbarPosition,
- final Listener<T> onPerformCall, final String group, final RadioMustBeChecked mustBeChecked) {
- super(accessRol, toolbarPosition, onPerformCall);
- this.group = group;
- this.mustBeChecked = mustBeChecked;
- }
-
- public String getGroup() {
- return group;
- }
-
- public boolean mustBeChecked() {
- return mustBeChecked.mustBeChecked();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPosition.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPosition.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPosition.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,63 +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 org.ourproject.kune.platf.client.actions;
-
-public class ActionToolbarPosition {
-
- private final String id;
-
- public ActionToolbarPosition(final String id) {
- this.id = id;
- }
-
- @Override
- public boolean equals(final Object obj) {
- if (this == obj) {
- return true;
- }
- if (obj == null) {
- return false;
- }
- if (getClass() != obj.getClass()) {
- return false;
- }
- ActionToolbarPosition other = (ActionToolbarPosition) obj;
- if (id == null) {
- if (other.id != null) {
- return false;
- }
- } else if (!id.equals(other.id)) {
- return false;
- }
- return true;
- }
-
- public String getId() {
- return id;
- }
-
- @Override
- public int hashCode() {
- final int prime = 31;
- int result = 1;
- result = prime * result + ((id == null) ? 0 : id.hashCode());
- return result;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPushButtonDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPushButtonDescriptor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionToolbarPushButtonDescriptor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,45 +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 org.ourproject.kune.platf.client.actions;
-
-
-
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-import com.calclab.suco.client.events.Listener0;
-
-public class ActionToolbarPushButtonDescriptor<T> extends ActionToolbarButtonDescriptor<T> {
-
- private ActionPressedCondition<T> mustInitialyPressed;
-
- public ActionToolbarPushButtonDescriptor(final AccessRolDTO accessRolDTO,
- final ActionToolbarPosition actionToolbarPosition, final Listener0 onPerformCall) {
- super(accessRolDTO, actionToolbarPosition, onPerformCall);
- }
-
- public ActionPressedCondition<T> getMustInitialyPressed() {
- return mustInitialyPressed;
- }
-
- public void setMustInitialyPressed(final ActionPressedCondition<T> mustInitialyPressed) {
- this.mustInitialyPressed = mustInitialyPressed;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ChangebleObject.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ChangebleObject.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ChangebleObject.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,135 +0,0 @@
-package org.ourproject.kune.platf.client.actions;
-
-import java.util.HashMap;
-
-/**
- * A base class for implementing the {@link Action} interface.
- *
- * @author Andrew Selkirk
- * @author Adapted version for GWT (C) The kune development team
- */
-public class ChangebleObject {
-
- /**
- * Provides support for property change event notification.
- */
- protected PropertyChangeSupport changeSupport = new PropertyChangeSupport(this);
- /**
- * store
- */
- protected HashMap<String, Object> store = new HashMap<String, Object>();
-
- /**
- * Registers a listener to receive {@link PropertyChangeEvent} notifications
- * from this action.
- *
- * @param listener
- * the listener.
- *
- * @see #removePropertyChangeListener(PropertyChangeListener)
- */
- public void addPropertyChangeListener(final PropertyChangeListener listener) {
- changeSupport.addPropertyChangeListener(listener);
- }
-
- /**
- * Returns an array of the keys for the property values that have been
- * defined via the {@link #putValue(String, Object)} method (or the class
- * constructor).
- *
- * @return An array of keys.
- */
- public Object[] getKeys() {
- return store.keySet().toArray();
- }
-
- /**
- * Returns all registered listeners.
- *
- * @return An array of listeners.
- *
- * @since 1.4
- */
- public PropertyChangeListener[] getPropertyChangeListeners() {
- return changeSupport.getPropertyChangeListeners();
- }
-
- /**
- * Returns the value associated with the specified key.
- *
- * @param key
- * the key (not <code>null</code>).
- *
- * @return The value associated with the specified key, or <code>null</code>
- * if the key is not found.
- *
- * @see #putValue(String, Object)
- */
- public Object getValue(final String key) {
- return store.get(key);
- }
-
- /**
- * Sets the value associated with the specified key and sends a
- * {@link java.beans.PropertyChangeEvent} to all registered listeners.
- *
- * Any existing value associated with the key will be overwritten.
- *
- * @param key
- * the key (not <code>null</code>).
- * @param value
- * the value (<code>null</code> permitted).
- */
- public void putValue(final String key, final Object value) {
- final Object old = getValue(key);
- if ((old == null && value != null) || (old != null && !old.equals(value))) {
- store.put(key, value);
- firePropertyChange(key, old, value);
- }
- }
-
- /**
- * Deregisters a listener so that it no longer receives
- * {@link PropertyChangeEvent} notifications from this action.
- *
- * @param listener
- * the listener.
- *
- * @see #addPropertyChangeListener(PropertyChangeListener)
- */
- public void removePropertyChangeListener(final PropertyChangeListener listener) {
- changeSupport.removePropertyChangeListener(listener);
- }
-
- /**
- * Sends a {@link PropertyChangeEvent} for the named property to all
- * registered listeners. This private method is called by the
- * {@link #setEnabled(boolean)} method.
- *
- * @param propertyName
- * the property name.
- * @param oldValue
- * the old value of the property.
- * @param newValue
- * the new value of the property.
- */
- protected void firePropertyChange(final String propertyName, final boolean oldValue, final boolean newValue) {
- changeSupport.firePropertyChange(propertyName, oldValue, newValue);
- }
-
- /**
- * Sends a {@link PropertyChangeEvent} for the named property to all
- * registered listeners.
- *
- * @param propertyName
- * the property name.
- * @param oldValue
- * the old value of the property.
- * @param newValue
- * the new value of the property.
- */
- protected void firePropertyChange(final String propertyName, final Object oldValue, final Object newValue) {
- changeSupport.firePropertyChange(propertyName, oldValue, newValue);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListener.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListener.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,53 +0,0 @@
-/* EventListener.java -- tagging interface for all event listeners
- Copyright (C) 1998, 1999, 2001, 2002, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-/**
- * Empty interface that is implemented by classes that need to receive events.
- * Subinterfaces define methods that can be called to fire an event
- * notification. Normally the name of these subinterfaces end in
- * <code>Listener</code> and all method described by the subinterface take as
- * argument an subclass of <code>EventObject</code>.
- *
- * @author Tom Tromey (tromey(a)cygnus.com)
- * @author Adapted version for GWT (C) The kune development team
- * @see EventObject
- * @status updated to 1.4
- */
-public interface EventListener {
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListenerProxy.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListenerProxy.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/EventListenerProxy.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,74 +0,0 @@
-/* EventListenerProxy.java -- abstract wrapper for event listeners
- Copyright (C) 2002, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-/**
- * An abstract wrapper for event listeners. This allows subclasses to attach
- * additional parameters to an existing event listener to create a new one.
- * Subclasses are expected to add methods to set and retrieve any attached
- * properties.
- *
- * @author Eric Blake (ebb9(a)email.byu.edu)
- * @author Adapted version for GWT (C) The kune development team
- *
- * @since 1.4
- * @status updated to 1.4
- */
-public abstract class EventListenerProxy implements EventListener {
- /** The listener that this proxy wraps. */
- private final EventListener listener;
-
- /**
- * Construct a proxy event listener, given an existing one to augment.
- *
- * @param listener
- * the listener to wrap
- */
- public EventListenerProxy(final EventListener listener) {
- this.listener = listener;
- }
-
- /**
- * Return the wrapped event listener.
- *
- * @return the listener associated with this proxy
- */
- public EventListener getListener() {
- return listener;
- }
-} // class EventListenerProxy
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/InputMap.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/InputMap.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/InputMap.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,235 +0,0 @@
-/* InputMap.java --
- Copyright (C) 2002, 2004, 2006, Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-import java.util.Arrays;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.Map;
-import java.util.Set;
-
-/**
- * Maps {@link KeyStroke}s to arbitrary objects, usually Strings. This is used
- * in combination with ActionMaps.
- *
- * If a component receives an input event, this is looked up in the component's
- * <code>InputMap</code>. The result is an object which serves as a key to the
- * component's <code>ActionMap</code>. Finally the <code>Action</code> that is
- * stored is executed.
- *
- * @author Andrew Selkirk
- * @author Michael Koch
- * @author Adapted version for GWT (C) The kune development team
- *
- * @since 1.3
- */
-public class InputMap {
-
- /**
- * Storage for the KeyStroke --> Object mappings.
- */
- private Map<KeyStroke, OldAbstractAction> inputMap;
-
- /**
- * An optional parent map.
- */
- private InputMap parent;
-
- /**
- * Creates a new <code>InputMap</code> instance. This default instance
- * contains no mappings and has no parent.
- */
- public InputMap() {
- // nothing to do
- }
-
- /**
- * Returns all keys of entries in this <code>InputMap</code> and all its
- * parents.
- *
- * @return An array of keys (may be <code>null</code> or have zero length).
- */
- public KeyStroke[] allKeys() {
- final Set<KeyStroke> set = new HashSet<KeyStroke>();
-
- if (parent != null) {
- final KeyStroke[] parentKeys = parent.allKeys();
- if (parentKeys != null) {
- set.addAll(Arrays.asList(parentKeys));
- }
- }
- if (inputMap != null) {
- set.addAll(inputMap.keySet());
- }
- if (set.isEmpty()) {
- return null;
- }
- final KeyStroke[] array = new KeyStroke[set.size()];
- return set.toArray(array);
- }
-
- /**
- * Clears the entries from this <code>InputMap</code>. The parent map, if
- * there is one, is not cleared.
- */
- public void clear() {
- if (inputMap != null) {
- inputMap.clear();
- }
- }
-
- /**
- * Returns the binding for the specified keystroke, if there is one.
- *
- * @param keystroke
- * the key of the entry (<code>null</code> is ignored).
- *
- * @return The binding associated with the specified keystroke (or
- * <code>null</code>).
- */
- public OldAbstractAction get(final KeyStroke keystroke) {
- OldAbstractAction result = null;
- if (inputMap != null) {
- result = inputMap.get(keystroke);
- }
-
- if (result == null && parent != null) {
- result = parent.get(keystroke);
- }
- return result;
- }
-
- /**
- * Returns the parent of this <code>InputMap</code>. The default value is
- * <code>null</code>.
- *
- * @return The parent map (possibly <code>null</code>).
- *
- * @see #setParent(InputMap)
- */
- public InputMap getParent() {
- return parent;
- }
-
- /**
- * Returns all keys of entries in this <code>InputMap</code>. This does not
- * include keys defined in the parent, if there is one (use the
- * {@link #allKeys()} method for that case). <br>
- * <br>
- * Following the behaviour of the reference implementation, this method will
- * return <code>null</code> when no entries have been added to the map, and
- * a zero length array if entries have been added but subsequently removed
- * (or cleared) from the map.
- *
- * @return An array of keys (may be <code>null</code> or have zero length).
- */
- // @PMD:REVIEWED:ReturnEmptyArrayRatherThanNull: by vjrj on 21/05/09 15:33
- public KeyStroke[] keys() {
- if (inputMap != null) {
- final KeyStroke[] array = new KeyStroke[size()];
- return inputMap.keySet().toArray(array);
- }
- return null;
- }
-
- /**
- * Puts a new entry into the <code>InputMap</code>. If
- * <code>actionMapKey</code> is <code>null</code> any existing entry will be
- * removed.
- *
- * @param keystroke
- * the keystroke for the entry (<code>null</code> is ignored).
- * @param actionMapKey
- * the action (<code>null</code> permitted).
- */
- public void put(final KeyStroke keystroke, final OldAbstractAction actionMapKey) {
- if (keystroke == null) {
- return;
- }
- if (inputMap == null) {
- inputMap = new HashMap<KeyStroke, OldAbstractAction>();
- }
- if (actionMapKey == null) {
- inputMap.remove(keystroke);
- } else {
- inputMap.put(keystroke, actionMapKey);
- }
- }
-
- /**
- * Removes an entry from this <code>InputMap</code>. Note that this will not
- * remove any entry from the parent map, if there is one.
- *
- * @param keystroke
- * the key of the entry to remove (<code>null</code> is ignored).
- */
- public void remove(final KeyStroke keystroke) {
- if (inputMap != null) {
- inputMap.remove(keystroke);
- }
- }
-
- /**
- * Sets a parent for this <code>InputMap</code>. If a parent is specified,
- * the {@link #get(KeyStroke)} method will look in the parent if it cannot
- * find an entry in this map.
- *
- * @param parentMap
- * the new parent (<code>null</code> permitted).
- *
- * @see #getParent()
- */
- public void setParent(final InputMap parentMap) {
- parent = parentMap;
- }
-
- /**
- * Returns the number of entries in this <code>InputMap</code>. This count
- * does not include any entries from the parent map, if there is one.
- *
- * @return The number of entries.
- */
- public int size() {
- int result = 0;
- if (inputMap != null) {
- result = inputMap.size();
- }
- return result;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/KeyStroke.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/KeyStroke.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/KeyStroke.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,535 +0,0 @@
-/* AWTKeyStroke.java -- an immutable key stroke
- Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.ourproject.kune.platf.client.i18n.Resources;
-import org.ourproject.kune.platf.client.shortcuts.Keyboard;
-
-import com.google.gwt.dom.client.NativeEvent;
-import com.google.gwt.event.dom.client.KeyCodes;
-import com.google.gwt.event.dom.client.KeyEvent;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Event;
-
-/**
- * This class mirrors KeyEvents, representing both low-level key presses and key
- * releases, and high level key typed inputs. However, this class forms
- * immutable strokes, and can be efficiently reused via the factory methods for
- * creating them.
- *
- * <p>
- * For backwards compatibility with Swing, this supports a way to build
- * instances of a subclass, using reflection, provided the subclass has a no-arg
- * constructor (of any accessibility).
- *
- * @author Eric Blake (ebb9(a)email.byu.edu)
- * @author Andrew John Hughes (gnu_andrew(a)member.fsf.org)
- * @author Adapted version for GWT (C) The kune development team
- * @see #getKeyStroke(char)
- * @since 1.4
- * @status updated to 1.4
- */
-public class KeyStroke {
-
- /**
- * The cache of recently created keystrokes. This maps KeyStrokes to
- * KeyStrokes in a cache which removes the least recently accessed entry,
- * under the assumption that garbage collection of a new keystroke is easy
- * when we find the old one that it matches in the cache.
- */
- private static final Map<KeyStroke, KeyStroke> CACHE = new HashMap<KeyStroke, KeyStroke>();
-
- /** The most recently generated keystroke, or null. */
- private static KeyStroke recent;
-
- /**
- * A table of keyCode names to values. This is package-private to avoid an
- * accessor method.
- *
- * @see #getKeyStroke(String)
- */
- static final Map<String, Object> VKTABLE = new HashMap<String, Object>();
-
- private static final int VK_UNDEFINED = 0;
- private static final char CHAR_UNDEFINED = '\uffff';
-
- public static int getKeyboardModifiers(final NativeEvent event) {
- return (event.getShiftKey() ? Keyboard.MODIFIER_SHIFT : 0) | (event.getMetaKey() ? Keyboard.MODIFIER_META : 0)
- | (event.getCtrlKey() ? Keyboard.MODIFIER_CTRL : 0) | (event.getAltKey() ? Keyboard.MODIFIER_ALT : 0);
- }
-
- /**
- * Returns a keystroke representing a typed character.
- *
- * @param keyChar
- * the typed character
- * @return the specified keystroke
- */
- public static KeyStroke getKeyStroke(final char keyChar) {
- return getKeyStroke(keyChar, VK_UNDEFINED, 0, false);
- }
-
- /**
- * Returns a keystroke representing a typed character with the given
- * modifiers. Note that keyChar is a <code>Character</code> instead of a
- * <code>char</code> to avoid accidental ambiguity with
- * <code>getKeyStroke(int, int)</code>. The modifiers are the bitwise or of
- * the masks found in InputEvent; the new style (*_DOWN_MASK) is preferred,
- * but the old style will work.
- *
- * @param keyChar
- * the typed character
- * @param modifiers
- * the modifiers, or 0
- * @return the specified keystroke
- * @throws IllegalArgumentException
- * if keyChar is null
- */
- public static KeyStroke getKeyStroke(final Character keyChar, final int modifiers) {
- if (keyChar == null) {
- throw new IllegalArgumentException();
- }
- return getKeyStroke(keyChar.charValue(), VK_UNDEFINED, modifiers, false);
- }
-
- /**
- * Returns a keystroke representing a pressed key event, with the given
- * modifiers. The "virtual key" should be one of the VK_* constants in
- * {@link KeyEvent}. The modifiers are the bitwise or of the masks found in
- * InputEvent; the new style (*_DOWN_MASK) is preferred, but the old style
- * will work.
- *
- * @param keyCode
- * the virtual key
- * @param modifiers
- * the modifiers, or 0
- * @return the specified keystroke
- */
- public static KeyStroke getKeyStroke(final int keyCode, final int modifiers) {
- return getKeyStroke(CHAR_UNDEFINED, keyCode, modifiers, false);
- }
-
- /**
- * Returns a keystroke representing a pressed or released key event, with
- * the given modifiers. The "virtual key" should be one of the VK_*
- * constants in {@link KeyEvent}. The modifiers are the bitwise or of the
- * masks found in InputEvent; the new style (*_DOWN_MASK) is preferred, but
- * the old style will work.
- *
- * @param keyCode
- * the virtual key
- * @param modifiers
- * the modifiers, or 0
- * @param release
- * true if this is a key release instead of a key press
- * @return the specified keystroke
- */
- public static KeyStroke getKeyStroke(final int keyCode, final int modifiers, final boolean release) {
- return getKeyStroke(CHAR_UNDEFINED, keyCode, modifiers, release);
- }
-
- /**
- * Returns a keystroke representing what caused the key event.
- *
- * @param event
- * the key event to convert
- * @return the specified keystroke, or null if the event is invalid
- * @throws NullPointerException
- * if event is null
- */
- public static KeyStroke getKeyStrokeForEvent(final Event event) {
- final int eventModif = getKeyboardModifiers(event);
- final int eventKeyCode = event.getKeyCode();
- // Log.info("key: " + eventKeyCode + " modifier: " + eventModif);
- switch (DOM.eventGetType(event)) {
- case Event.ONKEYDOWN:
- return getKeyStroke(CHAR_UNDEFINED, eventKeyCode, eventModif, false);
- case Event.ONKEYPRESS:
- final char charac = (char) eventKeyCode;
- return getKeyStroke(Character.isLowerCase(charac) ? Character.toUpperCase(charac) : charac, VK_UNDEFINED,
- eventModif, false);
- case Event.ONKEYUP:
- return getKeyStroke(CHAR_UNDEFINED, eventKeyCode, eventModif, false);
- default:
- return null;
- }
- }
-
- /**
- * Gets the appropriate keystroke, creating one if necessary.
- *
- * @param keyChar
- * the keyChar
- * @param keyCode
- * the keyCode
- * @param modifiers
- * the modifiers
- * @param release
- * true for key release
- * @return the specified keystroke
- */
- private static KeyStroke getKeyStroke(final char keyChar, final int keyCode, final int modifiers,
- final boolean release) {
- // Check level 0 cache.
- KeyStroke stroke = recent; // Avoid thread races.
- if (stroke != null && stroke.keyChar == keyChar && stroke.keyCode == keyCode && stroke.modifiers == modifiers
- && stroke.onKeyRelease == release) {
- return stroke;
- }
- stroke = new KeyStroke(keyChar, keyCode, modifiers, release);
- // Check level 1 cache.
- final KeyStroke cached = CACHE.get(stroke);
- if (cached == null) {
- CACHE.put(stroke, stroke);
- } else {
- stroke = cached;
- }
- return recent = stroke;
- }
-
- /**
- * The typed character, or CHAR_UNDEFINED for key presses and releases.
- *
- * @serial the keyChar
- */
- private final char keyChar;
-
- /**
- * The virtual key code, or VK_UNDEFINED for key typed. Package visible for
- * use by Component.
- *
- * @serial the keyCode
- */
- int keyCode;
-
- /**
- * The modifiers in effect. To match Sun, this stores the old style masks
- * for shift, control, alt, meta, and alt-graph (but not button1); as well
- * as the new style of extended modifiers for all modifiers.
- *
- * @serial bitwise or of the *_DOWN_MASK modifiers
- */
- private int modifiers;
-
- /**
- * True if this is a key release; should only be true if keyChar is
- * CHAR_UNDEFINED.
- *
- * @serial true to distinguish key pressed from key released
- */
- private boolean onKeyRelease;
-
- /**
- * Construct a keystroke with default values: it will be interpreted as a
- * key typed event with an invalid character and no modifiers. Client code
- * should use the factory methods instead.
- *
- * @see #getKeyStroke(char)
- * @see #getKeyStroke(Character, int)
- * @see #getKeyStroke(int, int, boolean)
- * @see #getKeyStroke(int, int)
- * @see #getKeyStrokeForEvent(KeyEvent)
- * @see #getKeyStroke(String)
- */
- protected KeyStroke() {
- keyChar = CHAR_UNDEFINED;
- }
-
- /**
- * Construct a keystroke with the given values. Client code should use the
- * factory methods instead.
- *
- * @param keyChar
- * the character entered, if this is a key typed
- * @param keyCode
- * the key pressed or released, or VK_UNDEFINED for key typed
- * @param modifiers
- * the modifier keys for the keystroke, in old or new style
- * @param onKeyRelease
- * true if this is a key release instead of a press
- * @see #getKeyStroke(char)
- * @see #getKeyStroke(Character, int)
- * @see #getKeyStroke(int, int, boolean)
- * @see #getKeyStroke(int, int)
- * @see #getKeyStrokeForEvent(KeyEvent)
- * @see #getKeyStroke(String)
- */
- protected KeyStroke(final char keyChar, final int keyCode, final int modifiers, final boolean onKeyRelease) {
- this.keyChar = keyChar;
- this.keyCode = keyCode;
- // No need to call extend(), as only trusted code calls this
- // constructor.
- this.modifiers = modifiers;
- this.onKeyRelease = onKeyRelease;
- }
-
- /**
- * Tests two keystrokes for equality.
- *
- * @param obj
- * the object to test
- * @return true if it is equal
- */
- @Override
- public final boolean equals(final Object obj) {
- if (!(obj instanceof KeyStroke)) {
- return false;
- }
- final KeyStroke stroke = (KeyStroke) obj;
- return this == obj
- || (keyChar == stroke.keyChar && keyCode == stroke.keyCode && modifiers == stroke.modifiers && onKeyRelease == stroke.onKeyRelease);
- }
-
- /**
- * Returns the character of this keystroke, if it was typed.
- *
- * @return the character value, or CHAR_UNDEFINED
- * @see #getKeyStroke(char)
- */
- public final char getKeyChar() {
- return keyChar;
- }
-
- /**
- * Returns the virtual key code of this keystroke, if it was pressed or
- * released. This will be a VK_* constant from KeyEvent.
- *
- * @return the virtual key code value, or VK_UNDEFINED
- * @see #getKeyStroke(int, int)
- */
- public final int getKeyCode() {
- return keyCode;
- }
-
- /**
- * Returns the AWT event type of this keystroke. This is one of
- * {@link KeyEvent#KEY_TYPED}, {@link KeyEvent#KEY_PRESSED}, or
- * {@link KeyEvent#KEY_RELEASED}.
- *
- * @return the key event type
- */
- public final int getKeyEventType() {
- return keyCode == VK_UNDEFINED ? Event.ONKEYDOWN : onKeyRelease ? Event.ONKEYUP : Event.ONKEYPRESS;
- }
-
- @SuppressWarnings("deprecation")
- public String getKeyText() {
- switch (keyCode) {
- case KeyCodes.KEY_BACKSPACE:
- return translateKey("Backspace");
- // case KeyCodes.KEY_DELETE:
- // return translateKey("Delete");
- case KeyCodes.KEY_DOWN:
- return translateKey("Down");
- case KeyCodes.KEY_END:
- return translateKey("End");
- case KeyCodes.KEY_ENTER:
- return translateKey("Enter");
- case KeyCodes.KEY_ESCAPE:
- return translateKey("Escape");
- case KeyCodes.KEY_HOME:
- return translateKey("Home");
- case KeyCodes.KEY_LEFT:
- return translateKey("Left");
- case KeyCodes.KEY_PAGEDOWN:
- return translateKey("Page Down");
- case KeyCodes.KEY_PAGEUP:
- return translateKey("Page Up");
- case KeyCodes.KEY_RIGHT:
- return translateKey("Right");
- case KeyCodes.KEY_TAB:
- return translateKey("Tab");
- case KeyCodes.KEY_UP:
- return translateKey("Up");
- case Keyboard.KEY_SPACE:
- return translateKey("Space");
- case Keyboard.KEY_F1:
- case Keyboard.KEY_F2:
- case Keyboard.KEY_F3:
- case Keyboard.KEY_F4:
- case Keyboard.KEY_F5:
- case Keyboard.KEY_F6:
- case Keyboard.KEY_F7:
- case Keyboard.KEY_F8:
- case Keyboard.KEY_F9:
- case Keyboard.KEY_F10:
- case Keyboard.KEY_F11:
- case Keyboard.KEY_F12:
- return translateKey("F" + (keyCode - (Keyboard.KEY_F1 - 1)));
- case Keyboard.KEY_COMMA:
- case Keyboard.KEY_PERIOD:
- case Keyboard.KEY_SLASH:
- case Keyboard.KEY_0:
- case Keyboard.KEY_1:
- case Keyboard.KEY_2:
- case Keyboard.KEY_3:
- case Keyboard.KEY_4:
- case Keyboard.KEY_5:
- case Keyboard.KEY_6:
- case Keyboard.KEY_7:
- case Keyboard.KEY_8:
- case Keyboard.KEY_9:
- case Keyboard.KEY_SEMICOLON:
- case Keyboard.KEY_EQUALS:
- case Keyboard.KEY_A:
- case Keyboard.KEY_B:
- case Keyboard.KEY_C:
- case Keyboard.KEY_D:
- case Keyboard.KEY_E:
- case Keyboard.KEY_F:
- case Keyboard.KEY_G:
- case Keyboard.KEY_H:
- case Keyboard.KEY_I:
- case Keyboard.KEY_J:
- case Keyboard.KEY_K:
- case Keyboard.KEY_L:
- case Keyboard.KEY_M:
- case Keyboard.KEY_N:
- case Keyboard.KEY_O:
- case Keyboard.KEY_P:
- case Keyboard.KEY_Q:
- case Keyboard.KEY_R:
- case Keyboard.KEY_S:
- case Keyboard.KEY_T:
- case Keyboard.KEY_U:
- case Keyboard.KEY_V:
- case Keyboard.KEY_W:
- case Keyboard.KEY_X:
- case Keyboard.KEY_Y:
- case Keyboard.KEY_Z:
- case Keyboard.KEY_OPEN_BRACKET:
- case Keyboard.KEY_BACK_SLASH:
- case Keyboard.KEY_CLOSE_BRACKET:
- return String.valueOf(keyCode).toUpperCase();
- default:
- final String charS = String.valueOf(keyChar);
- if (charS == null) {
- return "Unknown keyCode: 0x" + (keyCode < 0 ? "-" : "") + Integer.toHexString(Math.abs(keyCode));
- } else {
- if (" ".equals(charS)) {
- return translateKey("Space");
- } else {
- return charS;
- }
- }
- }
- }
-
- /**
- * Returns the modifiers for this keystroke. This will be a bitwise or of
- * constants from InputEvent; it includes the old style masks for shift,
- * control, alt, meta, and alt-graph (but not button1); as well as the new
- * style of extended modifiers for all modifiers.
- *
- * @return the modifiers
- * @see #getKeyStroke(Character, int)
- * @see #getKeyStroke(int, int)
- */
- public final int getModifiers() {
- return modifiers;
- }
-
- /**
- * Returns a hashcode for this key event. It is not documented, but appears
- * to be: <code>(getKeyChar() + 1) * (getKeyCode() + 1)
- * * (getModifiers() + 1) * 2 + (isOnKeyRelease() ? 1 : 2)</code>.
- *
- * @return the hashcode
- */
- @Override
- public int hashCode() {
- return (keyChar + 1) * (keyCode + 1) * (modifiers + 1) * 2 + (onKeyRelease ? 1 : 2);
- }
-
- /**
- * Tests if this keystroke is a key release.
- *
- * @return true if this is a key release
- * @see #getKeyStroke(int, int, boolean)
- */
- public final boolean isOnKeyRelease() {
- return onKeyRelease;
- }
-
- @Override
- public String toString() {
- String s = " (";
- if ((modifiers & Keyboard.MODIFIER_META) != 0) {
- s += translateKey("Meta") + "+";
- }
- if ((modifiers & Keyboard.MODIFIER_CTRL) != 0) {
- s += translateKey("Ctrl") + "+";
- }
- if ((modifiers & Keyboard.MODIFIER_ALT) != 0) {
- s += translateKey("Alt") + "+";
- }
- if ((modifiers & Keyboard.MODIFIER_SHIFT) != 0) {
- s += translateKey("Shift") + "+";
- }
- /*
- * if ((modifiers & Event.BUTTON_LEFT) != 0) { s +=
- * translateKey("Button1") + "+"; } if ((modifiers & Event.BUTTON_RIGHT)
- * != 0) { s += translateKey("Button2") + "+"; } if ((modifiers &
- * Event.BUTTON_MIDDLE) != 0) { s += translateKey("Button3") + "+"; }
- */
- s += getKeyText() + ")";
- return s;
- }
-
- /**
- * Returns a cached version of the deserialized keystroke, if available.
- *
- * @return a cached replacement if something goes wrong
- */
- protected Object readResolve() {
- final KeyStroke s = CACHE.get(this);
- if (s != null) {
- return s;
- }
- CACHE.put(this, this);
- return this;
- }
-
- private String translateKey(final String keyNameToTranslate) {
- return Resources.i18n.tWithNT(keyNameToTranslate, "The '" + keyNameToTranslate + "' keyboard key");
- }
-
-} // class KeyStroke
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/MenuItemsContainer.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/MenuItemsContainer.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/MenuItemsContainer.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,75 +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 org.ourproject.kune.platf.client.actions;
-
-import java.util.HashMap;
-
-import com.calclab.suco.client.events.Listener;
-import com.google.gwt.core.client.Scheduler;
-import com.google.gwt.core.client.Scheduler.ScheduledCommand;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.menu.BaseItem;
-import com.gwtext.client.widgets.menu.Item;
-import com.gwtext.client.widgets.menu.Menu;
-import com.gwtext.client.widgets.menu.event.BaseItemListenerAdapter;
-
-public class MenuItemsContainer<T> {
- private final HashMap<String, Menu> contextMenus;
-
- public MenuItemsContainer() {
- contextMenus = new HashMap<String, Menu>();
- }
-
- public void clear() {
- contextMenus.clear();
- }
-
- public void createItemMenu(final String id, final ActionItemCollection<T> actionCollection,
- final Listener<ActionItem<T>> listener) {
- Scheduler.get().scheduleDeferred(new ScheduledCommand() {
- public void execute() {
- Menu menu = null;
- if (actionCollection != null) {
- menu = new Menu();
- // Remove if when retrieved rights of siblings
- for (final ActionItem<T> actionItem : actionCollection) {
- final ActionDescriptor<T> action = actionItem.getAction();
- if (actionItem.mustBeEnabled()) {
- final Item item = new Item(action.getText());
- item.setIcon(action.getIconUrl());
- menu.addItem(item);
- item.addListener(new BaseItemListenerAdapter() {
- @Override
- public void onClick(final BaseItem item, final EventObject e) {
- listener.onEvent(actionItem);
- }
- });
- }
- }
- }
- contextMenus.put(id, menu);
- }
- });
- }
-
- public Menu get(final String id) {
- return contextMenus.get(id);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/OldAbstractAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/OldAbstractAction.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/OldAbstractAction.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,168 +0,0 @@
-/* AbstractAction.java --
- Copyright (C) 2002, 2004, 2005, 2006 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-import java.util.HashMap;
-
-import com.google.gwt.resources.client.ImageResource;
-
-/**
- * A base class for implementing the {@link Action} interface.
- *
- * @author Andrew Selkirk
- * @author Adapted version for GWT (C) The kune development team
- */
-@Deprecated
-public abstract class OldAbstractAction extends ChangebleObject implements Action {
-
- /**
- * A flag that indicates whether or not the action is enabled.
- */
- protected boolean enabled = true;
-
- /**
- * Creates a new action with no properties set.
- */
- public OldAbstractAction() {
- // Nothing to do.
- }
-
- /**
- * Copy constructor used as a substitute of clone
- */
- @SuppressWarnings("unchecked")
- public OldAbstractAction(final OldAbstractAction action) {
- enabled = action.enabled;
- store = (HashMap<String, Object>) action.store.clone();
- }
-
- /**
- * Creates a new action with the specified name. The name is stored as a
- * property with the key {@link Action#NAME}, and no other properties are
- * initialised.
- *
- * @param name
- * the name (<code>null</code> permitted).
- */
- public OldAbstractAction(final String name) {
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:19
- putValue(NAME, name);
- }
-
- /**
- * Creates a new action with the specified name and icon. The name is stored
- * as a property with the key {@link Action#NAME}, the icon is stored as a
- * property with the key {@link Action#SMALL_ICON}, and no other properties
- * are initialised.
- *
- * @param name
- * the name (<code>null</code> permitted).
- * @param icon
- * the icon (<code>null</code> permitted).
- */
- public OldAbstractAction(final String name, final ImageResource icon) {
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:19
- putValue(NAME, name);
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 15:19
- putValue(SMALL_ICON, icon);
- }
-
- /**
- * Returns the flag that indicates whether or not the action is enabled.
- *
- * @return The flag.
- *
- * @see #setEnabled(boolean)
- */
- @Override
- public boolean isEnabled() {
- return enabled;
- }
-
- @Override
- /**
- * Sets the value associated with the specified key and sends a
- * {@link java.beans.PropertyChangeEvent} to all registered listeners. The
- * standard keys are:
- * <ul>
- * <li>{@link #NAME}</li>
- * <li>{@link #SHORT_DESCRIPTION}</li>
- * <li>{@link #LONG_DESCRIPTION}</li>
- * <li>{@link #SMALL_ICON}</li>
- * <li>{@link #ACTION_COMMAND_KEY}</li>
- * <li>{@link #ACCELERATOR_KEY}</li>
- * <li>{@link #MNEMONIC_KEY}</li>
- * </ul>
- * Any existing value associated with the key will be overwritten.
- *
- * @param key
- * the key (not <code>null</code>).
- * @param value
- * the value (<code>null</code> permitted).
- */
- public void putValue(final String key, final Object value) {
- // TODO Auto-generated method stub
- super.putValue(key, value);
- }
-
- /**
- * Sets the flag that indicates whether or not the action is enabled and, if
- * the value of the flag changed from the previous setting, sends a
- * {@link java.beans.PropertyChangeEvent} to all registered listeners (using
- * the property name 'enabled').
- *
- * @param enabled
- * the new flag value.
- *
- * @see #isEnabled()
- */
- @Override
- public void setEnabled(final boolean enabled) {
- if (enabled != this.enabled) {
- this.enabled = enabled;
- firePropertyChange(ENABLED, !this.enabled, this.enabled);
- }
- }
-
- public void setShortcut(final KeyStroke key) {
- putValue(Action.ACCELERATOR_KEY, key);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeEvent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeEvent.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeEvent.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,185 +0,0 @@
-/* PropertyChangeEvent.java -- describes a change in a property
- Copyright (C) 1998, 2000, 2002, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-/**
- * PropertyChangeEvents are fired in the PropertyChange and VetoableChange event
- * classes. They represent the old and new values as well as the source Bean. If
- * the old or new value is a primitive type, it must be wrapped in the
- * appropriate wrapper type (java.lang.Integer for int, etc., etc.).
- *
- * <p>
- * If the old or new values are unknown (although why that would be I do not
- * know), they may be null. Also, if the set of properties itself has changed,
- * the name should be null, and the old and new values may also be null. Right
- * now Sun put in a propagationId, reserved for future use. Read the comments on
- * the constructor and on setPropagationId for more information.
- *
- * @author John Keiser
- * @author Eric Blake (ebb9(a)email.byu.edu)
- * @author Adapted version for GWT (C) The kune development team
- * @since 1.1
- * @status udpated to 1.4
- */
-public class PropertyChangeEvent {
-
- /**
- * The name of the property that changed, may be null. Package visible for
- * use by PropertyChangeSupport.
- *
- * @serial the changed property name
- */
- final String propertyName;
-
- /**
- * The new value of the property, may be null. Package visible for use by
- * PropertyChangeSupport.
- *
- * @serial the new property value
- */
- final Object newValue;
-
- /**
- * The old value of the property, may be null. Package visible for use by
- * PropertyChangeSupport.
- *
- * @serial the old property value
- */
- final Object oldValue;
-
- /**
- * The propagation ID, reserved for future use. May be null.
- *
- * @see #getPropagationId()
- * @serial the Propagation ID
- */
- private Object propagationId;
-
- private final Object source;
-
- /**
- * Create a new PropertyChangeEvent. Remember that if you received a
- * PropertyChangeEvent and are sending a new one, you should also set the
- * propagation ID from the old PropertyChangeEvent.
- *
- * @param source
- * the Bean containing the property
- * @param propertyName
- * the property's name
- * @param oldVal
- * the old value of the property
- * @param newVal
- * the new value of the property
- * @throws IllegalArgumentException
- * if source is null
- */
- public PropertyChangeEvent(final Object source, final String propertyName, final Object oldVal, final Object newVal) {
- this.source = source;
- this.propertyName = propertyName;
- this.oldValue = oldVal;
- this.newValue = newVal;
- }
-
- /**
- * Get the property's new value. May be null if multiple properties changed.
- *
- * @return the property's new value
- */
- public Object getNewValue() {
- return newValue;
- }
-
- /**
- * Get the property's old value. May be null if multiple properties changed.
- *
- * @return the property's old value
- */
- public Object getOldValue() {
- return oldValue;
- }
-
- /**
- * Get the propagation ID. Right now, it is not used for anything.
- *
- * @return the propagation ID
- * @see #setPropagationId(Object)
- */
- public Object getPropagationId() {
- return propagationId;
- }
-
- /**
- * Get the property name. May be null if multiple properties changed.
- *
- * @return the property name
- */
- public String getPropertyName() {
- return propertyName;
- }
-
- public Object getSource() {
- return source;
- }
-
- /**
- * Set the propagation ID. This is a way for the event to be passed from
- * hand to hand and retain a little extra state. Right now it is unused, but
- * it should be propagated anyway so that future versions of JavaBeans can
- * use it, for God knows what.
- *
- * @param propagationId
- * the propagation ID
- * @see #getPropagationId()
- */
- public void setPropagationId(final Object propagationId) {
- this.propagationId = propagationId;
- }
-
- /**
- * Utility method to rollback a change.
- *
- * @param event
- * the event to rollback
- * @return a new event with old and new swapped
- */
- PropertyChangeEvent rollback() {
- PropertyChangeEvent result = new PropertyChangeEvent(source, propertyName, newValue, oldValue);
- result.propagationId = propagationId;
- return result;
- }
-} // class PropertyChangeEvent
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListener.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListener.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,58 +0,0 @@
-/* PropertyChangeListener.java -- listen for changes in a bound property
- Copyright (C) 1998, 2000, 2002 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-/**
- * PropertyChangeListener allows a class to monitor properties of a Bean for
- * changes. A propertyChange() event will only be fired <em>after</em> the
- * property has changed.
- *
- * @author John Keiser
- * @author Adapted version for GWT (C) The kune development team
- * @since 1.1
- * @status updated to 1.4
- */
-public interface PropertyChangeListener extends EventListener {
- /**
- * Fired after a Bean's property has changed.
- *
- * @param e
- * the change (containing the old and new values)
- */
- void propertyChange(PropertyChangeEvent e);
-} // interface PropertyChangeListener
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListenerProxy.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListenerProxy.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeListenerProxy.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,99 +0,0 @@
-/* PropertyChangeListenerProxy.java -- adds a name to a property listener
- Copyright (C) 2002, 2005 Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-/**
- * This class provides an extension to <code>PropertyChangeListener</code> -
- * associating a name with the listener. This can be used to filter the changes
- * that one is interested in.
- *
- * @author Eric Blake (ebb9(a)email.byu.edu)
- * @author Adapted version for GWT (C) The kune development team
- * @since 1.4
- * @status udpated to 1.4
- */
-public class PropertyChangeListenerProxy extends EventListenerProxy implements PropertyChangeListener {
- /**
- * The name of the property to listen for. Package visible for use by
- * PropertyChangeSupport.
- */
- final String propertyName;
-
- /**
- * Create a new proxy which filters property change events and only passes
- * changes to the named property on to the delegate. A null propertyName or
- * listener does not fail now, but may cause a NullPointerException down the
- * road.
- *
- * @param propertyName
- * the property's name to filter on
- * @param listener
- * the delegate listener
- */
- public PropertyChangeListenerProxy(final String propertyName, final PropertyChangeListener listener) {
- super(listener);
- this.propertyName = propertyName;
- }
-
- /**
- * Gets the name of the property this proxy is filtering on.
- *
- * @return the property name
- */
- public String getPropertyName() {
- return propertyName;
- }
-
- /**
- * Forwards the event on to the delegate if the property name matches.
- *
- * @param event
- * the event to pass on, if it meets the filter
- * @throws NullPointerException
- * if the delegate this was created with is null
- */
- public void propertyChange(final PropertyChangeEvent event) {
- // Note: Sun does not filter, under the assumption that since
- // PropertyChangeSupport unwraps proxys, this method should never be
- // called by normal use of listeners.
- String name = event == null ? null : event.getPropertyName();
- if (name == null ? propertyName == null : name.equals(propertyName)) {
- ((PropertyChangeListener) getListener()).propertyChange(event);
- }
- }
-} // class PropertyChangeListenerProxy
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeSupport.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeSupport.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/PropertyChangeSupport.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,440 +0,0 @@
-/* PropertyChangeSupport.java -- support to manage property change listeners
- Copyright (C) 1998, 1999, 2000, 2002, 2005, 2006
- Free Software Foundation, Inc.
-
-This file is part of GNU Classpath.
-
-GNU Classpath is free software; you can redistribute it and/or modify
-it under the terms of the GNU General Public License as published by
-the Free Software Foundation; either version 2, or (at your option)
-any later version.
-
-GNU Classpath is distributed in the hope that it will be useful, but
-WITHOUT ANY WARRANTY; without even the implied warranty of
-MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
-General Public License for more details.
-
-You should have received a copy of the GNU General Public License
-along with GNU Classpath; see the file COPYING. If not, write to the
-Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-02110-1301 USA.
-
-Linking this library statically or dynamically with other modules is
-making a combined work based on this library. Thus, the terms and
-conditions of the GNU General Public License cover the whole
-combination.
-
-As a special exception, the copyright holders of this library give you
-permission to link this library with independent modules to produce an
-executable, regardless of the license terms of these independent
-modules, and to copy and distribute the resulting executable under
-terms of your choice, provided that you also meet, for each linked
-independent module, the terms and conditions of the license of that
-module. An independent module is a module which is not derived from
-or based on this library. If you modify this library, you may extend
-this exception to your version of the library, but you are not
-obligated to do so. If you do not wish to do so, delete this
-exception statement from your version. */
-
-package org.ourproject.kune.platf.client.actions;
-
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.Iterator;
-import java.util.Map.Entry;
-import java.util.Vector;
-
-/**
- * PropertyChangeSupport makes it easy to fire property change events and handle
- * listeners. It allows chaining of listeners, as well as filtering by property
- * name. In addition, it will serialize only those listeners which are
- * serializable, ignoring the others without problem. This class is thread-safe.
- *
- * @author John Keiser
- * @author Eric Blake (ebb9(a)email.byu.edu)
- * @author Adapted version for GWT (C) The kune development team
- * @since 1.1
- * @status updated to 1.4
- */
-public class PropertyChangeSupport {
-
- /**
- * Maps property names (String) to named listeners (PropertyChangeSupport).
- * If this is a child instance, this field will be null.
- *
- * @serial the map of property names to named listener managers
- * @since 1.2
- */
- private HashMap<String, PropertyChangeSupport> children;
-
- /**
- * The non-null source object for any generated events.
- *
- * @serial the event source
- */
- private final Object source;
-
- /**
- * The list of all registered property listeners. If this instance was
- * created by user code, this only holds the global listeners (ie. not tied
- * to a name), and may be null. If it was created by this class, as a helper
- * for named properties, then this vector will be non-null, and this
- * instance appears as a value in the <code>children</code> hashtable of
- * another instance, so that the listeners are tied to the key of that
- * hashtable entry.
- */
- private Vector<PropertyChangeListener> listeners;
-
- /**
- * Create a PropertyChangeSupport to work with a specific source bean.
- *
- * @param source
- * the source bean to use
- * @throws NullPointerException
- * if source is null
- */
- public PropertyChangeSupport(final Object source) {
- this.source = source;
- if (source == null) {
- // @PMD:REVIEWED:AvoidThrowingNullPointerException: by vjrj on
- // 21/05/09 14:12
- throw new NullPointerException();
- }
- }
-
- /**
- * Adds a PropertyChangeListener to the list of global listeners. All
- * property change events will be sent to this listener. The listener add is
- * not unique: that is, <em>n</em> adds with the same listener will result
- * in <em>n</em> events being sent to that listener for every property
- * change. Adding a null listener is silently ignored. This method will
- * unwrap a PropertyChangeListenerProxy, registering the underlying delegate
- * to the named property list.
- *
- * @param l
- * the listener to add
- */
- public void addPropertyChangeListener(final PropertyChangeListener l) {
- if (l == null) {
- return;
- }
-
- if (l instanceof PropertyChangeListenerProxy) {
- final PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l;
- addPropertyChangeListener(p.propertyName, (PropertyChangeListener) p.getListener());
- } else {
- if (listeners == null) {
- listeners = new Vector<PropertyChangeListener>();
- }
- listeners.add(l);
- }
- }
-
- /**
- * Adds a PropertyChangeListener listening on the specified property. Events
- * will be sent to the listener only if the property name matches. The
- * listener add is not unique; that is, <em>n</em> adds on a particular
- * property for a particular listener will result in <em>n</em> events being
- * sent to that listener when that property is changed. The effect is
- * cumulative, too; if you are registered to listen to receive events on all
- * property changes, and then you register on a particular property, you
- * will receive change events for that property twice. Adding a null
- * listener is silently ignored. This method will unwrap a
- * PropertyChangeListenerProxy, registering the underlying delegate to the
- * named property list if the names match, and discarding it otherwise.
- *
- * @param propertyName
- * the name of the property to listen on
- * @param l
- * the listener to add
- * @throws NullPointerException
- * if propertyName is null
- */
- // @PMD:REVIEWED:AvoidReassigningParameters: by vjrj on 21/05/09 14:12
- public void addPropertyChangeListener(final String propertyName, PropertyChangeListener l) {
- if (l == null) {
- return;
- }
-
- while (l instanceof PropertyChangeListenerProxy) {
- final PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l;
- if (propertyName == null ? p.propertyName != null : !propertyName.equals(p.propertyName)) {
- return;
- }
- l = (PropertyChangeListener) p.getListener();
- }
- PropertyChangeSupport s = null;
- if (children == null) {
- children = new HashMap<String, PropertyChangeSupport>();
- } else {
- s = children.get(propertyName);
- }
- if (s == null) {
- s = new PropertyChangeSupport(source);
- s.listeners = new Vector<PropertyChangeListener>();
- children.put(propertyName, s);
- }
- s.listeners.add(l);
- }
-
- /**
- * Fire an indexed property change event. This will only fire an event if
- * the old and new values are not equal.
- *
- * @param name
- * the name of the property which changed
- * @param index
- * the index of the property which changed
- * @param oldValue
- * the old value of the property
- * @param newValue
- * the new value of the property
- * @since 1.5
- */
- public void fireIndexedPropertyChange(final String name, final int index, final boolean oldValue,
- final boolean newValue) {
- if (oldValue != newValue) {
- fireIndexedPropertyChange(name, index, Boolean.valueOf(oldValue), Boolean.valueOf(newValue));
- }
- }
-
- /**
- * Fire an indexed property change event. This will only fire an event if
- * the old and new values are not equal.
- *
- * @param name
- * the name of the property which changed
- * @param index
- * the index of the property which changed
- * @param oldValue
- * the old value of the property
- * @param newValue
- * the new value of the property
- * @since 1.5
- */
- public void fireIndexedPropertyChange(final String name, final int index, final int oldValue, final int newValue) {
- if (oldValue != newValue) {
- fireIndexedPropertyChange(name, index, Integer.valueOf(oldValue), Integer.valueOf(newValue));
- }
- }
-
- /**
- * Fire a PropertyChangeEvent to all the global listeners, and to all the
- * listeners for the specified property name. This does nothing if old and
- * new values of the event are equal.
- *
- * @param event
- * the event to fire
- * @throws NullPointerException
- * if event is null
- */
- public void firePropertyChange(final PropertyChangeEvent event) {
- if (event.oldValue != null && event.oldValue.equals(event.newValue)) {
- return;
- }
- Vector<PropertyChangeListener> v = listeners; // Be thread-safe.
- if (v != null) {
- int i = v.size();
- while (--i >= 0) {
- (v.get(i)).propertyChange(event);
- }
- }
- final HashMap<String, PropertyChangeSupport> h = children; // Be
- // thread-safe.
- if (h != null && event.propertyName != null) {
- final PropertyChangeSupport s = h.get(event.propertyName);
- if (s != null) {
- v = s.listeners; // Be thread-safe.
- int i = v == null ? 0 : v.size();
- while (--i >= 0) {
- (v.get(i)).propertyChange(event);
- }
- }
- }
- }
-
- /**
- * Fire a PropertyChangeEvent containing the old and new values of the
- * property to all the global listeners, and to all the listeners for the
- * specified property name. This does nothing if old and new are equal.
- *
- * @param propertyName
- * the name of the property that changed
- * @param oldVal
- * the old value
- * @param newVal
- * the new value
- */
- public void firePropertyChange(final String propertyName, final boolean oldVal, final boolean newVal) {
- if (oldVal != newVal) {
- firePropertyChange(new PropertyChangeEvent(source, propertyName, Boolean.valueOf(oldVal),
- Boolean.valueOf(newVal)));
- }
- }
-
- /**
- * Fire a PropertyChangeEvent containing the old and new values of the
- * property to all the global listeners, and to all the listeners for the
- * specified property name. This does nothing if old and new are equal.
- *
- * @param propertyName
- * the name of the property that changed
- * @param oldVal
- * the old value
- * @param newVal
- * the new value
- */
- public void firePropertyChange(final String propertyName, final int oldVal, final int newVal) {
- if (oldVal != newVal) {
- firePropertyChange(new PropertyChangeEvent(source, propertyName, Integer.valueOf(oldVal),
- Integer.valueOf(newVal)));
- }
- }
-
- /**
- * Fire a PropertyChangeEvent containing the old and new values of the
- * property to all the global listeners, and to all the listeners for the
- * specified property name. This does nothing if old and new are non-null
- * and equal.
- *
- * @param propertyName
- * the name of the property that changed
- * @param oldVal
- * the old value
- * @param newVal
- * the new value
- */
- public void firePropertyChange(final String propertyName, final Object oldVal, final Object newVal) {
- firePropertyChange(new PropertyChangeEvent(source, propertyName, oldVal, newVal));
- }
-
- /**
- * Returns an array of all registered property change listeners. Those that
- * were registered under a name will be wrapped in a
- * <code>PropertyChangeListenerProxy</code>, so you must check whether the
- * listener is an instance of the proxy class in order to see what name the
- * real listener is registered under. If there are no registered listeners,
- * this returns an empty array.
- *
- * @return the array of registered listeners
- * @see PropertyChangeListenerProxy
- * @since 1.4
- */
- public PropertyChangeListener[] getPropertyChangeListeners() {
- final ArrayList<PropertyChangeListener> list = new ArrayList<PropertyChangeListener>();
- if (listeners != null) {
- list.addAll(listeners);
- }
- if (children != null) {
- int i = children.size();
- final Iterator<Entry<String, PropertyChangeSupport>> iter = children.entrySet().iterator();
- while (--i >= 0) {
- final Entry<String, PropertyChangeSupport> e = iter.next();
- final String name = e.getKey();
- final Vector<PropertyChangeListener> v = (e.getValue()).listeners;
- int j = v.size();
- while (--j >= 0) {
- list.add(new PropertyChangeListenerProxy(name, v.get(j)));
- }
- }
- }
- return list.toArray(new PropertyChangeListener[list.size()]);
- }
-
- /**
- * Returns an array of all property change listeners registered under the
- * given property name. If there are no registered listeners, or
- * propertyName is null, this returns an empty array.
- *
- * @return the array of registered listeners
- * @since 1.4
- */
- public PropertyChangeListener[] getPropertyChangeListeners(final String propertyName) {
- if (children == null || propertyName == null) {
- return new PropertyChangeListener[0];
- }
- final PropertyChangeSupport s = children.get(propertyName);
- if (s == null) {
- return new PropertyChangeListener[0];
- }
- return s.listeners.toArray(new PropertyChangeListener[s.listeners.size()]);
- }
-
- /**
- * Tell whether the specified property is being listened on or not. This
- * will only return <code>true</code> if there are listeners on all
- * properties or if there is a listener specifically on this property.
- *
- * @param propertyName
- * the property that may be listened on
- * @return whether the property is being listened on
- */
- public boolean hasListeners(final String propertyName) {
- return listeners != null || (children != null && children.get(propertyName) != null);
- }
-
- /**
- * Removes a PropertyChangeListener from the list of global listeners. If
- * any specific properties are being listened on, they must be deregistered
- * by themselves; this will only remove the general listener to all
- * properties. If <code>add()</code> has been called multiple times for a
- * particular listener, <code>remove()</code> will have to be called the
- * same number of times to deregister it. This method will unwrap a
- * PropertyChangeListenerProxy, removing the underlying delegate from the
- * named property list.
- *
- * @param l
- * the listener to remove
- */
- public void removePropertyChangeListener(final PropertyChangeListener l) {
- if (l instanceof PropertyChangeListenerProxy) {
- final PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l;
- removePropertyChangeListener(p.propertyName, (PropertyChangeListener) p.getListener());
- } else if (listeners != null) {
- listeners.remove(l);
- if (listeners.isEmpty()) {
- listeners = null;
- }
- }
- }
-
- /**
- * Removes a PropertyChangeListener from listening to a specific property.
- * If <code>add()</code> has been called multiple times for a particular
- * listener on a property, <code>remove()</code> will have to be called the
- * same number of times to deregister it. This method will unwrap a
- * PropertyChangeListenerProxy, removing the underlying delegate from the
- * named property list if the names match.
- *
- * @param propertyName
- * the property to stop listening on
- * @param l
- * the listener to remove
- * @throws NullPointerException
- * if propertyName is null
- */
- // @PMD:REVIEWED:AvoidReassigningParameters: by vjrj on 21/05/09 14:12
- public void removePropertyChangeListener(final String propertyName, PropertyChangeListener l) {
- if (children == null) {
- return;
- }
- final PropertyChangeSupport s = children.get(propertyName);
- if (s == null) {
- return;
- }
- while (l instanceof PropertyChangeListenerProxy) {
- final PropertyChangeListenerProxy p = (PropertyChangeListenerProxy) l;
- if (propertyName == null ? p.propertyName != null : !propertyName.equals(p.propertyName)) {
- return;
- }
- l = (PropertyChangeListener) p.getListener();
- }
- s.listeners.remove(l);
- if (s.listeners.isEmpty()) {
- children.remove(propertyName);
- if (children.isEmpty()) {
- children = null;
- }
- }
- }
-} // class PropertyChangeSupport
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/RadioMustBeChecked.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/RadioMustBeChecked.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/RadioMustBeChecked.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,24 +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 org.ourproject.kune.platf.client.actions;
-
-public interface RadioMustBeChecked {
- boolean mustBeChecked();
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/actions/Shortcut.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/Shortcut.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/Shortcut.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,44 +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 org.ourproject.kune.platf.client.actions;
-
-import org.ourproject.kune.platf.client.shortcuts.Keyboard;
-
-public final class Shortcut {
-
- public static KeyStroke getShortcut(final boolean ctrl, final boolean alt, final boolean shift, final boolean meta,
- final Character character) {
- return KeyStroke.getKeyStroke(character, (ctrl ? Keyboard.MODIFIER_CTRL : 0)
- + (alt ? Keyboard.MODIFIER_ALT : 0) + (shift ? Keyboard.MODIFIER_SHIFT : 0)
- + (meta ? Keyboard.MODIFIER_META : 0));
- }
-
- public static KeyStroke getShortcut(final boolean ctrl, final boolean shift, final Character character) {
- return getShortcut(ctrl, false, shift, false, character);
- }
-
- public static KeyStroke getShortcut(final boolean ctrl, final Character character) {
- return getShortcut(ctrl, false, false, false, character);
- }
-
- private Shortcut() {
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractLabel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractLabel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractLabel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,72 +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 org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.DoubleClickHandler;
-import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.event.dom.client.MouseMoveHandler;
-import com.google.gwt.event.dom.client.MouseOutHandler;
-import com.google.gwt.event.dom.client.MouseOverHandler;
-import com.google.gwt.event.dom.client.MouseUpHandler;
-import com.google.gwt.event.dom.client.MouseWheelHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.Event;
-
-public interface AbstractLabel {
-
- HandlerRegistration addClickHandler(final ClickHandler handler);
-
- HandlerRegistration addDoubleClickHandler(final DoubleClickHandler handler);
-
- HandlerRegistration addMouseDownHandler(final MouseDownHandler handler);
-
- HandlerRegistration addMouseMoveHandler(final MouseMoveHandler handler);
-
- HandlerRegistration addMouseOutHandler(final MouseOutHandler handler);
-
- HandlerRegistration addMouseOverHandler(final MouseOverHandler handler);
-
- HandlerRegistration addMouseUpHandler(final MouseUpHandler handler);
-
- HandlerRegistration addMouseWheelHandler(final MouseWheelHandler handler);
-
- void addStyleDependentName(String string);
-
- Element getElement();
-
- String getText();
-
- void onBrowserEvent(final Event event);
-
- void removeStyleDependentName(String string);
-
- void setColor(final String color);
-
- void setStylePrimaryName(String string);
-
- void setText(final String text);
-
- void setTitle(final String title);
-
- void setVisible(boolean visible);
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractSearcherPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,147 +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 org.ourproject.kune.platf.client.ui;
-
-import java.util.Map;
-
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.extjs.gxt.ui.client.data.BaseListLoader;
-import com.extjs.gxt.ui.client.data.BasePagingLoadConfig;
-import com.extjs.gxt.ui.client.data.HttpProxy;
-import com.extjs.gxt.ui.client.data.JsonLoadResultReader;
-import com.extjs.gxt.ui.client.data.ListLoadResult;
-import com.extjs.gxt.ui.client.data.ModelData;
-import com.extjs.gxt.ui.client.data.ModelType;
-import com.extjs.gxt.ui.client.data.PagingLoadConfig;
-import com.extjs.gxt.ui.client.event.Events;
-import com.extjs.gxt.ui.client.event.GridEvent;
-import com.extjs.gxt.ui.client.event.Listener;
-import com.extjs.gxt.ui.client.store.ListStore;
-import com.extjs.gxt.ui.client.store.Store;
-import com.extjs.gxt.ui.client.store.StoreFilter;
-import com.extjs.gxt.ui.client.widget.grid.Grid;
-import com.extjs.gxt.ui.client.widget.grid.GridSelectionModel;
-import com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar;
-import com.extjs.gxt.ui.client.widget.toolbar.PagingToolBar.PagingToolBarMessages;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.http.client.RequestBuilder;
-
-public class AbstractSearcherPanel {
-
- protected static final int PAGINATION_SIZE = 10;
- protected final I18nTranslationService i18n;
-
- public AbstractSearcherPanel(final I18nTranslationService i18n) {
- this.i18n = i18n;
- }
-
- protected void createPagingToolbar(final Store store, final Grid grid) {
- final PagingToolBar pag = new PagingToolBar(PAGINATION_SIZE);
- final PagingToolBarMessages msgs = new PagingToolBarMessages();
-
- msgs.setDisplayMsg(i18n.tWithNT("Displaying results {0} - {1} of {2}",
- "Respect {} values in translations. "
- + "This will produce: 'Displaying results 1 - 25 of 95465' for instance"));
- msgs.setEmptyMsg(i18n.t("No results to display"));
- msgs.setFirstText(i18n.t("First Page"));
- msgs.setAfterPageText(i18n.tWithNT("of {0}", "Used to show multiple results: '1 of 30'"));
- msgs.setBeforePageText(i18n.t("Page"));
- msgs.setLastText(i18n.t("Last Page"));
- msgs.setNextText(i18n.t("Next Page"));
- msgs.setPrevText(i18n.t("Previous Page"));
- msgs.setRefreshText(i18n.t("Refresh"));
- pag.setMessages(msgs);
- // pag.setStore(store);
- // pag.setDisplayInfo(true);
- // grid.setBottomToolbar(pag);
- grid.setLoadMask(true);
- // grid.setLoadMask(i18n.t("Searching"));
- grid.setSelectionModel(new GridSelectionModel());
- grid.setBorders(false);
- // grid.setFrame(true);
- grid.setStripeRows(true);
- }
-
- protected Store createStore(final ModelType type, final String url, final String id, final Grid grid) {
- final String path = GWT.getHostPageBaseURL() + url;
-
- // use a http proxy to get the data
- final RequestBuilder builder = new RequestBuilder(RequestBuilder.GET, path);
- final HttpProxy<String> proxy = new HttpProxy<String>(builder);
-
- // need a loader, proxy, and reader
- final JsonLoadResultReader<ListLoadResult<ModelData>> reader = new JsonLoadResultReader<ListLoadResult<ModelData>>(
- type);
-
- final BaseListLoader<ListLoadResult<ModelData>> loader = new BaseListLoader<ListLoadResult<ModelData>>(
- proxy, reader);
- loader.setRemoteSort(true);
-
- final ListStore<ModelData> store = new ListStore<ModelData>(loader);
- grid.addListener(Events.Attach, new Listener<GridEvent<ModelData>>() {
- @Override
- public void handleEvent(final GridEvent<ModelData> be) {
- final PagingLoadConfig config = new BasePagingLoadConfig();
- config.setOffset(0);
- config.setLimit(PAGINATION_SIZE);
-
- final Map<String, Object> state = grid.getState();
- if (state.containsKey("offset")) {
- final int offset = (Integer) state.get("offset");
- final int limit = (Integer) state.get("limit");
- config.setOffset(offset);
- config.setLimit(limit);
- }
- // if (state.containsKey("sortField")) {
- // config.setSortField((String) state.get("sortField"));
- // config.setSortDir(SortDir.valueOf((String) state.get("sortDir")));
- // }
- loader.load(config);
- }
- });
-
- // this goes to Model...
- // reader.setRoot("list");
- // reader.setTotalProperty("size");
- // reader.setId(id);
- // final HttpProxy proxy = new HttpProxy(url, Connection.POST);
- // return new Store(proxy, reader, true);
-
- return store;
- }
-
- protected void query(final Store store, final Grid grid, final String query) {
- // final UrlParam[] newParams = new UrlParam[] { new UrlParam("query",
- // query) };
- // store.setBaseParams(newParams);
- // store.load(0, PAGINATION_SIZE);
- store.clearFilters();
- store.addFilter(new StoreFilter<ModelData>() {
- @Override
- public boolean select(final Store<ModelData> store, final ModelData parent, final ModelData item,
- final String property) {
- // TODO Auto-generated method stub
- return false;
- }
- });
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractToolbar.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/AbstractToolbar.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,53 +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 org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;
-import com.google.gwt.user.client.ui.Widget;
-
-public interface AbstractToolbar {
-
- void add(final Widget widget);
-
- void add(final Widget widget, VerticalAlignmentConstant valign);
-
- Widget addFill();
-
- Widget addSeparator();
-
- Widget addSpacer();
-
- int getOffsetHeight();
-
- void insert(final Widget widget, int position);
-
- boolean isAttached();
-
- void remove(final Widget widget);
-
- void removeAll();
-
- void setBlankStyle();
-
- void setHeight(String height);
-
- void setNormalStyle();
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/ContextPropertyPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/ContextPropertyPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/ContextPropertyPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,63 +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 org.ourproject.kune.platf.client.ui;
-
-import org.ourproject.kune.platf.client.services.Images;
-
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.DisclosurePanel;
-import com.google.gwt.user.client.ui.DisclosurePanelImages;
-import com.google.gwt.user.client.ui.Widget;
-
-public class ContextPropertyPanel extends Composite {
-
- public ContextPropertyPanel(AbstractImagePrototype headerIcon, String tooltip, String headerText, boolean isOpen,
- String debugId, Widget content) {
- this(new IconLabel(headerIcon, headerText), tooltip, isOpen, debugId, content);
- }
-
- public ContextPropertyPanel(String headerText, String tooltip, boolean isOpen, String debugId, Widget content) {
- DisclosurePanelImages images = new DisclosurePanelImages() {
- public AbstractImagePrototype disclosurePanelClosed() {
- return Images.App.getInstance().arrowRightWhite();
- }
-
- public AbstractImagePrototype disclosurePanelOpen() {
- return Images.App.getInstance().arrowDownWhite();
- }
- };
- DisclosurePanel disclosure = new DisclosurePanel(images, headerText, isOpen);
- init(disclosure, tooltip, content, debugId);
- }
-
- public ContextPropertyPanel(Widget header, String tooltip, boolean isOpen, String debugId, Widget content) {
- DisclosurePanel disclosure = new DisclosurePanel(header, isOpen);
- init(disclosure, tooltip, content, debugId);
- }
-
- private void init(DisclosurePanel disclosure, String tooltip, Widget content, String debugId) {
- disclosure.setAnimationEnabled(true);
- disclosure.ensureDebugId(debugId);
- disclosure.setContent(content);
- KuneUiUtils.setQuickTip(disclosure, tooltip);
- initWidget(disclosure);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultGrid.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultGrid.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DefaultGrid.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,26 +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 org.ourproject.kune.platf.client.ui;
-
-public class DefaultGrid {
- public DefaultGrid() {
-
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,172 +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 org.ourproject.kune.platf.client.ui;
-
-import org.ourproject.kune.platf.client.services.Images;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * <p>
- * This panel opens when you click on the arrow or the title (gmail style)
- * </p>
- *
- */
-public class DropDownPanel extends Composite implements ClickHandler {
- private final VerticalPanel vpanel;
- private final HorizontalPanel titleHP;
- private final Label titleLabel;
- private final SimplePanel contentPanel;
- private final Images img;
- private final Image arrowImage;
- private final RoundedPanel outerBorder;
- private String stylePrimaryName;
-
- public DropDownPanel(final Images img) {
- super();
- this.img = img;
- vpanel = new VerticalPanel();
- outerBorder = new RoundedPanel(vpanel, RoundedPanel.ALL);
- titleHP = new HorizontalPanel();
- arrowImage = new Image();
- titleLabel = new Label();
- contentPanel = new SimplePanel();
-
- initWidget(outerBorder);
- vpanel.add(titleHP);
- vpanel.add(contentPanel);
- titleHP.add(arrowImage);
- titleHP.add(titleLabel);
-
- this.stylePrimaryName = "k-dropdownouter";
- outerBorder.setCornerStyleName(stylePrimaryName);
- vpanel.setStylePrimaryName(stylePrimaryName);
- vpanel.setWidth("100%");
- vpanel.setCellWidth(contentPanel, "100%");
- vpanel.setCellWidth(titleHP, "100%");
- titleHP.setStylePrimaryName("k-dropdownlabel");
- img.arrowDownWhite().applyTo(arrowImage);
- titleLabel.setText("");
- contentPanel.setStylePrimaryName("k-dropdowninner");
-
- setContentVisibleImpl(false);
- arrowImage.addClickHandler(this);
- titleLabel.addClickHandler(this);
- }
-
- public DropDownPanel(final Images img, final boolean visible) {
- this(img);
- setContentVisibleImpl(visible);
- }
-
- public DropDownPanel(final Images img, final String headerText, final boolean visible) {
- this(img);
- setContentVisibleImpl(visible);
- setHeaderTextImpl(headerText);
- }
-
- public boolean isContentVisible() {
- return contentPanel.isVisible();
- }
-
- public void onClick(final ClickEvent event) {
- setContentVisible(!isContentVisible());
- }
-
- public void setBorderStylePrimaryName(final String stylePrimaryName) {
- this.stylePrimaryName = stylePrimaryName;
- outerBorder.setCornerStyleName(stylePrimaryName);
- vpanel.setStylePrimaryName(stylePrimaryName);
- }
-
- public void setContent(final Widget widget) {
- contentPanel.setWidget(widget);
- // refresh panel
- setContentVisible(isContentVisible());
- }
-
- public void setContentHeight(final String height) {
- contentPanel.setHeight(height);
- }
-
- public void setContentVisible(final boolean visible) {
- setContentVisibleImpl(visible);
- }
-
- public void setHeaderText(final String text) {
- setHeaderTextImpl(text);
- }
-
- public void setHeaderTitle(final String title) {
- // QuickTips size problems with images
- KuneUiUtils.setQuickTip(arrowImage, title);
- KuneUiUtils.setQuickTip(titleLabel, title);
- }
-
- @Override
- public void setHeight(final String height) {
- super.setHeight(height);
- outerBorder.setHeight(height);
- }
-
- public void setTheme(final String oldTheme, final String newTheme) {
- if (oldTheme != null) {
- // outerBorder.removeStyleDependentName(oldThemeS);
- vpanel.removeStyleDependentName(oldTheme);
- titleHP.removeStyleDependentName(oldTheme);
- contentPanel.removeStyleDependentName(oldTheme);
- }
- outerBorder.setCornerStyleName(stylePrimaryName + "-" + newTheme);
- // outerBorder.addStyleDependentName(newThemeS);
- vpanel.addStyleDependentName(newTheme);
- titleHP.addStyleDependentName(newTheme);
- contentPanel.addStyleDependentName(newTheme);
- }
-
- @Override
- public void setWidth(final String width) {
- super.setWidth(width);
- outerBorder.setWidth(width);
- }
-
- private void setContentVisibleImpl(final boolean visible) {
- if (visible) {
- img.arrowDownWhite().applyTo(arrowImage);
- contentPanel.setVisible(true);
-
- } else {
- img.arrowRightWhite().applyTo(arrowImage);
- contentPanel.setVisible(false);
- }
- }
-
- private void setHeaderTextImpl(final String text) {
- titleLabel.setText(text);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableClickListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableClickListener.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableClickListener.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,27 +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 org.ourproject.kune.platf.client.ui;
-
-public interface EditableClickListener {
-
- @Deprecated
- void onEdited(String text);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/FlowToolbar.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,120 +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 org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.Widget;
-
-public class FlowToolbar extends Composite implements AbstractToolbar {
-
- private final HorizontalPanel mainPanel;
- private final FlowPanel childPanel;
-
- public FlowToolbar() {
- super();
- mainPanel = new HorizontalPanel();
- childPanel = new FlowPanel();
- mainPanel.add(childPanel);
- initWidget(mainPanel);
- }
-
- public void add(final Widget widget) {
- childPanel.add(widget);
- }
-
- public void add(final Widget widget, final VerticalAlignmentConstant valign) {
- childPanel.add(widget);
- }
-
- public Widget addFill() {
- final Label emptyLabel = new Label("");
- emptyLabel.addStyleName("kune-floatleft");
- this.add(emptyLabel);
- return emptyLabel;
- }
-
- public Widget addSeparator() {
- final Label emptyLabel = new Label("");
- emptyLabel.setStyleName("ytb-sep");
- emptyLabel.addStyleName("k-toolbar-sep");
- emptyLabel.addStyleName("kune-floatleft");
- this.add(emptyLabel);
- return emptyLabel;
- }
-
- public Widget addSpacer() {
- final Label emptyLabel = new Label("");
- emptyLabel.setStyleName("ytb-spacer");
- emptyLabel.addStyleName("kune-floatleft");
- this.add(emptyLabel);
- return emptyLabel;
- }
-
- public void insert(final Widget widget, final int position) {
- childPanel.insert(widget, position);
- }
-
- public void remove(final Widget widget) {
- childPanel.remove(widget);
- }
-
- public void removeAll() {
- childPanel.clear();
- }
-
- /**
- * Set the blank style
- */
- public void setBlankStyle() {
- setBasicStyle();
- addStyleName("k-blank-toolbar");
- }
-
- @Override
- public void setHeight(final String height) {
- mainPanel.setHeight(height);
- childPanel.setHeight(height);
- }
-
- /**
- * Set the normal grey style
- */
- public void setNormalStyle() {
- setBasicStyle();
- addStyleName("k-toolbar-bottom-line");
- }
-
- /**
- * Set the transparent style
- */
- public void setTranspStyle() {
- setBasicStyle();
- addStyleName("k-transp");
- }
-
- private void setBasicStyle() {
- setStyleName("x-toolbar");
- addStyleName("x-panel");
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/HasColor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/HasColor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/HasColor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,26 +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 org.ourproject.kune.platf.client.ui;
-
-public interface HasColor {
- void setColor(String color);
-
- String getColor();
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/HorizontalLine.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/HorizontalLine.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/HorizontalLine.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,29 +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 org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.user.client.ui.HTML;
-
-final public class HorizontalLine extends HTML {
-
- public HorizontalLine() {
- this.setHTML("<hr noshadow size='1'>");
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconHyperlink.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconHyperlink.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconHyperlink.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,165 +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 org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.DoubleClickEvent;
-import com.google.gwt.event.dom.client.DoubleClickHandler;
-import com.google.gwt.event.dom.client.HasAllMouseHandlers;
-import com.google.gwt.event.dom.client.HasClickHandlers;
-import com.google.gwt.event.dom.client.HasDoubleClickHandlers;
-import com.google.gwt.event.dom.client.MouseDownEvent;
-import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.event.dom.client.MouseMoveEvent;
-import com.google.gwt.event.dom.client.MouseMoveHandler;
-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.dom.client.MouseUpEvent;
-import com.google.gwt.event.dom.client.MouseUpHandler;
-import com.google.gwt.event.dom.client.MouseWheelEvent;
-import com.google.gwt.event.dom.client.MouseWheelHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.Widget;
-
-public class IconHyperlink extends Widget implements AbstractLabel, HasClickHandlers, HasDoubleClickHandlers,
- HasAllMouseHandlers {
-
- private Element anchorElem;
-
- private String targetHistoryToken;
- private final Element link;
- private final Element icon;
-
- public IconHyperlink(final AbstractImagePrototype image) {
- setElement(DOM.createDiv());
- DOM.appendChild(getElement(), anchorElem = DOM.createAnchor());
- setStyleName("kune-IconHyperlink");
- icon = image.createImage().getElement();
- link = DOM.createSpan();
- DOM.appendChild(anchorElem, icon);
- DOM.appendChild(anchorElem, link);
- }
-
- public IconHyperlink(final AbstractImagePrototype image, final String text, final boolean asHTML,
- final String targetHistoryToken) {
- this(image);
- if (asHTML) {
- setLabelHtmlImpl(text);
- } else {
- setLabelTextImpl(text);
- }
- setTargetHistoryTokenImpl(targetHistoryToken);
- }
-
- public IconHyperlink(final AbstractImagePrototype image, final String text, final String targetHistoryToken) {
- this(image);
- setLabelTextImpl(text);
- setTargetHistoryTokenImpl(targetHistoryToken);
- }
-
- public HandlerRegistration addClickHandler(final ClickHandler handler) {
- return addDomHandler(handler, ClickEvent.getType());
- }
-
- public HandlerRegistration addDoubleClickHandler(final DoubleClickHandler handler) {
- return addDomHandler(handler, DoubleClickEvent.getType());
- }
-
- public HandlerRegistration addMouseDownHandler(final MouseDownHandler handler) {
- return addDomHandler(handler, MouseDownEvent.getType());
- }
-
- public HandlerRegistration addMouseMoveHandler(final MouseMoveHandler handler) {
- return addDomHandler(handler, MouseMoveEvent.getType());
- }
-
- public HandlerRegistration addMouseOutHandler(final MouseOutHandler handler) {
- return addDomHandler(handler, MouseOutEvent.getType());
- }
-
- public HandlerRegistration addMouseOverHandler(final MouseOverHandler handler) {
- return addDomHandler(handler, MouseOverEvent.getType());
- }
-
- public HandlerRegistration addMouseUpHandler(final MouseUpHandler handler) {
- return addDomHandler(handler, MouseUpEvent.getType());
- }
-
- public HandlerRegistration addMouseWheelHandler(final MouseWheelHandler handler) {
- return addDomHandler(handler, MouseWheelEvent.getType());
- }
-
- public String getTargetHistoryToken() {
- return targetHistoryToken;
- }
-
- public String getText() {
- return DOM.getInnerText(link);
- }
-
- public void setColor(final String color) {
- DOM.setStyleAttribute(link, "color", color);
- }
-
- public void setImage(final AbstractImagePrototype image) {
- DOM.setInnerHTML(icon, image.getHTML());
- }
-
- public void setLabelHTML(final String html) {
- setLabelHtmlImpl(html);
- }
-
- public void setLabelText(final String text) {
- setLabelTextImpl(text);
- }
-
- public void setTargetHistoryToken(final String targetHistoryToken) {
- setTargetHistoryTokenImpl(targetHistoryToken);
- }
-
- public void setText(final String text) {
- setLabelText(text);
- }
-
- @Override
- public void setTitle(final String title) {
- KuneUiUtils.setQuickTip(icon, title);
- KuneUiUtils.setQuickTip(anchorElem, title);
- }
-
- private void setLabelHtmlImpl(final String html) {
- DOM.setInnerHTML(link, html);
- }
-
- private void setLabelTextImpl(final String text) {
- DOM.setInnerText(link, text);
- }
-
- private void setTargetHistoryTokenImpl(final String targetHistoryToken) {
- this.targetHistoryToken = targetHistoryToken;
- DOM.setElementProperty(anchorElem, "href", "#" + targetHistoryToken);
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,237 +0,0 @@
-/*
- * Copyright 2007 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.
- *
- * Adapted by Vicente J. Ruiz Jurado for kune
- \*/
-package org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.DoubleClickEvent;
-import com.google.gwt.event.dom.client.DoubleClickHandler;
-import com.google.gwt.event.dom.client.HasAllMouseHandlers;
-import com.google.gwt.event.dom.client.HasClickHandlers;
-import com.google.gwt.event.dom.client.HasDoubleClickHandlers;
-import com.google.gwt.event.dom.client.MouseDownEvent;
-import com.google.gwt.event.dom.client.MouseDownHandler;
-import com.google.gwt.event.dom.client.MouseMoveEvent;
-import com.google.gwt.event.dom.client.MouseMoveHandler;
-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.dom.client.MouseUpEvent;
-import com.google.gwt.event.dom.client.MouseUpHandler;
-import com.google.gwt.event.dom.client.MouseWheelEvent;
-import com.google.gwt.event.dom.client.MouseWheelHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.HasHorizontalAlignment;
-import com.google.gwt.user.client.ui.HasText;
-import com.google.gwt.user.client.ui.HasWordWrap;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * A widget that contains a icon and arbitrary text, <i>not</i> interpreted as
- * HTML.
- *
- * <h3>CSS Style Rules</h3> <ul class='css'> <li>.kune-IconLabel { }</li> </ul>
- *
- * <p>
- * <h3>Example</h3>
- * {@example com.google.gwt.examples.HTMLExample}
- * </p>
- */
-
-public class IconLabel extends Widget implements HasClickHandlers, HasDoubleClickHandlers, HasAllMouseHandlers,
- HasHorizontalAlignment, HasText, HasWordWrap, AbstractLabel {
-
- private HorizontalAlignmentConstant horzAlign;
-
- private Element icon;
-
- private final Element textLabel;
-
- /**
- * Creates an empty label with a icon.
- *
- * @param image
- * the icon to add
- */
- public IconLabel(final AbstractImagePrototype image, final boolean leftIcon) {
- setElement(DOM.createDiv());
- setIconImpl(image);
- textLabel = DOM.createSpan();
- if (leftIcon) {
- setStyleName("kune-IconLabel-l");
- DOM.appendChild(getElement(), icon);
- DOM.appendChild(getElement(), textLabel);
- } else {
- setStyleName("kune-IconLabel-r");
- DOM.appendChild(getElement(), textLabel);
- DOM.appendChild(getElement(), icon);
- }
- }
-
- /**
- * Creates a label with the specified text and a icon in the left.
- *
- * @param image
- * the icon to add
- * @param text
- * the new label's text
- */
- public IconLabel(final AbstractImagePrototype image, final String text) {
- this(image, true);
- setTextImpl(text);
- }
-
- /**
- * Creates a label with the specified text and a icon in the left.
- *
- * @param image
- * the icon to add
- * @param text
- * the new label's text
- * @param wordWrap
- * <code>false</code> to disable word wrapping
- */
- public IconLabel(final AbstractImagePrototype image, final String text, final boolean wordWrap) {
- this(image, text);
- setWordWrapImpl(wordWrap);
- }
-
- /**
- * Creates a label with the specified text and a icon in the right.
- *
- * @param image
- * the icon to add
- * @param text
- * the new label's text
- */
- public IconLabel(final String text, final AbstractImagePrototype image) {
- this(image, false);
- setTextImpl(text);
- }
-
- /**
- * Creates a label with the specified text and a icon in the right.
- *
- * @param image
- * the icon to add
- * @param text
- * the new label's text
- * @param wordWrap
- * <code>false</code> to disable word wrapping
- */
- public IconLabel(final String text, final AbstractImagePrototype image, final boolean wordWrap) {
- this(text, image);
- setWordWrapImpl(wordWrap);
- }
-
- public HandlerRegistration addClickHandler(final ClickHandler handler) {
- return addDomHandler(handler, ClickEvent.getType());
- }
-
- public HandlerRegistration addDoubleClickHandler(final DoubleClickHandler handler) {
- return addDomHandler(handler, DoubleClickEvent.getType());
- }
-
- public HandlerRegistration addMouseDownHandler(final MouseDownHandler handler) {
- return addDomHandler(handler, MouseDownEvent.getType());
- }
-
- public HandlerRegistration addMouseMoveHandler(final MouseMoveHandler handler) {
- return addDomHandler(handler, MouseMoveEvent.getType());
- }
-
- public HandlerRegistration addMouseOutHandler(final MouseOutHandler handler) {
- return addDomHandler(handler, MouseOutEvent.getType());
- }
-
- public HandlerRegistration addMouseOverHandler(final MouseOverHandler handler) {
- return addDomHandler(handler, MouseOverEvent.getType());
- }
-
- public HandlerRegistration addMouseUpHandler(final MouseUpHandler handler) {
- return addDomHandler(handler, MouseUpEvent.getType());
- }
-
- public HandlerRegistration addMouseWheelHandler(final MouseWheelHandler handler) {
- return addDomHandler(handler, MouseWheelEvent.getType());
- }
-
- public HorizontalAlignmentConstant getHorizontalAlignment() {
- return horzAlign;
- }
-
- public String getText() {
- return DOM.getInnerText(textLabel);
- }
-
- public boolean getWordWrap() {
- return !DOM.getStyleAttribute(textLabel, "whiteSpace").equals("nowrap");
- }
-
- public void setColor(final String color) {
- DOM.setStyleAttribute(textLabel, "color", color);
- }
-
- public void setHorizontalAlignment(final HorizontalAlignmentConstant align) {
- horzAlign = align;
- DOM.setStyleAttribute(textLabel, "textAlign", align.getTextAlignString());
- }
-
- public void setIcon(final AbstractImagePrototype image) {
- setIconImpl(image);
- }
-
- public void setStyleNameToText(final String styleName) {
- DOM.setElementProperty(textLabel.<com.google.gwt.user.client.Element> cast(), "className", styleName);
- }
-
- public void setText(final String text) {
- setTextImpl(text);
- }
-
- @Override
- public void setTitle(final String title) {
- KuneUiUtils.setQuickTip(icon, title);
- KuneUiUtils.setQuickTip(textLabel, title);
- }
-
- public void setWordWrap(final boolean wrap) {
- setWordWrapImpl(wrap);
- }
-
- private Element getImageElement(final AbstractImagePrototype image) {
- return image.createImage().getElement();
- }
-
- private void setIconImpl(final AbstractImagePrototype image) {
- icon = getImageElement(image);
- }
-
- private void setTextImpl(final String text) {
- DOM.setInnerText(textLabel, text);
- }
-
- private void setWordWrapImpl(final boolean wrap) {
- DOM.setStyleAttribute(textLabel, "whiteSpace", wrap ? "normal" : "nowrap");
- }
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconLabelEditable.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,245 +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 org.ourproject.kune.platf.client.ui;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import com.calclab.suco.client.events.Listener2;
-import com.google.gwt.event.dom.client.BlurEvent;
-import com.google.gwt.event.dom.client.BlurHandler;
-import com.google.gwt.event.dom.client.ChangeEvent;
-import com.google.gwt.event.dom.client.ChangeHandler;
-import com.google.gwt.event.dom.client.ClickEvent;
-import com.google.gwt.event.dom.client.ClickHandler;
-import com.google.gwt.event.dom.client.DoubleClickEvent;
-import com.google.gwt.event.dom.client.DoubleClickHandler;
-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.HandlerRegistration;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.TextBox;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * @author vjrj
- *
- */
-public class IconLabelEditable extends Composite {
-
- private ClickHandler clickHandler;
- private String clickLabel;
- private String currentText;
- private String dblClickLabel;
- private DoubleClickHandler doubleClickHandler;
- // private Event2<String, String> onEditEvent;
- private TextBox editor;
- private HorizontalPanel hpanel;
- private final AbstractLabel label;
- private MouseOutHandler mouseOutHandler;
- private MouseOverHandler mouseOverHandler;
- private List<HandlerRegistration> registrations;
- private boolean useDoubleClick;
-
- public IconLabelEditable() {
- this("");
- }
-
- public IconLabelEditable(final AbstractImagePrototype icon, final String text, final boolean useDoubleClick) { // NO_UCD
- super();
- label = new IconLabel(icon, text);
- init(text, useDoubleClick);
- }
-
- public IconLabelEditable(final AbstractImagePrototype icon, final String text, final String targetToken, // NO_UCD
- final boolean useDoubleClick) {
- super();
- label = new IconHyperlink(icon, text, targetToken);
- init(text, useDoubleClick);
- }
-
- public IconLabelEditable(final String text) {
- this(text, false);
- }
-
- public IconLabelEditable(final String text, final boolean useDoubleClick) { // NO_UCD
- this(text, false, useDoubleClick);
- }
-
- public IconLabelEditable(final String text, final boolean wordWrap, final boolean useDoubleClick) { // NO_UCD
- super();
- label = new LabelWrapper(text, wordWrap);
- init(text, useDoubleClick);
- }
-
- private void afterEdit() {
- final String text = editor.getText();
- // onEditEvent.fire(currentText, text);
- setTextImpl(text);
- editor.setVisible(false);
- editor.setReadOnly(true);
- label.setVisible(true);
- label.removeStyleDependentName("high");
- }
-
- public void edit() {
- showEditor();
- editor.setFocus(true);
- }
-
- public String getText() {
- return label.getText();
- }
-
- private void init(final String text, final boolean useDoubleClick) {
- // this.onEditEvent = new Event2<String, String>("onLabelEdit");
- registrations = new ArrayList<HandlerRegistration>();
- dblClickLabel = "Double click to rename";
- clickLabel = "Click to rename";
- hpanel = new HorizontalPanel();
- hpanel.add((Widget) label);
- initWidget(hpanel);
- this.currentText = text;
- this.useDoubleClick = useDoubleClick;
- label.setStylePrimaryName("kune-EditableLabel");
- doubleClickHandler = new DoubleClickHandler() {
- @Override
- public void onDoubleClick(final DoubleClickEvent event) {
- showEditor();
- }
- };
- clickHandler = new ClickHandler() {
- @Override
- public void onClick(final ClickEvent event) {
- showEditor();
- }
- };
- mouseOverHandler = new MouseOverHandler() {
- @Override
- public void onMouseOver(final MouseOverEvent event) {
- label.addStyleDependentName("high");
- }
- };
- mouseOutHandler = new MouseOutHandler() {
- @Override
- public void onMouseOut(final MouseOutEvent event) {
- label.removeStyleDependentName("high");
- }
- };
- setEditableImpl(false);
- }
-
- public void onEdit(final Listener2<String, String> slot) {
- // onEditEvent.add(slot);
- }
-
- private void reset() {
- label.removeStyleDependentName("noneditable");
- label.removeStyleDependentName("editable");
- for (final HandlerRegistration reg : registrations) {
- reg.removeHandler();
- }
- registrations.clear();
- }
-
- /**
- * Sets the text tooltip showed to indicate "click to rename".
- *
- * @param text
- * the new click to rename label
- */
- public void setClickToRenameLabel(final String text) {
- this.clickLabel = text;
- }
-
- /**
- * Sets the text tooltip showed to indicate "double click to rename".
- *
- * @param text
- * the new double click to rename label
- */
- public void setDoubleClickToRenameLabel(final String text) {
- this.dblClickLabel = text;
- }
-
- public void setEditable(final boolean editable) {
- setEditableImpl(editable);
- }
-
- private void setEditableImpl(final boolean editable) {
- reset();
- if (editable) {
- if (useDoubleClick) {
- label.setTitle(dblClickLabel);
- registrations.add(label.addDoubleClickHandler(doubleClickHandler));
- } else {
- label.setTitle(clickLabel);
- registrations.add(label.addClickHandler(clickHandler));
- }
- registrations.add(label.addMouseOverHandler(mouseOverHandler));
- registrations.add(label.addMouseOutHandler(mouseOutHandler));
- label.addStyleDependentName("editable");
- } else {
- label.setTitle(null);
- label.addStyleDependentName("noneditable");
- }
- }
-
- public void setText(final String text) {
- setTextImpl(text);
- }
-
- private void setTextImpl(final String text) {
- this.currentText = text;
- label.setText(text);
- }
-
- private void showEditor() {
- final int hpWidth = hpanel.getParent().getOffsetWidth();
- label.setVisible(false);
- if (editor == null) {
- editor = new TextBox();
- editor.setStyleName("k-eil-edit");
- hpanel.add(editor);
- editor.addBlurHandler(new BlurHandler() {
- @Override
- public void onBlur(final BlurEvent event) {
- afterEdit();
- }
- });
- editor.addChangeHandler(new ChangeHandler() {
- @Override
- public void onChange(final ChangeEvent event) {
- editor.setFocus(false);
- }
- });
- }
- editor.setReadOnly(false);
- editor.setPixelSize(hpWidth < 100 ? 100 : hpWidth - 3, 21);
- editor.setText(currentText);
- editor.setVisible(true);
- editor.setFocus(true);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneStringUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneStringUtils.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneStringUtils.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,31 +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 org.ourproject.kune.platf.client.ui;
-
-import cc.kune.common.client.utils.TextUtils;
-
-/**
- * Use TextUtils
- *
- */
-@Deprecated
-public class KuneStringUtils extends TextUtils {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneUiUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneUiUtils.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/KuneUiUtils.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,144 +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 org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.core.Ext;
-import com.gwtext.client.widgets.ToolTip;
-import com.gwtext.client.widgets.form.Field;
-
-@Deprecated
-public final class KuneUiUtils {
-
- public enum IconPosition {
- left, right
- }
-
- public static void focusOnField(final Field field) {
- new Timer() {
- @Override
- public void run() {
- field.focus(true);
- }
- }.schedule(50);
- }
-
- public static String genQuickTipLabel(final String labelText, final String tipTitle, final String tipText) {
- String tipHtml = "<span style=\"vertical-align: middle;\" ext:qtip=\"" + tipText + "\"";
- if (tipTitle != null && tipTitle.length() > 0) {
- tipHtml += " ext:qtitle=\"" + tipTitle + "\"";
- }
- tipHtml += ">";
- tipHtml += labelText;
- tipHtml += "</span>";
- return tipHtml;
- }
-
- public static String genQuickTipLabel(final String labelText, final String tipTitle, final String tipText,
- final AbstractImagePrototype icon, final IconPosition iconPosition) {
- String tipHtml = "<span style=\"vertical-align: middle;\" ext:qtip=\"" + tipText + "\"";
- if (tipTitle != null && tipTitle.length() > 0) {
- tipHtml += " ext:qtitle=\"" + tipTitle + "\"";
- }
- tipHtml += ">";
- final Image iconImg = new Image();
- icon.applyTo(iconImg);
- iconImg.setStyleName("vamiddle");
- // setQuickTip(iconImg, tipText, tipTitle);
-
- final ToolTip tooltip = new ToolTip();
- tooltip.setHtml(tipText);
- tooltip.setWidth(250);
- tooltip.applyTo(iconImg.getElement());
-
- if (iconPosition.equals(IconPosition.left)) {
- tipHtml += iconImg.toString();
- tipHtml += " ";
- tipHtml += labelText;
- } else if (iconPosition.equals(IconPosition.right)) {
- tipHtml += labelText;
- tipHtml += " ";
- tipHtml += iconImg.toString();
- }
- tipHtml += "</span>";
- return tipHtml;
- }
-
- public static String genQuickTipWithImage(final String imageResizedUrl, final int size) {
- return new Image(imageResizedUrl).toString();
- }
-
- /**
- * Use widget.setTitle if you don't want to use extjs (but remember that
- * title is limited to 64chars).
- *
- * Bug: extjs quicktips don't work with images or span inside divs (like
- * pushbutton). See: http://extjs.com/forum/showthread.php?t=22293
- * http://extjs.com/forum/showthread.php?t=5200
- *
- * @param element
- * @param tip
- */
- public static void setQuickTip(final Element element, final String tipText) {
- setQuickTip(element, tipText, null);
- }
-
- public static void setQuickTip(final Element element, final String tipText, final String tipTitle) {
- // If we don't want to use ext, use 'title' instead (limited to 64
- // chars)
- if (tipText == null || tipText.length() == 0) {
- DOM.removeElementAttribute(element, "ext:qtip");
- } else {
- final ToolTip tip = new ToolTip();
- tip.setHtml(tipText);
- if (tipTitle != null) {
- tip.setTitle(tipTitle);
- }
- tip.applyTo(element);
- // check size here?
- // String newTip = "<div style='min-width: 35px'>" + tip + "</div>";
- }
- }
-
- public static void setQuickTip(final Widget widget, final String tip) {
- setQuickTip(widget.getElement(), tip);
- }
-
- public static void setQuickTip(final Widget widget, final String tip, final String tipTitle) {
- setQuickTip(widget.getElement(), tip, tipTitle);
- }
-
- /**
- * Disables text selection on element
- *
- * @param element
- */
- public static void setUnselectable(final Element element) {
- Ext.get(element).unselectable();
- }
-
- private KuneUiUtils() {
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/LabelWrapper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/LabelWrapper.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/LabelWrapper.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,50 +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 org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.event.dom.client.DoubleClickEvent;
-import com.google.gwt.event.dom.client.DoubleClickHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.ui.Label;
-
-public class LabelWrapper extends Label implements AbstractLabel {
-
- public LabelWrapper() {
- super();
- }
-
- public LabelWrapper(final String text) {
- super(text);
- }
-
- public LabelWrapper(final String text, final boolean wordWrap) {
- super(text, wordWrap);
- }
-
- public HandlerRegistration addDoubleClickHandler(final DoubleClickHandler handler) {
- return addDomHandler(handler, DoubleClickEvent.getType());
- }
-
- public void setColor(final String color) {
- DOM.setStyleAttribute(super.getElement(), "color", color);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItem.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,48 +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 org.ourproject.kune.platf.client.ui;
-
-import com.calclab.suco.client.events.Listener;
-
-public class MenuItem<T> {
-
- final String icon;
- final String title;
- private final Listener<T> listener;
-
- public MenuItem(final String icon, final String title, final Listener<T> listener) {
- this.icon = icon;
- this.title = title;
- this.listener = listener;
-
- }
-
- public void fire(final T id) {
- listener.onEvent(id);
- }
-
- public String getIcon() {
- return icon;
- }
-
- public String getTitle() {
- return title;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItemCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItemCollection.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/MenuItemCollection.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,49 +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/>.
- *
- */
-/*
- *
- * ((e)) emite: A pure gwt (Google Web Toolkit) xmpp (jabber) library
- *
- * (c) 2008-2009 The emite development team (see CREDITS for details)
- * This file is part of emite.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Lesser 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 Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.platf.client.ui;
-
-import java.util.ArrayList;
-
-public class MenuItemCollection<T> extends ArrayList<MenuItem<T>> {
-
- private static final long serialVersionUID = -4719030300216601947L;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/QuickTipsHelper.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,36 +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 org.ourproject.kune.platf.client.ui;
-
-import com.gwtext.client.widgets.QuickTip;
-import com.gwtext.client.widgets.QuickTips;
-
-public class QuickTipsHelper {
-
- public QuickTipsHelper() {
- QuickTips.init();
- final QuickTip quickTipInstance = QuickTips.getQuickTip();
- quickTipInstance.setInterceptTitles(true);
- quickTipInstance.setDismissDelay(7000);
- quickTipInstance.setHideDelay(400);
- quickTipInstance.setMinWidth(100);
- quickTipInstance.setShowDelay(1500);
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/RoundedPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,512 +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/>.
- *
- */
-/*
- * Copyright 2007 Hilbrand Bouwkamp, hs(a)bouwkamp.com
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- \*/
-package org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.Widget;
-
-/**
- * The <code>RoundedPanel</code> class adds similar rounded corners, as seen in
- * other Google applications, to a widget. This is done by adding several
- * <code>div</code> Elements around a Widget. The HTML code roughly for a corner
- * height 2 looks as follows:
- *
- * <pre>
- * <div>
- * <div style="margin:0 2px"></div>
- * <div style="margin:0 1px"></div>
- * <div>your widget</div>
- * <div style="margin:0 1px"></div>
- * <div style="margin:0 2px"></div>
- * </div>
- * </pre>
- *
- * To add the rounded corners to a widget start simply wrap your own widget in
- * the <code>RoundedPanel</code> class, for example with all corners rounded:
- *
- * <pre>
- * // all 4 corners are rounded.
- * RoundedPanel rp = new RoundedPanel(yourWidget);
- * // use rp where you would use 'yourWidget' otherwise
- * </pre>
- *
- * Or with custom set corners, like only on the left:
- *
- * <pre>
- * // custom set corners
- * RoundedPanel rp = new RoundedPanel(yourWidget, RoundedPanel.LEFT);
- * // use rp where you would use 'yourWidget' otherwise
- * </pre>
- *
- * By default the height of the corners is 2px. It is possible to set a
- * different height at construction time. The height can be a value between and
- * including 1 and 9. This value doesn't correspond exactly with the height,
- * e.g. 9 is 12px heigh.
- *
- * <pre>
- * // all 4 corners are rounded and height index 5
- * RoundedPanel rp = new RoundedPanel(yourWidget, ALL, 5);
- * // use rp where you would use 'yourWidget' otherwise
- * </pre>
- *
- * Programmatically set the color of the corners with
- * {@link #setCornerColor(String)}:
- *
- * <pre>
- * // all 4 corners are rounded.
- * RoundedPanel rp = new RoundedPanel(yourWidget);
- * rp.setCornerColor("red");
- * </pre>
- *
- * Default the css style name of the rounded corner divs is <code>cbg-RP</code>.
- * Use it to set the colors of the corner. For example:
- *
- * <pre>
- * .cbg-RP { background-color:#c3d9ff; }
- * </pre>
- *
- * A custom style might be needed when the corners are visible only when a panel
- * is selected (see the KitchenSink example modification below). Use the
- * <code>setCornerStyleName</code> method to set the custom style name. For
- * example set a custom style <code>my-RP</code> and add something like the
- * following to the stylesheet:
- *
- * <pre>
- * .selected .my-RP { background-color:#c3d9ff; }
- * </pre>
- *
- * <h3>Adding rounded corners to DialogBox widgets</h3> Adding rounded corners
- * to a <code>DialogBox</code> is somewhat more complicated. The problem with
- * <code>DialogBox</code> is that it uses a private panel and the
- * <code>RoundedPanel</code> should be applied to this private
- * <code>Panel</code>. To add the rounded corners to a <code>DialogBox</code>
- * you have to rewrite the implementation of the <code>DialogBox</code>. For the
- * <code>DialogBox</code> widget this can be done as follows. First create a new
- * class like <code>RoundedDialogBox</code> and copy the code from the original
- * <code>DialogBox</code> (Please take the copyright of this class into
- * account). Next make the following changes to the code:
- *
- * <pre>
- * // Private variable for RoundedPanel
- * private RoundedPanel rp;
- * </pre>
- *
- * In the constructor change:
- *
- * <pre>
- * super.add(panel);
- * </pre>
- *
- * into:
- *
- * <pre>
- * rp = new RoundedPanel(panel);
- * super.add(rp);
- * </pre>
- *
- * Next change the style, otherwise the style of the dialog box is applied to
- * the rounded lines too. Do this by changing the following line:
- *
- * <pre>
- * setStyleName("gwt-DialogBox");
- * </pre>
- *
- * into:
- *
- * <pre>
- * panel.setStyleName("gwt-DialogBox");
- * </pre>
- *
- * In your css add the color of the border, something like:
- *
- * <pre>
- * .cbg-RP { background-color:#AAAAAA; }
- * </pre>
- *
- * There seems to be a problem with the width under IE. The RoundedPanel divs
- * don't follow the width of the dialog. To fix this change the
- * <code>show</code> method as follows:
- *
- * <pre>
- * public void show() {
- * super.show();
- * // (The width must be set after the super.show() otherwise it will be 0).
- * // NOTE: As of GWT 1.1 the .getOffsetWidth() returns 0 at this point.
- * // This is different with earlier versions of GWT. Disable the line will make
- * // the rounded corners work in at least Firefox 1.5, but not in IE.
- * // I'm looking into this issue.
- * rp.setWidth(panel.getOffsetWidth() + "px");
- * }
- * </pre>
- *
- * Now by extending your own dialog class on this <code>RoundedDialogBox</code>
- * instead of the original <code>DialogBox</code> you will have rounded corners
- * around your dialog.
- *
- *
- * @author Hilbrand Bouwkamp(hs(a)bouwkamp.com)
- * @version 1.3
- */
-public class RoundedPanel extends SimplePanel {
-
- private static final String _1PX = "1px";
- private static final String _2PX = "2px";
- private static final String _3PX = "3px";
- private static final String _4PX = "4px";
- private static final String _5PX = "5px";
- private static final String _6PX = "6px";
-
- /**
- * <code>TOPLEFT</code> top left rounded corner
- */
- public final static int TOPLEFT = 1;
-
- /**
- * <code>TOPRIGHT</code> top right rounded corner
- */
- public final static int TOPRIGHT = 2;
-
- /**
- * <code>BOTTOMLEFT</code> bottom left rounded corner
- */
- public final static int BOTTOMLEFT = 4;
-
- /**
- * <code>BOTTOMRIGHT</code> bottom right rounded corner
- */
- public final static int BOTTOMRIGHT = 8;
-
- /**
- * <code>BOTTOM</code> rounded corners at the top
- */
- public final static int TOP = TOPLEFT | TOPRIGHT;
-
- /**
- * <code>TOP</code> rounded corners at the bottom
- */
- public final static int BOTTOM = BOTTOMLEFT | BOTTOMRIGHT;
-
- /**
- * <code>LEFT</code> rounded corners on the left side
- */
- public final static int LEFT = TOPLEFT | BOTTOMLEFT;
-
- /**
- * <code>RIGHT</code> rounded corners on the right side
- */
- public final static int RIGHT = TOPRIGHT | BOTTOMRIGHT;
-
- /**
- * <code>ALL</code> rounded corners on all sides
- */
- public final static int ALL = TOP | BOTTOM;
-
- /**
- * Default border style
- */
- private final static String RPSTYLE = "cbg-RP";
-
- /**
- * Lookup table for corner border width
- */
- private final static String[][] CORNERBORDER = { { _1PX }, { _1PX, _1PX }, { _1PX, _1PX, _1PX },
- { _1PX, _1PX, _1PX, _1PX }, { _1PX, _1PX, _1PX, _2PX, _1PX }, { _1PX, _1PX, _1PX, _1PX, _2PX, _1PX },
- { _1PX, _1PX, _1PX, _1PX, _1PX, _2PX, _1PX }, { _1PX, _1PX, _1PX, _1PX, _1PX, _2PX, _2PX, _1PX },
- { _1PX, _1PX, _1PX, _1PX, _1PX, _1PX, _2PX, _3PX, _1PX } };
-
- /**
- * Lookup table for corner height
- */
- private final static String[][] CORNERHEIGHT = { { _1PX }, { _1PX, _1PX }, { _1PX, _1PX, _1PX },
- { _1PX, _1PX, _1PX, _1PX }, { _2PX, _1PX, _1PX, _1PX, _1PX }, { _2PX, _1PX, _1PX, _1PX, _1PX, _1PX },
- { _2PX, _1PX, _1PX, _1PX, _1PX, _1PX, _1PX }, { _2PX, _1PX, _1PX, _1PX, _1PX, _1PX, _1PX, _1PX },
- { _3PX, _2PX, _1PX, _1PX, _1PX, _1PX, _1PX, _1PX, _1PX } };
-
- /**
- * Lookup table for corner margin
- */
- private final static String[][] CORNERMARGIN = { { _1PX }, { _1PX, _2PX }, { _1PX, _2PX, _3PX },
- { _1PX, _2PX, _3PX, _4PX }, { _1PX, _2PX, _3PX, _4PX, _6PX }, { _1PX, _2PX, _3PX, _4PX, _5PX, "7px" },
- { _1PX, _2PX, _3PX, _4PX, _5PX, _6PX, "8px" }, { _1PX, _2PX, _3PX, _4PX, _5PX, _6PX, "8px", "10px" },
- { _1PX, _2PX, _3PX, _4PX, _5PX, _6PX, "7px", "9px", "12px" }, };
-
- /**
- * Element array containing all div elements of the top corner div's.
- */
- protected final Element[] divt;
-
- /**
- * Element array containing all div elements of the bottom corner div's.
- */
- protected final Element[] divb;
-
- /**
- * Index of the corner height.
- */
- protected final int cornerHeight;
-
- /**
- * Index of which corners are set.
- */
- protected final int corners;
-
- private final Element body; // body of widget
- private final Element divElement; // div element containing widget
-
- /**
- * Creates a new <code>RoundedPanel</code> with all corners rounded and
- * height of corners 2px. Use <code>setWidget</code> to add the widget.
- */
- public RoundedPanel() {
- this(ALL, 2);
- }
-
- /**
- * Creates a new <code>RoundedPanel</code> with custom rounding and height
- * of corners 2px but with no widget set. Use <code>setWidget</code> to add
- * widget.
- *
- * Every combination of corners can be set via <code>corners</code>. Use the
- * static constants to set the corners. For example, to create a panel with
- * only rounded corners at the left, use:
- *
- * <code>new RoundedPanel(yourWidget, RoundedPanel.LEFT);</code>
- *
- * @param corners
- * set custom rounded corners
- */
- public RoundedPanel(final int corners) {
- this(corners, 2);
- }
-
- /**
- * Creates a new <code>RoundedPanel</code> with custom rounding and custom
- * height of the corners but with no widget set. Height can be value from 1
- * to 9. The height for a value 5 or higher is actually larger, e.g. for 5
- * the height is 6px. Use {@link #setWidget(Widget)} to add widget.
- *
- * @param corners
- * set custom rounded corners
- * @param cornerHeight
- * height index between and including 1 and 9
- * @throws IndexOutOfBoundsException
- * when cornerHeight below 1 or above 9
- */
- public RoundedPanel(final int corners, final int cornerHeight) {
- super(DOM.createDiv());
- body = getElement();
- if (cornerHeight < 1 || cornerHeight > 9) {
- throw new IndexOutOfBoundsException("RoundedPanel height range between and including 1 and 9");
- }
- this.cornerHeight = cornerHeight;
- divt = new Element[cornerHeight];
- divb = new Element[cornerHeight];
- this.corners = corners;
- if (inMask(corners, TOP)) {
- final int ct = corners & TOP;
-
- for (int i = 0; i < cornerHeight; ++i) {
- divt[i] = addLine(ct, cornerHeight - (i + 1));
- }
- }
- divElement = DOM.createDiv();
- DOM.appendChild(body, divElement);
- if (inMask(corners, BOTTOM)) {
- final int cb = corners & BOTTOM;
-
- for (int i = cornerHeight - 1; i >= 0; --i) {
- divb[i] = addLine(cb, cornerHeight - (i + 1));
- }
- }
- // @PMD:REVIEWED:ConstructorCallsOverridableMethod: by vjrj on 21/05/09
- // 14:17
- setCornerStyleName(RPSTYLE);
- }
-
- /**
- * Creates a new <code>RoundedPanel</code> with all corners rounded and
- * height 2px on the widget <code>w</code>.
- *
- * @param w
- * widget to add corners to
- */
- public RoundedPanel(final Widget w) {
- this(w, ALL);
- }
-
- /**
- * Creates a new <code>RoundedPanel</code> with custom rounded corners and
- * height 2px on the widget <code>w</code>.
- *
- * @param w
- * widget to add corners to
- * @param corners
- * set custom rounded corners
- */
- public RoundedPanel(final Widget w, final int corners) {
- this(w, corners, 2);
- }
-
- /**
- * Creates a new <code>RoundedPanel</code> with custom rounded corners and
- * custom height on widget <code>w</code>.
- *
- * @param w
- * widget to add corners to
- * @param corners
- * set custom rounded corners
- * @param cornerHeight
- * height index between and including 1 and 9
- */
- public RoundedPanel(final Widget w, final int corners, final int cornerHeight) {
- this(corners, cornerHeight);
- setWidget(w);
- }
-
- /**
- * <p>
- * Set the bolder color of the rounded corner by setting the background
- * color of the div's.
- * </p>
- *
- * @param borderColor
- * border color
- */
- public void setCornerColor(final String borderColor) {
- if (null != divt[0]) {
- for (int i = 0; i < cornerHeight; ++i) {
- DOM.setStyleAttribute(divt[i], "backgroundColor", borderColor);
- }
- }
- if (null != divb[0]) {
- for (int i = 0; i < cornerHeight; ++i) {
- DOM.setStyleAttribute(divb[i], "backgroundColor", borderColor);
- }
- }
- }
-
- /**
- * Set the css style name of the rounded corners div's. Default the css
- * stylename is <code>cbg-RP</code>. Use it to set the colors of the corner.
- * For example: <code>.cbg-RP { background-color:#c3d9ff; }</code>.
- *
- * A custom style might be needed when the corners are visible only when a
- * panel is selected. Use this method to set the custom style name and add
- * something like the following to the stylesheet:
- *
- * <code>.selected .cbg-RP { background-color:#c3d9ff; }</code> Setting the
- * color is also possible via the method {@link #setCornerColor(String)}.
- *
- * @param style
- * css style name
- */
- public void setCornerStyleName(final String style) {
- if (null != divt[0]) {
- for (int i = 0; i < cornerHeight; ++i) {
- DOM.setElementProperty(divt[i], "className", style);
- }
- }
- if (null != divb[0]) {
- for (int i = 0; i < cornerHeight; ++i) {
- DOM.setElementProperty(divb[i], "className", style);
- }
- }
- }
-
- /**
- * Set the style of the RoundedPanel. In most cases this is not necessary
- * and setting the style on the widget to which the
- * <code>RoundedPanel</code> is applied should be set, as is done when not
- * using the <code>RoundedPanel</code>
- *
- * @param style
- * css style name
- */
- @Override
- public void setStyleName(final String style) {
- DOM.setElementProperty(body, "className", style);
- }
-
- /**
- * Overwrite of parent getContainerElement()
- */
- @Override
- protected Element getContainerElement() {
- return divElement;
- }
-
- /**
- * Creates div element representing part of the rounded corner.
- *
- * @param corner
- * corner mask to set rounded corner
- * @param heightIndex
- * margin width for line
- */
- private Element addLine(final int corner, final int heightIndex) {
- // margin 2 fields : top/bottom right/left => "0 <width>px"
- // margin 4 fields : top right bottom left => "0 <width>px 0 <width>px"
- final String margin = corner == TOP || corner == BOTTOM ? "0 "
- + RoundedPanel.CORNERMARGIN[cornerHeight - 1][heightIndex] : inMask(corner, LEFT) ? "0 0 0 "
- + RoundedPanel.CORNERMARGIN[cornerHeight - 1][heightIndex] : "0 "
- + RoundedPanel.CORNERMARGIN[cornerHeight - 1][heightIndex] + " 0 0";
- final Element div = DOM.createDiv();
-
- DOM.setStyleAttribute(div, "fontSize", "0px");
- DOM.setStyleAttribute(div, "height", RoundedPanel.CORNERHEIGHT[cornerHeight - 1][heightIndex]);
- DOM.setStyleAttribute(div, "borderWidth", "0 " + RoundedPanel.CORNERBORDER[cornerHeight - 1][heightIndex]);
- DOM.setStyleAttribute(div, "lineHeight", RoundedPanel.CORNERHEIGHT[cornerHeight - 1][heightIndex]);
- DOM.setStyleAttribute(div, "margin", margin);
- DOM.setInnerHTML(div, " ");
- DOM.appendChild(body, div);
- return div;
- }
-
- /**
- * Convenience method to check if given <code>input</code> is with the
- * <code>mask</code>.
- *
- * @param input
- * input to check
- * @param mask
- * mask to check against
- * @return true if input within mask
- */
- private boolean inMask(final int input, final int mask) {
- return (input & mask) > 0;
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/SimpleToolbar.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,107 +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 org.ourproject.kune.platf.client.ui;
-
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HasVerticalAlignment.VerticalAlignmentConstant;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class SimpleToolbar extends Composite implements AbstractToolbar {
-
- private final HorizontalPanel childPanel;
- private final HorizontalPanel mainPanel;
-
- public SimpleToolbar() {
- mainPanel = new HorizontalPanel();
- childPanel = new HorizontalPanel();
- mainPanel.add(childPanel);
- initWidget(mainPanel);
- mainPanel.setWidth("100%");
- }
-
- public void add(final Widget widget) {
- childPanel.add(widget);
- childPanel.setCellVerticalAlignment(widget, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void add(final Widget widget, VerticalAlignmentConstant valign) {
- childPanel.add(widget);
- childPanel.setCellVerticalAlignment(widget, valign);
- }
-
- public Widget addFill() {
- final Label emptyLabel = new Label("");
- this.add(emptyLabel);
- childPanel.setCellWidth(emptyLabel, "100%");
- return emptyLabel;
- }
-
- public Widget addSeparator() {
- final Label emptyLabel = new Label("");
- emptyLabel.setStyleName("ytb-sep");
- emptyLabel.addStyleName("k-toolbar-sep");
- this.add(emptyLabel);
- return emptyLabel;
- }
-
- public Widget addSpacer() {
- final Label emptyLabel = new Label("");
- emptyLabel.setStyleName("ytb-spacer");
- this.add(emptyLabel);
- return emptyLabel;
- }
-
- public void insert(final Widget widget, int position) {
- childPanel.insert(widget, position);
- childPanel.setCellVerticalAlignment(widget, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public void remove(final Widget widget) {
- childPanel.remove(widget);
- }
-
- public void removeAll() {
- childPanel.clear();
- }
-
- public void setBlankStyle() {
- setBasicStyle();
- addStyleName("k-blank-toolbar");
- }
-
- @Override
- public void setHeight(String height) {
- mainPanel.setHeight(height);
- mainPanel.setCellHeight(childPanel, height);
- }
-
- public void setNormalStyle() {
- setBasicStyle();
- addStyleName("k-toolbar-bottom-line");
- }
-
- private void setBasicStyle() {
- setStyleName("x-toolbar");
- addStyleName("x-panel");
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/AbstractPopupPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/AbstractPopupPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/AbstractPopupPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,83 +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 org.ourproject.kune.platf.client.ui.dialogs;
-
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.ui.PopupPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public abstract class AbstractPopupPanel {
-
- private PopupPanel popupPalette;
- protected Widget widget;
-
- private final boolean autoHide;
- private final boolean modal;
-
- public AbstractPopupPanel() {
- this(true, true);
- }
-
- public AbstractPopupPanel(final boolean autohide) {
- this(autohide, false);
- }
-
- public AbstractPopupPanel(final boolean autohide, final boolean modal) {
- this.autoHide = autohide;
- this.modal = modal;
- }
-
- public void addStyleName(final String style) {
- assert popupPalette != null;
- popupPalette.addStyleName(style);
- }
-
- public void hide() {
- if (popupPalette != null) {
- popupPalette.hide();
- }
- }
-
- public boolean isVisible() {
- if (popupPalette != null && popupPalette.isVisible()) {
- return true;
- }
- return false;
- }
-
- public void show(final int left, final int top) {
- popupPalette = new PopupPanel(autoHide, modal);
- popupPalette.addStyleName("k-def-popup");
- if (widget == null) {
- createWidget();
- }
- popupPalette.setWidget(widget);
- popupPalette.setPopupPositionAndShow(new PopupPanel.PositionCallback() {
- public void setPosition(final int offsetWidth, final int offsetHeight) {
- final int maxLeft = Window.getClientWidth() - offsetWidth;
- final int maxTop = Window.getClientHeight() - offsetHeight;
- popupPalette.setPopupPosition(left < maxLeft ? left : maxLeft, top < maxTop ? top : maxTop);
- }
- });
- }
-
- protected abstract void createWidget();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,100 +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 org.ourproject.kune.platf.client.ui.dialogs;
-
-import com.gwtext.client.core.Ext;
-import com.gwtext.client.core.Position;
-import com.gwtext.client.widgets.BoxComponent;
-import com.gwtext.client.widgets.Component;
-import com.gwtext.client.widgets.Window;
-import com.gwtext.client.widgets.event.WindowListenerAdapter;
-
-public class BasicDialog extends Window {
-
- public BasicDialog(final String caption, final boolean modal) {
- this(Ext.generateId(), caption, modal, false);
- }
-
- public BasicDialog(final String caption, final boolean modal, final boolean autoScroll, final int width,
- final int height) {
- this(Ext.generateId(), caption, modal, autoScroll, width, height, width, height);
- }
-
- public BasicDialog(final String caption, final boolean modal, final boolean autoScroll, final int width,
- final int height, final int minWidth, final int minHeight) {
- this(Ext.generateId(), caption, modal, autoScroll, width, height, minWidth, minHeight);
- }
-
- public BasicDialog(final String id, final String caption, final boolean modal) {
- this(id, caption, modal, false);
- }
-
- public BasicDialog(final String id, final String caption, final boolean modal, final boolean autoScroll) {
- setId(id);
- setBorder(false);
- setAutoWidth(true);
- // Param values
- setTitle(caption);
- setModal(modal);
- setAutoScroll(autoScroll);
- // Def values
- setShadow(true);
- setPlain(true);
- setClosable(true);
- setCollapsible(true);
- setResizable(true);
- setCloseAction(Window.HIDE);
- setButtonAlign(Position.RIGHT);
- addListener(new WindowListenerAdapter() {
- @Override
- public void onMove(final BoxComponent component, final int x, final int y) {
- checkPosition(component, x, y);
- }
-
- @Override
- public void onShow(final Component component) {
- checkPosition(BasicDialog.this, component.getAbsoluteLeft(), component.getAbsoluteTop());
- }
-
- private void checkPosition(final BoxComponent component, final int x, final int y) {
- if (y < 0) {
- component.setPagePosition(x, 0);
- }
- }
- });
- }
-
- public BasicDialog(final String id, final String caption, final boolean modal, final boolean autoScroll,
- final int width, final int height) {
- this(id, caption, modal, autoScroll, width, height, width, height);
- }
-
- public BasicDialog(final String id, final String caption, final boolean modal, final boolean autoScroll,
- final int width, final int height, final int minWidth, final int minHeight) {
- this(id, caption, modal, autoScroll);
- setAutoWidth(false);
- // Param values
- setWidth(width);
- setHeight(height);
- setMinWidth(minWidth);
- setMinHeight(minHeight);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicPopupPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicPopupPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/BasicPopupPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,46 +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 org.ourproject.kune.platf.client.ui.dialogs;
-
-import com.google.gwt.user.client.ui.Widget;
-
-public class BasicPopupPanel extends AbstractPopupPanel {
-
- public BasicPopupPanel() {
- super();
- }
-
- public BasicPopupPanel(final boolean autohide) {
- super(autohide);
- }
-
- public BasicPopupPanel(final boolean autohide, final boolean modal) {
- super(autohide, modal);
- }
-
- public void setWidget(final Widget widget) {
- this.widget = widget;
- }
-
- @Override
- protected void createWidget() {
- // Nothing
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,156 +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 org.ourproject.kune.platf.client.ui.dialogs;
-
-import com.gwtext.client.core.Position;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.Component;
-import com.gwtext.client.widgets.PaddedPanel;
-import com.gwtext.client.widgets.form.Field;
-import com.gwtext.client.widgets.form.FieldSet;
-import com.gwtext.client.widgets.form.FormPanel;
-import com.gwtext.client.widgets.form.Label;
-import com.gwtext.client.widgets.form.event.FormPanelListener;
-
-public class DefaultForm {
-
- public static final int DEF_FIELD_WIDTH = 200;
- public static final int DEF_SMALL_FIELD_WIDTH = 100;
- public static final int DEF_XSMALL_FIELD_WIDTH = 50;
- public static final int DEF_MEDIUM_FIELD_WIDTH = 150;
- public static final int DEF_FIELD_LABEL_WITH = 75;
-
- private final FormPanel form;
-
- public DefaultForm() {
- this(Position.RIGHT);
- }
-
- public DefaultForm(Position buttonAlign) {
- form = new FormPanel();
- form.setFrame(true);
- form.setPaddings(10);
- form.setBorder(false);
- form.setLabelWidth(DEF_FIELD_LABEL_WITH);
- form.setLabelAlign(Position.RIGHT);
- form.setButtonAlign(buttonAlign);
- form.setHeader(false);
- }
-
- public DefaultForm(String title) {
- this(title, Position.RIGHT);
- }
-
- public DefaultForm(String title, Position buttonAlign) {
- this(buttonAlign);
- form.setTitle(title);
- }
-
- public void add(final Field field) {
- form.add(field);
- }
-
- public void add(final FieldSet fieldset) {
- form.add(fieldset);
- }
-
- public void add(Label label) {
- form.add(label);
- }
-
- public void add(PaddedPanel paddedPanel) {
- form.add(paddedPanel);
- }
-
- public void addButton(final Button button) {
- form.addButton(button);
- }
-
- public void addListener(FormPanelListener listener) {
- form.addListener(listener);
- }
-
- public void addStyleName(final String cls) {
- form.addStyleName(cls);
- }
-
- public Field findField(String id) {
- return form.getForm().findField(id);
- }
-
- public FormPanel getFormPanel() {
- return form;
- }
-
- public void insert(int index, Component component) {
- form.insert(index, component);
- }
-
- public boolean isValid() {
- return form.getForm().isValid();
- }
-
- public void removeStyleName(final String cls) {
- form.removeStyleName(cls);
- }
-
- public void reset() {
- form.getForm().reset();
- }
-
- public void setAutoHeight(final boolean autoHeight) {
- form.setAutoHeight(autoHeight);
- }
-
- public void setAutoWidth(final boolean autoWidth) {
- form.setAutoWidth(autoWidth);
- }
-
- public void setFrame(boolean frame) {
- form.setFrame(frame);
- }
-
- public void setHeight(int height) {
- form.setHeight(height);
- }
-
- public void setHideLabels(boolean hide) {
- form.setHideLabels(hide);
- }
-
- public void setIconCls(String iconCls) {
- form.setIconCls(iconCls);
- }
-
- public void setPaddings(int padding) {
- form.setPaddings(padding);
- }
-
- public void setWidth(int width) {
- form.setWidth(width);
- }
-
- public void validate() {
- final Field[] fields = form.getFields();
- for (Field field : fields) {
- field.validate();
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultFormUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultFormUtils.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultFormUtils.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,58 +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 org.ourproject.kune.platf.client.ui.dialogs;
-
-import org.ourproject.kune.platf.client.ui.KuneUiUtils;
-
-import com.gwtext.client.widgets.ToolTip;
-import com.gwtext.client.widgets.form.FieldSet;
-import com.gwtext.client.widgets.form.Radio;
-
-public class DefaultFormUtils {
-
- public static String br() {
- return "<br/>";
- }
-
- public static String brbr() {
- return "<br/><br/>";
- }
-
- public static Radio createRadio(final FieldSet fieldSet, final String radioLabel, final String radioFieldName,
- final String radioTip, final String id) {
- Radio radio = new Radio();
- radio.setName(radioFieldName);
- radio.setAutoCreate(true);
- radio.setHideLabel(true);
- radio.setId(id);
- fieldSet.add(radio);
-
- if (radioTip != null) {
- radio.setBoxLabel(KuneUiUtils.genQuickTipLabel(radioLabel, null, radioTip));
- ToolTip tooltip = new ToolTip();
- tooltip.setHtml(radioTip);
- tooltip.setWidth(250);
- tooltip.applyTo(radio);
- } else {
- radio.setBoxLabel(radioLabel);
- }
- return radio;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultTabbedForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultTabbedForm.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultTabbedForm.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,71 +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 org.ourproject.kune.platf.client.ui.dialogs;
-
-import com.gwtext.client.core.Position;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.Component;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.TabPanel;
-import com.gwtext.client.widgets.form.Form;
-import com.gwtext.client.widgets.form.FormPanel;
-import com.gwtext.client.widgets.layout.FormLayout;
-
-public class DefaultTabbedForm {
- private final FormPanel formPanel;
- private final TabPanel tabPanel;
-
- public DefaultTabbedForm(final int width, final int labelWidth) {
- formPanel = new FormPanel();
- formPanel.setFrame(true);
- formPanel.setLabelWidth(labelWidth);
- formPanel.setBorder(false);
- formPanel.setWidth(width);
- formPanel.setButtonAlign(Position.RIGHT);
-
- tabPanel = new TabPanel();
- tabPanel.setActiveTab(0);
- formPanel.add(tabPanel);
- }
-
- public void addButton(final Button button) {
- formPanel.addButton(button);
- }
-
- public void addTab(final String title, final Panel tab) {
- tab.setTitle(title);
- tab.setLayout(new FormLayout());
- tab.setAutoHeight(true);
- tab.setPaddings(10);
- tabPanel.add(tab);
- if (formPanel.isRendered()) {
- formPanel.doLayout();
- }
- }
-
- public Form getForm() {
- return formPanel.getForm();
- }
-
- public Component getPanel() {
- return formPanel;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/ExtendedDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/ExtendedDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/ExtendedDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,93 +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 org.ourproject.kune.platf.client.ui.dialogs;
-
-import com.calclab.suco.client.events.Listener0;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.core.Ext;
-import com.gwtext.client.core.Position;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.layout.FitLayout;
-
-public class ExtendedDialog extends BasicDialog {
-
- private final Button cancel;
- private final Button firstButton;
-
- public ExtendedDialog(final String dialogId, final String title, final boolean modal,
- final boolean autoscroll, final int width, final int heigth, final String icon,
- final String firstButtonTitle, final String cancelButtonTitle, final Listener0 onFirstButtonClick,
- final Listener0 onCancelButtonClick, final int tabIndexStart) {
- this(dialogId, title, modal, autoscroll, width, heigth, icon, firstButtonTitle, Ext.generateId(),
- cancelButtonTitle, Ext.generateId(), onFirstButtonClick, onCancelButtonClick, tabIndexStart);
- }
-
- public ExtendedDialog(final String dialogId, final String title, final boolean modal,
- final boolean autoscroll, final int width, final int heigth, final String icon,
- final String firstButtonTitle, final String firstButtonId, final String cancelButtonTitle,
- final String cancelButtonId, final Listener0 onFirstButtonClick, final Listener0 onCancelButtonClick,
- final int tabIndexStart) {
- super(dialogId, title, modal, autoscroll, width, heigth);
- setLayout(new FitLayout());
- setCollapsible(false);
- setButtonAlign(Position.RIGHT);
- setIconCls(icon);
-
- firstButton = new Button(firstButtonTitle);
- firstButton.setId(firstButtonId);
- firstButton.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject event) {
- onFirstButtonClick.onEvent();
- }
- });
-
- firstButton.setTabIndex(tabIndexStart);
-
- cancel = new Button(cancelButtonTitle);
- cancel.setId(cancelButtonId);
- cancel.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject event) {
- onCancelButtonClick.onEvent();
- }
- });
- cancel.setTabIndex(tabIndexStart + 1);
- addButton(firstButton);
- addButton(cancel);
- }
-
- public Button getCancel() {
- return cancel;
- }
-
- public Button getFirstButton() {
- return firstButton;
- }
-
- public void mask(final String message) {
- getEl().mask(message, "x-mask-loading");
- }
-
- public void unMask() {
- getEl().unmask();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/InfoDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/InfoDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/InfoDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,86 +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 org.ourproject.kune.platf.client.ui.dialogs;
-
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
-@Deprecated
-public class InfoDialog extends BasicDialog {
-
- private final Panel mainPanel;
-
- public InfoDialog(final String dialogId, final String title, final String okButtonText, final String okButtonId,
- final boolean modal, final boolean autoScroll, final int width, final int height) {
- super(dialogId, title, modal, autoScroll, width, height);
- final Button okButton = new Button(okButtonText);
- okButton.setId(okButtonId);
- okButton.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- destroy();
- }
- });
- mainPanel = new Panel();
- mainPanel.setBorder(false);
- mainPanel.setHeader(false);
- mainPanel.setPaddings(20);
- super.add(mainPanel);
- addButton(okButton);
- }
-
- public InfoDialog(final String dialogId, final String title, final String header, final String text,
- final String okButtonText, final String okButtonId, final boolean modal, final boolean autoScroll,
- final int width, final int height) {
- this(dialogId, title, header, text, okButtonText, okButtonId, modal, autoScroll, width, height, false);
- }
-
- public InfoDialog(final String dialogId, final String title, final String header, final String text,
- final String okButtonText, final String okButtonId, final boolean modal, final boolean autoScroll,
- final int width, final int height, final boolean isHtml) {
- this(dialogId, title, okButtonText, okButtonId, modal, autoScroll, width, height);
-
- final Label headerLabel = new Label(header);
- Widget textLabel;
- if (isHtml) {
- textLabel = new HTML(text);
- } else {
- textLabel = new Label(text);
- }
-
- mainPanel.add(headerLabel);
- mainPanel.add(textLabel);
-
- headerLabel.addStyleName("k-infod-head");
- }
-
- public void add(final Panel panel) {
- mainPanel.add(panel);
- }
-
- public void setMainPanelPaddings(final int padding) {
- mainPanel.setPaddings(padding);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,305 +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 org.ourproject.kune.platf.client.ui.dialogs;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser;
-
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.gwt.user.client.ui.DeckPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.Component;
-import com.gwtext.client.widgets.Panel;
-import com.gwtext.client.widgets.Toolbar;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-import com.gwtext.client.widgets.event.WindowListenerAdapter;
-import com.gwtext.client.widgets.layout.FitLayout;
-
-public class WizardDialog implements WizardDialogView {
-
- private final Button backButton;
- private final Button cancelButton;
- private final DeckPanel deck;
- private final BasicDialog dialog;
- private final Button finishButton;
- private final I18nTranslationService i18n;
- private final Panel mainPanel;
- private final Button nextButton;
-
- public WizardDialog(final String dialogId, final String caption, final boolean modal,
- final boolean minimizable, final int width, final int height, final int minWidth,
- final int minHeight, final String backId, final String nextId, final String finishId,
- final String cancelId, final String closeId, final I18nTranslationService i18n,
- final WizardListener listener) {
- dialog = new BasicDialog(dialogId, caption, modal, false, width, height, minWidth, minHeight);
- this.i18n = i18n;
- dialog.setCollapsible(minimizable);
- dialog.setShadow(true);
- dialog.setPlain(true);
- dialog.setCollapsible(false);
- dialog.setResizable(false);
- dialog.setId(dialogId);
-
- backButton = new Button(i18n.tWithNT("« Back", "used in button"), new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- listener.onBack();
- }
- });
- backButton.setId(backId);
- dialog.addButton(backButton);
-
- nextButton = new Button(i18n.tWithNT("Next »", "used in button"), new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- listener.onNext();
- }
- });
- nextButton.setId(nextId);
- dialog.addButton(nextButton);
-
- cancelButton = new Button(i18n.tWithNT("Cancel", "used in button"), new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- listener.onCancel();
- }
- });
- cancelButton.setId(cancelId);
- dialog.addButton(cancelButton);
-
- finishButton = new Button(i18n.tWithNT("Finish", "used in button"), new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- listener.onFinish();
- }
- });
- finishButton.setId(finishId);
- dialog.addButton(finishButton);
-
- dialog.addListener(new WindowListenerAdapter() {
- @Override
- public void onHide(final Component component) {
- listener.onClose();
- }
- });
- mainPanel = new Panel();
- mainPanel.setLayout(new FitLayout());
- deck = new DeckPanel();
- mainPanel.add(deck);
- }
-
- public WizardDialog(final String dialogId, final String caption, final boolean modal,
- final boolean minimizable, final int width, final int height, final WizardListener listener,
- final I18nTranslationService i18n, final String backId, final String nextId,
- final String finishId, final String cancelId, final String closeId) {
- this(dialogId, caption, modal, minimizable, width, height, width, height, backId, nextId, finishId,
- cancelId, closeId, i18n, listener);
- }
-
- @Override
- public void add(final View view) {
- deck.add(toWidget(view));
- doLayoutIfNeeded();
- }
-
- @Override
- public void center() {
- dialog.center();
- }
-
- @Override
- public void clear() {
- dialog.clear();
- }
-
- private void doLayoutIfNeeded() {
- if (dialog.isRendered()) {
- dialog.doLayout();
- mainPanel.syncSize();
- mainPanel.doLayout();
- }
- }
-
- private int getWidgetCount(final View view) {
- if (view instanceof Widget) {
- return deck.getWidgetIndex((Widget) view);
- } else if (view instanceof DefaultForm) {
- return deck.getWidgetIndex(((DefaultForm) view).getFormPanel());
- }
- return -1;
- }
-
- @Override
- public void hide() {
- dialog.hide();
- }
-
- @Override
- public boolean isCurrentPage(final View view) {
- final int visibleWidgetIndex = deck.getVisibleWidget();
- if (visibleWidgetIndex == -1) {
- return false;
- } else {
- return deck.getWidget(visibleWidgetIndex).equals(toWidget(view));
- }
- }
-
- @Override
- public void mask(final String message) {
- dialog.getEl().mask(message, "x-mask-loading");
- }
-
- @Override
- public void maskProcessing() {
- mask(i18n.t("Processing"));
- }
-
- @Override
- public void remove(final View view) {
- final int count = getWidgetCount(view);
- if (count != -1) {
- deck.remove(count);
- }
- }
-
- public void setBottomToolbar1(final Toolbar toolbar) {
- dialog.setBottomToolbar(toolbar);
- }
-
- @Override
- public void setEnabled(final boolean back, final boolean next, final boolean cancel,
- final boolean finish) {
- setEnabledBackButton(back);
- setEnabledNextButton(next);
- setEnabledCancelButton(cancel);
- setEnabledFinishButton(finish);
- }
-
- @Override
- public void setEnabledBackButton(final boolean enabled) {
- if (enabled) {
- backButton.enable();
- } else {
- backButton.disable();
- }
- }
-
- @Override
- public void setEnabledCancelButton(final boolean enabled) {
- if (enabled) {
- cancelButton.enable();
- } else {
- cancelButton.disable();
- }
- }
-
- @Override
- public void setEnabledFinishButton(final boolean enabled) {
- if (enabled) {
- finishButton.enable();
- } else {
- finishButton.disable();
- }
- }
-
- @Override
- public void setEnabledNextButton(final boolean enabled) {
- if (enabled) {
- nextButton.enable();
- } else {
- nextButton.disable();
- }
- }
-
- @Override
- public void setFinishText(final String text) {
- finishButton.setText(text);
- }
-
- public void setIconCls(final String iconCls) {
- dialog.setIconCls(iconCls);
- }
-
- @Override
- public void setVisible(final boolean back, final boolean next, final boolean cancel,
- final boolean finish) {
- setVisibleBackButton(back);
- setVisibleNextButton(next);
- setVisibleCancelButton(cancel);
- setVisibleFinishButton(finish);
- }
-
- @Override
- public void setVisibleBackButton(final boolean visible) {
- backButton.setVisible(visible);
- }
-
- @Override
- public void setVisibleCancelButton(final boolean visible) {
- cancelButton.setVisible(visible);
- }
-
- @Override
- public void setVisibleFinishButton(final boolean visible) {
- finishButton.setVisible(visible);
- }
-
- @Override
- public void setVisibleNextButton(final boolean visible) {
- nextButton.setVisible(visible);
- }
-
- @Override
- public void show() {
- dialog.show();
- }
-
- @Override
- public void show(final View view) {
- final int count = getWidgetCount(view);
- if (count != -1) {
- deck.showWidget(count);
- dialog.add(mainPanel);
- doLayoutIfNeeded();
- } else {
- OldNotifyUser.error("Widget not found in deck of WizardDialog");
- }
-
- }
-
- private Widget toWidget(final View view) {
- if (view instanceof Widget) {
- return (Widget) view;
- } else if (view instanceof DefaultForm) {
- return ((DefaultForm) view).getFormPanel();
- } else {
- OldNotifyUser.error("Trying to add a unknown element in WizardDialog");
- return null;
- }
- }
-
- @Override
- public void unMask() {
- dialog.getEl().unmask();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialogView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardDialogView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,70 +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 org.ourproject.kune.platf.client.ui.dialogs;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface WizardDialogView extends View {
-
- void add(View view);
-
- void center();
-
- void clear();
-
- void hide();
-
- boolean isCurrentPage(View view);
-
- void mask(final String message);
-
- void maskProcessing();
-
- void remove(View view);
-
- void setEnabled(boolean back, boolean next, boolean cancel, boolean finish);
-
- void setEnabledBackButton(final boolean enabled);
-
- void setEnabledCancelButton(final boolean enabled);
-
- void setEnabledFinishButton(final boolean enabled);
-
- void setEnabledNextButton(final boolean enabled);
-
- void setFinishText(final String text);
-
- void setVisible(boolean back, boolean next, boolean cancel, boolean finish);
-
- void setVisibleBackButton(final boolean visible);
-
- void setVisibleCancelButton(final boolean visible);
-
- void setVisibleFinishButton(final boolean visible);
-
- void setVisibleNextButton(final boolean visible);
-
- void show();
-
- void show(View view);
-
- void unMask();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardListener.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/WizardListener.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,34 +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 org.ourproject.kune.platf.client.ui.dialogs;
-
-public interface WizardListener {
-
- void onBack();
-
- void onNext();
-
- void onFinish();
-
- void onCancel();
-
- void onClose();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/RichTextArea.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,733 +0,0 @@
-/*
- * Copyright 2007 Google Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License"); you may not
- * use this file except in compliance with the License. You may obtain a copy of
- * the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
- * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
- * License for the specific language governing permissions and limitations under
- * the License.
- */
-package org.ourproject.kune.platf.client.ui.rte;
-
-import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl;
-import org.xwiki.gwt.dom.client.Document;
-import org.xwiki.gwt.dom.client.IFrameElement;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.event.logical.shared.HasInitializeHandlers;
-import com.google.gwt.event.logical.shared.InitializeEvent;
-import com.google.gwt.event.logical.shared.InitializeHandler;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.user.client.ui.FocusWidget;
-import com.google.gwt.user.client.ui.HasHTML;
-
-/**
- * A rich text editor that allows complex styling and formatting.
- *
- * Because some browsers do not support rich text editing, and others support
- * only a limited subset of functionality, there are two formatter interfaces,
- * accessed via {@link #getBasicFormatter()} and {@link #getExtendedFormatter()}
- * . A browser that does not support rich text editing at all will return
- * <code>null</code> for both of these, while one that supports only the basic
- * functionality will return <code>null</code> for the latter.
- *
- * <p>
- * <img class='gallery' src='doc-files/RichTextArea.png'/>
- * </p>
- *
- * <h3>CSS Style Rules</h3>
- * <dl>
- * <dt>.gwt-RichTextArea</dt>
- * <dd>Applied to the rich text element.</dd>
- * </dl>
- */
-public class RichTextArea extends FocusWidget implements HasHTML, HasInitializeHandlers {
-
- /**
- * <p>
- * This interface is used to access basic formatting options, when
- * available. If the implementation supports basic formatting, then
- * {@link RichTextArea#getBasicFormatter()} will return an instance of this
- * class.
- * </p>
- * <p>
- * The formatter will format the user selected text in the
- * {@link RichTextArea}. As a result, it will only work reliably if the
- * {@link RichTextArea} is attached, visible to on the page, and has been
- * focused at least once. If you just want to initialize the content of the
- * {@link RichTextArea}, use {@link RichTextArea#setHTML(String)} instead.
- * </p>
- *
- * @deprecated use {@link RichTextArea.Formatter} instead
- */
- @Deprecated
- public interface BasicFormatter {
-
- /**
- * Gets the background color.
- *
- * @return the background color
- */
- String getBackColor();
-
- /**
- * Gets the foreground color.
- *
- * @return the foreground color
- */
- String getForeColor();
-
- /**
- * Is the current region bold?
- *
- * @return true if the current region is bold
- */
- boolean isBold();
-
- /**
- * Is the current region italic?
- *
- * @return true if the current region is italic
- */
- boolean isItalic();
-
- /**
- * Is the current region subscript?
- *
- * @return true if the current region is subscript
- */
- boolean isSubscript();
-
- /**
- * Is the current region superscript?
- *
- * @return true if the current region is superscript
- */
- boolean isSuperscript();
-
- /**
- * Is the current region underlined?
- *
- * @return true if the current region is underlined
- */
- boolean isUnderlined();
-
- /**
- * Selects all the text.
- */
- void selectAll();
-
- /**
- * Sets the background color.
- *
- * @param color
- * the new background color
- */
- void setBackColor(String color);
-
- /**
- * Sets the font name.
- *
- * @param name
- * the new font name
- */
- void setFontName(String name);
-
- /**
- * Sets the font size.
- *
- * @param fontSize
- * the new font size
- */
- void setFontSize(FontSize fontSize);
-
- /**
- * Sets the foreground color.
- *
- * @param color
- * the new foreground color
- */
- void setForeColor(String color);
-
- /**
- * Sets the justification.
- *
- * @param justification
- * the new justification
- */
- void setJustification(Justification justification);
-
- /**
- * Toggles bold.
- */
- void toggleBold();
-
- /**
- * Toggles italic.
- */
- void toggleItalic();
-
- /**
- * Toggles subscript.
- */
- void toggleSubscript();
-
- /**
- * Toggles superscript.
- */
- void toggleSuperscript();
-
- /**
- * Toggles underline.
- */
- void toggleUnderline();
- }
-
- /**
- * <p>
- * This interface is used to access full formatting options, when available.
- * If the implementation supports full formatting, then
- * {@link RichTextArea#getExtendedFormatter()} will return an instance of
- * this class.
- * </p>
- * <p>
- * The formatter will format the user selected text in the
- * {@link RichTextArea}. As a result, it will only work reliably if the
- * {@link RichTextArea} is attached, visible to on the page, and has been
- * focused at least once. If you just want to initialize the content of the
- * {@link RichTextArea}, use {@link RichTextArea#setHTML(String)} instead.
- * </p>
- *
- * @deprecated use {@link RichTextArea.Formatter} instead
- */
- @Deprecated
- public interface ExtendedFormatter extends BasicFormatter {
-
- void copy();
-
- /**
- * Creates a link to the supplied URL.
- *
- * @param url
- * the URL to be linked to
- */
- void createLink(String url);
-
- void cut();
-
- /*
- * delete all text and objects that are selected.
- */
- void delete();
-
- /**
- * Inserts a horizontal rule.
- */
- void insertHorizontalRule();
-
- /**
- * Inserts an image element.
- *
- * @param url
- * the url of the image to be inserted
- */
- void insertImage(String url);
-
- /**
- * Starts an numbered list. Indentation will create nested items.
- */
- void insertOrderedList();
-
- /**
- * Starts an bulleted list. Indentation will create nested items.
- */
- void insertUnorderedList();
-
- /**
- * Is the current region strikethrough?
- *
- * @return true if the current region is strikethrough
- */
- boolean isStrikethrough();
-
- /**
- * Left indent.
- */
- void leftIndent();
-
- void paste();
-
- void redo();
-
- /**
- * Removes all formatting on the selected text.
- */
- void removeFormat();
-
- /**
- * Removes any link from the selected text.
- */
- void removeLink();
-
- /**
- * Right indent.
- */
- void rightIndent();
-
- /**
- * Toggles strikethrough.
- */
- void toggleStrikethrough();
-
- void undo();
- }
-
- /**
- * Font size enumeration. Represents the seven basic HTML font sizes, as
- * defined in CSS.
- */
- public static class FontSize {
-
- /**
- * Represents a Large font.
- */
- public static final FontSize LARGE = new FontSize(5);
-
- /**
- * Represents a Medium font.
- */
- public static final FontSize MEDIUM = new FontSize(4);
-
- /**
- * Represents a Small font.
- */
- public static final FontSize SMALL = new FontSize(3);
-
- /**
- * Represents an X-Large font.
- */
- public static final FontSize X_LARGE = new FontSize(6);
-
- /**
- * Represents an X-Small font.
- */
- public static final FontSize X_SMALL = new FontSize(2);
-
- /**
- * Represents an XX-Large font.
- */
- public static final FontSize XX_LARGE = new FontSize(7);
-
- /**
- * Represents an XX-Small font.
- */
- public static final FontSize XX_SMALL = new FontSize(1);
-
- private final int number;
-
- private FontSize(final int number) {
- this.number = number;
- }
-
- /**
- * Gets the HTML font number associated with this font size.
- *
- * @return an integer from 1 to 7 inclusive
- */
- public int getNumber() {
- return number;
- }
-
- @Override
- public String toString() {
- return Integer.toString(number);
- }
- }
-
- /**
- * <p>
- * This interface is used to access full formatting options, when available.
- * If the implementation supports full formatting, then
- * {@link RichTextArea#getFormatter()} will return an instance of this
- * class.
- * </p>
- * <p>
- * The formatter will format the user selected text in the
- * {@link RichTextArea}. As a result, it will only work reliably if the
- * {@link RichTextArea} is attached, visible to on the page, and has been
- * focused at least once. If you just want to initialize the content of the
- * {@link RichTextArea}, use {@link RichTextArea#setHTML(String)} instead.
- * </p>
- */
- public interface Formatter extends ExtendedFormatter {
- /**
- * Creates a link to the supplied URL.
- *
- * @param url
- * the URL to be linked to
- */
- void createLink(String url);
-
- /**
- * Gets the background color.
- *
- * @return the background color
- */
- String getBackColor();
-
- /**
- * Gets the foreground color.
- *
- * @return the foreground color
- */
- String getForeColor();
-
- /**
- * Inserts a horizontal rule.
- */
- void insertHorizontalRule();
-
- /**
- * Inserts generic html.
- *
- * @param html
- * the HTML to insert
- */
- void insertHTML(String html);
-
- /**
- * Inserts an image element.
- *
- * @param url
- * the url of the image to be inserted
- */
- void insertImage(String url);
-
- /**
- * Starts an numbered list. Indentation will create nested items.
- */
- void insertOrderedList();
-
- /**
- * Starts an bulleted list. Indentation will create nested items.
- */
- void insertUnorderedList();
-
- /**
- * Is the current region bold?
- *
- * @return true if the current region is bold
- */
- boolean isBold();
-
- /**
- * Is the current region italic?
- *
- * @return true if the current region is italic
- */
- boolean isItalic();
-
- /**
- * Is the current region strikethrough?
- *
- * @return true if the current region is strikethrough
- */
- boolean isStrikethrough();
-
- /**
- * Is the current region subscript?
- *
- * @return true if the current region is subscript
- */
- boolean isSubscript();
-
- /**
- * Is the current region superscript?
- *
- * @return true if the current region is superscript
- */
- boolean isSuperscript();
-
- /**
- * Is the current region underlined?
- *
- * @return true if the current region is underlined
- */
- boolean isUnderlined();
-
- /**
- * Left indent.
- */
- void leftIndent();
-
- /**
- * Redo an action that was just undone.
- */
- void redo();
-
- /**
- * Removes all formatting on the selected text.
- */
- void removeFormat();
-
- /**
- * Removes any link from the selected text.
- */
- void removeLink();
-
- /**
- * Right indent.
- */
- void rightIndent();
-
- /**
- * Selects all the text.
- */
- void selectAll();
-
- /**
- * Sets the background color.
- *
- * @param color
- * the new background color
- */
- void setBackColor(String color);
-
- /**
- * Sets the font name.
- *
- * @param name
- * the new font name
- */
- void setFontName(String name);
-
- /**
- * Sets the font size.
- *
- * @param fontSize
- * the new font size
- */
- void setFontSize(FontSize fontSize);
-
- /**
- * Sets the foreground color.
- *
- * @param color
- * the new foreground color
- */
- void setForeColor(String color);
-
- /**
- * Sets the justification.
- *
- * @param justification
- * the new justification
- */
- void setJustification(Justification justification);
-
- /**
- * Toggles bold.
- */
- void toggleBold();
-
- /**
- * Toggles italic.
- */
- void toggleItalic();
-
- /**
- * Toggles strikethrough.
- */
- void toggleStrikethrough();
-
- /**
- * Toggles subscript.
- */
- void toggleSubscript();
-
- /**
- * Toggles superscript.
- */
- void toggleSuperscript();
-
- /**
- * Toggles underline.
- */
- void toggleUnderline();
-
- /**
- * Undo the last action.
- */
- void undo();
- }
-
- /**
- * Justification enumeration. The three values are <code>left</code>,
- * <code>right</code>, <code>center</code>.
- */
- public static class Justification {
-
- /**
- * Center justification.
- */
- public static final Justification CENTER = new Justification("Center");
-
- /**
- * Full justification.
- */
- public static final Justification FULL = new Justification("Full");
-
- /**
- * Left justification.
- */
- public static final Justification LEFT = new Justification("Left");
-
- /**
- * Right justification.
- */
- public static final Justification RIGHT = new Justification("Right");
-
- private final String tag;
-
- private Justification(final String tag) {
- this.tag = tag;
- }
-
- @Override
- public String toString() {
- return "Justify " + tag;
- }
- }
-
- private final RichTextAreaImpl impl = GWT.create(RichTextAreaImpl.class);
-
- /**
- * Creates a new, blank {@link RichTextArea} object with no stylesheet.
- */
- public RichTextArea() {
- setElement(impl.getElement());
- setStyleName("gwt-RichTextArea");
- impl.setOwner(this);
- }
-
- public HandlerRegistration addInitializeHandler(final InitializeHandler handler) {
- return addHandler(handler, InitializeEvent.getType());
- }
-
- /**
- * Gets the basic rich text formatting interface. Note that formatting can
- * only be done when the {@link RichTextArea} is attached, visible on the
- * page, and has been focused by the user.
- *
- * @return <code>null</code> if basic formatting is not supported
- * @deprecated use {@link #getFormatter()} instead
- */
- @Deprecated
- public BasicFormatter getBasicFormatter() {
- return getFormatter();
- }
-
- /**
- * NOTE: If the current browser doesn't support rich text editing this
- * method returns <code>null</code>. You should test the returned value and
- * fail save to an appropriate behavior!<br/>
- * The appropriate test would be: <code><pre>
- * if (rta.isAttached() && rta.getDocument() == null) {
- * // The current browser doesn't support rich text editing.
- * }
- * </pre></code>
- *
- * @return The DOM document being edited with this rich text area.
- *
- * copied from xwiki
- */
- public Document getDocument() {
- if (getElement().getTagName().equalsIgnoreCase("iframe")) {
- return IFrameElement.as(getElement()).getContentDocument().cast();
- } else {
- return null;
- }
- }
-
- /**
- * Gets the full rich text formatting interface. Note that formatting can
- * only be done when the {@link RichTextArea} is attached, visible on the
- * page, and has been focused by the user.
- *
- * @return <code>null</code> if full formatting is not supported
- * @deprecated use {@link #getFormatter()} instead
- */
- @Deprecated
- public ExtendedFormatter getExtendedFormatter() {
- return getFormatter();
- }
-
- /**
- * Gets the rich text formatting interface. Note that formatting can only be
- * done when the {@link RichTextArea} is attached, visible on the page, and
- * has been focused by the user.
- *
- * @return <code>null</code> if full formatting is not supported
- */
- public Formatter getFormatter() {
- if (impl instanceof Formatter) {
- return (Formatter) impl;
- }
- return null;
- }
-
- public String getHTML() {
- return impl.getHTML();
- }
-
- public String getText() {
- return impl.getText();
- }
-
- @Override
- public boolean isEnabled() {
- return impl.isEnabled();
- }
-
- @Override
- public void setEnabled(final boolean enabled) {
- impl.setEnabled(enabled);
- }
-
- @Override
- public void setFocus(final boolean focused) {
- // There are different problems on each browser when you try to focus an
- // unattached rich text iframe, so just cut it off early.
- Log.debug("Focus setted: " + focused);
- if (isAttached()) {
- impl.setFocus(focused);
- }
- }
-
- public void setHTML(final String html) {
- impl.setHTML(html);
- }
-
- public void setText(final String text) {
- impl.setText(text);
- }
-
- @Override
- protected void onAttach() {
- super.onAttach();
- impl.initElement();
- }
-
- @Override
- protected void onDetach() {
- super.onDetach();
- impl.uninitElement();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/TestRTEDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,65 +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 org.ourproject.kune.platf.client.ui.rte;
-
-import org.ourproject.kune.platf.client.actions.ui.ComplexToolbar;
-import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
-import org.ourproject.kune.platf.client.ui.rte.basic.RTEditorPanel;
-import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditor;
-
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.gwtext.client.widgets.Window;
-import com.gwtext.client.widgets.event.WindowListenerAdapter;
-
-public class TestRTEDialog {
-
- private final RTESavingEditor editor;
- private final BasicDialog dialog;
-
- public TestRTEDialog(final RTESavingEditor editor) {
- this.editor = editor;
- dialog = new BasicDialog("Testing RTE", false, false, 650, 200);
- final VerticalPanel vp = new VerticalPanel();
-
- vp.add((ComplexToolbar) editor.getTopBar());
- vp.add((ComplexToolbar) editor.getSndBar());
- final RTEditorPanel editorPanel = (RTEditorPanel) editor.getEditorArea();
- vp.add(editorPanel);
- vp.setWidth("100%");
- dialog.add(vp);
- dialog.addListener(new WindowListenerAdapter() {
- @Override
- public void onResize(final Window source, final int width, final int height) {
- final int newHeight = height - 26 * 2 - 40;
- editorPanel.adjustSize(newHeight);
- vp.setCellHeight(editorPanel, "" + newHeight);
- }
- });
- }
-
- public void setExtended(final boolean extended) {
- editor.setExtended(extended);
- }
-
- public void show() {
- editor.attach();
- dialog.show();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplIE6.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplIE6.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplIE6.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,67 +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 org.ourproject.kune.platf.client.ui.rte;
-
-import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplIE6;
-
-/**
- * A wrapper used to inject css into RTA. As published in:
- *
- * http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/
- * f64c0024d8676a66
- * /d5f26a54145fc5d4?lnk=st&q=richtextarea+style#d5f26a54145fc5d4
- *
- * FIXME: Only for IE and Mozilla
- *
- */
-public class WrappedRichTextAreaImplIE6 extends RichTextAreaImplIE6 {
-
- @Override
- public native void initElement() /*-{
- var _this = this;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing = true;
-
- setTimeout($entry(function() {
- if (_this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::initializing == false) {
- return;
- }
-
- // Attempt to set the iframe document's body to 'contentEditable' mode.
- // There's no way to know when the body will actually be available, so
- // keep trying every so often until it is.
- // Note: The body seems to be missing only rarely, so please don't remove
- // this retry loop just because it's hard to reproduce.
- var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- var doc = elem.contentWindow.document;
- if (!doc.body) {
- // Retry in 50 ms. Faster would run the risk of pegging the CPU. Slower
- // would increase the probability of a user-visible delay.
- setTimeout(arguments.callee, 50);
- return;
- }
- var ct = "<html><head><style>@import url('" + $wnd.location.protocol + "//" + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
- doc.write( ct );
- doc.body.contentEditable = true;
-
- // Send notification that the iframe has reached design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- }, 1));
- }-*/;
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplMozilla.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplMozilla.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplMozilla.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,86 +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 org.ourproject.kune.platf.client.ui.rte;
-
-import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplMozilla;
-
-/**
- * A wrapper used to inject css into RTA. As published in:
- *
- * http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/
- * f64c0024d8676a66
- * /d5f26a54145fc5d4?lnk=st&q=richtextarea+style#d5f26a54145fc5d4
- *
- * FIXME: Only for IE and Mozilla
- *
- */
-public class WrappedRichTextAreaImplMozilla extends RichTextAreaImplMozilla {
- boolean isFirstFocus;
-
- @Override
- public native void initElement() /*-{
- // Mozilla doesn't allow designMode to be set reliably until the iframe is
- // fully loaded.
- var _this = this;
- var iframe = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitializing()();
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplMozilla::isFirstFocus = true;
-
- iframe.onload = $entry(function() {
- // Some Mozillae have the nasty habit of calling onload again when you set
- // designMode, so let's avoid doing it more than once.
- iframe.onload = null;
-
- // patch ccs inject:
-
- var doc = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document;
- head=doc.getElementsByTagName('head')[0];
- link=document.createElement('link');
- link.setAttribute('rel',"stylesheet");
- link.setAttribute('type',"text/css");
- link.setAttribute('href',$wnd.location.protocol + "//" + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" );
- head.appendChild(link);
-
- // -- patch
-
- // Don't set designMode until the RTA is targeted by an event. This is
- // necessary because editing won't work on Mozilla if the iframe is
- // *hidden, but attached*. Waiting for an event gets around this issue.
- //
- // Note: These events will not conflict with the
- // addEventListener('oneventtype', ...) in RichTextAreaImplStandard.
- iframe.contentWindow.onfocus = function() {
- iframe.contentWindow.onfocus = null;
- iframe.contentWindow.onmouseover = null;
- iframe.contentWindow.document.designMode = 'On';
- };
-
- // Issue 1441: we also need to catch the onmouseover event because focus
- // occurs after mouse down, so the cursor will not appear until the user
- // clicks twice, making the RichTextArea look uneditable. Catching the
- // mouseover event allows us to set design mode earlier. The focus event
- // is still needed to handle tab selection.
- iframe.contentWindow.onmouseover = iframe.contentWindow.onfocus;
-
- // Send notification that the iframe has finished loading.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- });
- }-*/;
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplOpera.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplOpera.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplOpera.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,46 +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 org.ourproject.kune.platf.client.ui.rte;
-
-import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplOpera;
-
-public class WrappedRichTextAreaImplOpera extends RichTextAreaImplOpera {
- public native void initElement() /*-{
- // Most browsers don't like setting designMode until slightly _after_
- // the iframe becomes attached to the DOM. Any non-zero timeout will do
- // just fine.
- var _this = this;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitializing()();
- setTimeout($entry(function() {
- // Turn on design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
-
- // patch css inject:
- var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- var doc = elem.contentWindow.document;
- var ct = "<html><head><style>@import url('" +$wnd.location.protocol+ "//" + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
- doc.write( ct );
- // -- patch
-
- // Send notification that the iframe has reached design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- }), 1);
- }-*/;
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplSafari.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplSafari.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/WrappedRichTextAreaImplSafari.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,49 +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 org.ourproject.kune.platf.client.ui.rte;
-
-import org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplSafari;
-
-public class WrappedRichTextAreaImplSafari extends RichTextAreaImplSafari {
-
- @Override
- public native void initElement() /*-{
- // Most browsers don't like setting designMode until slightly _after_
- // the iframe becomes attached to the DOM. Any non-zero timeout will do
- // just fine.
- var _this = this;
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitializing()();
- setTimeout($entry(function() {
- // Turn on design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem.contentWindow.document.designMode = 'On';
-
- // patch css inject:
- var elem = _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImpl::elem;
- var doc = elem.contentWindow.document;
- var ct = "<html><head><style>@import url('" +$wnd.location.protocol+ "//" + $wnd.location.host + $wnd.location.pathname + "css/richtext.css" + "');</style></head><body CONTENTEDITABLE='true'></body></html>" ;
- doc.write( ct );
- // -- patch
-
- // Send notification that the iframe has reached design mode.
- _this.@org.ourproject.kune.platf.client.ui.rte.impl.RichTextAreaImplStandard::onElementInitialized()();
- }), 1);
- }-*/;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlAgent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlAgent.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlAgent.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,27 +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 org.ourproject.kune.platf.client.ui.rte.edithtml;
-
-public interface EditHtmlAgent {
-
- String getHtml();
-
- void setHtml(String html);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,39 +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 org.ourproject.kune.platf.client.ui.rte.edithtml;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialog;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public interface EditHtmlDialog extends OldAbstractTabbedDialog {
-
- String getHtml();
-
- void setAgent(EditHtmlAgent agent);
-
- void setCancelListener(Listener0 cancelListener);
-
- void setHtml(String html);
-
- void setUpdateListener(Listener<String> updateListener);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,80 +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 org.ourproject.kune.platf.client.ui.rte.edithtml;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPanel;
-import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
-
-import cc.kune.common.client.notify.NotifyLevel;
-import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.google.gwt.user.client.Window;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
-public class EditHtmlDialogPanel extends OldAbstractTabbedDialogPanel implements EditHtmlDialogView {
-
- public static final String EDIG_HTML_DIALOG_ERROR_ID = "ehtml-dialgo-error";
- public static final String EDIT_HTML_DIALOG = "ehtml-dialog";
- private Button cancel;
- private final EditHtmlGroup editHtmlGroup;
- private final I18nTranslationService i18n;
- private final EditHtmlDialogPresenter presenter;
-
- public EditHtmlDialogPanel(final EditHtmlDialogPresenter presenter, final I18nTranslationService i18n,
- final RTEImgResources resources, final NotifyLevelImages images, final EditHtmlGroup editHtmlGroup) {
- super(EDIT_HTML_DIALOG, i18n.tWithNT("Edit the HTML",
- "Option in a content editor to edit the html internal code (for advance users)"),
- Window.getClientWidth() - 100, HEIGHT + 80, Window.getClientWidth() - 100, HEIGHT + 80, true, images,
- EDIG_HTML_DIALOG_ERROR_ID);
- this.presenter = presenter;
- this.i18n = i18n;
- this.editHtmlGroup = editHtmlGroup;
- // super.setIconCls(RTEImgResources.SUFFIX +
- // resources.edithtml().getName());
- }
-
- @Override
- public void createAndShow() {
- if (cancel == null) {
- cancel = new Button(i18n.t("Cancel"));
- final Button update = new Button(i18n.t("Update"));
- cancel.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onCancel();
- }
- });
- update.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onUpdate();
- }
- });
- super.addButton(update);
- super.addButton(cancel);
- }
- editHtmlGroup.createAll();
- super.createAndShow();
- super.setErrorMessage(i18n.t("This option is only for advanced users"), NotifyLevel.info);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPresenter.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogPresenter.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,70 +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 org.ourproject.kune.platf.client.ui.rte.edithtml;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPresenter;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class EditHtmlDialogPresenter extends OldAbstractTabbedDialogPresenter implements EditHtmlDialog {
-
- private Listener<String> updateListener;
- private Listener0 cancelListener;
- private EditHtmlAgent agent;
-
- public EditHtmlDialogPresenter() {
- }
-
- public String getHtml() {
- return agent.getHtml();
- }
-
- public void onCancel() {
- if (cancelListener != null) {
- cancelListener.onEvent();
- }
- hide();
- }
-
- public void onUpdate() {
- if (updateListener != null) {
- // FIXME
- updateListener.onEvent(agent.getHtml());
- }
- hide();
- }
-
- public void setAgent(EditHtmlAgent agent) {
- this.agent = agent;
- }
-
- public void setCancelListener(Listener0 cancelListener) {
- this.cancelListener = cancelListener;
- }
-
- public void setHtml(String html) {
- agent.setHtml(html);
- }
-
- public void setUpdateListener(Listener<String> updateListener) {
- this.updateListener = updateListener;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlDialogView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,29 +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 org.ourproject.kune.platf.client.ui.rte.edithtml;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogView;
-
-public interface EditHtmlDialogView extends OldAbstractTabbedDialogView, View {
-
- int HEIGHT = 225;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlGroup.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/edithtml/EditHtmlGroup.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,38 +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 org.ourproject.kune.platf.client.ui.rte.edithtml;
-
-import com.calclab.suco.client.ioc.Container;
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.ioc.decorator.ProviderCollection;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-
-public class EditHtmlGroup extends ProviderCollection {
-
- public EditHtmlGroup(final Container container) {
- super(container, Singleton.instance);
- }
-
- public void createAll() {
- for (final Provider<?> p : getProviders()) {
- p.get();
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/ImageInfo.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,148 +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 org.ourproject.kune.platf.client.ui.rte.insertimg;
-
-import org.cobogw.gwt.user.client.CSS;
-import org.ourproject.kune.platf.client.ui.rte.insertlink.LinkInfo;
-
-import cc.kune.core.client.ui.ContentPosition;
-
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.user.client.DOM;
-
-public class ImageInfo {
-
- public static final boolean DEF_WRAP_VALUE = true;
- public static final boolean DEF_CLICK_ORIGINAL_VALUE = false;
-
- public static final String SIZE_ORIGINAL = "original";
- public static final String SIZE_FIT = "fit";
- public static final String SIZE_XS = "xs";
- public static final String SIZE_S = "s";
- public static final String SIZE_M = "m";
- public static final String SIZE_L = "l";
- public static final String SIZE_XL = "xl";
-
- public static String[][] sizes = { new String[] { SIZE_ORIGINAL, "Original image size", "" },
- new String[] { SIZE_FIT, "Fit page width", "100%" },
- new String[] { SIZE_XS, "Thumbnail, up to 160 pixels wide", "160px" },
- new String[] { SIZE_S, "Small, up to 320 pixels wide", "320px" },
- new String[] { SIZE_M, "Medium, up to 640 pixels wide", "640px" },
- new String[] { SIZE_L, "Large, up to 1024 pixels wide", "1024px" },
- new String[] { SIZE_XL, "Extra large, up to 1600 pixels wide", "1600px" } };
-
- private String src;
- private boolean wraptext;
- private boolean clickOriginal;
- private String position;
- private String size;
-
- public ImageInfo(final String src, final boolean wraptext, final boolean clickOriginal, final String position,
- final String size) {
- this.src = src;
- this.wraptext = wraptext;
- this.clickOriginal = clickOriginal;
- setPositionImpl(position);
- setSizeImpl(size);
- }
-
- public boolean getClickOriginal() {
- return clickOriginal;
- }
-
- public Element getElement() {
- Element imgElement = getImageElement();
- if (clickOriginal) {
- com.google.gwt.user.client.Element anchor = DOM.createAnchor();
- DOM.setElementProperty(anchor, LinkInfo.HREF, src);
- DOM.setElementProperty(anchor, LinkInfo.TARGET, LinkInfo._BLANK);
- anchor.setInnerHTML(imgElement.getString());
- return anchor;
- } else {
- return imgElement;
- }
- }
-
- public String getPosition() {
- return position;
- }
-
- public String getSize() {
- return size;
- }
-
- public String getSrc() {
- return src;
- }
-
- public boolean isWraptext() {
- return wraptext;
- }
-
- public void setClickOriginal(final boolean clickOriginal) {
- this.clickOriginal = clickOriginal;
- }
-
- public void setPosition(final String position) {
- setPositionImpl(position);
- }
-
- public void setSize(final String size) {
- setSizeImpl(size);
- }
-
- public void setSrc(final String src) {
- this.src = src;
- }
-
- public void setWraptext(final boolean wraptext) {
- this.wraptext = wraptext;
- }
-
- @Override
- public String toString() {
- Element element = getElement();
- return element.getString();
- }
-
- private Element getImageElement() {
- com.google.gwt.user.client.Element img = DOM.createImg();
- DOM.setElementProperty(img, "src", src);
- CSS.setProperty(img, CSS.A.WIDTH, getStyleSize());
- return ContentPosition.setPosition(img, wraptext, position);
- }
-
- private String getStyleSize() {
- for (String[] current : sizes) {
- if (current[0].equals(size)) {
- return current[2];
- }
- }
- return "";
- }
-
- private void setPositionImpl(final String position) {
- this.position = position;
- }
-
- private void setSizeImpl(final String size) {
- this.size = size;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,39 +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 org.ourproject.kune.platf.client.ui.rte.insertimg;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialog;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public interface InsertImageDialog extends OldAbstractTabbedDialog {
-
- void fireOnInsertImage(ImageInfo imageInfo);
-
- ImageInfo getImageInfo();
-
- void reset();
-
- void setOnCreateImage(Listener<ImageInfo> listener);
-
- void setOnInsertImagePressed(Listener0 onInsertLinkPressed);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,76 +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 org.ourproject.kune.platf.client.ui.rte.insertimg;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPanel;
-
-import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.calclab.suco.client.events.Listener0;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
-public class InsertImageDialogPanel extends OldAbstractTabbedDialogPanel implements InsertImageDialogView {
-
- private static final String INSERT_IMG_DIALOG = "k-iip-dial";
- private static final String INSERT_IMG_DIALOG_ERROR_ID = "k-iip-err";
- private final InsertImageGroup insertImageGroup;
-
- public InsertImageDialogPanel(final InsertImageDialogPresenter presenter, final I18nTranslationService i18n,
- final NotifyLevelImages images, final InsertImageGroup insertImageGroup) {
- super(INSERT_IMG_DIALOG, i18n.t("Insert Image"), 390, HEIGHT + 100, 390, HEIGHT + 100, true, images,
- INSERT_IMG_DIALOG_ERROR_ID);
- super.setIconCls("k-picture-icon");
- this.insertImageGroup = insertImageGroup;
-
- super.addHideListener(new Listener0() {
- @Override
- public void onEvent() {
- insertImageGroup.resetAll();
- }
- });
-
- final Button insert = new Button(i18n.t("Insert"));
- insert.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onInsert();
- }
- });
-
- final Button cancel = new Button(i18n.t("Cancel"));
- cancel.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onCancel();
- }
- });
- addButton(insert);
- addButton(cancel);
- }
-
- @Override
- public void createAndShow() {
- insertImageGroup.createAll();
- super.createAndShow();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogPresenter.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,72 +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 org.ourproject.kune.platf.client.ui.rte.insertimg;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPresenter;
-
-import cc.kune.core.client.ui.ContentPosition;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class InsertImageDialogPresenter extends OldAbstractTabbedDialogPresenter implements InsertImageDialog {
-
- private Listener<ImageInfo> onCreateListener;
- private ImageInfo imageInfo;
- private Listener0 onInsertPressed;
-
- public InsertImageDialogPresenter() {
- initImageInfo();
- }
-
- public void fireOnInsertImage(final ImageInfo imageInfo) {
- onCreateListener.onEvent(imageInfo);
- super.hide();
- }
-
- public ImageInfo getImageInfo() {
- return imageInfo;
- }
-
- public void reset() {
- initImageInfo();
- }
-
- public void setOnCreateImage(final Listener<ImageInfo> listener) {
- onCreateListener = listener;
- }
-
- public void setOnInsertImagePressed(final Listener0 onInsertPressed) {
- this.onInsertPressed = onInsertPressed;
- }
-
- protected void onCancel() {
- super.hide();
- }
-
- protected void onInsert() {
- onInsertPressed.onEvent();
- }
-
- private void initImageInfo() {
- imageInfo = new ImageInfo("", ImageInfo.DEF_WRAP_VALUE, ImageInfo.DEF_CLICK_ORIGINAL_VALUE,
- ContentPosition.LEFT, ImageInfo.SIZE_ORIGINAL);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageDialogView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,28 +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 org.ourproject.kune.platf.client.ui.rte.insertimg;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogView;
-
-public interface InsertImageDialogView extends OldAbstractTabbedDialogView {
-
- int HEIGHT = 350;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertimg/InsertImageGroup.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,46 +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 org.ourproject.kune.platf.client.ui.rte.insertimg;
-
-import org.ourproject.kune.platf.client.ui.rte.insertimg.abstractimg.InsertImageAbstract;
-
-import com.calclab.suco.client.ioc.Container;
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.ioc.decorator.ProviderCollection;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-
-public class InsertImageGroup extends ProviderCollection {
-
- public InsertImageGroup(final Container container) {
- super(container, Singleton.instance);
- }
-
- public void createAll() {
- for (final Provider<?> p : getProviders()) {
- p.get();
- }
- }
-
- public void resetAll() {
- for (final Provider<?> p : getProviders()) {
- ((InsertImageAbstract) p.get()).reset();
- }
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,39 +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 org.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialog;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public interface InsertLinkDialog extends OldAbstractTabbedDialog {
-
- void fireOnInsertLink(LinkInfo linkInfo);
-
- LinkInfo getLinkInfo();
-
- void setLinkInfo(LinkInfo linkInfo);
-
- void setOnCreateLink(Listener<LinkInfo> listener);
-
- void setOnInsertLinkPressed(Listener0 onInsertLinkPressed);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,76 +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 org.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPanel;
-
-import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.calclab.suco.client.events.Listener0;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
-public class InsertLinkDialogPanel extends OldAbstractTabbedDialogPanel implements InsertLinkDialogView {
- public static final String TEXT_EDT_INSERT_DIALOG = "k-ted-iep-dialog";
- public static final String TEXT_EDT_INSERT_DIALOG_ERROR_ID = "k-ted-iep-dialog-err";
- private final InsertLinkGroup textEditorInsertElementGroup;
-
- public InsertLinkDialogPanel(final InsertLinkDialogPresenter presenter, final NotifyLevelImages images,
- final I18nTranslationService i18n, final InsertLinkGroup textEditorInsertElementGroup) {
- super(TEXT_EDT_INSERT_DIALOG, i18n.tWithNT("Insert a link",
- "Option in a text editor to insert links and other elements"), 380, HEIGHT + 100, 380, HEIGHT + 100,
- true, images, TEXT_EDT_INSERT_DIALOG_ERROR_ID);
- super.setIconCls("k-link-icon");
- this.textEditorInsertElementGroup = textEditorInsertElementGroup;
- super.addHideListener(new Listener0() {
- @Override
- public void onEvent() {
- textEditorInsertElementGroup.resetAll();
- }
- });
-
- final Button insert = new Button(i18n.t("Insert"));
- insert.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onInsert();
- }
- });
-
- final Button cancel = new Button(i18n.t("Cancel"));
- cancel.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onCancel();
- }
- });
- addButton(insert);
- addButton(cancel);
-
- }
-
- @Override
- public void createAndShow() {
- textEditorInsertElementGroup.createAll();
- super.createAndShow();
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogPresenter.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,66 +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 org.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPresenter;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class InsertLinkDialogPresenter extends OldAbstractTabbedDialogPresenter implements InsertLinkDialog {
-
- private Listener<LinkInfo> onCreateListener;
- private LinkInfo linkInfo;
- private Listener0 onInsertLinkPressed;
-
- public InsertLinkDialogPresenter() {
- linkInfo = new LinkInfo("");
- }
-
- public void fireOnInsertLink(final LinkInfo linkInfo) {
- onCreateListener.onEvent(linkInfo);
- super.hide();
- }
-
- public LinkInfo getLinkInfo() {
- return linkInfo;
- }
-
- public void onCancel() {
- super.hide();
- }
-
- public void setLinkInfo(final LinkInfo linkInfo) {
- this.linkInfo = linkInfo;
- }
-
- public void setOnCreateLink(final Listener<LinkInfo> listener) {
- this.onCreateListener = listener;
- }
-
- public void setOnInsertLinkPressed(final Listener0 onInsertLinkPressed) {
- this.onInsertLinkPressed = onInsertLinkPressed;
- }
-
- protected void onInsert() {
- onInsertLinkPressed.onEvent();
- }
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkDialogView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,29 +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 org.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogView;
-
-public interface InsertLinkDialogView extends OldAbstractTabbedDialogView, View {
-
- int HEIGHT = 350;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkGroup.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/InsertLinkGroup.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,46 +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 org.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import org.ourproject.kune.platf.client.ui.rte.insertlink.abstractlink.InsertLinkAbstract;
-
-import com.calclab.suco.client.ioc.Container;
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.ioc.decorator.ProviderCollection;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-
-public class InsertLinkGroup extends ProviderCollection {
-
- public InsertLinkGroup(final Container container) {
- super(container, Singleton.instance);
- }
-
- public void createAll() {
- for (final Provider<?> p : getProviders()) {
- p.get();
- }
- }
-
- public void resetAll() {
- for (final Provider<?> p : getProviders()) {
- ((InsertLinkAbstract) p.get()).reset();
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkExecutableUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkExecutableUtils.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkExecutableUtils.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,125 +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/>.
- *
- */
-/*
- * See the NOTICE file distributed with this work for additional
- * information regarding copyright ownership.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software 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
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import org.ourproject.kune.platf.client.ui.rte.RichTextArea;
-import org.xwiki.gwt.dom.client.DOMUtils;
-import org.xwiki.gwt.dom.client.Element;
-import org.xwiki.gwt.dom.client.Range;
-
-import com.google.gwt.dom.client.Node;
-
-/**
- * Utility class to perform functions associated to link executables, such as
- * detecting the selected anchor. We have this as static function in a distinct
- * class since there is no way to insert this on both the
- * {@link CreateLinkExecutable} and {@link UnlinkExecutable} hierarchies.
- *
- * @version $Id$
- */
-public class LinkExecutableUtils {
- /**
- * The tag name of the anchor element.
- */
- public static final String ANCHOR_TAG_NAME = "a";
-
- /**
- * Returns the currently selected anchor element in the passed
- * {@link RichTextArea}, as the user perceives the selection. The algorithm
- * used is as follows:
- * <ul>
- * <li>find anchor ancestor of the first leaf of the selection. If the first
- * leaf is the selection start container and the offset is at the end, then
- * eliminate this first leaf and analyze the second</li>
- * <li>find anchor ancestor of the last leaf of the selection. If the last
- * leaf is the end container and the selection starts at its very beginning,
- * skip this and analyze the previous leaf</li>
- * <li>is the two ancestor anchors are not null and are the same, this
- * anchor is the selected anchor</li>
- * </ul>
- *
- * @param rta
- * the rich text area whose selection to test
- * @return the anchor in which the current selection is found
- */
- public static Element getSelectedAnchor(final RichTextArea rta) {
- // there is no wrapping anchor if there is no selection
- if (rta.getDocument().getSelection().getRangeCount() == 0) {
- return null;
- }
- // Find the selected anchor by the following algorithm:
- final Range range = rta.getDocument().getSelection().getRangeAt(0);
- // if the selection is collapsed, we have our answer already
- if (range.isCollapsed()) {
- return (Element) DOMUtils.getInstance().getFirstAncestor(range.getStartContainer(), ANCHOR_TAG_NAME);
- }
- Element foundAncestorStart = null;
- Element foundAncestorEnd = null;
- // get the first leaf of the selection and check it out
- Node firstLeaf = DOMUtils.getInstance().getFirstLeaf(range);
- if (firstLeaf == range.getStartContainer()
- && range.getStartOffset() == DOMUtils.getInstance().getLength(firstLeaf)) {
- firstLeaf = DOMUtils.getInstance().getNextLeaf(firstLeaf);
- }
- foundAncestorStart = (Element) DOMUtils.getInstance().getFirstAncestor(firstLeaf, ANCHOR_TAG_NAME);
- // if no anchor found for start, it's pointless to keep looking, won't
- // find anything
- if (foundAncestorStart == null) {
- return null;
- }
- // check the other end
- Node lastLeaf = DOMUtils.getInstance().getLastLeaf(range);
- if (lastLeaf == range.getEndContainer() && range.getEndOffset() == 0) {
- lastLeaf = DOMUtils.getInstance().getPreviousLeaf(lastLeaf);
- }
- foundAncestorEnd = (Element) DOMUtils.getInstance().getFirstAncestor(lastLeaf, ANCHOR_TAG_NAME);
-
- if (foundAncestorStart == foundAncestorEnd && foundAncestorStart != null) {
- return foundAncestorStart;
- }
-
- return null;
- }
-
- /**
- * Protected constructor.
- */
- protected LinkExecutableUtils() {
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertlink/LinkInfo.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,141 +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 org.ourproject.kune.platf.client.ui.rte.insertlink;
-
-import com.google.gwt.dom.client.Element;
-import com.google.gwt.user.client.DOM;
-
-public class LinkInfo {
- public static final String HREF = "href";
- public static final String TITLE = "title";
- public static final String TARGET = "target";
- public static final String _BLANK = "_blank";
- private static final String NO_TARGET = null;
-
- public static LinkInfo parse(final Element element) {
- final String target = element.getAttribute(TARGET);
- return new LinkInfo(element.getInnerText(), element.getTitle(), element.getAttribute(HREF), target != null
- && target.equals(_BLANK));
- }
-
- public static LinkInfo parse(final org.xwiki.gwt.dom.client.Element element) {
- final String target = element.getAttribute(TARGET);
- return new LinkInfo(element.getInnerText(), element.getTitle(), element.getAttribute(HREF), target != null
- && target.equals(_BLANK));
- }
-
- private String text;
- private String title;
- private String href;
- private String target;
-
- public LinkInfo(final String text) {
- this(text, null, "", false);
- }
-
- public LinkInfo(final String text, final String href) {
- this.text = text;
- this.href = href;
- }
-
- public LinkInfo(final String text, final String title, final String href, final boolean inNewWindow) {
- this.text = text;
- this.href = href;
- this.title = title;
- setInNewWindowImpl(inNewWindow);
- }
-
- public Element getElement() {
- final Element anchor = DOM.createAnchor();
- final com.google.gwt.user.client.Element element = (com.google.gwt.user.client.Element) anchor;
- DOM.setElementProperty(element, HREF, href);
- if (getTarget() != NO_TARGET) {
- DOM.setElementProperty(element, TARGET, getTarget());
- }
- if (title != null) {
- DOM.setElementAttribute(element, TITLE, title);
- }
- DOM.setInnerText(element, text);
- return anchor;
- }
-
- public String getHref() {
- return href;
- }
-
- public String getTarget() {
- return target;
- }
-
- public String getText() {
- return text;
- }
-
- public String getTitle() {
- return title;
- }
-
- public boolean inSameWindow() {
- if (target.equals(NO_TARGET)) {
- return false;
- } else {
- return target.equals(_BLANK);
- }
- }
-
- public void setHref(final String href) {
- this.href = href;
- }
-
- public void setInNewWindow(final boolean inNewWindow) {
- setInNewWindowImpl(inNewWindow);
- }
-
- public void setTarget(final String target) {
- setTargetImpl(target);
- }
-
- public void setText(final String text) {
- this.text = text;
- }
-
- public void setTitle(final String title) {
- this.title = title;
- }
-
- @Override
- public String toString() {
- final Element anchor = getElement();
- return anchor.getString();
- }
-
- private void setInNewWindowImpl(final boolean inNewWindow) {
- if (inNewWindow) {
- setTargetImpl(_BLANK);
- } else {
- setTargetImpl(NO_TARGET);
- }
- }
-
- private void setTargetImpl(final String target) {
- this.target = target;
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/ExternalMediaRegistry.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,59 +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 org.ourproject.kune.platf.client.ui.rte.insertmedia;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import cc.kune.common.client.utils.TextUtils;
-import cc.kune.core.shared.dto.ExtMediaDescripDTO;
-
-public class ExternalMediaRegistry extends ArrayList<ExtMediaDescripDTO> {
-
- private static final long serialVersionUID = -9109609520119776917L;
- public static final ExtMediaDescripDTO NO_MEDIA = new ExtMediaDescripDTO(null, null, null, null, null, 0, 0);
-
- public ExternalMediaRegistry(final List<ExtMediaDescripDTO> extMediaDescrips) {
- super(extMediaDescrips);
- }
-
- public ExtMediaDescripDTO get(final String url) {
- for (ExtMediaDescripDTO media : this) {
- if (media.is(url)) {
- return media;
- }
-
- }
- return NO_MEDIA;
- }
-
- public String getNames() {
- String names = "";
- for (Iterator<ExtMediaDescripDTO> iterator = this.iterator(); iterator.hasNext();) {
- ExtMediaDescripDTO elem = iterator.next();
- names += TextUtils.generateHtmlLink(elem.getSiteurl(), elem.getName());
- if (iterator.hasNext()) {
- names += ", ";
- }
- }
- return names;
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,35 +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 org.ourproject.kune.platf.client.ui.rte.insertmedia;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialog;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public interface InsertMediaDialog extends OldAbstractTabbedDialog {
-
- void fireOnInsertMedia(String html);
-
- void setOnCreate(Listener<String> listener);
-
- void setOnInsertPressed(Listener0 onInsertPressed);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,76 +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 org.ourproject.kune.platf.client.ui.rte.insertmedia;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPanel;
-
-import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.calclab.suco.client.events.Listener0;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
-public class InsertMediaDialogPanel extends OldAbstractTabbedDialogPanel implements InsertMediaDialogView {
-
- private static final String INSERT_MEDIA_DIALOG = "k-imdp-dialog";
- private static final String INSERT_MEDIA_DIALOG_ERROR_ID = "k-imdp-dialog-err";
- private final InsertMediaGroup insertMediaGroup;
-
- public InsertMediaDialogPanel(final InsertMediaDialogPresenter presenter, final I18nTranslationService i18n,
- final NotifyLevelImages images, final InsertMediaGroup insertMediaGroup) {
- super(INSERT_MEDIA_DIALOG, i18n.t("Insert Media (audio/video)"), 390, HEIGHT + 100, 390, HEIGHT + 100, true,
- images, INSERT_MEDIA_DIALOG_ERROR_ID);
- super.setIconCls("k-film-icon");
- this.insertMediaGroup = insertMediaGroup;
-
- super.addHideListener(new Listener0() {
- @Override
- public void onEvent() {
- insertMediaGroup.resetAll();
- }
- });
-
- final Button insert = new Button(i18n.t("Insert"));
- insert.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onInsert();
- }
- });
-
- final Button cancel = new Button(i18n.t("Cancel"));
- cancel.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- presenter.onCancel();
- }
- });
- addButton(insert);
- addButton(cancel);
- }
-
- @Override
- public void createAndShow() {
- insertMediaGroup.createAll();
- super.createAndShow();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogPresenter.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,52 +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 org.ourproject.kune.platf.client.ui.rte.insertmedia;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPresenter;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-
-public class InsertMediaDialogPresenter extends OldAbstractTabbedDialogPresenter implements InsertMediaDialog {
-
- private Listener0 onInsertPressed;
- Listener<String> onCreateListener;
-
- public void fireOnInsertMedia(String html) {
- onCreateListener.onEvent(html);
- super.hide();
- }
-
- public void setOnCreate(Listener<String> listener) {
- onCreateListener = listener;
- }
-
- public void setOnInsertPressed(Listener0 onInsertPressed) {
- this.onInsertPressed = onInsertPressed;
- }
-
- protected void onCancel() {
- super.hide();
- }
-
- protected void onInsert() {
- onInsertPressed.onEvent();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaDialogView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,28 +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 org.ourproject.kune.platf.client.ui.rte.insertmedia;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface InsertMediaDialogView extends View {
-
- int HEIGHT = 250;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaGroup.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertmedia/InsertMediaGroup.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,46 +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 org.ourproject.kune.platf.client.ui.rte.insertmedia;
-
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.abstractmedia.InsertMediaAbstract;
-
-import com.calclab.suco.client.ioc.Container;
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.ioc.decorator.ProviderCollection;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-
-public class InsertMediaGroup extends ProviderCollection {
-
- public InsertMediaGroup(final Container container) {
- super(container, Singleton.instance);
- }
-
- public void createAll() {
- for (final Provider<?> p : getProviders()) {
- p.get();
- }
- }
-
- public void resetAll() {
- for (final Provider<?> p : getProviders()) {
- ((InsertMediaAbstract) p.get()).reset();
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialog.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialog.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialog.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,37 +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 org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialog;
-
-import com.calclab.suco.client.events.Listener;
-
-public interface InsertSpecialCharDialog extends OldAbstractTabbedDialog {
-
- String DEF_LABEL = "Click on a character below to insert it into the document.";
-
- void hide();
-
- void onInsert(char character);
-
- void setOnInsertSpecialChar(Listener<String> listener);
-
- void show();
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,60 +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 org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPanel;
-import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
-
-import cc.kune.common.client.notify.NotifyLevelImages;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
-public class InsertSpecialCharDialogPanel extends OldAbstractTabbedDialogPanel implements InsertSpecialCharDialogView {
-
- private static final String INSERT_SPECIAL_CHAR_DIALOG = "iscdp-dial";
- private static final String INSERT_SPECIAL_CHAR_DIALOG_ERROR_ID = "iscdp-err";
- private final InsertSpecialCharGroup insertSpecialCharGroup;
-
- public InsertSpecialCharDialogPanel(final InsertSpecialCharDialogPresenter presenter,
- final NotifyLevelImages images, final I18nTranslationService i18n,
- final InsertSpecialCharGroup insertSpecialCharGroup, final RTEImgResources imgResources) {
- super(INSERT_SPECIAL_CHAR_DIALOG, i18n.t("Insert Special Character"), 495, HEIGHT + 90, 495, HEIGHT + 90, true,
- images, INSERT_SPECIAL_CHAR_DIALOG_ERROR_ID);
- super.setIconCls("k-specialchars-icon");
- this.insertSpecialCharGroup = insertSpecialCharGroup;
- final Button close = new Button(i18n.t("Close"));
- close.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- hide();
- }
- });
- addButton(close);
- }
-
- @Override
- public void createAndShow() {
- insertSpecialCharGroup.createAll();
- super.createAndShow();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPresenter.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogPresenter.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,40 +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 org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogPresenter;
-
-import com.calclab.suco.client.events.Listener;
-
-public class InsertSpecialCharDialogPresenter extends OldAbstractTabbedDialogPresenter implements InsertSpecialCharDialog {
-
- private Listener<String> onInsertSpecialChar;
-
- public void onInsert(char character) {
- hide();
- if (onInsertSpecialChar != null) {
- onInsertSpecialChar.onEvent("" + character);
- }
- }
-
- public void setOnInsertSpecialChar(Listener<String> listener) {
- this.onInsertSpecialChar = listener;
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharDialogView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,28 +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 org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
-
-import org.ourproject.kune.platf.client.ui.dialogs.tabbed.OldAbstractTabbedDialogView;
-
-public interface InsertSpecialCharDialogView extends OldAbstractTabbedDialogView {
-
- int HEIGHT = 315;
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharGroup.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/rte/insertspecialchar/InsertSpecialCharGroup.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,38 +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 org.ourproject.kune.platf.client.ui.rte.insertspecialchar;
-
-import com.calclab.suco.client.ioc.Container;
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.ioc.decorator.ProviderCollection;
-import com.calclab.suco.client.ioc.decorator.Singleton;
-
-public class InsertSpecialCharGroup extends ProviderCollection {
-
- public InsertSpecialCharGroup(final Container container) {
- super(container, Singleton.instance);
- }
-
- public void createAll() {
- for (final Provider<?> p : getProviders()) {
- p.get();
- }
- }
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/ActionsModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ActionsModule.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ActionsModule.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,51 +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 org.ourproject.kune.workspace.client;
-
-import org.ourproject.kune.platf.client.services.AbstractExtendedModule;
-
-public class ActionsModule extends AbstractExtendedModule {
- @Override
- protected void onInstall() {
- // register(NoDecoration.class, new
- // Factory<ParticipateAction>(ParticipateAction.class) {
- // @Override
- // public ParticipateAction create() {
- // return new ParticipateAction(i(Session.class),
- // p(SocialNetworkServiceAsync.class),
- // i(StateManager.class), i(AccessRightsClientManager.class),
- // i(I18nTranslationService.class),
- // i(IconResources.class));
- // }
- // });
- //
- // register(NoDecoration.class, new
- // Factory<UnjoinAction>(UnjoinAction.class) {
- // @Override
- // public UnjoinAction create() {
- // return new UnjoinAction(i(Session.class),
- // p(SocialNetworkServiceAsync.class), i(StateManager.class),
- // i(AccessRightsClientManager.class), i(I18nTranslationService.class),
- // i(IconResources.class));
- // }
- // });
-
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/OldAbstractFoldableContentActions.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,683 +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 org.ourproject.kune.workspace.client;
-
-import org.ourproject.kune.platf.client.actions.ActionCheckedCondition;
-import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
-import org.ourproject.kune.platf.client.actions.ActionMenuItemDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarButtonAndItemDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarButtonSeparator;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuAndItemDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuCheckItemDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarMenuRadioDescriptor;
-import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
-import org.ourproject.kune.platf.client.actions.RadioMustBeChecked;
-import org.ourproject.kune.platf.client.ui.noti.OldNotifyUser;
-import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
-import org.ourproject.kune.workspace.client.editor.ContentEditor;
-import org.ourproject.kune.workspace.client.entityheader.EntityHeader;
-import org.ourproject.kune.workspace.client.upload.FileUploader;
-
-import cc.kune.common.client.utils.SchedulerManager;
-import cc.kune.core.client.cnt.ContentActionRegistry;
-import cc.kune.core.client.cnt.FoldableContent;
-import cc.kune.core.client.errors.ErrorHandler;
-import cc.kune.core.client.errors.SessionExpiredException;
-import cc.kune.core.client.i18n.I18nUITranslationService;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.ContentStatus;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.AccessRolDTO;
-import cc.kune.core.shared.dto.ContentSimpleDTO;
-import cc.kune.core.shared.dto.InitDataDTO;
-import cc.kune.core.shared.dto.StateAbstractDTO;
-import cc.kune.core.shared.dto.StateContainerDTO;
-import cc.kune.core.shared.dto.StateContentDTO;
-import cc.kune.gspace.client.style.GSpaceBackManager;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-import com.calclab.suco.client.ioc.Provider;
-import com.google.gwt.core.client.Scheduler.ScheduledCommand;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public abstract class OldAbstractFoldableContentActions {
-
- protected enum Position {
- cnt, ctx
- }
-
- public static final ActionToolbarPosition CONTENT_BOTTOMBAR = new ActionToolbarPosition(
- "afca-ctn-bottom");
-
- public static final ActionToolbarPosition CONTENT_TOPBAR = new ActionToolbarPosition("afca-ctn-top");
- public static final ActionToolbarPosition CONTEXT_BOTTOMBAR = new ActionToolbarPosition(
- "afca-ctx-bottom");
- public static final ActionToolbarPosition CONTEXT_TOPBAR = new ActionToolbarPosition("afca-ctx-top");
- private static final String PUBLICATION_MENU = "Publication";
-
- protected final ContentActionRegistry contentActionRegistry;
- protected final Provider<ContentServiceAsync> contentServiceProvider;
- // protected final ContextActionRegistry contextActionRegistry;
- protected final ContextNavigator contextNavigator;
- // protected final Provider<ContextPropEditor> contextPropEditorProvider;
- protected final SchedulerManager deferredCommandWrapper;
- protected final EntityHeader entityLogo;
- protected final ErrorHandler errorHandler;
- protected final Provider<FileDownloadUtils> fileDownloadProvider;
- protected final Provider<FileUploader> fileUploaderProvider;
- protected final FoldableContent foldableContent;
- protected final Provider<GroupServiceAsync> groupServiceProvider;
- protected final I18nUITranslationService i18n;
-
- protected final Session session;
- protected final StateManager stateManager;
- protected final Provider<ContentEditor> textEditorProvider;
-
- private final GSpaceBackManager wsBackManager;
-
- public OldAbstractFoldableContentActions(final Session session, final StateManager stateManager,
- final I18nUITranslationService i18n, final ErrorHandler errorHandler,
- final SchedulerManager deferredCommandWrapper,
- final Provider<GroupServiceAsync> groupServiceProvider,
- final Provider<ContentServiceAsync> contentServiceProvider,
- final Provider<FileUploader> fileUploaderProvider,
- final ContextNavigator contextNavigator,
- final ContentActionRegistry contentActionRegistry,
- // final ContextActionRegistry contextActionRegistry,
- final Provider<FileDownloadUtils> fileDownloadProvider,
- final Provider<ContentEditor> textEditorProvider,
- // final Provider<ContextPropEditor> contextPropEditorProvider,
- final FoldableContent foldableContent, final EntityHeader entityLogo,
- final GSpaceBackManager wsBackManager) {
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- this.errorHandler = errorHandler;
- this.deferredCommandWrapper = deferredCommandWrapper;
- this.groupServiceProvider = groupServiceProvider;
- this.contentServiceProvider = contentServiceProvider;
- this.fileUploaderProvider = fileUploaderProvider;
- this.contextNavigator = contextNavigator;
- this.contentActionRegistry = contentActionRegistry;
- // this.contextActionRegistry = contextActionRegistry;
- this.fileDownloadProvider = fileDownloadProvider;
- this.textEditorProvider = textEditorProvider;
- // this.contextPropEditorProvider = contextPropEditorProvider;
- this.foldableContent = foldableContent;
- this.entityLogo = entityLogo;
- this.wsBackManager = wsBackManager;
- createActions();
- session.onInitDataReceived(new Listener<InitDataDTO>() {
- @Override
- public void onEvent(final InitDataDTO parameter) {
- createPostSessionInitActions();
- }
- });
- }
-
- protected abstract void createActions();
-
- protected void createContentModeratedActions(final String parentMenuTitle,
- final String... contentsModerated) {
- createSetStatusAction(AccessRolDTO.Administrator, i18n.t("Published online"),
- ContentStatus.publishedOnline, contentsModerated);
- createSetStatusAction(AccessRolDTO.Editor, i18n.t("Editing in progress"),
- ContentStatus.editingInProgress, contentsModerated);
- createSetStatusAction(AccessRolDTO.Administrator, i18n.t("Rejected"), ContentStatus.rejected,
- contentsModerated);
- createSetStatusAction(AccessRolDTO.Editor, i18n.t("Submitted for publish"),
- ContentStatus.submittedForEvaluation, contentsModerated);
- createSetStatusAction(AccessRolDTO.Administrator, i18n.t("In the rubbish bin"),
- ContentStatus.inTheDustbin, contentsModerated);
- }
-
- protected void createContentRenameAction(final String parentMenuTitle, final String textDescription,
- final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtn = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- contextNavigator.editItem(stateToken);
- }
- });
- renameCtn.setTextDescription(textDescription);
- renameCtn.setParentMenuTitle(parentMenuTitle);
- renameCtn.setEnableCondition(notDeleted());
-
- // contentActionRegistry.addAction(renameCtn, registerInTypes);
- }
-
- protected void createDelContainerAction(final String text, final String parentMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> delContainer = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- OldNotifyUser.info("Sorry, in development");
- }
- });
- delContainer.setParentMenuTitle(parentMenuTitle);
- delContainer.setTextDescription(i18n.t(text));
- delContainer.setMustBeConfirmed(true);
- delContainer.setConfirmationTitle(i18n.t("Please confirm"));
- delContainer.setConfirmationText(i18n.t("You will delete it with all its contents. Are you sure?"));
- // contextActionRegistry.addAction(delContainer, registerInTypes);
- }
-
- protected void createDelContentAction(final String parentMenuTitle, final String textDescription,
- final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> delContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- contentServiceProvider.get().delContent(session.getUserHash(), token,
- new AsyncCallbackSimple<StateContentDTO>() {
- @Override
- public void onSuccess(final StateContentDTO state) {
- session.setCurrentState(state);
- final StateToken parent = token.copy().clearDocument();
- stateManager.gotoStateToken(parent);
- contextNavigator.clear();
- contextNavigator.refreshState();
- }
- });
- }
- });
- delContent.setParentMenuTitle(parentMenuTitle);
- delContent.setTextDescription(textDescription);
- delContent.setMustBeConfirmed(true);
- delContent.setConfirmationTitle(i18n.t("Please confirm"));
- delContent.setConfirmationText(i18n.t("Are you sure?"));
- delContent.setEnableCondition(notDefAndNotDeleted());
- // contentActionRegistry.addAction(delContent, registerInTypes);
- }
-
- protected void createDownloadActions(final String typeUploadedfile) {
- final ActionToolbarButtonDescriptor<StateToken> download = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Viewer, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- downloadContent(token);
- }
- });
- download.setMustBeAuthenticated(false);
- download.setTextDescription(i18n.t("Download"));
- download.setToolTip(i18n.t("Download this file"));
- download.setIconUrl("images/nav/download.png");
-
- final ActionMenuItemDescriptor<StateToken> downloadCtx = new ActionMenuItemDescriptor<StateToken>(
- AccessRolDTO.Viewer, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- downloadContent(token);
- }
- });
- downloadCtx.setMustBeAuthenticated(false);
- downloadCtx.setTextDescription(i18n.t("Download"));
- downloadCtx.setIconUrl("images/nav/download.png");
-
- // contentActionRegistry.addAction(download, typeUploadedfile);
- // contextActionRegistry.addAction(downloadCtx, typeUploadedfile);
- }
-
- protected ActionToolbarButtonDescriptor<StateToken> createEditAction(final String fileMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarButtonDescriptor<StateToken> editContent = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- OldNotifyUser.showProgressProcessing();
- session.check(new AsyncCallbackSimple<Void>() {
- @Override
- public void onSuccess(final Void result) {
- final ContentEditor editor = textEditorProvider.get();
- foldableContent.detach();
- contextNavigator.detach();
- // contextPropEditorProvider.get().attach();
- editor.edit(session.getContentState().getContent(), new Listener<String>() {
- @Override
- public void onEvent(final String html) {
- OldNotifyUser.showProgressSaving();
- contentServiceProvider.get().save(session.getUserHash(), stateToken, html,
- new AsyncCallback<Void>() {
- @Override
- public void onFailure(final Throwable caught) {
- OldNotifyUser.hideProgress();
- if (caught instanceof SessionExpiredException) {
- errorHandler.doSessionExpired();
- } else {
- OldNotifyUser.error(i18n.t("Error saving document. Retrying..."));
- errorHandler.process(caught);
- editor.onSaveFailed();
- }
- }
-
- @Override
- public void onSuccess(final Void param) {
- OldNotifyUser.hideProgress();
- session.getContentState().setContent(html);
- editor.onSavedSuccessful();
- }
- });
- }
- }, new Listener0() {
- @Override
- public void onEvent() {
- // onClose
- deferredCommandWrapper.addCommand(new ScheduledCommand() {
- @Override
- public void execute() {
- foldableContent.attach();
- // contextPropEditorProvider.get().detach();
- contextNavigator.attach();
- if (session.inSameToken(stateToken)) {
- contextNavigator.refreshState();
- foldableContent.refreshState();
- }
- }
- });
- }
- });
- editor.setFileMenuTitle(fileMenuTitle);
- OldNotifyUser.hideProgress();
- }
- });
- }
- });
- editContent.setTextDescription(i18n.tWithNT("Edit", "used in button"));
- editContent.setIconUrl("images/content_edit.png");
- editContent.setLeftSeparator(ActionToolbarButtonSeparator.spacer);
- editContent.setEnableCondition(notDeleted());
- // contentActionRegistry.addAction(editContent, registerInTypes);
- return editContent;
- }
-
- protected ActionMenuItemDescriptor<StateToken> createGoAction(final String... registerInTypes) {
- final ActionMenuItemDescriptor<StateToken> go = new ActionMenuItemDescriptor<StateToken>(
- AccessRolDTO.Viewer, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- stateManager.gotoStateToken(token);
- }
- });
- go.setMustBeAuthenticated(false);
- go.setTextDescription(i18n.t("Open"));
- go.setIconUrl("images/nav/go.png");
- // contextActionRegistry.addAction(go, registerInTypes);
- return go;
- }
-
- protected ActionToolbarButtonDescriptor<StateToken> createGoHomeAction(final String... registerInTypes) {
- final ActionToolbarButtonDescriptor<StateToken> goGroupHome = new ActionToolbarButtonDescriptor<StateToken>(
- AccessRolDTO.Viewer, CONTEXT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- stateManager.gotoHistoryToken(token.getGroup());
- }
- });
- goGroupHome.setMustBeAuthenticated(false);
- goGroupHome.setIconUrl("images/group-home.png");
- goGroupHome.setEnableCondition(new ActionEnableCondition<StateToken>() {
- @Override
- public boolean mustBeEnabled(final StateToken token) {
- final StateToken defContentToken = session.getCurrentState().getGroup().getDefaultContent().getStateToken();
- return !session.getCurrentStateToken().equals(defContentToken);
- }
- });
- goGroupHome.setLeftSeparator(ActionToolbarButtonSeparator.fill);
- // contextActionRegistry.addAction(goGroupHome, registerInTypes);
- return goGroupHome;
- }
-
- protected void createNewContainerAction(final String contentTypeId, final String iconUrl,
- final String textDescription, final String parentMenuTitle, final String parentMenuSubtitle,
- final String defaultName, final Position position, final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder;
- addFolder = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor, CONTEXT_TOPBAR,
- new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- OldNotifyUser.showProgressProcessing();
- contentServiceProvider.get().addFolder(session.getUserHash(), stateToken, defaultName,
- contentTypeId, new AsyncCallbackSimple<StateContainerDTO>() {
- @Override
- public void onSuccess(final StateContainerDTO state) {
- contextNavigator.setEditOnNextStateChange(true);
- stateManager.setRetrievedStateAndGo(state);
- }
- });
- }
- });
- addFolder.setTextDescription(textDescription);
- addFolder.setParentMenuTitle(parentMenuTitle);
- addFolder.setParentSubMenuTitle(parentMenuSubtitle);
- addFolder.setIconUrl(iconUrl);
- register(addFolder, position, registerInTypes);
- }
-
- protected ActionToolbarMenuAndItemDescriptor<StateToken> createNewContentAction(final String typeId,
- final String iconUrl, final String description, final String parentMenuTitle,
- final Position position, final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> addContent = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
- @Override
- public void onEvent() {
- OldNotifyUser.showProgressProcessing();
- contentServiceProvider.get().addContent(session.getUserHash(),
- session.getCurrentState().getStateToken(), description, typeId,
- new AsyncCallbackSimple<StateContentDTO>() {
- @Override
- public void onSuccess(final StateContentDTO state) {
- contextNavigator.setEditOnNextStateChange(true);
- stateManager.setRetrievedStateAndGo(state);
- }
- });
- }
- });
- addContent.setTextDescription(description);
- addContent.setParentMenuTitle(parentMenuTitle);
- addContent.setParentSubMenuTitle(i18n.t("New"));
- addContent.setIconUrl(iconUrl);
- register(addContent, position, registerInTypes);
- return addContent;
- }
-
- protected abstract void createPostSessionInitActions();
-
- protected ActionToolbarMenuDescriptor<StateToken> createRefreshCntAction(final String parentMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarMenuDescriptor<StateToken> refreshCnt = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- stateManager.refreshCurrentState();
- contextNavigator.selectItem(stateToken);
- }
- });
- refreshCnt.setMustBeAuthenticated(false);
- refreshCnt.setParentMenuTitle(parentMenuTitle);
- refreshCnt.setTextDescription(i18n.t("Refresh"));
- refreshCnt.setIconUrl("images/nav/refresh.png");
- // contentActionRegistry.addAction(refreshCnt, registerInTypes);
- return refreshCnt;
- }
-
- protected ActionToolbarMenuDescriptor<StateToken> createRefreshCxtAction(
- final String parentMenuTitleCtx, final String... registerInTypes) {
- final ActionToolbarMenuDescriptor<StateToken> refreshCtx = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- stateManager.refreshCurrentState();
- contextNavigator.selectItem(stateToken);
- }
- });
- refreshCtx.setMustBeAuthenticated(false);
- refreshCtx.setParentMenuTitle(parentMenuTitleCtx);
- refreshCtx.setTextDescription(i18n.t("Refresh"));
- refreshCtx.setIconUrl("images/nav/refresh.png");
- // contextActionRegistry.addAction(refreshCtx, registerInTypes);
- return refreshCtx;
- }
-
- protected ActionToolbarMenuAndItemDescriptor<StateToken> createRenameContentInCtxAction(
- final String parentMenuTitleCtx, final String textDescription, final String... registerInTypes) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtx = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- contextNavigator.editItem(stateToken);
- }
- });
- renameCtx.setTextDescription(textDescription);
- renameCtx.setParentMenuTitle(parentMenuTitleCtx);
- // contextActionRegistry.addAction(renameCtx, registerInTypes);
- return renameCtx;
- }
-
- protected ActionToolbarMenuDescriptor<StateToken> createSetAsDefContent(final String parentMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupContent;
- setAsDefGroupContent = new ActionToolbarMenuDescriptor<StateToken>(AccessRolDTO.Administrator,
- CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken token) {
- OldNotifyUser.showProgressProcessing();
- contentServiceProvider.get().setAsDefaultContent(session.getUserHash(), token,
- new AsyncCallbackSimple<ContentSimpleDTO>() {
- @Override
- public void onSuccess(final ContentSimpleDTO defContent) {
- session.getCurrentState().getGroup().setDefaultContent(defContent);
- OldNotifyUser.hideProgress();
- OldNotifyUser.info(i18n.t("Content selected as the group homepage"));
- }
- });
- }
- });
- setAsDefGroupContent.setTextDescription(i18n.t("Set this as the default group page"));
- setAsDefGroupContent.setIconUrl("images/group-home.png");
- setAsDefGroupContent.setEnableCondition(notDefAndNotDeleted());
- setAsDefGroupContent.setParentMenuTitle(parentMenuTitle);
- // contentActionRegistry.addAction(setAsDefGroupContent,
- // registerInTypes);
- return setAsDefGroupContent;
- }
-
- //
- // protected void createSetGroupBackImageAction(final String parentMenuTitle,
- // final String... registerInTypes) {
- // final ActionToolbarMenuAndItemDescriptor<StateToken> setGroupBackImage =
- // new ActionToolbarMenuAndItemDescriptor<StateToken>(
- // AccessRolDTO.Administrator, CONTENT_TOPBAR, new Listener<StateToken>() {
- // @Override
- // public void onEvent(final StateToken token) {
- // groupServiceProvider.get().setGroupBackImage(session.getUserHash(), token,
- // new AsyncCallbackSimple<GroupDTO>() {
- // @Override
- // public void onSuccess(final GroupDTO newGroup) {
- // if (session.getCurrentState().getGroup().getShortName().equals(
- // newGroup.getShortName())) {
- // session.getCurrentState().setGroup(newGroup);
- // wsBackManager.clearBackImage();
- // wsBackManager.setBackImage(newGroup.getGroupBackImage().getStateToken());
- // }
- // }
- // });
- // }
- // });
- // setGroupBackImage.setParentMenuTitle(parentMenuTitle);
- // setGroupBackImage.setTextDescription(i18n.t("Set this as the group background image"));
- // setGroupBackImage.setIconUrl("images/nav/picture.png");
- // setGroupBackImage.setEnableCondition(new
- // ActionEnableCondition<StateToken>() {
- // @Override
- // public boolean mustBeEnabled(final StateToken token) {
- // return session.getContentState().getMimeType().isImage();
- // }
- // });
- // // contentActionRegistry.addAction(setGroupBackImage, registerInTypes);
- // }
-
- protected void createSetStatusAction(final AccessRolDTO rol, final String textDescription,
- final ContentStatus status, final String[] contentsModerated) {
- final ActionToolbarMenuRadioDescriptor<StateToken> action = new ActionToolbarMenuRadioDescriptor<StateToken>(
- rol, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- setContentStatus(status, stateToken);
- }
- }, "ContentRadioStatus", new RadioMustBeChecked() {
- @Override
- public boolean mustBeChecked() {
- if (session.getContainerState() instanceof StateContentDTO) {
- final ContentStatus currentStatus = session.getContentState().getStatus();
- return status.equals(currentStatus);
- }
- return false;
- }
- });
- action.setTextDescription(textDescription);
- action.setParentMenuTitle(PUBLICATION_MENU);
- action.setParentMenuIconUrl("images/anybody.png");
- // contentActionRegistry.addAction(action, contentsModerated);
- }
-
- protected void createShowDeletedItems(final String parentMenuTitle, final String... registerInTypes) {
- final ActionToolbarMenuCheckItemDescriptor<StateToken> showDeletedItems = new ActionToolbarMenuCheckItemDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTEXT_TOPBAR, new Listener0() {
- @Override
- public void onEvent() {
- final boolean mustShow = !session.getCurrentUserInfo().getShowDeletedContent();
- session.getCurrentUserInfo().setShowDeletedContent(mustShow);
- if (!mustShow && session.isCurrentStateAContent()
- && session.getContentState().getStatus().equals(ContentStatus.inTheDustbin)) {
- stateManager.gotoHistoryToken(session.getCurrentStateToken().getGroup());
- }
- contextNavigator.clear();
- contextNavigator.refreshState();
- }
- }, new ActionCheckedCondition() {
- @Override
- public boolean mustBeChecked() {
- return session.getShowDeletedContent();
- }
- });
- showDeletedItems.setParentMenuTitle(parentMenuTitle);
- showDeletedItems.setTextDescription("Show deleted items");
- showDeletedItems.setMustBeAuthenticated(true);
- // contextActionRegistry.addAction(showDeletedItems, registerInTypes);
- }
-
- protected ActionToolbarMenuDescriptor<StateToken> createTranslateAction(final String fileMenuTitle,
- final String... registerInTypes) {
- final ActionToolbarMenuDescriptor<StateToken> translateContent = new ActionToolbarMenuDescriptor<StateToken>(
- AccessRolDTO.Editor, CONTENT_TOPBAR, new Listener<StateToken>() {
- @Override
- public void onEvent(final StateToken stateToken) {
- OldNotifyUser.important(i18n.t("Sorry, this functionality is currently in development"));
- }
- });
- translateContent.setParentMenuTitle(fileMenuTitle);
- translateContent.setTextDescription(i18n.tWithNT("Translate", "used in button"));
- translateContent.setToolTip(i18n.t("Translate this document to other languages"));
- translateContent.setIconUrl("images/language.gif");
- translateContent.setEnableCondition(notDeleted());
- // contentActionRegistry.addAction(translateContent, registerInTypes);
- return translateContent;
- }
-
- protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadAction(
- final String textDescription, final String iconUrl, final String toolTip,
- final String permitedExtensions, final String... registerInTypes) {
- final ActionToolbarButtonAndItemDescriptor<StateToken> uploadFile;
- uploadFile = new ActionToolbarButtonAndItemDescriptor<StateToken>(AccessRolDTO.Editor,
- CONTEXT_BOTTOMBAR, new Listener0() {
- @Override
- public void onEvent() {
- if (permitedExtensions != null) {
- // FIXME: can't be reset ...
- // fileUploaderProvider.get().setPermittedExtensions(permitedExtensions);
- } else {
- // FIXME: can't be reset ...
- // fileUploaderProvider.get().resetPermittedExtensions();
- }
- fileUploaderProvider.get().show();
- }
- });
- uploadFile.setTextDescription(textDescription);
- uploadFile.setIconUrl(iconUrl);
- uploadFile.setToolTip(toolTip);
- // contextActionRegistry.addAction(uploadFile, registerInTypes);
- return uploadFile;
- }
-
- protected ActionToolbarButtonAndItemDescriptor<StateToken> createUploadMediaAction(
- final String... registerInTypes) {
- final ActionToolbarButtonAndItemDescriptor<StateToken> uploadMedia = createUploadAction(
- i18n.t("Upload media"), "images/nav/upload.png",
- i18n.t("Upload some media (images, videos...)"), session.getGalleryPermittedExtensions());
- // contextActionRegistry.addAction(uploadMedia, registerInTypes);
- return uploadMedia;
- }
-
- protected void downloadContent(final StateToken token) {
- fileDownloadProvider.get().downloadFile(token);
- }
-
- private ActionEnableCondition<StateToken> notDefAndNotDeleted() {
- return new ActionEnableCondition<StateToken>() {
- @Override
- public boolean mustBeEnabled(final StateToken token) {
- final boolean isNotDefContentToken = !session.getCurrentState().getGroup().getDefaultContent().getStateToken().equals(
- session.getCurrentStateToken());
- return isNotDefContentToken && notDeleted().mustBeEnabled(token);
- }
- };
- }
-
- private ActionEnableCondition<StateToken> notDeleted() {
- return new ActionEnableCondition<StateToken>() {
- @Override
- public boolean mustBeEnabled(final StateToken token) {
- final boolean isNotDeleted = !(session.isCurrentStateAContent() && session.getContentState().getStatus().equals(
- ContentStatus.inTheDustbin));
- return isNotDeleted;
- }
- };
- }
-
- private void register(final ActionToolbarMenuAndItemDescriptor<StateToken> action,
- final Position position, final String... registerInTypes) {
- if (position.equals(Position.ctx)) {
- // contextActionRegistry.addAction(action, registerInTypes);
- } else if (position.equals(Position.cnt)) {
- // contentActionRegistry.addAction(action, registerInTypes);
- }
- }
-
- private void setContentStatus(final ContentStatus status, final StateToken stateToken) {
- final AsyncCallbackSimple<StateAbstractDTO> callback = new AsyncCallbackSimple<StateAbstractDTO>() {
- @Override
- public void onSuccess(final StateAbstractDTO state) {
- if (session.inSameToken(stateToken)) {
- session.setCurrentState(state);
- // publicLink.setState(state);
- foldableContent.refreshState();
- }
- contextNavigator.setItemStatus(stateToken, status);
- }
- };
- if (status.equals(ContentStatus.publishedOnline) || status.equals(ContentStatus.rejected)
- || status.equals(ContentStatus.inTheDustbin)) {
- contentServiceProvider.get().setStatusAsAdmin(session.getUserHash(), stateToken, status, callback);
- } else {
- contentServiceProvider.get().setStatus(session.getUserHash(), stateToken, status, callback);
- }
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/RegistryModule.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,219 +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 org.ourproject.kune.workspace.client;
-
-import org.ourproject.kune.platf.client.services.AbstractExtendedModule;
-
-import cc.kune.core.client.registry.AclEditableRegistry;
-import cc.kune.core.client.registry.AuthorableRegistry;
-import cc.kune.core.client.registry.CanBeHomepageRegistry;
-import cc.kune.core.client.registry.ComentableRegistry;
-import cc.kune.core.client.registry.DragableRegistry;
-import cc.kune.core.client.registry.DropableRegistry;
-import cc.kune.core.client.registry.EmailSubscribeAbleRegistry;
-import cc.kune.core.client.registry.LicensableRegistry;
-import cc.kune.core.client.registry.PublishModerableRegistry;
-import cc.kune.core.client.registry.RateableRegistry;
-import cc.kune.core.client.registry.RenamableRegistry;
-import cc.kune.core.client.registry.TageableRegistry;
-import cc.kune.core.client.registry.TranslatableRegistry;
-import cc.kune.core.client.registry.VersionableRegistry;
-import cc.kune.core.client.registry.XmppComentableRegistry;
-import cc.kune.core.client.registry.XmppNotifyCapableRegistry;
-
-import com.calclab.suco.client.ioc.decorator.Singleton;
-import com.calclab.suco.client.ioc.module.Factory;
-
-public class RegistryModule extends AbstractExtendedModule {
-
- @Override
- protected void onInstall() {
-
- register(Singleton.class, new Factory<AclEditableRegistry>(AclEditableRegistry.class) {
- @Override
- public AclEditableRegistry create() {
- return new AclEditableRegistry();
- }
- });
- register(Singleton.class, new Factory<AuthorableRegistry>(AuthorableRegistry.class) {
- @Override
- public AuthorableRegistry create() {
- return new AuthorableRegistry();
- }
- });
- register(Singleton.class, new Factory<CanBeHomepageRegistry>(CanBeHomepageRegistry.class) {
- @Override
- public CanBeHomepageRegistry create() {
- return new CanBeHomepageRegistry();
- }
- });
-
- register(Singleton.class, new Factory<ComentableRegistry>(ComentableRegistry.class) {
- @Override
- public ComentableRegistry create() {
- return new ComentableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<DragableRegistry>(DragableRegistry.class) {
- @Override
- public DragableRegistry create() {
- return new DragableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<DropableRegistry>(DropableRegistry.class) {
- @Override
- public DropableRegistry create() {
- return new DropableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<EmailSubscribeAbleRegistry>(EmailSubscribeAbleRegistry.class) {
- @Override
- public EmailSubscribeAbleRegistry create() {
- return new EmailSubscribeAbleRegistry();
- }
- });
-
- register(Singleton.class, new Factory<LicensableRegistry>(LicensableRegistry.class) {
- @Override
- public LicensableRegistry create() {
- return new LicensableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<PublishModerableRegistry>(PublishModerableRegistry.class) {
- @Override
- public PublishModerableRegistry create() {
- return new PublishModerableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<RateableRegistry>(RateableRegistry.class) {
- @Override
- public RateableRegistry create() {
- return new RateableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<TageableRegistry>(TageableRegistry.class) {
- @Override
- public TageableRegistry create() {
- return new TageableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<RenamableRegistry>(RenamableRegistry.class) {
- @Override
- public RenamableRegistry create() {
- return new RenamableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<TranslatableRegistry>(TranslatableRegistry.class) {
- @Override
- public TranslatableRegistry create() {
- return new TranslatableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<VersionableRegistry>(VersionableRegistry.class) {
- @Override
- public VersionableRegistry create() {
- return new VersionableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<XmppComentableRegistry>(XmppComentableRegistry.class) {
- @Override
- public XmppComentableRegistry create() {
- return new XmppComentableRegistry();
- }
- });
-
- register(Singleton.class, new Factory<XmppNotifyCapableRegistry>(XmppNotifyCapableRegistry.class) {
- @Override
- public XmppNotifyCapableRegistry create() {
- return new XmppNotifyCapableRegistry();
- }
- });
-
- // register(Singleton.class, new
- // Factory<IconsRegistry>(IconsRegistry.class) {
- // @Override
- // public IconsRegistry create() {
- // return new IconsRegistry();
- // }
- // });
-
- // register(Singleton.class, new
- // Factory<ContentCapabilitiesRegistry>(ContentCapabilitiesRegistry.class)
- // {
- // @Override
- // public ContentCapabilitiesRegistry create() {
- // return new ContentCapabilitiesRegistry(i(AuthorableRegistry.class),
- // i(AclEditableRegistry.class),
- // i(OldIconsRegistry.class), i(CanBeHomepageRegistry.class),
- // i(ComentableRegistry.class),
- // i(DragableRegistry.class), i(DropableRegistry.class),
- // i(EmailSubscribeAbleRegistry.class),
- // i(LicensableRegistry.class), i(PublishModerableRegistry.class),
- // i(RateableRegistry.class),
- // i(TageableRegistry.class), i(RenamableRegistry.class),
- // i(TranslatableRegistry.class),
- // i(VersionableRegistry.class), i(XmppComentableRegistry.class),
- // i(XmppNotifyCapableRegistry.class));
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<ContextActionRegistry>(ContextActionRegistry.class) {
- // @Override
- // public ContextActionRegistry create() {
- // return new ContextActionRegistry();
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<ContentActionRegistry>(ContentActionRegistry.class) {
- // @Override
- // public ContentActionRegistry create() {
- // return new ContentActionRegistry();
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<GroupActionRegistry>(GroupActionRegistry.class) {
- // @Override
- // public GroupActionRegistry create() {
- // return new GroupActionRegistry();
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<UserActionRegistry>(UserActionRegistry.class) {
- // @Override
- // public UserActionRegistry create() {
- // return new UserActionRegistry();
- // }
- // });
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceMessages.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceMessages.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceMessages.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,26 +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 org.ourproject.kune.workspace.client;
-
-public final class WorkspaceMessages {
-
- private WorkspaceMessages() {
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceModule.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,1113 +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 org.ourproject.kune.workspace.client;
-
-import org.ourproject.kune.platf.client.services.AbstractExtendedModule;
-
-public class WorkspaceModule extends AbstractExtendedModule {
- @Override
- protected void onInstall() {
- //
- // register(Singleton.class, new
- // Factory<SocialNetworkServiceAsync>(SocialNetworkServiceAsync.class) {
- // @Override
- // public SocialNetworkServiceAsync create() {
- // final SocialNetworkServiceAsync snServiceAsync =
- // (SocialNetworkServiceAsync) GWT.create(SocialNetworkService.class);
- // ((ServiceDefTarget)
- // snServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL()
- // + "SocialNetworkService");
- // return snServiceAsync;
- // }
- // }, new Factory<GroupServiceAsync>(GroupServiceAsync.class) {
- // @Override
- // public GroupServiceAsync create() {
- // final GroupServiceAsync groupServiceAsync = (GroupServiceAsync)
- // GWT.create(GroupService.class);
- // ((ServiceDefTarget)
- // groupServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL() +
- // "GroupService");
- // return groupServiceAsync;
- // }
- // }, new Factory<ContentServiceAsync>(ContentServiceAsync.class) {
- // @Override
- // public ContentServiceAsync create() {
- // final ContentServiceAsync contentServiceAsync = (ContentServiceAsync)
- // GWT.create(ContentService.class);
- // ((ServiceDefTarget)
- // contentServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL() +
- // "ContentService");
- // return contentServiceAsync;
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<WorkspaceSkeleton>(WorkspaceSkeleton.class) {
- // @Override
- // public WorkspaceSkeleton create() {
- // return new WorkspaceSkeleton();
- // }
- // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<SiteProgress>(SiteProgress.class) {
- // // @Override
- // // public SiteProgress create() {
- // // final SiteProgressPresenter presenter = new
- // SiteProgressPresenter();
- // // final SiteProgressPanel panel = new SiteProgressPanel(presenter,
- // // p(SitePublicSpaceLink.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // // register(ApplicationComponentGroup.class, new
- // Factory<WorkspaceNotifyUser>(WorkspaceNotifyUser.class) {
- // // @Override
- // // public WorkspaceNotifyUser create() {
- // // return new WorkspaceNotifyUser(i(NotifyUser.class),
- // i(I18nUITranslationService.class),
- // // i(SiteProgress.class), p(ToastMessage.class),
- // p(WorkspaceSkeleton.class));
- // // }
- // // });
- // //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<SitePublicSpaceLink>(SitePublicSpaceLink.class) {
- // // @Override
- // // public SitePublicSpaceLink create() {
- // // final SitePublicSpaceLinkPresenter presenter = new
- // // SitePublicSpaceLinkPresenter(i(StateManager.class),
- // // i(StateTokenUtils.class));
- // // final SitePublicSpaceLinkPanel panel = new
- // // SitePublicSpaceLinkPanel(presenter,
- // // i(WorkspaceSkeleton.class), i(I18nUITranslationService.class),
- // // i(Images.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // register(Singleton.class, new
- // Factory<StateTokenUtils>(StateTokenUtils.class) {
- // @Override
- // public StateTokenUtils create() {
- // return new StateTokenUtils(i(Session.class));
- // }
- // });
- //
- // register(NoDecoration.class, new
- // Factory<ToastMessage>(ToastMessage.class) {
- // @Override
- // public ToastMessage create() {
- // final ToastMessagePresenter presenter = new ToastMessagePresenter();
- // final ToastMessagePanel panel = new ToastMessagePanel();
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<SiteUserOptions>(SiteUserOptions.class) {
- // // @Override
- // // public SiteUserOptions create() {
- // // final SiteUserOptionsPresenter presenter = new
- // // SiteUserOptionsPresenter(i(Session.class),
- // // i(StateManager.class), p(FileDownloadUtils.class),
- // // $(I18nTranslationService.class),
- // // $(IconResources.class));
- // // final SiteUserOptionsPanel panel = new
- // // SiteUserOptionsPanel(presenter, i(WorkspaceSkeleton.class),
- // // $(GuiBindingsRegister.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- // //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<SiteSignInLink>(SiteSignInLink.class) {
- // // @Override
- // // public SiteSignInLink create() {
- // // final SiteSignInLinkPresenter presenter = new
- // // SiteSignInLinkPresenter(i(Session.class));
- // // final SiteSignInLinkPanel panel = new
- // SiteSignInLinkPanel(presenter,
- // // i(I18nUITranslationService.class),
- // // i(WorkspaceSkeleton.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<SiteSignOutLink>(SiteSignOutLink.class) {
- // // @Override
- // // public SiteSignOutLink create() {
- // // final SiteSignOutLinkPresenter presenter = new
- // // SiteSignOutLinkPresenter(i(Session.class),
- // // p(UserServiceAsync.class), p(ErrorHandler.class));
- // // final SiteSignOutLinkPanel panel = new
- // // SiteSignOutLinkPanel(presenter,
- // // i(I18nUITranslationService.class), i(WorkspaceSkeleton.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- // //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<SiteOptions>(SiteOptions.class) {
- // // @Override
- // // public SiteOptions create() {
- // // final SiteOptionsPresenter presenter = new
- // // SiteOptionsPresenter(i(I18nUITranslationService.class),
- // // i(IconResources.class));
- // // final SiteOptionsPanel panel = new
- // // SiteOptionsPanel(i(WorkspaceSkeleton.class),
- // // i(I18nUITranslationService.class), i(GuiBindingsRegister.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<SiteSearch>(SiteSearch.class) {
- // @Override
- // public SiteSearch create() {
- // final SiteSearchPresenter presenter = new
- // SiteSearchPresenter(p(SiteSearcher.class),
- // i(I18nTranslationService.class));
- // final SiteSearchPanel panel = new SiteSearchPanel(presenter,
- // i(WorkspaceSkeleton.class),
- // i(Images.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<SiteLogo>(SiteLogo.class) {
- // @Override
- // public SiteLogo create() {
- // // final SiteLogoPresenter presenter = new
- // // SiteLogoPresenter(i(Session.class));
- // // final SiteLogoPanel panel = new SiteLogoPanel(presenter,
- // // i(WorkspaceSkeleton.class));
- // // presenter.init(panel);
- // return null;
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<EntityHeader>(EntityHeader.class) {
- // @Override
- // public EntityHeader create() {
- // final EntityHeaderPresenter presenter = new
- // EntityHeaderPresenter(i(StateManager.class),
- // i(WsThemeManager.class), i(Session.class));
- // final EntityHeaderPanel panel = new
- // EntityHeaderPanel(i(WorkspaceSkeleton.class),
- // p(FileDownloadUtils.class), i(Images.class),
- // i(GuiBindingsRegister.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<WsBackManager>(WsBackManager.class) {
- // @Override
- // public WsBackManager create() {
- // return new WsBackManagerImpl(i(FileDownloadUtils.class));
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<WsThemeManager>(WsThemeManager.class) {
- // @Override
- // public WsThemeManager create() {
- // final WsThemeManager presenter = new WsThemeManager(i(Session.class),
- // p(GroupServiceAsync.class),
- // i(StateManager.class), i(WsBackManager.class));
- // new WsThemeManagerPanel(presenter, i(WorkspaceSkeleton.class));
- // return presenter;
- // }
- // });
- //
- // register(NoDecoration.class, new
- // Factory<WsThemeSelector>(WsThemeSelector.class) {
- // @Override
- // public WsThemeSelector create() {
- // final WsThemeSelectorPresenter presenter = new
- // WsThemeSelectorPresenter(i(Session.class),
- // i(I18nTranslationService.class));
- // presenter.init(new SimpleGuiItem(i(GuiBindingsRegister.class)));
- // return presenter;
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<EntityTitle>(EntityTitle.class) {
- // @Override
- // public EntityTitle create() {
- // final EntityTitlePresenter presenter = new
- // EntityTitlePresenter(i(StateManager.class),
- // i(Session.class), i(ContentIconsRegistry.class),
- // i(RenamableRegistry.class),
- // i(RenameAction.class));
- // final EntityTitlePanel panel = new
- // EntityTitlePanel(i(WorkspaceSkeleton.class), presenter);
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<EntitySubTitle>(EntitySubTitle.class) {
- // @Override
- // public EntitySubTitle create() {
- // final EntitySubTitlePresenter presenter = new
- // EntitySubTitlePresenter(
- // i(I18nUITranslationService.class), i(StateManager.class), false,
- // i(AuthorableRegistry.class));
- // final EntitySubTitlePanel panel = new EntitySubTitlePanel(presenter,
- // i(WorkspaceSkeleton.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<EntityLicensePresenter>(EntityLicensePresenter.class) {
- // // @Override
- // // public EntityLicensePresenter create() {
- // // final EntityLicensePresenter presenter = new
- // // EntityLicensePresenter(i(StateManager.class));
- // // final EntityLicensePanel panel = new EntityLicensePanel(presenter,
- // // i(I18nUITranslationService.class),
- // // i(WorkspaceSkeleton.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<RateIt>(RateIt.class) {
- // @Override
- // public RateIt create() {
- // final RateItPresenter presenter = new
- // RateItPresenter(i(I18nUITranslationService.class),
- // i(Session.class), p(ContentServiceAsync.class),
- // i(StateManager.class), p(RatePresenter.class),
- // i(ContentCapabilitiesRegistry.class));
- // final RateItPanel panel = new RateItPanel(presenter,
- // i(I18nUITranslationService.class),
- // i(WorkspaceSkeleton.class), i(Images.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<RatePresenter>(RatePresenter.class) {
- // @Override
- // public RatePresenter create() {
- // final RatePresenter presenter = new
- // RatePresenter(i(StateManager.class),
- // i(ContentCapabilitiesRegistry.class));
- // final RatePanel panel = new RatePanel(null, null,
- // i(I18nUITranslationService.class),
- // i(WorkspaceSkeleton.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<ActionManager>(ActionManager.class) {
- // @Override
- // public ActionManager create() {
- // return new ActionManager();
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<ActionGroupSummaryToolbar>(ActionGroupSummaryToolbar.class) {
- // @Override
- // public ActionGroupSummaryToolbar create() {
- // final ActionToolbarPanel<StateToken> panel = new
- // ActionToolbarPanel<StateToken>(p(ActionManager.class));
- // final ActionGroupSummaryToolbarPresenter toolbar = new
- // ActionGroupSummaryToolbarPresenter(panel);
- // return toolbar;
- // }
- // }, new
- // Factory<ActionParticipationToolbar>(ActionParticipationToolbar.class)
- // {
- // @Override
- // public ActionParticipationToolbar create() {
- // final ActionToolbarPanel<StateToken> panel = new
- // ActionToolbarPanel<StateToken>(p(ActionManager.class));
- // final ActionParticipationSummaryToolbarPresenter toolbar = new
- // ActionParticipationSummaryToolbarPresenter(
- // panel);
- // return toolbar;
- // }
- // }, new
- // Factory<ActionBuddiesSummaryToolbar>(ActionBuddiesSummaryToolbar.class)
- // {
- // @Override
- // public ActionBuddiesSummaryToolbar create() {
- // final ActionToolbarPanel<UserSimpleDTO> panel = new
- // ActionToolbarPanel<UserSimpleDTO>(
- // p(ActionManager.class));
- // final ActionBuddiesSummaryToolbarPresenter toolbar = new
- // ActionBuddiesSummaryToolbarPresenter(panel);
- // return toolbar;
- // }
- // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<GroupMembersSummary>(GroupMembersSummary.class) {
- // // @Override
- // // public GroupMembersSummary create() {
- // // final GroupMembersSummaryPresenter presenter = new
- // // GroupMembersSummaryPresenter(
- // // i(I18nUITranslationService.class), i(StateManager.class),
- // // i(ImageUtils.class),
- // // i(Session.class), p(SocialNetworkServiceAsync.class),
- // // p(GroupServiceAsync.class),
- // // p(GroupLiveSearcher.class), p(ChatEngine.class),
- // // i(GroupActionRegistry.class),
- // // i(ActionGroupSummaryToolbar.class), p(FileDownloadUtils.class),
- // // i(AccessRightsClientManager.class), i(IconResources.class));
- // // final GroupMembersSummaryView view = new
- // // GroupMembersSummaryPanel(presenter,
- // // i(I18nUITranslationService.class), i(WorkspaceSkeleton.class), i(
- // // ActionGroupSummaryToolbar.class).getView());
- // // presenter.init(view);
- // // return presenter;
- // // }
- // // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<AddAsBuddieHeaderButton>(AddAsBuddieHeaderButton.class) {
- // @Override
- // public AddAsBuddieHeaderButton create() {
- // return new AddAsBuddieHeaderButton(p(ChatEngine.class),
- // i(Session.class), i(StateManager.class),
- // i(I18nTranslationService.class), i(IconResources.class),
- // i(EntityHeader.class));
- // }
- // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<BuddiesSummary>(BuddiesSummary.class) {
- // // @Override
- // // public BuddiesSummary create() {
- // // final BuddiesSummaryPresenter presenter = new
- // // BuddiesSummaryPresenter(i(StateManager.class),
- // // i(Session.class), p(UserServiceAsync.class),
- // // i(UserActionRegistry.class),
- // // i(I18nTranslationService.class), p(ChatEngine.class),
- // // i(ActionBuddiesSummaryToolbar.class),
- // // p(FileDownloadUtils.class), i(ImageUtils.class),
- // // p(SocialNetworkServiceAsync.class),
- // // i(GroupActionRegistry.class), i(AccessRightsClientManager.class),
- // // i(IconResources.class));
- // // final BuddiesSummaryPanel panel = new
- // BuddiesSummaryPanel(presenter,
- // // i(WorkspaceSkeleton.class),
- // // i(I18nTranslationService.class), i(ActionManager.class),
- // // i(ActionBuddiesSummaryToolbar.class).getView());
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<ParticipationSummary>(ParticipationSummary.class) {
- // // @Override
- // // public ParticipationSummary create() {
- // // final ParticipationSummaryPresenter presenter = new
- // // ParticipationSummaryPresenter(
- // // i(I18nUITranslationService.class), i(StateManager.class),
- // // i(ImageUtils.class),
- // // i(Session.class), p(SocialNetworkServiceAsync.class),
- // // i(GroupActionRegistry.class),
- // // i(ActionParticipationToolbar.class), p(FileDownloadUtils.class),
- // // i(AccessRightsClientManager.class), i(IconResources.class));
- // // final ParticipationSummaryView view = new
- // // ParticipationSummaryPanel(presenter,
- // // i(I18nUITranslationService.class), i(WorkspaceSkeleton.class), i(
- // // ActionParticipationToolbar.class).getView());
- // // presenter.init(view);
- // // return presenter;
- // // }
- // // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<TagsSummary>(TagsSummary.class) {
- // // @Override
- // // public TagsSummary create() {
- // // final TagsSummaryPresenter presenter = new
- // // TagsSummaryPresenter(i(Session.class),
- // // p(SiteSearcher.class), i(StateManager.class));
- // // final TagsSummaryPanel panel = new TagsSummaryPanel(presenter,
- // // i(I18nUITranslationService.class),
- // // i(WorkspaceSkeleton.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<NoHomePage>(NoHomePage.class) {
- // @Override
- // public NoHomePage create() {
- // final NoHomePagePresenter presenter = new
- // NoHomePagePresenter(i(StateManager.class),
- // p(EntityHeader.class));
- // final NoHomePagePanel panel = new NoHomePagePanel(presenter,
- // i(WorkspaceSkeleton.class),
- // i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(ApplicationComponentGroup.class, new
- // Factory<GroupOptions>(GroupOptions.class) {
- // @Override
- // public GroupOptions create() {
- // final GroupOptionsPresenter presenter = new
- // GroupOptionsPresenter(i(StateManager.class),
- // i(I18nTranslationService.class), i(IconResources.class));
- // final GroupOptionsPanel panel = new GroupOptionsPanel(presenter,
- // i(EntityHeader.class),
- // i(I18nTranslationService.class), i(NotifyLevelImages.class),
- // i(GroupOptionsCollection.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- // //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<UserOptions>(UserOptions.class) {
- // // @Override
- // // public UserOptions create() {
- // // final UserOptionsPresenter presenter = new
- // // UserOptionsPresenter(i(Session.class),
- // // i(StateManager.class), i(I18nTranslationService.class),
- // // i(IconResources.class),
- // // i(SiteUserOptions.class));
- // // final UserOptionsPanel panel = new UserOptionsPanel(presenter,
- // // i(EntityHeader.class),
- // // i(I18nTranslationService.class), i(NotifyLevelImages.class),
- // // i(UserOptionsCollection.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // register(GroupOptionsCollection.class, new
- // Factory<EntityOptionsToolsConf>(EntityOptionsToolsConf.class) {
- // @Override
- // public EntityOptionsToolsConf create() {
- // final GroupOptionsToolsConfPresenter presenter = new
- // GroupOptionsToolsConfPresenter(
- // i(StateManager.class), i(Session.class),
- // i(I18nTranslationService.class),
- // i(GroupOptions.class), p(GroupServiceAsync.class));
- // final EntityOptionsToolsConfPanel panel = new
- // EntityOptionsToolsConfPanel(presenter,
- // i(WorkspaceSkeleton.class), i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(UserOptionsCollection.class, new
- // Factory<UserOptionsToolsConf>(UserOptionsToolsConf.class) {
- // @Override
- // public UserOptionsToolsConf create() {
- // final UserOptionsToolsConfPresenter presenter = new
- // UserOptionsToolsConfPresenter(i(Session.class),
- // i(StateManager.class), i(I18nTranslationService.class),
- // i(UserOptions.class),
- // p(GroupServiceAsync.class));
- // final EntityOptionsToolsConfPanel panel = new
- // EntityOptionsToolsConfPanel(presenter,
- // i(WorkspaceSkeleton.class), i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(GroupOptionsCollection.class, new
- // Factory<GroupOptionsLogo>(GroupOptionsLogo.class) {
- // @Override
- // public GroupOptionsLogo create() {
- // final EntityOptionsLogoPresenter presenter = new
- // GroupOptionsLogoPresenter(i(Session.class),
- // i(EntityHeader.class), i(GroupOptions.class), i(StateManager.class),
- // p(UserServiceAsync.class),
- // p(ChatEngine.class));
- // final GroupOptionsLogoPanel panel = new
- // GroupOptionsLogoPanel(presenter, i(WorkspaceSkeleton.class),
- // i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(UserOptionsCollection.class, new
- // Factory<UserOptionsLogo>(UserOptionsLogo.class) {
- // @Override
- // public UserOptionsLogo create() {
- // final EntityOptionsLogoPresenter presenter = new
- // UserOptionsLogoPresenter(i(Session.class),
- // i(EntityHeader.class), i(UserOptions.class), i(StateManager.class),
- // p(UserServiceAsync.class),
- // p(ChatEngine.class));
- // final UserOptionsLogoPanel panel = new
- // UserOptionsLogoPanel(presenter, i(WorkspaceSkeleton.class),
- // i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(GroupOptionsCollection.class, new
- // Factory<GroupOptionsDefLicense>(GroupOptionsDefLicense.class) {
- // @Override
- // public GroupOptionsDefLicense create() {
- // final GroupOptionsDefLicensePresenter presenter = new
- // GroupOptionsDefLicensePresenter(
- // i(GroupOptions.class), i(StateManager.class), i(Session.class),
- // p(LicenseWizard.class),
- // p(LicenseChangeAction.class));
- // final EntityOptionsDefLicensePanel panel = new
- // EntityOptionsDefLicensePanel(presenter,
- // i(WorkspaceSkeleton.class), i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(UserOptionsCollection.class, new
- // Factory<UserOptionsDefLicense>(UserOptionsDefLicense.class) {
- // @Override
- // public UserOptionsDefLicense create() {
- // final UserOptionsDefLicensePresenter presenter = new
- // UserOptionsDefLicensePresenter(
- // i(UserOptions.class), i(Session.class), p(LicenseWizard.class),
- // p(LicenseChangeAction.class));
- // final EntityOptionsDefLicensePanel panel = new
- // EntityOptionsDefLicensePanel(presenter,
- // i(WorkspaceSkeleton.class), i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(GroupOptionsCollection.class, new
- // Factory<GroupOptionsPublicSpaceConf>(
- // GroupOptionsPublicSpaceConf.class) {
- // @Override
- // public GroupOptionsPublicSpaceConf create() {
- // final WsThemeSelector themeSelector = i(WsThemeSelector.class);
- // final GroupOptionsPublicSpaceConfPresenter presenter = new
- // GroupOptionsPublicSpaceConfPresenter(
- // i(Session.class), i(StateManager.class), i(GroupOptions.class),
- // i(WsThemeManager.class),
- // themeSelector, p(GroupServiceAsync.class), i(WsBackManager.class));
- // final EntityOptionsPublicSpaceConfPanel panel = new
- // EntityOptionsPublicSpaceConfPanel(presenter,
- // i(WorkspaceSkeleton.class), i(I18nTranslationService.class),
- // themeSelector,
- // i(FileDownloadUtils.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(UserOptionsCollection.class,
- // new
- // Factory<UserOptionsPublicSpaceConf>(UserOptionsPublicSpaceConf.class)
- // {
- // @Override
- // public UserOptionsPublicSpaceConf create() {
- // final WsThemeSelector themeSelector = i(WsThemeSelector.class);
- // final UserOptionsPublicSpaceConfPresenter presenter = new
- // UserOptionsPublicSpaceConfPresenter(
- // i(Session.class), i(StateManager.class), i(UserOptions.class),
- // i(WsThemeManager.class),
- // themeSelector, p(GroupServiceAsync.class), i(WsBackManager.class));
- // final EntityOptionsPublicSpaceConfPanel panel = new
- // EntityOptionsPublicSpaceConfPanel(
- // presenter, i(WorkspaceSkeleton.class),
- // i(I18nTranslationService.class), themeSelector,
- // i(FileDownloadUtils.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<LicenseChangeAction>(LicenseChangeAction.class) {
- // @Override
- // public LicenseChangeAction create() {
- // return new LicenseChangeAction(p(GroupServiceAsync.class),
- // i(Session.class),
- // i(I18nTranslationService.class), i(StateManager.class));
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<RenameAction>(RenameAction.class) {
- // @Override
- // public RenameAction create() {
- // return new RenameAction(i(I18nTranslationService.class),
- // i(Session.class), p(ContentServiceAsync.class));
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<LicenseWizard>(LicenseWizard.class) {
- // @Override
- // public LicenseWizard create() {
- // final LicenseWizardPresenter presenter = new LicenseWizardPresenter(
- // i(LicenseWizardFirstFormView.class),
- // i(LicenseWizardSndFormView.class),
- // i(LicenseWizardTrdFormView.class), i(LicenseWizardFrdFormView.class),
- // i(Session.class));
- // final LicenseWizardPanel panel = new LicenseWizardPanel(presenter,
- // i(WorkspaceSkeleton.class),
- // i(I18nTranslationService.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<LicenseWizardFirstFormView>(LicenseWizardFirstFormView.class)
- // {
- // @Override
- // public LicenseWizardFirstFormView create() {
- // return new LicenseWizardFirstForm(i(I18nTranslationService.class));
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<LicenseWizardSndFormView>(LicenseWizardSndFormView.class) {
- // @Override
- // public LicenseWizardSndFormView create() {
- // return new LicenseWizardSndForm(i(I18nTranslationService.class));
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<LicenseWizardTrdFormView>(LicenseWizardTrdFormView.class) {
- // @Override
- // public LicenseWizardTrdFormView create() {
- // return new LicenseWizardTrdForm(i(Images.class),
- // i(I18nTranslationService.class));
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<LicenseWizardFrdFormView>(LicenseWizardFrdFormView.class) {
- // @Override
- // public LicenseWizardFrdFormView create() {
- // return new LicenseWizardFrdForm(i(I18nTranslationService.class),
- // i(Session.class));
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<FileUploader>(FileUploader.class) {
- // @Override
- // public FileUploader create() {
- // final FileUploaderPresenter presenter = new
- // FileUploaderPresenter(i(Session.class));
- // final FileUploaderDialog panel = new FileUploaderDialog(presenter,
- // i(I18nUITranslationService.class),
- // i(WorkspaceSkeleton.class));
- // presenter.init(panel);
- // return presenter;
- // }
- //
- // @Override
- // public void onAfterCreated(final FileUploader uploader) {
- // i(ContextNavigator.class).addFileUploaderListener(uploader);
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<SiteSearcher>(SiteSearcher.class) {
- // @Override
- // public SiteSearcher create() {
- // final SiteSearcherPresenter presenter = new
- // SiteSearcherPresenter(p(StateManager.class));
- // final SiteSearcherView view = new SiteSearcherPanel(presenter,
- // i(I18nTranslationService.class),
- // i(WorkspaceSkeleton.class));
- // presenter.init(view);
- // return presenter;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<I18nTranslator>(I18nTranslator.class) {
- // @Override
- // public I18nTranslator create() {
- // final I18nTranslatorPresenter presenter = new
- // I18nTranslatorPresenter(i(Session.class),
- // i(I18nServiceAsync.class), i(I18nUITranslationService.class));
- // final I18nTranslatorView view = new I18nTranslatorPanel(presenter,
- // i(I18nTranslationService.class),
- // i(LanguageSelector.class), i(WorkspaceSkeleton.class),
- // i(Images.class));
- // presenter.init(view);
- // return presenter;
- // }
- // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<SiteOptionsI18nTranslatorAction>(
- // // SiteOptionsI18nTranslatorAction.class) {
- // // @Override
- // // public SiteOptionsI18nTranslatorAction create() {
- // // return new SiteOptionsI18nTranslatorAction(i(SiteOptions.class),
- // // i(I18nTranslationService.class),
- // // i(IconResources.class), p(I18nTranslator.class));
- // // }
- // // });
- //
- // // register(Singleton.class, new Factory<SignIn>(SignIn.class) {
- // // @Override
- // // public SignIn create() {
- // // final SignInPresenter presenter = new
- // // SignInPresenter(i(Session.class), i(StateManager.class),
- // // i(I18nUITranslationService.class), p(UserServiceAsync.class),
- // // p(Register.class));
- // // final SignInView panel = new SignInPanel(presenter,
- // // i(I18nTranslationService.class),
- // // i(WorkspaceSkeleton.class), i(NotifyLevelImages.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- // //
- // // register(Singleton.class, new Factory<Register>(Register.class) {
- // // @Override
- // // public Register create() {
- // // final RegisterPresenter presenter = new
- // // RegisterPresenter(i(Session.class), i(StateManager.class),
- // // i(I18nUITranslationService.class), p(UserServiceAsync.class),
- // // p(SignIn.class));
- // // final RegisterView panel = new RegisterPanel(presenter,
- // // i(I18nTranslationService.class),
- // // i(WorkspaceSkeleton.class), i(Session.class),
- // // i(NotifyLevelImages.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // // register(Singleton.class, new Factory<NewGroup>(NewGroup.class) {
- // // @Override
- // // public NewGroup create() {
- // // final NewGroupPresenter presenter = new
- // // NewGroupPresenter(i(I18nTranslationService.class),
- // // i(Session.class), i(StateManager.class),
- // // p(GroupServiceAsync.class));
- // // final NewGroupPanel view = new NewGroupPanel(presenter,
- // // i(I18nTranslationService.class),
- // // p(LicenseWizard.class), i(NotifyLevelImages.class));
- // // presenter.init(view);
- // // return presenter;
- // // }
- // // });
- //
- // register(Singleton.class, new
- // Factory<UserLiveSearcher>(UserLiveSearcher.class) {
- // @Override
- // public UserLiveSearcher create() {
- // final UserLiveSearcherPresenter presenter = new
- // UserLiveSearcherPresenter();
- // final EntityLiveSearcherView view = new
- // UserLiveSearcherPanel(presenter,
- // i(I18nTranslationService.class), i(FileDownloadUtils.class));
- // presenter.init(view);
- // return presenter;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<GroupLiveSearcher>(GroupLiveSearcher.class) {
- // @Override
- // public GroupLiveSearcher create() {
- // final GroupLiveSearcherPresenter presenter = new
- // GroupLiveSearcherPresenter();
- // final EntityLiveSearcherView view = new
- // GroupLiveSearchPanel(presenter,
- // i(I18nTranslationService.class), i(FileDownloadUtils.class));
- // presenter.init(view);
- // return presenter;
- // }
- // });
- //
- // // register(Singleton.class, new
- // // Factory<ToolSelector>(ToolSelector.class) {
- // // @Override
- // // public ToolSelector create() {
- // // final ToolSelectorPresenter presenter = new
- // // ToolSelectorPresenter(i(StateManager.class),
- // // i(WsThemeManager.class));
- // // return presenter;
- // // }
- // // });
- //
- // register(Singleton.class, new
- // Factory<LanguageSelector>(LanguageSelector.class) {
- // @Override
- // public LanguageSelector create() {
- // final LanguageSelectorPresenter presenter = new
- // LanguageSelectorPresenter(i(Session.class));
- // final LanguageSelectorView view = new
- // LanguageSelectorPanel(presenter, i(I18nTranslationService.class));
- // presenter.init(view);
- // return presenter;
- // }
- // });
- //
- // // Register of tokens like "signin", "newgroup", "translate" etcetera
- // i(StateManager.class).addSiteToken(SiteTokens.SIGNIN, new
- // HistoryTokenCallback() {
- //
- // @Override
- // public void onHistoryToken() {
- // i(SignIn.class).showSignInDialog();
- // }
- // });
- //
- // i(StateManager.class).addSiteToken(SiteTokens.REGISTER, new
- // HistoryTokenCallback() {
- //
- // @Override
- // public void onHistoryToken() {
- // i(Register.class).doRegister();
- // }
- // });
- //
- // i(StateManager.class).addSiteToken(SiteTokens.NEWGROUP, new
- // HistoryTokenCallback() {
- //
- // @Override
- // public void onHistoryToken() {
- // i(NewGroup.class).doNewGroup();
- // }
- // });
- //
- // i(StateManager.class).addSiteToken(SiteTokens.TRANSLATE, new
- // HistoryTokenCallback() {
- //
- // @Override
- // public void onHistoryToken() {
- // i(I18nTranslator.class).doShowTranslator();
- // }
- // });
- //
- // // register(NoDecoration.class, new
- // // Factory<ActionContentToolbar>(ActionContentToolbar.class) {
- // // @Override
- // // public ActionContentToolbar create() {
- // // final ActionCntCtxToolbarPanel<StateToken> tbar = new
- // // ActionCntCtxToolbarPanel<StateToken>(
- // // AbstractFoldableContentActions.CONTENT_TOPBAR,
- // // p(ActionManager.class),
- // // i(WorkspaceSkeleton.class));
- // // final ActionContentToolbar toolbar = new
- // // ActionContentToolbarPresenter(tbar);
- // // return toolbar;
- // // }
- // // });
- //
- // // register(Singleton.class, new
- // // Factory<ContentEditor>(ContentEditor.class) {
- // // @Override
- // // public ContentEditor create() {
- // // final ContentEditorPresenter presenter = new
- // // ContentEditorPresenter(i(I18nTranslationService.class),
- // // i(Session.class), i(RTEImgResources.class),
- // // p(InsertLinkDialog.class),
- // // p(ColorWebSafePalette.class), p(EditHtmlDialog.class),
- // // p(InsertImageDialog.class),
- // // p(InsertMediaDialog.class), p(InsertTableDialog.class),
- // // p(InsertSpecialCharDialog.class),
- // // i(SchedulerManager.class), true, i(StateManager.class),
- // // i(SiteSignOutLink.class),
- // // i(WorkspaceSkeleton.class), i(TimerWrapper.class),
- // // i(EntityTitle.class));
- // // final ContentEditorPanel panel = new ContentEditorPanel(presenter,
- // // i(I18nUITranslationService.class),
- // // i(GlobalShortcutRegister.class), i(GuiBindingsRegister.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- // register(NoDecoration.class, new
- // Factory<ActionContextTopToolbar>(ActionContextTopToolbar.class) {
- // @Override
- // public ActionContextTopToolbar create() {
- // final ActionCntCtxToolbarPanel<StateToken> panel = new
- // ActionCntCtxToolbarPanel<StateToken>(
- // OldAbstractFoldableContentActions.CONTEXT_TOPBAR,
- // p(ActionManager.class),
- // i(WorkspaceSkeleton.class));
- // final ActionContextTopToolbar toolbar = new
- // ActionContextTopToolbar(panel);
- // return toolbar;
- // }
- // });
- //
- // register(NoDecoration.class, new
- // Factory<ActionContextBottomToolbar>(ActionContextBottomToolbar.class)
- // {
- // @Override
- // public ActionContextBottomToolbar create() {
- // final ActionCntCtxToolbarPanel<StateToken> panel = new
- // ActionCntCtxToolbarPanel<StateToken>(
- // OldAbstractFoldableContentActions.CONTEXT_BOTTOMBAR,
- // p(ActionManager.class),
- // i(WorkspaceSkeleton.class));
- // final ActionContextBottomToolbar toolbar = new
- // ActionContextBottomToolbar(panel);
- // return toolbar;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<ContextNavigator>(ContextNavigator.class) {
- // @Override
- // public ContextNavigator create() {
- // final ContextNavigatorPresenter presenter = new
- // ContextNavigatorPresenter(i(StateManager.class),
- // i(Session.class), i(I18nTranslationService.class),
- // i(ContentIconsRegistry.class),
- // i(ContentCapabilitiesRegistry.class),
- // i(ActionContextTopToolbar.class),
- // i(ActionContextBottomToolbar.class), i(ContextActionRegistry.class),
- // p(FileDownloadUtils.class), true, i(RenameAction.class));
- // final ContextNavigatorPanel panel = new
- // ContextNavigatorPanel(presenter,
- // i(I18nTranslationService.class), i(WorkspaceSkeleton.class),
- // i(ActionManager.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(Singleton.class, new
- // Factory<ContextPropEditor>(ContextPropEditor.class) {
- // @Override
- // public ContextPropEditor create() {
- // final ContextPropEditorPresenter presenter = new
- // ContextPropEditorPresenter(i(Session.class),
- // i(StateManager.class), i(ContentCapabilitiesRegistry.class),
- // p(TagsSummary.class),
- // p(ContentServiceAsync.class), i(EntitySubTitle.class));
- // final ContextPropEditorView view = new
- // ContextPropEditorPanel(presenter,
- // i(I18nUITranslationService.class), i(WorkspaceSkeleton.class),
- // p(LanguageSelector.class),
- // i(Images.class));
- // presenter.init(view);
- // return presenter;
- // }
- // });
- //
- // register(InsertImageGroup.class, new
- // Factory<InsertImageLocal>(InsertImageLocal.class) {
- // @Override
- // public InsertImageLocal create() {
- // final InsertImageLocalPresenter presenter = new
- // InsertImageLocalPresenter(i(InsertImageDialog.class),
- // i(Session.class));
- // final InsertImageLocalPanel panel = new
- // InsertImageLocalPanel(presenter,
- // i(I18nTranslationService.class), i(FileDownloadUtils.class),
- // i(Session.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // // register(ApplicationComponentGroup.class, new
- // // Factory<MaxMinWorkspace>(MaxMinWorkspace.class) {
- // // @Override
- // // public MaxMinWorkspace create() {
- // // final MaxMinWorkspacePresenter presenter = new
- // // MaxMinWorkspacePresenter(
- // // i(GlobalShortcutRegister.class), i(IconResources.class),
- // // i(I18nTranslationService.class),
- // // i(SiteOptions.class));
- // // final MaxMinWorkspacePanel panel = new
- // // MaxMinWorkspacePanel(i(WorkspaceSkeleton.class));
- // // presenter.init(panel);
- // // return presenter;
- // // }
- // // });
- //
- // register(InsertLinkGroup.class, new
- // Factory<InsertLinkLocal>(InsertLinkLocal.class) {
- // @Override
- // public InsertLinkLocal create() {
- // final InsertLinkLocalPresenter presenter = new
- // InsertLinkLocalPresenter(i(InsertLinkDialog.class));
- // final InsertLinkLocalPanel panel = new
- // InsertLinkLocalPanel(presenter, i(WorkspaceSkeleton.class),
- // i(I18nTranslationService.class), i(FileDownloadUtils.class),
- // i(StateTokenUtils.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- //
- // register(InsertMediaGroup.class, new
- // Factory<InsertMediaLocal>(InsertMediaLocal.class) {
- // @Override
- // public InsertMediaLocal create() {
- // final InsertMediaLocalPresenter presenter = new
- // InsertMediaLocalPresenter(i(InsertMediaDialog.class),
- // i(Session.class), p(MediaUtils.class));
- // final InsertMediaLocalPanel panel = new
- // InsertMediaLocalPanel(presenter,
- // i(I18nTranslationService.class), i(FileDownloadUtils.class));
- // presenter.init(panel);
- // return presenter;
- // }
- // });
- // i(GlobalShortcutRegister.class).enable();
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditor.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,35 +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 org.ourproject.kune.workspace.client.editor;
-
-import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditor;
-
-public interface ContentEditor extends RTESavingEditor {
-
- /**
- * Sets the "File" menu title (some times you want a "Post" or "Wikipage"
- * menu instead of a "File" menu).
- *
- * @param title
- * the new file menu title
- */
- void setFileMenuTitle(String title);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,35 +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 org.ourproject.kune.workspace.client.editor;
-
-import org.ourproject.kune.platf.client.actions.ui.GuiBindingsRegister;
-import org.ourproject.kune.platf.client.shortcuts.GlobalShortcutRegister;
-import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditorPanel;
-
-import cc.kune.core.client.i18n.I18nUITranslationService;
-
-public class ContentEditorPanel extends RTESavingEditorPanel implements ContentEditorView {
-
- public ContentEditorPanel(final ContentEditorPresenter presenter, final I18nUITranslationService i18n,
- final GlobalShortcutRegister globalShortcutReg, final GuiBindingsRegister bindReg) {
- super(presenter, i18n, globalShortcutReg, bindReg);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPresenter.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorPresenter.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,174 +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 org.ourproject.kune.workspace.client.editor;
-
-import static org.ourproject.kune.platf.client.actions.AbstractExtendedAction.NO_ICON;
-import static org.ourproject.kune.platf.client.actions.AbstractExtendedAction.NO_TEXT;
-
-import org.ourproject.kune.platf.client.actions.AbstractExtendedAction;
-import org.ourproject.kune.platf.client.actions.Action;
-import org.ourproject.kune.platf.client.actions.ActionEvent;
-import org.ourproject.kune.platf.client.actions.KeyStroke;
-import org.ourproject.kune.platf.client.actions.ui.ComplexToolbar;
-import org.ourproject.kune.platf.client.actions.ui.OldMenuItemDescriptor;
-import org.ourproject.kune.platf.client.shortcuts.Keyboard;
-import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
-import org.ourproject.kune.platf.client.ui.rte.basic.RTEditor;
-import org.ourproject.kune.platf.client.ui.rte.basic.RTEditorPanel;
-import org.ourproject.kune.platf.client.ui.rte.edithtml.EditHtmlDialog;
-import org.ourproject.kune.platf.client.ui.rte.img.RTEImgResources;
-import org.ourproject.kune.platf.client.ui.rte.insertimg.InsertImageDialog;
-import org.ourproject.kune.platf.client.ui.rte.insertlink.InsertLinkDialog;
-import org.ourproject.kune.platf.client.ui.rte.insertmedia.InsertMediaDialog;
-import org.ourproject.kune.platf.client.ui.rte.insertspecialchar.InsertSpecialCharDialog;
-import org.ourproject.kune.platf.client.ui.rte.inserttable.InsertTableDialog;
-import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditorPresenter;
-import org.ourproject.kune.workspace.client.skel.Toolbar;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import cc.kune.common.client.utils.SchedulerManager;
-import cc.kune.common.client.utils.TimerWrapper;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.i18n.I18nTranslationService;
-
-import com.calclab.suco.client.events.Listener;
-import com.calclab.suco.client.events.Listener0;
-import com.calclab.suco.client.ioc.Provider;
-import com.google.gwt.resources.client.ImageResource;
-import com.google.gwt.user.client.Window;
-import com.google.gwt.user.client.Window.ClosingEvent;
-import com.google.gwt.user.client.Window.ClosingHandler;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.gwtext.client.widgets.BoxComponent;
-import com.gwtext.client.widgets.event.ContainerListenerAdapter;
-
-public class ContentEditorPresenter extends RTESavingEditorPresenter implements ContentEditor {
-
- public class RenameAction extends AbstractExtendedAction {
- public RenameAction(final String text, final String tooltip, final ImageResource icon) {
- super(text, tooltip, icon);
- }
-
- @Override
- public void actionPerformed(final ActionEvent actionEvent) {
- // entityTitle.edit();
- }
- }
-
- private RTEditorPanel editorPanel;
- // private final EntityTitle entityTitle;
- // private final SiteSignOutLink siteSignOutLink;
- private final I18nTranslationService i18n;
- private ComplexToolbar sndbar;
- private ComplexToolbar topbar;
- private VerticalPanel vpanel;
- private final WorkspaceSkeleton wspace;
-
- public ContentEditorPresenter(final I18nTranslationService i18n, final Session session,
- final RTEImgResources imgResources, final Provider<InsertLinkDialog> insLinkDialog,
- final Provider<ColorWebSafePalette> palette, final Provider<EditHtmlDialog> editHtmlDialog,
- final Provider<InsertImageDialog> insertImageDialog,
- final Provider<InsertMediaDialog> insertMediaDialog,
- final Provider<InsertTableDialog> insertTableDialog,
- final Provider<InsertSpecialCharDialog> insCharDialog, final SchedulerManager deferred,
- final boolean autoSave, final StateManager stateManager, final WorkspaceSkeleton wspace,
- final TimerWrapper timer) {
- super(i18n, session, imgResources, insLinkDialog, palette, editHtmlDialog, insertImageDialog,
- insertMediaDialog, insertTableDialog, insCharDialog, deferred, autoSave, stateManager, timer);
- super.setExtended(true);
- this.i18n = i18n;
-
- // this.entityTitle = entityTitle;
- this.wspace = wspace;
- Window.addWindowClosingHandler(new ClosingHandler() {
- @Override
- public void onWindowClosing(final ClosingEvent event) {
- if (isSavePending()) {
- event.setMessage(i18n.t("You have changes without save. Are you sure?"));
- }
- // onDoSaveAndClose();
- }
- });
- wspace.getEntityWorkspace().addContentListener(new ContainerListenerAdapter() {
- @Override
- public void onResize(final BoxComponent component, final int adjWidth, final int adjHeight,
- final int rawWidth, final int rawHeight) {
- adjHeight(adjHeight);
- }
- });
-
- }
-
- private void addContentActions() {
- final RenameAction renameAction = new RenameAction(i18n.t("Rename"), NO_TEXT, NO_ICON);
- final OldMenuItemDescriptor renameItem = new OldMenuItemDescriptor(super.getFileMenu(), renameAction);
- renameItem.setLocation(RTEditor.TOPBAR);
- final KeyStroke key = KeyStroke.getKeyStroke(Keyboard.KEY_F2, 0);
- renameAction.putValue(Action.ACCELERATOR_KEY, key);
- super.setActionShortcut(key, renameAction);
- addAction(renameItem);
- }
-
- private void adjHeight(final int height) {
- final int barHeight = sndbar.getOffsetHeight();
- final int newHeight = height - 20 - barHeight;
- // Log.debug("Sndbar height: " + barHeight + " new height: " +
- // newHeight);
- editorPanel.adjustSize(newHeight);
- vpanel.setCellHeight(editorPanel, String.valueOf(newHeight));
- }
-
- @Override
- public void edit(final String html, final Listener<String> onSave, final Listener0 onEditCancelled) {
- super.edit(html, onSave, onEditCancelled);
- final Toolbar contentTopBar = wspace.getEntityWorkspace().getContentTopBar();
- contentTopBar.removeAll();
- contentTopBar.add(topbar);
- wspace.getEntityWorkspace().setContent(vpanel);
- adjHeight(wspace.getEntityWorkspace().getContentHeight());
- // siteSignOutLink.addBeforeSignOut(getBeforeSavingListener());
- }
-
- public void init(final ContentEditorView view) {
- super.init(view);
- addContentActions();
- vpanel = new VerticalPanel();
- editorPanel = (RTEditorPanel) super.getEditorArea();
- topbar = ((ComplexToolbar) super.getTopBar());
- sndbar = ((ComplexToolbar) super.getSndBar());
- vpanel.add(sndbar);
- vpanel.add(editorPanel);
- vpanel.setWidth("100%");
- }
-
- @Override
- protected void onCancelConfirmed() {
- wspace.getEntityWorkspace().clearContent();
- super.onCancelConfirmed();
- // siteSignOutLink.addBeforeSignOut(getBeforeSavingListener());
- }
-
- @Override
- public void setFileMenuTitle(final String fileMenuTitleNew) {
- super.getFileMenu().setText(fileMenuTitleNew);
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/ContentEditorView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,26 +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 org.ourproject.kune.workspace.client.editor;
-
-import org.ourproject.kune.platf.client.ui.rte.saving.RTESavingEditorView;
-
-public interface ContentEditorView extends RTESavingEditorView {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeader.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeader.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeader.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -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 org.ourproject.kune.workspace.client.entityheader;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.actions.ui.OldGuiActionDescrip;
-
-public interface EntityHeader {
-
- void addAction(OldGuiActionDescrip descriptor);
-
- void addWidget(View widget);
-
- /**
- * Refresh the logo from the group info in the client session
- */
- void refreshGroupLogo();
-
- /**
- * Reload the logo from the group reloaded from the server
- */
- void reloadGroupLogoImage();
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderButton.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderButton.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderButton.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,44 +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 org.ourproject.kune.workspace.client.entityheader;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.ui.IconLabel;
-
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-
-public class EntityHeaderButton extends IconLabel implements View {
- public EntityHeaderButton(final AbstractImagePrototype icon, final String text) {
- super(icon, text, false);
- setDefStyle();
- }
-
- public EntityHeaderButton(final String text, final AbstractImagePrototype icon) {
- super(text, icon, false);
- setDefStyle();
- }
-
- private void setDefStyle() {
- addStyleName("kune-Margin-Medium-t");
- addStyleName("kune-pointer");
- addStyleName("kune-floatright");
- }
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPanel.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,132 +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 org.ourproject.kune.workspace.client.entityheader;
-
-import java.util.Date;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.actions.ui.ComplexToolbar;
-import org.ourproject.kune.platf.client.actions.ui.OldGuiActionDescrip;
-import org.ourproject.kune.platf.client.actions.ui.GuiBindingsRegister;
-import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import cc.kune.core.client.services.FileConstants;
-import cc.kune.core.client.services.FileDownloadUtils;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.GSpaceTheme;
-import cc.kune.core.shared.dto.GroupDTO;
-
-import com.calclab.suco.client.ioc.Provider;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class EntityHeaderPanel extends HorizontalPanel implements EntityHeaderView {
-
- private final Provider<FileDownloadUtils> downloadProvider;
- private final EntityTextLogo entityTextLogo;
- private final Images images;
- private final VerticalPanel vpanel;
- private final ComplexToolbar toolbar;
-
- public EntityHeaderPanel(final WorkspaceSkeleton wskel, final Provider<FileDownloadUtils> downloadProvider,
- final Images images, final GuiBindingsRegister bindings) {
- super();
- super.setWidth("100%");
- this.downloadProvider = downloadProvider;
- this.images = images;
- vpanel = new VerticalPanel();
- vpanel.setWidth("100%");
- vpanel.setHorizontalAlignment(ALIGN_RIGHT);
- entityTextLogo = new EntityTextLogo();
- add(entityTextLogo);
- toolbar = new ComplexToolbar(bindings);
- toolbar.setTranspStyle();
- vpanel.add(toolbar);
- add(vpanel);
- wskel.addToEntityMainHeader(this);
- }
-
- public void addAction(final OldGuiActionDescrip descriptor) {
- toolbar.add(descriptor);
- }
-
- public void addWidget(final View view) {
- final Widget widget = (Widget) view;
- vpanel.add(widget);
- }
-
- public void reloadImage(final GroupDTO group) {
- entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(group.getStateToken()) + "&nocache="
- + new Date().getTime());
- }
-
- @Deprecated
- public void setFullLogo(final StateToken stateToken, final boolean clipped) {
- clear();
- final String imageUrl = downloadProvider.get().getImageUrl(stateToken);
- Image logo;
- if (clipped) {
- logo = new Image(imageUrl, 0, 0, FileConstants.LOGO_DEF_WIDTH, FileConstants.LOGO_DEF_HEIGHT);
- } else {
- logo = new Image(imageUrl);
- logo.setWidth(String.valueOf(FileConstants.LOGO_DEF_WIDTH));
- logo.setHeight(String.valueOf(FileConstants.LOGO_DEF_HEIGHT));
- }
- add(logo);
- }
-
- public void setLargeFont() {
- entityTextLogo.setLargeFont();
- }
-
- public void setLogoImage(final StateToken stateToken) {
- entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(stateToken));
- }
-
- public void setLogoImageVisible(final boolean visible) {
- entityTextLogo.setLogoVisible(visible);
- }
-
- public void setLogoText(final String groupName) {
- entityTextLogo.setLogoText(groupName);
- }
-
- public void setMediumFont() {
- entityTextLogo.setMediumFont();
- }
-
- public void setSmallFont() {
- entityTextLogo.setSmallFont();
- }
-
- public void setTheme(final GSpaceTheme oldTheme, final GSpaceTheme newTheme) {
- if (oldTheme != null) {
- entityTextLogo.removeStyleDependentName(oldTheme.toString());
- }
- entityTextLogo.addStyleDependentName(newTheme.toString());
- }
-
- public void showDefUserLogo() {
- entityTextLogo.setLogoImage(images.personAvatarDef());
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPresenter.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderPresenter.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,108 +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 org.ourproject.kune.workspace.client.entityheader;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.actions.ui.OldGuiActionDescrip;
-
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.gspace.client.themes.GSpaceThemeManager;
-
-import com.calclab.suco.client.events.Listener2;
-
-public class EntityHeaderPresenter implements EntityHeader {
- private static final int LARGE_NAME_LIMIT = 20;
- private static final int MEDIUM_NAME_LIMIT = 90;
-
- private final Session session;
- private EntityHeaderView view;
-
- public EntityHeaderPresenter(final StateManager stateManager, final GSpaceThemeManager theme,
- final Session session) {
- this.session = session;
-
- stateManager.onGroupChanged(new Listener2<String, String>() {
- @Override
- public void onEvent(final String oldGroup, final String newGroup) {
- setGroupLogo(session.getCurrentState().getGroup());
- }
- });
- // theme.addOnThemeChanged(new Listener2<GSpaceTheme, GSpaceTheme>() {
- // public void onEvent(final GSpaceTheme oldTheme, final GSpaceTheme
- // newTheme) {
- // view.setTheme(oldTheme, newTheme);
- // }
- // });
- }
-
- @Override
- public void addAction(final OldGuiActionDescrip descriptor) {
- view.addAction(descriptor);
- }
-
- @Override
- public void addWidget(final View widget) {
- view.addWidget(widget);
- }
-
- public void init(final EntityHeaderView view) {
- this.view = view;
- }
-
- @Override
- public void refreshGroupLogo() {
- setGroupLogo(session.getCurrentState().getGroup());
- }
-
- @Override
- public void reloadGroupLogoImage() {
- view.reloadImage(session.getCurrentState().getGroup());
- }
-
- void setGroupLogo(final GroupDTO group) {
- if (group.hasLogo()) {
- setLogoText(group.getLongName());
- view.setLogoImage(group.getStateToken());
- view.setLogoImageVisible(true);
- } else {
- setLogoText(group.getLongName());
- if (group.isPersonal()) {
- view.showDefUserLogo();
- view.setLogoImageVisible(true);
- } else {
- view.setLogoImageVisible(false);
- }
- }
- }
-
- void setLogoText(final String name) {
- final int length = name.length();
- if (length <= LARGE_NAME_LIMIT) {
- view.setLargeFont();
- } else if (length <= MEDIUM_NAME_LIMIT) {
- view.setMediumFont();
- } else {
- view.setSmallFont();
- }
- view.setLogoText(name);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityHeaderView.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,52 +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 org.ourproject.kune.workspace.client.entityheader;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.actions.ui.OldGuiActionDescrip;
-
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.GSpaceTheme;
-import cc.kune.core.shared.dto.GroupDTO;
-
-public interface EntityHeaderView {
-
- void addAction(OldGuiActionDescrip descriptor);
-
- void addWidget(View view);
-
- void reloadImage(GroupDTO group);
-
- void setLargeFont();
-
- void setLogoImage(StateToken stateToken);
-
- void setLogoImageVisible(boolean visible);
-
- void setLogoText(final String groupName);
-
- void setMediumFont();
-
- void setSmallFont();
-
- void setTheme(final GSpaceTheme oldTheme, GSpaceTheme newTheme);
-
- void showDefUserLogo();
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityTextLogo.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityTextLogo.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entityheader/EntityTextLogo.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,117 +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 org.ourproject.kune.workspace.client.entityheader;
-
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class EntityTextLogo extends VerticalPanel {
-
- public static final String LOGO_NAME = "k-elogop-ln";
- public static final String LOGO_IMAGE = "k-elogop-image";
-
- private static final String _100 = "100%";
- private static final String LOGO_MEDIUM_FONT_STYLE = "k-elogo-l-m";
- private static final String LOGO_SMALL_FONT_STYLE = "k-elogo-l-s";
- private static final String LOGO_LARGE_FONT_STYLE = "k-elogo-l-l";
- private final Label logoLabel;
- private final Image logoImage;
-
- public EntityTextLogo() {
- // Initialize
- super();
- final HorizontalPanel generalHP = new HorizontalPanel();
- final VerticalPanel logoTextVP = new VerticalPanel();
- logoImage = new Image();
- logoLabel = new Label();
- final Label expandCell = new Label("");
-
- logoImage.ensureDebugId(LOGO_IMAGE);
- logoLabel.ensureDebugId(LOGO_NAME);
-
- // Layout
- add(generalHP);
- generalHP.add(logoImage);
- generalHP.add(logoTextVP);
- logoTextVP.add(logoLabel);
-
- // Set properties
-
- expandCell.setStyleName("k-elogop-expand");
- generalHP.setWidth(_100);
- generalHP.setHeight(_100);
- generalHP.setCellWidth(logoTextVP, _100);
- generalHP.setCellHeight(logoTextVP, _100);
- logoTextVP.setWidth(_100);
- logoTextVP.setCellWidth(logoLabel, _100);
- super.setVerticalAlignment(ALIGN_MIDDLE);
- logoTextVP.setVerticalAlignment(ALIGN_MIDDLE);
- generalHP.setVerticalAlignment(ALIGN_MIDDLE);
- setStylePrimaryName("k-entitytextlogo");
- addStyleName("k-entitytextlogo-no-border");
- logoImage.setVisible(false);
- setLogoTextImpl("");
- }
-
- public void setLargeFont() {
- resetFontSize();
- logoLabel.addStyleName(LOGO_LARGE_FONT_STYLE);
- }
-
- public void setLogoImage(final AbstractImagePrototype imageProto) {
- imageProto.applyTo(logoImage);
- }
-
- public void setLogoImage(final String url) {
- Image.prefetch(url);
- logoImage.setUrl(url);
- }
-
- public void setLogoText(final String text) {
- setLogoTextImpl(text);
- }
-
- public void setLogoVisible(final boolean visible) {
- logoImage.setVisible(visible);
- }
-
- public void setMediumFont() {
- resetFontSize();
- logoLabel.addStyleName(LOGO_MEDIUM_FONT_STYLE);
- }
-
- public void setSmallFont() {
- resetFontSize();
- logoLabel.addStyleName(LOGO_SMALL_FONT_STYLE);
- }
-
- private void resetFontSize() {
- logoLabel.removeStyleName(LOGO_LARGE_FONT_STYLE);
- logoLabel.removeStyleName(LOGO_SMALL_FONT_STYLE);
- logoLabel.removeStyleName(LOGO_MEDIUM_FONT_STYLE);
- }
-
- private void setLogoTextImpl(final String text) {
- logoLabel.setText(text);
- }
-}
\ No newline at end of file
Added: trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/CustomWebDriverEventListener.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -0,0 +1,88 @@
+package cc.kune.selenium;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.events.WebDriverEventListener;
+import org.testng.Assert;
+
+public class CustomWebDriverEventListener implements WebDriverEventListener {
+
+ @Override
+ public void afterChangeValueOf(final WebElement element, final WebDriver driver) {
+ }
+
+ @Override
+ public void afterClickOn(final WebElement element, final WebDriver driver) {
+ slow();
+ }
+
+ @Override
+ public void afterFindBy(final By by, final WebElement element, final WebDriver driver) {
+ }
+
+ @Override
+ public void afterNavigateBack(final WebDriver driver) {
+ slow();
+ }
+
+ @Override
+ public void afterNavigateForward(final WebDriver driver) {
+ slow();
+ }
+
+ @Override
+ public void afterNavigateTo(final String url, final WebDriver driver) {
+ slow();
+ }
+
+ @Override
+ public void afterScript(final String script, final WebDriver driver) {
+ }
+
+ @Override
+ public void beforeChangeValueOf(final WebElement element, final WebDriver driver) {
+ }
+
+ @Override
+ public void beforeClickOn(final WebElement element, final WebDriver driver) {
+ slow();
+ }
+
+ @Override
+ public void beforeFindBy(final By by, final WebElement element, final WebDriver driver) {
+ }
+
+ @Override
+ public void beforeNavigateBack(final WebDriver driver) {
+ ;
+ }
+
+ @Override
+ public void beforeNavigateForward(final WebDriver driver) {
+ }
+
+ @Override
+ public void beforeNavigateTo(final String url, final WebDriver driver) {
+ }
+
+ @Override
+ public void beforeScript(final String script, final WebDriver driver) {
+ }
+
+ @Override
+ public void onException(final Throwable throwable, final WebDriver driver) {
+ }
+
+ public void sleep(final int milliseconds) {
+ try {
+ Thread.sleep(milliseconds);
+ } catch (final InterruptedException e) {
+ Assert.fail("Exception in sleep method", e);
+ }
+ }
+
+ private void slow() {
+ sleep(500);
+ }
+}
\ No newline at end of file
Modified: trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -22,22 +22,23 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openqa.selenium.By;
+import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.PageFactory;
-import org.openqa.selenium.support.events.EventFiringWebDriver;
-import org.openqa.selenium.support.events.WebDriverEventListener;
import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
import org.testng.Assert;
import org.testng.ITestContext;
import org.testng.annotations.AfterSuite;
import org.testng.annotations.BeforeMethod;
+import org.testng.annotations.BeforeSuite;
import org.testng.annotations.DataProvider;
+import cc.kune.core.client.auth.AnonUsersManager;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.selenium.login.EntityHeaderPageObject;
import cc.kune.selenium.login.LoginPageObject;
-import cc.kune.selenium.tools.GenericWebDriver;
+import cc.kune.selenium.login.RegisterPageObject;
import cc.kune.selenium.tools.SeleniumConstants;
-import cc.kune.selenium.tools.SeleniumModule;
import com.google.inject.Guice;
import com.google.inject.Injector;
@@ -45,127 +46,63 @@
public class KuneSeleniumDefaults {
private static final Log LOG = LogFactory.getLog(KuneSeleniumDefaults.class);
public static boolean mustCloseFinally = true;
- protected EventFiringWebDriver eventFiring;
+ private final String baseUrl;
+ protected final EntityHeaderPageObject entityHeader;
private final Injector injector;
protected LoginPageObject login;
- protected GenericWebDriver webdriver;
+ protected RegisterPageObject register;
+ private final WebDriver webdriver;
public KuneSeleniumDefaults() {
+ // baseUrl = "http://kune.beta.iepala.es/ws/?locale=en#";
+ baseUrl = "http://127.0.0.1:8888/ws/?locale=es&log_level=INFO&gwt.codesvr=127.0.0.1:99…";
injector = Guice.createInjector(new SeleniumModule());
- webdriver = injector.getInstance(GenericWebDriver.class);
+ webdriver = injector.getInstance(WebDriver.class);
login = injector.getInstance(LoginPageObject.class);
- eventFiring = injector.getInstance(EventFiringWebDriver.class);
- eventFiring.register(new WebDriverEventListener() {
+ register = injector.getInstance(RegisterPageObject.class);
+ entityHeader = injector.getInstance(EntityHeaderPageObject.class);
+ final ElementLocatorFactory locator = injector.getInstance(ElementLocatorFactory.class);
+ PageFactory.initElements(locator, login);
+ PageFactory.initElements(locator, register);
+ PageFactory.initElements(locator, entityHeader);
+ }
- @Override
- public void afterChangeValueOf(final WebElement element, final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
+ @BeforeSuite
+ public void beforeClass() {
+ resize();
+ LOG.info("Going home");
+ home();
+ webdriver.findElement(By.id(SeleniumConstants.GWTDEV + AnonUsersManager.ANON_MESSAGE_CLOSE_ICON)).click();
+ }
- @Override
- public void afterClickOn(final WebElement element, final WebDriver driver) {
- sleep(500);
- }
+ @BeforeMethod
+ public void beforeMethods(final ITestContext context) {
+ }
- @Override
- public void afterFindBy(final By by, final WebElement element, final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void afterNavigateBack(final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void afterNavigateForward(final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void afterNavigateTo(final String url, final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void afterScript(final String script, final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void beforeChangeValueOf(final WebElement element, final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void beforeClickOn(final WebElement element, final WebDriver driver) {
- sleep(500);
- }
-
- @Override
- public void beforeFindBy(final By by, final WebElement element, final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void beforeNavigateBack(final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void beforeNavigateForward(final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void beforeNavigateTo(final String url, final WebDriver driver) {
- // TODO Auto-generated method stub
- sleep(500);
- }
-
- @Override
- public void beforeScript(final String script, final WebDriver driver) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void onException(final Throwable throwable, final WebDriver driver) {
- // TODO Auto-generated method stub
-
- }
- });
- final ElementLocatorFactory locator = injector.getInstance(ElementLocatorFactory.class);
- PageFactory.initElements(locator, login);
+ public void close() {
+ webdriver.close();
}
@AfterSuite
public void closeBrowser() {
// We try to only open one window for all our selenium tests
if (mustCloseFinally) {
- webdriver.close();
+ close();
}
}
@DataProvider(name = "correctlogin")
public Object[][] createCorrectLogin() {
// The default correct user/password used in tests
- return new Object[][] { { SeleniumConstants.USERNAME, SeleniumConstants.PASSWD }, };
+ return new Object[][] { { SeleniumConstants.USER_SHORNAME, SeleniumConstants.USER_PASSWD } };
}
- // public void moveMouseAt(final Point point) {
- // webtester.moveMouseAt(point);
- // }
+ @DataProvider(name = "correctregister")
+ public Object[][] createCorrectRegister() {
+ // The default correct user/password used in tests
+ return new Object[][] { { SeleniumConstants.USER_SHORNAME, SeleniumConstants.USER_LONGNAME,
+ SeleniumConstants.USER_PASSWD, SeleniumConstants.USER_EMAIL } };
+ }
@DataProvider(name = "incorrectlogin")
public Object[][] createIncorrectLogin() {
@@ -174,46 +111,37 @@
{ "test1@localhost", "test" }, { "", "" } };
}
- @BeforeMethod
- public void setupSeleniumModule(final ITestContext context) {
+ public void get(final String url) {
+ webdriver.get(url);
+ }
- // if (!Suco.getComponents().hasProvider(WebDriver.class)) {
- // Suco.install(new SeleniumModule());
- // }
- if (webdriver == null) {
- // final ChromeDriver driver = new ChromeDriver();
- // // final HtmlUnitDriver driver = new HtmlUnitDriver(true);
- //
- // // final ProfilesIni allProfiles = new ProfilesIni();
- // // final FirefoxProfile profile =
- // // allProfiles.getProfile(SeleniumConstants.FIREFOX_PROFILE_NAME);
- // // final FirefoxDriver driver = new FirefoxDriver(profile);
- //
- // locator = new AjaxElementLocatorFactory(driver,
- // SeleniumConstants.TIMEOUT);
- // webtester = new GenericWebTester(driver,
- // "http://kune.beta.iepala.es/ws/?locale=en#");
- // // webtester = Suco.get(GenericWebTester.class);
- // // login = Suco.get(LoginPageObject.class);
- // login = new LoginPageObject();
- // PageFactory.initElements(locator, login);
- // driver.get("http://kune.beta.iepala.es/ws/?locale=en#");
- // roster = Suco.get(RosterPageObject.class);
- // openChat = Suco.get(OpenChatPageObject.class);
- // search = Suco.get(SearchPageObject.class);
- // chat = Suco.get(ChatPageObject.class);
- // editBuddy = Suco.get(EditBuddyPageObject.class);
- // groupChat = Suco.get(GroupChatPageObject.class);
- // userPage = Suco.get(UserPageObject.class);
- // otherVCardPage = Suco.get(OtherVCardPageObject.class);
- // copyToClipboard = Suco.get(CopyToClipboardPageObject.class);
- // openGroupChat = Suco.get(OpenGroupChatPageObject.class);
- }
- LOG.info("Going home");
+ public String getPageSource() {
+ return webdriver.getPageSource();
+ }
- webdriver.home();
+ public void gotoToken(final StateToken token) {
+ get(baseUrl + token);
}
+ public void gotoToken(final String token) {
+ get(baseUrl + token);
+ }
+
+ public void home() {
+ assert baseUrl != null;
+ webdriver.get(baseUrl);
+ }
+
+ public void open(final String url) {
+ webdriver.get(url);
+ }
+
+ public void resize() {
+ final JavascriptExecutor js = (JavascriptExecutor) webdriver;
+ // 1024,769
+ js.executeScript("window.resizeTo(840,770); window.moveTo(0,0);");
+ }
+
public void sleep(final int milliseconds) {
try {
Thread.sleep(milliseconds);
Modified: trunk/src/test/java/cc/kune/selenium/PageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/PageObject.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/PageObject.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -19,33 +19,78 @@
*/
package cc.kune.selenium;
+import java.util.List;
+import java.util.Set;
+
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openqa.selenium.By;
+import org.openqa.selenium.Keys;
import org.openqa.selenium.NoSuchElementException;
import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebDriver.Navigation;
+import org.openqa.selenium.WebDriver.Options;
+import org.openqa.selenium.WebDriver.TargetLocator;
import org.openqa.selenium.WebElement;
+import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ByIdOrName;
+import org.openqa.selenium.support.ui.ExpectedCondition;
+import org.openqa.selenium.support.ui.Wait;
+import org.openqa.selenium.support.ui.WebDriverWait;
import org.testng.Assert;
+import com.google.gwt.user.client.ui.UIObject;
import com.google.inject.Inject;
public abstract class PageObject {
- protected static final String GWTDEV = "gwt-debug-";
private static final Log LOG = LogFactory.getLog(PageObject.class.getName());
private static final long[] POLL_INTERVALS = { 10, 20, 30, 40, 50, 50, 50, 50, 100 };
@Inject
private WebDriver webdriver;
- protected WebElement findElement(final By by) {
- return getWebDriver().findElement(by);
+ protected void clearField(final WebElement elem) {
+ elem.sendKeys(Keys.chord(Keys.CONTROL, "a"), Keys.DELETE);
}
- private WebDriver getWebDriver() {
+ public WebElement findElement(final By by) {
+ return webdriver.findElement(by);
+ }
+
+ public List<WebElement> findElements(final By by) {
+ return webdriver.findElements(by);
+ }
+
+ public WebElement getById(final String id) {
+ return webdriver.findElement(By.id(UIObject.DEBUG_ID_PREFIX + id));
+ }
+
+ public String getCurrentUrl() {
+ return webdriver.getCurrentUrl();
+ }
+
+ public String getTitle() {
+ return webdriver.getTitle();
+ }
+
+ protected WebDriver getWebDriver() {
return webdriver;
}
+ public String getWindowHandle() {
+ return webdriver.getWindowHandle();
+ }
+
+ public Set<String> getWindowHandles() {
+ return webdriver.getWindowHandles();
+ }
+
+ public boolean isElementPresent(final String id) {
+ final Wait<WebDriver> wait = new WebDriverWait(webdriver, 5);
+ final WebElement element = wait.until(visibilityOfElementLocated(By.id(id)));
+ return element != null;
+ }
+
public boolean isPresent(final WebElement element) {
// FIXME: find a better way to do this
try {
@@ -56,6 +101,44 @@
}
}
+ public boolean isTextPresent(final String text) {
+ return webdriver.findElement(By.tagName("body")).getText().contains(text);
+ }
+
+ public Options manage() {
+ return webdriver.manage();
+ }
+
+ public void moveMouseTo(final WebElement element) {
+ final Actions actions = new Actions(webdriver);
+ actions.moveToElement(element);
+ }
+
+ public Navigation navigate() {
+ return webdriver.navigate();
+ }
+
+ public void quit() {
+ webdriver.quit();
+ }
+
+ public TargetLocator switchTo() {
+ return webdriver.switchTo();
+ }
+
+ public ExpectedCondition<WebElement> visibilityOfElementLocated(final By locator) {
+ return new ExpectedCondition<WebElement>() {
+ @Override
+ public WebElement apply(final WebDriver driver) {
+ final WebElement toReturn = driver.findElement(locator);
+ if (toReturn.isDisplayed()) {
+ return toReturn;
+ }
+ return null;
+ }
+ };
+ }
+
/**
* Thanks to:
* http://groups.google.com/group/webdriver/browse_frm/thread/6e705242
Copied: trunk/src/test/java/cc/kune/selenium/PageObjectModule.java (from rev 1528, trunk/src/test/java/cc/kune/selenium/tools/PageObjectModule.java)
===================================================================
--- trunk/src/test/java/cc/kune/selenium/PageObjectModule.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/PageObjectModule.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -0,0 +1,34 @@
+/*
+ *
+ * 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.selenium;
+
+import org.openqa.selenium.support.PageFactory;
+import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
+
+import com.google.inject.AbstractModule;
+
+public abstract class PageObjectModule extends AbstractModule {
+ protected <T> void registerPageObject(final Class<T> componentType, final T object,
+ final ElementLocatorFactory locator) {
+ bind(componentType).toInstance(object);
+ PageFactory.initElements(locator, object);
+
+ }
+}
Copied: trunk/src/test/java/cc/kune/selenium/SeleniumModule.java (from rev 1528, trunk/src/test/java/cc/kune/selenium/tools/SeleniumModule.java)
===================================================================
--- trunk/src/test/java/cc/kune/selenium/SeleniumModule.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/SeleniumModule.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -0,0 +1,87 @@
+/*
+ *
+ * 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.selenium;
+
+import java.util.Arrays;
+
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.chrome.ChromeDriver;
+import org.openqa.selenium.firefox.FirefoxDriver;
+import org.openqa.selenium.firefox.FirefoxProfile;
+import org.openqa.selenium.firefox.internal.ProfilesIni;
+import org.openqa.selenium.remote.DesiredCapabilities;
+import org.openqa.selenium.remote.RemoteWebDriver;
+import org.openqa.selenium.support.events.EventFiringWebDriver;
+import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
+import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
+
+import cc.kune.selenium.login.EntityHeaderPageObject;
+import cc.kune.selenium.login.LoginPageObject;
+import cc.kune.selenium.login.RegisterPageObject;
+import cc.kune.selenium.tools.SeleniumConstants;
+
+import com.google.inject.Singleton;
+
+public class SeleniumModule extends PageObjectModule {
+
+ public SeleniumModule() {
+ }
+
+ @Override
+ protected void configure() {
+
+ // final RemoteWebDriver driver = createChromeDriver();
+ final WebDriver driver = creatFirefoxDriver();
+ final EventFiringWebDriver wrap = new EventFiringWebDriver(driver);
+ wrap.register(new CustomWebDriverEventListener());
+
+ bind(WebDriver.class).toInstance(wrap);
+
+ bind(ElementLocatorFactory.class).toInstance(
+ new AjaxElementLocatorFactory(wrap, SeleniumConstants.TIMEOUT));
+
+ // Page Objects here!
+ bind(LoginPageObject.class).in(Singleton.class);
+ bind(RegisterPageObject.class).in(Singleton.class);
+ bind(EntityHeaderPageObject.class).in(Singleton.class);
+ }
+
+ @SuppressWarnings("unused")
+ private RemoteWebDriver createChromeDriver() {
+ // http://code.google.com/p/selenium/wiki/ChromeDriver
+ System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
+ final DesiredCapabilities capabilities = DesiredCapabilities.chrome();
+ // http://peter.sh/experiments/chromium-command-line-switches/
+ capabilities.setCapability("chrome.switches", Arrays.asList("--disable-translate"));
+ capabilities.setCapability("chrome.binary", "/usr/bin/chromium-browser");
+ final ChromeDriver driver = new ChromeDriver(capabilities);
+ return driver;
+ }
+
+ private FirefoxDriver creatFirefoxDriver() {
+ // http://code.google.com/p/selenium/wiki/FirefoxDriver
+ final ProfilesIni allProfiles = new ProfilesIni();
+ final FirefoxProfile profile = allProfiles.getProfile(SeleniumConstants.FIREFOX_PROFILE_NAME);
+ // System.setProperty("webdriver.firefox.useExisting", "true");
+ // final FirefoxProfile profile = allProfiles.getProfile("76tp2vh0.ff5");
+ final FirefoxDriver driver = new FirefoxDriver(profile);
+ return driver;
+ }
+}
Added: trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/login/AbstractLoginObject.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -0,0 +1,41 @@
+package cc.kune.selenium.login;
+
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
+import cc.kune.core.client.sitebar.SitebarSignInLink;
+import cc.kune.core.client.sitebar.SitebarSignOutLink;
+import cc.kune.selenium.PageObject;
+import cc.kune.selenium.tools.SeleniumConstants;
+
+public class AbstractLoginObject extends PageObject {
+ @FindBy(id = SeleniumConstants.GWTDEV + SitebarSignInLink.SITE_SIGN_IN)
+ protected WebElement signInLink;
+ @FindBy(id = SeleniumConstants.GWTDEV + SitebarSignOutLink.SITE_SIGN_OUT)
+ protected WebElement signOutLink;
+ @FindBy(id = SeleniumConstants.GWTDEV + SiteUserOptionsPresenter.LOGGED_USER_MENU_ID)
+ protected WebElement userMenu;
+
+ public void assertIsConnectedAs(final String user) {
+ waitFor(userMenu, user);
+ }
+
+ public void assertIsDisconnected() {
+ try {
+ signOutLink.click();
+ } catch (final Exception e) {
+ }
+ waitFor(signInLink);
+ }
+
+ public void logout() {
+ signOutLink.click();
+ assertIsDisconnected();
+ }
+
+ public void signOut() {
+ logout();
+ }
+
+}
Added: trunk/src/test/java/cc/kune/selenium/login/EntityHeaderPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/EntityHeaderPageObject.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/login/EntityHeaderPageObject.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -0,0 +1,42 @@
+/*
+ *
+ * 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.selenium.login;
+
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+import cc.kune.core.client.ws.entheader.EntityTextLogo;
+import cc.kune.selenium.PageObject;
+import cc.kune.selenium.tools.SeleniumConstants;
+
+public class EntityHeaderPageObject extends PageObject {
+
+ @FindBy(id = SeleniumConstants.GWTDEV + EntityTextLogo.LOGO_IMAGE)
+ protected WebElement logoImage;
+ @FindBy(id = SeleniumConstants.GWTDEV + EntityTextLogo.LOGO_NAME)
+ protected WebElement logoName;
+
+ public EntityHeaderPageObject() {
+ }
+
+ public void waitForEntityTitle(final String text) {
+ waitFor(logoName, text);
+ }
+}
Modified: trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -25,53 +25,27 @@
import cc.kune.core.client.auth.SignInForm;
import cc.kune.core.client.auth.SignInPanel;
-import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
-import cc.kune.core.client.sitebar.SitebarSignInLink;
-import cc.kune.core.client.sitebar.SitebarSignOutLink;
-import cc.kune.selenium.PageObject;
-import cc.kune.selenium.tools.I18nHelper;
import cc.kune.selenium.tools.SeleniumConstants;
-import com.calclab.hablar.login.client.LoginMessages;
+public class LoginPageObject extends AbstractLoginObject {
-public class LoginPageObject extends PageObject {
-
- private final I18nHelper i18n;
- @FindBy(id = SignInForm.PASSWORD_FIELD_ID + "-input")
+ @FindBy(id = SeleniumConstants.GWTDEV + SignInPanel.CREATE_ONE)
+ protected WebElement createOneLink;
+ @FindBy(id = SignInForm.PASSWORD_FIELD_ID + SeleniumConstants.INPUT)
private WebElement passwd;
- @FindBy(id = GWTDEV + SignInPanel.SIGN_IN_BUTTON_ID)
+ @FindBy(id = SeleniumConstants.GWTDEV + SignInPanel.SIGN_IN_BUTTON_ID)
private WebElement signInButton;
- @FindBy(id = GWTDEV + SitebarSignInLink.SITE_SIGN_IN)
- private WebElement signInLink;
- @FindBy(id = GWTDEV + SitebarSignOutLink.SITE_SIGN_OUT)
- private WebElement signOutLink;
- @FindBy(id = SignInForm.USER_FIELD_ID + "-input")
+ @FindBy(id = SignInForm.USER_FIELD_ID + SeleniumConstants.INPUT)
private WebElement user;
- @FindBy(id = GWTDEV + SiteUserOptionsPresenter.LOGGED_USER_MENU_ID)
- private WebElement userMenu;
public LoginPageObject() {
- i18n = new I18nHelper(LoginMessages.class);
+ // i18n = new I18nHelper(LoginMessages.class);
}
- public void assertIsConnectedAs(final String user) {
- waitFor(userMenu, user);
- }
-
- public void assertIsDisconnected() {
- try {
- signOutLink.click();
- } catch (final Exception e) {
- }
- waitFor(signInLink);
- }
-
public void fillSigInInForm(final String username, final String password, final boolean withReturn) {
- user.clear();
- passwd.clear();
- user.clear();
- passwd.clear();
+ clearField(user);
user.sendKeys(username);
+ clearField(passwd);
passwd.sendKeys(password);
if (withReturn) {
passwd.sendKeys(Keys.RETURN);
@@ -88,27 +62,19 @@
return getHeader();
}
- public void logout() {
- signOutLink.click();
- assertIsDisconnected();
- }
-
public void signIn(final String username, final String password) {
signIn(username, password, true);
}
public void signIn(final String username, final String password, final boolean withReturn) {
assertIsDisconnected();
+ moveMouseTo(signInLink);
signInLink.click();
fillSigInInForm(username, password, withReturn);
}
public void signInDefUser() {
- signIn(SeleniumConstants.USERNAME, SeleniumConstants.PASSWD, false);
+ signIn(SeleniumConstants.USER_SHORNAME, SeleniumConstants.USER_PASSWD, false);
}
- public void signOut() {
- logout();
- }
-
}
Modified: trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -59,7 +59,7 @@
@Test(dataProvider = "correctlogin")
public void signInWithToken(final String user, final String passwd) {
login.assertIsDisconnected();
- webdriver.gotoToken(SiteTokens.SIGNIN);
+ gotoToken(SiteTokens.SIGNIN);
login.fillSigInInForm(user, passwd, true);
login.assertIsConnectedAs(user);
login.logout();
Added: trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/login/RegisterPageObject.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -0,0 +1,64 @@
+/*
+ *
+ * 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.selenium.login;
+
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebElement;
+import org.openqa.selenium.support.FindBy;
+
+import cc.kune.core.client.auth.RegisterForm;
+import cc.kune.core.client.auth.RegisterPanel;
+import cc.kune.selenium.tools.SeleniumConstants;
+
+public class RegisterPageObject extends AbstractLoginObject {
+
+ @FindBy(id = RegisterForm.EMAIL_FIELD + SeleniumConstants.INPUT)
+ private WebElement email;
+ @FindBy(id = RegisterForm.LONGNAME_FIELD + SeleniumConstants.INPUT)
+ private WebElement longName;
+ @FindBy(id = RegisterForm.PASSWORD_FIELD + SeleniumConstants.INPUT)
+ private WebElement passwd;
+ @FindBy(id = SeleniumConstants.GWTDEV + RegisterPanel.REGISTER_BUTTON_ID)
+ private WebElement registerButton;
+ @FindBy(id = RegisterForm.NICK_FIELD + SeleniumConstants.INPUT)
+ private WebElement shortName;
+
+ public RegisterPageObject() {
+ // i18n = new I18nHelper(LoginMessages.class);
+ }
+
+ public void fillRegisterForm(final String nick, final String name, final String pass, final String em,
+ final boolean withReturn) {
+ clearField(shortName);
+ shortName.sendKeys(nick);
+ clearField(longName);
+ longName.sendKeys(name);
+ clearField(passwd);
+ passwd.sendKeys(pass);
+ clearField(email);
+ email.sendKeys(em);
+ if (withReturn) {
+ email.sendKeys(Keys.RETURN);
+ } else {
+ registerButton.click();
+ }
+ }
+
+}
Added: trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/login/RegisterSeleniumTests.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -0,0 +1,68 @@
+/*
+ *
+ * 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.selenium.login;
+
+import org.testng.annotations.Test;
+
+import cc.kune.selenium.KuneSeleniumTest;
+
+public class RegisterSeleniumTests extends KuneSeleniumTest {
+
+ @Test(dataProvider = "correctregister")
+ public void severalsSignInSingOut(final String shortName, final String longName, final String passwd,
+ final String email) {
+ // 15 chars, the limit, so we don't use shortName
+ final String prefix = getTempString();
+ login.assertIsDisconnected();
+ login.signInLink.click();
+ login.createOneLink.click();
+ register.fillRegisterForm(prefix, prefix + longName, passwd, prefix + email, false);
+ login.assertIsConnectedAs(prefix);
+ sleep(1000);
+ entityHeader.waitForEntityTitle(prefix + longName);
+ login.logout();
+ }
+
+ // @Test(dataProvider = "correctlogin")
+ // public void signIn(final String user, final String passwd) {
+ // login.assertIsDisconnected();
+ // login.signIn(user, passwd);
+ // login.assertIsConnectedAs(user);
+ // login.logout();
+ // login.assertIsDisconnected();
+ // }
+ //
+ // @Test
+ // public void signInIncorrectPasswd() {
+ // login.assertIsDisconnected();
+ // login.signIn("nouser", "nopassword");
+ // login.assertIsDisconnected();
+ // }
+ //
+ // @Test(dataProvider = "correctlogin")
+ // public void signInWithToken(final String user, final String passwd) {
+ // login.assertIsDisconnected();
+ // webdriver.gotoToken(SiteTokens.SIGNIN);
+ // login.fillSigInInForm(user, passwd, true);
+ // login.assertIsConnectedAs(user);
+ // login.logout();
+ // login.assertIsDisconnected();
+ // }
+}
Deleted: trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,150 +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.selenium.tools;
-
-import java.util.List;
-import java.util.Set;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.Point;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebDriverBackedSelenium;
-import org.openqa.selenium.WebElement;
-
-import cc.kune.core.shared.domain.utils.StateToken;
-
-import com.google.gwt.user.client.ui.UIObject;
-import com.thoughtworks.selenium.Selenium;
-
-public abstract class AbstractWebDriver implements WebDriver {
- private final String baseUrl;
- private final WebDriver driver;
- private final Selenium selenium;
-
- public AbstractWebDriver(final WebDriver driver, final String baseUrl) {
- this.driver = driver;
- this.baseUrl = baseUrl;
- selenium = new WebDriverBackedSelenium(driver, baseUrl);
- selenium.setSpeed("500");
- // driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
-
- // selenium.setTimeout("5000");
- }
-
- @Override
- public void close() {
- driver.close();
- }
-
- @Override
- public WebElement findElement(final By by) {
- return driver.findElement(by);
- }
-
- @Override
- public List<WebElement> findElements(final By by) {
- return driver.findElements(by);
- }
-
- @Override
- public void get(final String url) {
- driver.get(url);
- }
-
- public WebElement getById(final String id) {
- return driver.findElement(By.id(UIObject.DEBUG_ID_PREFIX + id));
- }
-
- @Override
- public String getCurrentUrl() {
- return driver.getCurrentUrl();
- }
-
- @Override
- public String getPageSource() {
- return driver.getPageSource();
- }
-
- @Override
- public String getTitle() {
- return driver.getTitle();
- }
-
- @Override
- public String getWindowHandle() {
- return driver.getWindowHandle();
- }
-
- @Override
- public Set<String> getWindowHandles() {
- return driver.getWindowHandles();
- }
-
- public void gotoToken(final StateToken token) {
- get(baseUrl + token);
- }
-
- public void gotoToken(final String token) {
- get(baseUrl + token);
- }
-
- public void home() {
- assert baseUrl != null;
- driver.get(baseUrl);
- }
-
- public boolean isElementPresent(final String id) {
- // http://stackoverflow.com/questions/5922930/iselementpresent-in-selenium-2-0
- return selenium.isElementPresent(id);
- }
-
- public boolean isTextPresent(final String text) {
- return selenium.isTextPresent(text);
- }
-
- @Override
- public Options manage() {
- return driver.manage();
- }
-
- public void moveMouseAt(final Point point) {
- selenium.mouseMoveAt(String.valueOf(point.getX()), String.valueOf(point.getY()));
- }
-
- @Override
- public Navigation navigate() {
- return driver.navigate();
- }
-
- public void open(final String url) {
- get(url);
- }
-
- @Override
- public void quit() {
- driver.quit();
- }
-
- @Override
- public TargetLocator switchTo() {
- return driver.switchTo();
- }
-
-}
\ No newline at end of file
Deleted: trunk/src/test/java/cc/kune/selenium/tools/GenericWebDriver.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/GenericWebDriver.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/tools/GenericWebDriver.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,33 +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.selenium.tools;
-
-import org.openqa.selenium.WebDriver;
-
-import com.google.inject.Inject;
-
-public class GenericWebDriver extends AbstractWebDriver {
-
- @Inject
- public GenericWebDriver(final WebDriver driver) {
- super(driver, "http://kune.beta.iepala.es/ws/?locale=en#");
- }
-
-}
Deleted: trunk/src/test/java/cc/kune/selenium/tools/PageObjectModule.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/PageObjectModule.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/tools/PageObjectModule.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,34 +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.selenium.tools;
-
-import org.openqa.selenium.support.PageFactory;
-import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
-
-import com.google.inject.AbstractModule;
-
-public abstract class PageObjectModule extends AbstractModule {
- protected <T> void registerPageObject(final Class<T> componentType, final T object,
- final ElementLocatorFactory locator) {
- bind(componentType).toInstance(object);
- PageFactory.initElements(locator, object);
-
- }
-}
Modified: trunk/src/test/java/cc/kune/selenium/tools/SeleniumConstants.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/SeleniumConstants.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/tools/SeleniumConstants.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -21,9 +21,13 @@
public final class SeleniumConstants {
public static final String FIREFOX_PROFILE_NAME = "selenium";
- public static final String PASSWD = "easyeasy";
+ public static final String GWTDEV = "gwt-debug-";
+ public static final String INPUT = "-input";
public static final int TIMEOUT = 15;
- public static final String USERNAME = "admin";
+ public static final String USER_EMAIL = "admin(a)example.org";
+ public static final String USER_LONGNAME = "Administrator";
+ public static final String USER_PASSWD = "easyeasy";
+ public static final String USER_SHORNAME = "admin";
SeleniumConstants() {
// Final class
Deleted: trunk/src/test/java/cc/kune/selenium/tools/SeleniumModule.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/SeleniumModule.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/cc/kune/selenium/tools/SeleniumModule.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,87 +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.selenium.tools;
-
-import java.util.Arrays;
-
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.chrome.ChromeDriver;
-import org.openqa.selenium.firefox.FirefoxDriver;
-import org.openqa.selenium.firefox.FirefoxProfile;
-import org.openqa.selenium.firefox.internal.ProfilesIni;
-import org.openqa.selenium.remote.DesiredCapabilities;
-import org.openqa.selenium.support.events.EventFiringWebDriver;
-import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
-import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
-
-import cc.kune.selenium.login.LoginPageObject;
-
-import com.google.inject.Singleton;
-
-public class SeleniumModule extends PageObjectModule {
-
- public SeleniumModule() {
- }
-
- @Override
- protected void configure() {
-
- // bind(WebDriver.class).toInstance(creatFirefoxDriver());
- final WebDriver driver = createChromeDriver();
- bind(WebDriver.class).toInstance(driver);
- bind(GenericWebDriver.class).in(Singleton.class);
-
- // "http://127.0.0.1:8888/ws/?locale=en&log_level=INFO&gwt.codesvr=127.0.0.1:99…");
-
- bind(ElementLocatorFactory.class).toInstance(
- new AjaxElementLocatorFactory(driver, SeleniumConstants.TIMEOUT));
-
- final EventFiringWebDriver eventFiring = new EventFiringWebDriver(driver);
- bind(EventFiringWebDriver.class).toInstance(eventFiring);
-
- // Page Objects here!
- bind(LoginPageObject.class).in(Singleton.class);
- }
-
- private WebDriver createChromeDriver() {
- // http://code.google.com/p/selenium/wiki/ChromeDriver
- System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
- final DesiredCapabilities capabilities = DesiredCapabilities.chrome();
- // http://peter.sh/experiments/chromium-command-line-switches/
- capabilities.setCapability("chrome.switches", Arrays.asList("--disable-translate"));
- capabilities.setCapability("chrome.binary", "/usr/bin/chromium-browser");
- final WebDriver driver = new ChromeDriver(capabilities);
- return driver;
- }
-
- @SuppressWarnings("unused")
- private FirefoxDriver creatFirefoxDriver() {
- // final FirefoxProfile profile = new FirefoxProfile();
- // profile.setPreference("webdriver.firefox.profile",
- // SeleniumConstants.FIREFOX_PROFILE_NAME);
- // profile.setPreference("webdriver.firefox.useExisting",true);
-
- final ProfilesIni allProfiles = new ProfilesIni();
- final FirefoxProfile profile = allProfiles.getProfile(SeleniumConstants.FIREFOX_PROFILE_NAME);
- // profile.setPreferences("foo.bar", 23);
- final FirefoxDriver driver = new FirefoxDriver(profile);
- return driver;
- }
-}
Deleted: trunk/src/test/java/org/ourproject/kune/platf/client/ui/KuneStringUtilsTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/ui/KuneStringUtilsTest.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/ui/KuneStringUtilsTest.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,79 +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 org.ourproject.kune.platf.client.ui;
-
-import static org.junit.Assert.assertEquals;
-
-import java.util.ArrayList;
-
-import org.junit.Test;
-
-import cc.kune.common.client.utils.TextUtils;
-
-public class KuneStringUtilsTest {
-
- @Test
- public void testTagNull() {
- final String tagsString = null;
- final ArrayList<String> tags = TextUtils.splitTags(tagsString);
- assertEquals(0, tags.size());
- }
-
- @Test
- public void testTagStripsSimple() {
- final String tagsString = "ab cd";
- final ArrayList<String> tags = TextUtils.splitTags(tagsString);
- assertEquals("ab", tags.get(0));
- assertEquals("cd", tags.get(1));
- }
-
- @Test
- public void testTagStripsWithCommas() {
- final String tagsString = "ab,cd";
- final ArrayList<String> tags = TextUtils.splitTags(tagsString);
- assertEquals("ab", tags.get(0));
- assertEquals("cd", tags.get(1));
- }
-
- @Test
- public void testTagStripsWithCommasAndSpaces() {
- final String tagsString = "ab, cd";
- final ArrayList<String> tags = TextUtils.splitTags(tagsString);
- assertEquals("ab", tags.get(0));
- assertEquals("cd", tags.get(1));
- }
-
- @Test
- public void testTagStripsWithQuotes() {
- final String tagsString = "ab \"cd\"";
- final ArrayList<String> tags = TextUtils.splitTags(tagsString);
- assertEquals("ab", tags.get(0));
- assertEquals("cd", tags.get(1));
- }
-
- @Test
- public void testTagStripsWithSpaces() {
- final String tagsString = " ab cd ";
- final ArrayList<String> tags = TextUtils.splitTags(tagsString);
- assertEquals("ab", tags.get(0));
- assertEquals("cd", tags.get(1));
- }
-
-}
Deleted: trunk/src/test/java/org/ourproject/kune/platf/client/ui/TextUtilsTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/ui/TextUtilsTest.java 2011-09-23 21:10:32 UTC (rev 1530)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/ui/TextUtilsTest.java 2011-09-24 18:46:13 UTC (rev 1531)
@@ -1,89 +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 org.ourproject.kune.platf.client.ui;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Test;
-
-import cc.kune.common.client.utils.TextUtils;
-
-public class TextUtilsTest {
- @Test
- public void dontRemoveLastSlashIfNoExists() {
- final String text = "ab";
- assertEquals("ab", TextUtils.removeLastSlash(text));
- }
-
- @Test
- public void dontRemoveOtherSlashIfExists() {
- final String text = "/ab";
- assertEquals("/ab", TextUtils.removeLastSlash(text));
- }
-
- @Test
- public void matchDemoEmail() {
- final String email = "test100(a)emitedemo.ourproject.org";
- assertTrue(email.matches(TextUtils.EMAIL_REGEXP));
- }
-
- @Test
- public void matchLocalhostEmail() {
- final String email = "me@localhost";
- assertTrue(email.matches(TextUtils.EMAIL_REGEXP));
- }
-
- @Test
- public void matchSimpleEmail() {
- final String email = "me(a)example.com";
- assertTrue(email.matches(TextUtils.EMAIL_REGEXP));
- }
-
- @Test
- public void matchUrlWithHttp() {
- final String gnuUrl = "http://gnu.org";
- assertTrue(gnuUrl.matches(TextUtils.URL_REGEXP));
- }
-
- @Test
- public void matchUrlWithoutHttp() {
- final String gnuUrl = "gnu.org";
- assertTrue(!gnuUrl.matches(TextUtils.URL_REGEXP));
- }
-
- @Test
- public void notMatchWrongUrl() {
- final String someWrong = "some(a)email.com";
- assertTrue(!someWrong.matches(TextUtils.URL_REGEXP));
- }
-
- @Test
- public void removeLastSlashIfExists() {
- final String text = "/";
- assertEquals("", TextUtils.removeLastSlash(text));
- }
-
- @Test
- public void removeOnlytLastSlashIfExists() {
- final String text = "/ab/cd/";
- assertEquals("/ab/cd", TextUtils.removeLastSlash(text));
- }
-}
1
0
r1530 - in trunk/src/main/java/cc/kune: core/server core/server/auth wave/client
by Vicente J. Ruiz Jurado 23 Sep '11
by Vicente J. Ruiz Jurado 23 Sep '11
23 Sep '11
Author: vjrj_
Date: 2011-09-23 23:10:32 +0200 (Fri, 23 Sep 2011)
New Revision: 1530
Removed:
trunk/src/main/java/cc/kune/core/server/auth/SessionService.java
trunk/src/main/java/cc/kune/core/server/auth/SessionServiceDefault.java
Modified:
trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java
trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java
trunk/src/main/java/cc/kune/wave/client/KuneConversation.css
trunk/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java
trunk/src/main/java/cc/kune/wave/client/KuneFullDomWaveRendererImpl.java
trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java
trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java
trunk/src/main/java/cc/kune/wave/client/WebClient.java
Log:
CLOSED - # 105: Persist user sessions between restarts
http://kune.ourproject.org/issues/ticket/105
Wave code updated
Some other fixes / improvements
Modified: trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -39,8 +39,6 @@
import cc.kune.core.server.auth.AuthenticatedMethodInterceptor;
import cc.kune.core.server.auth.Authorizated;
import cc.kune.core.server.auth.AuthorizatedMethodInterceptor;
-import cc.kune.core.server.auth.SessionService;
-import cc.kune.core.server.auth.SessionServiceDefault;
import cc.kune.core.server.auth.SuperAdmin;
import cc.kune.core.server.auth.SuperAdminMethodInterceptor;
import cc.kune.core.server.content.ContainerManager;
@@ -159,7 +157,6 @@
bind(FinderService.class).to(FinderServiceDefault.class);
bind(StateService.class).to(StateServiceDefault.class);
bind(I18nTranslationService.class).to(I18nTranslationServiceDefault.class);
- bind(SessionService.class).to(SessionServiceDefault.class);
bind(KuneWaveService.class).to(KuneWaveServiceDefault.class);
bind(XMLActionReader.class);
}
Modified: trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -41,19 +41,10 @@
Provider<HttpServletRequest> requestProvider;
@Inject
- Provider<SessionService> sessionServiceProvider;
-
- // https://code.google.com/p/google-guice/wiki/Transactions
- // @Inject
- // private UnitOfWork unitOfWork;
- @Inject
UserSessionManager userSessionManager;
@Override
public Object invoke(final MethodInvocation invocation) throws Throwable {
- // https://code.google.com/p/google-guice/wiki/Transactions
- // unitOfWork.end();
- // unitOfWork.begin();
try {
final Object[] arguments = invocation.getArguments();
// Some browsers getCookie returns "null" as String instead of null
@@ -68,22 +59,18 @@
final boolean mandatory = authAnnotation.mandatory();
if (userHash == null && mandatory) {
- // sessionService.getNewSession();
throw new UserMustBeLoggedException();
} else if (userSessionManager.isUserNotLoggedIn() && mandatory) {
- // sessionService.getNewSession();
LOG.info("Session expired (not logged in server and mandatory)");
throw new SessionExpiredException();
} else if (userSessionManager.isUserNotLoggedIn() && userHash == null) {
// Ok, do nothing
} else if (userSessionManager.isUserNotLoggedIn() && userHash != null) {
- // sessionService.getNewSession();
LOG.info("Session expired (not logged in server)");
throw new SessionExpiredException();
} else if (!userSessionManager.getHash().equals(userHash)) {
final String serverHash = userSessionManager.getHash();
userSessionManager.logout();
- // sessionService.getNewSession();
LOG.info("Session expired (userHash: " + userHash + " different from server hash: " + serverHash
+ ")");
throw new SessionExpiredException();
@@ -91,7 +78,6 @@
final Object result = invocation.proceed();
return result;
} finally {
- // unitOfWork.end();
}
}
Deleted: trunk/src/main/java/cc/kune/core/server/auth/SessionService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/auth/SessionService.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/core/server/auth/SessionService.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -1,28 +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.auth;
-
-public interface SessionService {
-
- void setSessionExpiration();
-
- void getNewSession();
-
-}
Deleted: trunk/src/main/java/cc/kune/core/server/auth/SessionServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/auth/SessionServiceDefault.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/core/server/auth/SessionServiceDefault.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -1,69 +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.auth;
-
-import javax.servlet.http.HttpServletRequest;
-import javax.servlet.http.HttpSession;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-import com.google.inject.Singleton;
-
-@Singleton
-@Deprecated
-public class SessionServiceDefault implements SessionService {
-
- private final Provider<HttpServletRequest> requestProvider;
-
- @Inject
- public SessionServiceDefault(final Provider<HttpServletRequest> requestProvider) {
- this.requestProvider = requestProvider;
- }
-
- @Override
- @Deprecated
- public void getNewSession() {
- // HttpSession session = getSession();
- // if (session != null) {
- // // During tests session == null
- // session.invalidate();
- // }
- // getSession(true);
- setSessionExpiration();
- }
-
- private HttpSession getSession() {
- return requestProvider.get().getSession();
- }
-
- private HttpSession getSession(final boolean create) {
- return requestProvider.get().getSession(create);
- }
-
- @Override
- @Deprecated
- public void setSessionExpiration() {
- // HttpSession session = getSession();
- // if (session != null) {
- // session.setMaxInactiveInterval(Session.SESSION_DURATION / 1000);
- // }
- }
-
-}
Modified: trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -50,8 +50,6 @@
Provider<KuneProperties> kuneProperties;
@Inject
Provider<HttpServletRequest> requestProvider;
- @Inject
- Provider<SessionService> sessionServiceProvider;
private Group siteGroup;
@Inject
UserSessionManager userSessionManager;
Modified: trunk/src/main/java/cc/kune/wave/client/KuneConversation.css
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneConversation.css 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/wave/client/KuneConversation.css 2011-09-23 21:10:32 UTC (rev 1530)
@@ -12,11 +12,8 @@
z-index: 0;
}
-@sprite .toolbar {
- gwt-image: 'emptyToolbar';
-}
-
-.fixedThread { /*
+.fixedThread {
+ /*
* Allow scrolling. Also, keep the scrollbar there permanently, so that content does not get
* horizontally resized by the addition and removal of a scrollbar.
*/
@@ -27,4 +24,8 @@
/* left: 0; */ /* right: 0; */ /* bottom: 0; */
/* Layout under siblings (participant panel etc). */
z-index: -1;
-}
\ No newline at end of file
+}
+
+@sprite .toolbar {
+ gwt-image: 'emptyToolbar';
+}
Modified: trunk/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/wave/client/KuneFullDomRenderer.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -1,4 +1,5 @@
// @formatter:off
+// @formatter:off
/**
* Copyright 2010 Google Inc.
*
@@ -60,40 +61,40 @@
public final class KuneFullDomRenderer implements RenderingRules<UiBuilder> {
public interface DocRefRenderer {
+ UiBuilder render(ConversationBlip blip,
+ IdentityMap<ConversationThread, UiBuilder> replies);
+
DocRefRenderer EMPTY = new DocRefRenderer() {
@Override
- public UiBuilder render(final ConversationBlip blip,
- final IdentityMap<ConversationThread, UiBuilder> replies) {
+ public UiBuilder render(ConversationBlip blip,
+ IdentityMap<ConversationThread, UiBuilder> replies) {
return UiBuilder.Constant.of(EscapeUtils.fromSafeConstant("<div></div>"));
}
};
-
- UiBuilder render(ConversationBlip blip,
- IdentityMap<ConversationThread, UiBuilder> replies);
}
public interface ParticipantsRenderer {
+ UiBuilder render(Conversation c);
+
ParticipantsRenderer EMPTY = new ParticipantsRenderer() {
@Override
- public UiBuilder render(final Conversation c) {
+ public UiBuilder render(Conversation c) {
return UiBuilder.Constant.of(EscapeUtils.fromSafeConstant("<div></div>"));
}
};
-
- UiBuilder render(Conversation c);
}
private final ShallowBlipRenderer blipPopulator;
private final DocRefRenderer docRenderer;
+ private final ViewIdMapper viewIdMapper;
+ private final ViewFactory viewFactory;
private final ProfileManager profileManager;
private final ThreadReadStateMonitor readMonitor;
- private final ViewFactory viewFactory;
- private final ViewIdMapper viewIdMapper;
private final boolean showParticipantsPanel;
- public KuneFullDomRenderer(final ShallowBlipRenderer blipPopulator, final DocRefRenderer docRenderer,
- final ProfileManager profileManager, final ViewIdMapper viewIdMapper, final ViewFactory viewFactory,
- final ThreadReadStateMonitor readMonitor, boolean showParticipantsPanel) {
+ public KuneFullDomRenderer(ShallowBlipRenderer blipPopulator, DocRefRenderer docRenderer,
+ ProfileManager profileManager, ViewIdMapper viewIdMapper, ViewFactory viewFactory,
+ ThreadReadStateMonitor readMonitor, boolean showParticipantsPanel) {
this.blipPopulator = blipPopulator;
this.docRenderer = docRenderer;
this.profileManager = profileManager;
@@ -103,10 +104,18 @@
this.showParticipantsPanel = showParticipantsPanel;
}
- public UiBuilder getFirstConversation(final IdentityMap<Conversation, UiBuilder> conversations) {
+ @Override
+ public UiBuilder render(ConversationView wave,
+ IdentityMap<Conversation, UiBuilder> conversations) {
+ // return the first conversation in the view.
+ // TODO(hearnden): select the 'best' conversation.
+ return conversations.isEmpty() ? null : getFirstConversation(conversations);
+ }
+
+ public UiBuilder getFirstConversation(IdentityMap<Conversation, UiBuilder> conversations) {
return conversations.reduce(null, new Reduce<Conversation, UiBuilder, UiBuilder>() {
@Override
- public UiBuilder apply(final UiBuilder soFar, final Conversation key, final UiBuilder item) {
+ public UiBuilder apply(UiBuilder soFar, Conversation key, UiBuilder item) {
// Pick the first rendering (any will do).
return soFar == null ? item : soFar;
}
@@ -114,25 +123,20 @@
}
@Override
- public UiBuilder render(final Conversation conversation, final ParticipantId participant) {
- final Profile profile = profileManager.getProfile(participant);
- final String id = viewIdMapper.participantOf(conversation, participant);
- // Use ParticipantAvatarViewBuilder for avatars.
- // Kune patch
- // final ParticipantNameViewBuilder participantUi = ParticipantNameViewBuilder.create(id);
- final ParticipantAvatarViewBuilder participantUi = ParticipantAvatarViewBuilder.create(id);
- participantUi.setAvatar(profile.getImageUrl());
- participantUi.setName(profile.getFullName());
- return participantUi;
+ public UiBuilder render(Conversation conversation, UiBuilder participantsUi, UiBuilder threadUi) {
+ String id = viewIdMapper.conversationOf(conversation);
+ boolean isTop = !conversation.hasAnchor();
+ return isTop ? viewFactory.createTopConversationView(id, threadUi, participantsUi)
+ : viewFactory.createInlineConversationView(id, threadUi, participantsUi);
}
@Override
- public UiBuilder render(final Conversation conversation, final StringMap<UiBuilder> participantUis) {
- final HtmlClosureCollection participantsUi = new HtmlClosureCollection();
- for (final ParticipantId participant : conversation.getParticipantIds()) {
+ public UiBuilder render(Conversation conversation, StringMap<UiBuilder> participantUis) {
+ HtmlClosureCollection participantsUi = new HtmlClosureCollection();
+ for (ParticipantId participant : conversation.getParticipantIds()) {
participantsUi.add(participantUis.get(participant.getAddress()));
}
- final String id = viewIdMapper.participantsOf(conversation);
+ String id = viewIdMapper.participantsOf(conversation);
// Kune patch (but not used)
return showParticipantsPanel? ParticipantsViewBuilder.create(id, participantsUi): new UiBuilder() {
@Override
@@ -142,112 +146,109 @@
}
@Override
- public UiBuilder render(final Conversation conversation, final UiBuilder participantsUi, final UiBuilder threadUi) {
- final String id = viewIdMapper.conversationOf(conversation);
- final boolean isTop = !conversation.hasAnchor();
- return isTop ? viewFactory.createTopConversationView(id, threadUi, participantsUi)
- : viewFactory.createInlineConversationView(id, threadUi, participantsUi);
+ public UiBuilder render(Conversation conversation, ParticipantId participant) {
+ Profile profile = profileManager.getProfile(participant);
+ String id = viewIdMapper.participantOf(conversation, participant);
+ // Use ParticipantAvatarViewBuilder for avatars.
+ // Kune patch
+ // final ParticipantNameViewBuilder participantUi = ParticipantNameViewBuilder.create(id);
+ ParticipantAvatarViewBuilder participantUi = ParticipantAvatarViewBuilder.create(id);
+ participantUi.setAvatar(profile.getImageUrl());
+ participantUi.setName(profile.getFullName());
+ return participantUi;
}
- /**
- */
@Override
- public UiBuilder render(
- final ConversationBlip blip, final IdentityMap<ConversationThread, UiBuilder> replies) {
- return docRenderer.render(blip, replies);
+ public UiBuilder render(final ConversationThread thread,
+ final IdentityMap<ConversationBlip, UiBuilder> blipUis) {
+ HtmlClosure blipsUi = new HtmlClosure() {
+ @Override
+ public void outputHtml(SafeHtmlBuilder out) {
+ for (ConversationBlip blip : thread.getBlips()) {
+ UiBuilder blipUi = blipUis.get(blip);
+ // Not all blips are rendered.
+ if (blipUi != null) {
+ blipUi.outputHtml(out);
+ }
+ }
+ }
+ };
+ String threadId = viewIdMapper.threadOf(thread);
+ String replyIndicatorId = viewIdMapper.replyIndicatorOf(thread);
+ UiBuilder builder = null;
+ if (thread.getConversation().getRootThread() == thread) {
+ ReplyBoxViewBuilder replyBoxBuilder =
+ ReplyBoxViewBuilder.create(replyIndicatorId);
+ builder = RootThreadViewBuilder.create(threadId, blipsUi, replyBoxBuilder);
+ } else {
+ ContinuationIndicatorViewBuilder indicatorBuilder = ContinuationIndicatorViewBuilder.create(
+ replyIndicatorId);
+ InlineThreadViewBuilder inlineBuilder =
+ InlineThreadViewBuilder.create(threadId, blipsUi, indicatorBuilder);
+ int read = readMonitor.getReadCount(thread);
+ int unread = readMonitor.getUnreadCount(thread);
+ inlineBuilder.setTotalBlipCount(read + unread);
+ inlineBuilder.setUnreadBlipCount(unread);
+ builder = inlineBuilder;
+ }
+ return builder;
}
@Override
- public UiBuilder render(final ConversationBlip blip, final UiBuilder document,
+ public UiBuilder render(final ConversationBlip blip, UiBuilder document,
final IdentityMap<ConversationThread, UiBuilder> anchorUis,
final IdentityMap<Conversation, UiBuilder> nestedConversations) {
- final UiBuilder threadsUi = new UiBuilder() {
+ UiBuilder threadsUi = new UiBuilder() {
@Override
- public void outputHtml(final SafeHtmlBuilder out) {
- for (final ConversationThread thread : blip.getReplyThreads()) {
+ public void outputHtml(SafeHtmlBuilder out) {
+ for (ConversationThread thread : blip.getReplyThreads()) {
anchorUis.get(thread).outputHtml(out);
}
}
};
- final UiBuilder convsUi = new UiBuilder() {
+ UiBuilder convsUi = new UiBuilder() {
@Override
- public void outputHtml(final SafeHtmlBuilder out) {
+ public void outputHtml(SafeHtmlBuilder out) {
// Order by conversation id. Ideally, the sort key would be creation
// time, but that is not exposed in the conversation API.
final List<Conversation> ordered = CollectionUtils.newArrayList();
nestedConversations.each(new ProcV<Conversation, UiBuilder>() {
@Override
- public void apply(final Conversation conv, final UiBuilder ui) {
+ public void apply(Conversation conv, UiBuilder ui) {
ordered.add(conv);
}
});
Collections.sort(ordered, new Comparator<Conversation>() {
@Override
- public int compare(final Conversation o1, final Conversation o2) {
+ public int compare(Conversation o1, Conversation o2) {
return o1.getId().compareTo(o2.getId());
}
});
- final List<UiBuilder> orderedUis = CollectionUtils.newArrayList();
- for (final Conversation conv : ordered) {
+ List<UiBuilder> orderedUis = CollectionUtils.newArrayList();
+ for (Conversation conv : ordered) {
nestedConversations.get(conv).outputHtml(out);
}
}
};
- final BlipMetaViewBuilder metaUi = BlipMetaViewBuilder.create(viewIdMapper.metaOf(blip), document);
+ BlipMetaViewBuilder metaUi = BlipMetaViewBuilder.create(viewIdMapper.metaOf(blip), document);
blipPopulator.render(blip, metaUi);
return BlipViewBuilder.create(viewIdMapper.blipOf(blip), metaUi, threadsUi, convsUi);
}
+ /**
+ */
@Override
- public UiBuilder render(final ConversationThread thread,
- final IdentityMap<ConversationBlip, UiBuilder> blipUis) {
- final HtmlClosure blipsUi = new HtmlClosure() {
- @Override
- public void outputHtml(final SafeHtmlBuilder out) {
- for (final ConversationBlip blip : thread.getBlips()) {
- final UiBuilder blipUi = blipUis.get(blip);
- // Not all blips are rendered.
- if (blipUi != null) {
- blipUi.outputHtml(out);
- }
- }
- }
- };
- final String threadId = viewIdMapper.threadOf(thread);
- final String replyIndicatorId = viewIdMapper.replyIndicatorOf(thread);
- UiBuilder builder = null;
- if (thread.getConversation().getRootThread() == thread) {
- final ReplyBoxViewBuilder replyBoxBuilder =
- ReplyBoxViewBuilder.create(replyIndicatorId);
- builder = RootThreadViewBuilder.create(threadId, blipsUi, replyBoxBuilder);
- } else {
- final ContinuationIndicatorViewBuilder indicatorBuilder = ContinuationIndicatorViewBuilder.create(
- replyIndicatorId);
- final InlineThreadViewBuilder inlineBuilder =
- InlineThreadViewBuilder.create(threadId, blipsUi, indicatorBuilder);
- final int read = readMonitor.getReadCount(thread);
- final int unread = readMonitor.getUnreadCount(thread);
- inlineBuilder.setTotalBlipCount(read + unread);
- inlineBuilder.setUnreadBlipCount(unread);
- builder = inlineBuilder;
- }
- return builder;
+ public UiBuilder render(
+ ConversationBlip blip, IdentityMap<ConversationThread, UiBuilder> replies) {
+ return docRenderer.render(blip, replies);
}
@Override
- public UiBuilder render(final ConversationThread thread, final UiBuilder threadR) {
- final String id = EscapeUtils.htmlEscape(viewIdMapper.defaultAnchorOf(thread));
+ public UiBuilder render(ConversationThread thread, UiBuilder threadR) {
+ String id = EscapeUtils.htmlEscape(viewIdMapper.defaultAnchorOf(thread));
return AnchorViewBuilder.create(id, threadR);
}
-
- @Override
- public UiBuilder render(final ConversationView wave,
- final IdentityMap<Conversation, UiBuilder> conversations) {
- // return the first conversation in the view.
- // TODO(hearnden): select the 'best' conversation.
- return conversations.isEmpty() ? null : getFirstConversation(conversations);
- }
}
Modified: trunk/src/main/java/cc/kune/wave/client/KuneFullDomWaveRendererImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneFullDomWaveRendererImpl.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/wave/client/KuneFullDomWaveRendererImpl.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -39,7 +39,7 @@
/**
* Renders waves into HTML DOM, given a renderer that renders waves as HTML
- * closures.
+ * closures. (this is in StatesTwo.java)
*
*/
public final class KuneFullDomWaveRendererImpl implements DomRenderer {
Modified: trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -54,27 +54,27 @@
private final static AsyncHolder<Object> HALT = new AsyncHolder<Object>() {
@Override
- public void call(final Accessor<Object> accessor) {
+ public void call(Accessor<Object> accessor) {
// Never ready, so never notify the accessor.
}
};
+ private final Element wavePanelElement;
+ private final LogicalPanel rootPanel;
+ private final WaveRef waveRef;
private final RemoteViewServiceMultiplexer channel;
- private boolean closed;
private final IdGenerator idGenerator;
+ private final ProfileManager profiles;
+ private final WaveStore waveStore;
private final boolean isNewWave;
private final String localDomain;
- private StageOne one;
- private final ProfileManager profiles;
- private final LogicalPanel rootPanel;
- private final boolean showParticipantsPanel;
- private StageThree three;
+ private boolean closed;
+ private StageOne one;
private StageTwo two;
+ private StageThree three;
private WaveContext wave;
- private final Element wavePanelElement;
- private final WaveRef waveRef;
- private final WaveStore waveStore;
+ private boolean showParticipantsPanel;
/**
* @param wavePanelElement The dom element to become the wave panel
@@ -86,9 +86,9 @@
* @param isNewWave true if the wave is a new client-created wave
* @param idGenerator
*/
- public KuneStagesProvider(final Element wavePanelElement, final LogicalPanel rootPanel, final WaveRef waveRef,
- final RemoteViewServiceMultiplexer channel, final IdGenerator idGenerator, final ProfileManager profiles,
- final WaveStore store, final boolean isNewWave, final String localDomain, final boolean showParticipantsPanel) {
+ public KuneStagesProvider(Element wavePanelElement, LogicalPanel rootPanel, WaveRef waveRef,
+ RemoteViewServiceMultiplexer channel, IdGenerator idGenerator, ProfileManager profiles,
+ WaveStore store, boolean isNewWave, String localDomain, boolean showParticipantsPanel) {
this.wavePanelElement = wavePanelElement;
this.rootPanel = rootPanel;
this.waveRef = waveRef;
@@ -102,46 +102,29 @@
}
@Override
- protected AsyncHolder<StageOne> createStageOneLoader(final StageZero zero) {
+ protected AsyncHolder<StageZero> createStageZeroLoader() {
+ return haltIfClosed(super.createStageZeroLoader());
+ }
+
+ @Override
+ protected AsyncHolder<StageOne> createStageOneLoader(StageZero zero) {
return haltIfClosed(new StageOne.DefaultProvider(zero) {
@Override
- protected LogicalPanel createWaveContainer() {
- return rootPanel;
- }
-
- @Override
protected Element createWaveHolder() {
return wavePanelElement;
}
- });
- }
-
- @Override
- protected AsyncHolder<StageThree> createStageThreeLoader(final StageTwo two) {
- return haltIfClosed(new StageThree.DefaultProvider(this.two = two) {
@Override
- protected void create(final Accessor<StageThree> whenReady) {
- // Prepend an init wave flow onto the stage continuation.
- super.create(new Accessor<StageThree>() {
- @Override
- public void use(final StageThree x) {
- onStageThreeLoaded(x, whenReady);
- }
- });
+ protected LogicalPanel createWaveContainer() {
+ return rootPanel;
}
-
- @Override
- protected String getLocalDomain() {
- return localDomain;
- }
});
}
@Override
- // Kune patch
- protected AsyncHolder<StageTwo> createStageTwoLoader(final StageOne one) {
+ protected AsyncHolder<StageTwo> createStageTwoLoader(StageOne one) {
return haltIfClosed(new StageTwoProvider(
this.one = one, waveRef.getWaveId(), channel, isNewWave, idGenerator, profiles) {
+ // Kune patch
@Override
protected DomRenderer createRenderer() {
return KuneFullDomWaveRendererImpl.create(getConversations(), getProfileManager(),
@@ -159,51 +142,67 @@
}
@Override
- protected AsyncHolder<StageZero> createStageZeroLoader() {
- return haltIfClosed(super.createStageZeroLoader());
+ protected AsyncHolder<StageThree> createStageThreeLoader(final StageTwo two) {
+ return haltIfClosed(new StageThree.DefaultProvider(this.two = two) {
+ @Override
+ protected void create(final Accessor<StageThree> whenReady) {
+ // Prepend an init wave flow onto the stage continuation.
+ super.create(new Accessor<StageThree>() {
+ @Override
+ public void use(StageThree x) {
+ onStageThreeLoaded(x, whenReady);
+ }
+ });
+ }
+
+ @Override
+ protected String getLocalDomain() {
+ return localDomain;
+ }
+ });
}
- public void destroy() {
- if (wave != null) {
- waveStore.remove(wave);
- wave = null;
+ private void onStageThreeLoaded(StageThree x, Accessor<StageThree> whenReady) {
+ if (closed) {
+ // Stop the loading process.
+ return;
}
- if (three != null) {
- three.getEditActions().stopEditing();
- three = null;
+ three = x;
+ if (isNewWave) {
+ initNewWave(x);
+ } else {
+ handleExistingWave(x);
}
- if (two != null) {
- two.getConnector().close();
- two = null;
- }
- if (one != null) {
- one.getWavePanel().destroy();
- one = null;
- }
- closed = true;
+ wave = new WaveContext(
+ two.getWave(), two.getConversations(), two.getSupplement(), two.getReadMonitor());
+ waveStore.add(wave);
+ whenReady.use(x);
}
- /**
- * @return a halting provider if this stage is closed. Otherwise, returns the
- * given provider.
- */
- @SuppressWarnings("unchecked") // HALT is safe as a holder for any type
- private <T> AsyncHolder<T> haltIfClosed(final AsyncHolder<T> provider) {
- return closed ? (AsyncHolder<T>) HALT : provider;
+ private void initNewWave(StageThree three) {
+ // Do the new-wave flow.
+ ModelAsViewProvider views = two.getModelAsViewProvider();
+ BlipQueueRenderer blipQueue = two.getBlipQueue();
+ ConversationView wave = two.getConversations();
+
+ // Force rendering to finish.
+ blipQueue.flush();
+ BlipView blipUi = views.getBlipView(wave.getRoot().getRootThread().getFirstBlip());
+ three.getEditActions().startEditing(blipUi);
}
- private void handleExistingWave(final StageThree three) {
+ private void handleExistingWave(StageThree three) {
// If there's blip reference then focus on that blip.
- final String documentId = waveRef.getDocumentId();
+ String documentId = waveRef.getDocumentId();
if (documentId != null) {
- final ModelAsViewProvider views = two.getModelAsViewProvider();
- final BlipQueueRenderer blipQueue = two.getBlipQueue();
- final ConversationView wave = two.getConversations();
+ ModelAsViewProvider views = two.getModelAsViewProvider();
+ BlipQueueRenderer blipQueue = two.getBlipQueue();
+ ConversationView wave = two.getConversations();
blipQueue.flush();
// Find conversation
Conversation conversation;
if (waveRef.hasWaveletId()) {
- final String id = ModernIdSerialiser.INSTANCE.serialiseWaveletId(waveRef.getWaveletId());
+ String id = ModernIdSerialiser.INSTANCE.serialiseWaveletId(waveRef.getWaveletId());
conversation = wave.getConversation(id);
} else {
// Unspecified wavelet means root.
@@ -211,9 +210,9 @@
}
if (conversation != null) {
// Find selected blip.
- final ConversationBlip blip = wave.getRoot().getBlip(documentId);
+ ConversationBlip blip = wave.getRoot().getBlip(documentId);
if (blip != null) {
- final BlipView blipUi = views.getBlipView(blip);
+ BlipView blipUi = views.getBlipView(blip);
if (blipUi != null) {
two.getStageOne().getFocusFrame().focus(blipUi);
}
@@ -222,32 +221,32 @@
}
}
- private void initNewWave(final StageThree three) {
- // Do the new-wave flow.
- final ModelAsViewProvider views = two.getModelAsViewProvider();
- final BlipQueueRenderer blipQueue = two.getBlipQueue();
- final ConversationView wave = two.getConversations();
-
- // Force rendering to finish.
- blipQueue.flush();
- final BlipView blipUi = views.getBlipView(wave.getRoot().getRootThread().getFirstBlip());
- three.getEditActions().startEditing(blipUi);
- }
-
- private void onStageThreeLoaded(final StageThree x, final Accessor<StageThree> whenReady) {
- if (closed) {
- // Stop the loading process.
- return;
+ public void destroy() {
+ if (wave != null) {
+ waveStore.remove(wave);
+ wave = null;
}
- three = x;
- if (isNewWave) {
- initNewWave(x);
- } else {
- handleExistingWave(x);
+ if (three != null) {
+ three.getEditActions().stopEditing();
+ three = null;
}
- wave = new WaveContext(
- two.getWave(), two.getConversations(), two.getSupplement(), two.getReadMonitor());
- waveStore.add(wave);
- whenReady.use(x);
+ if (two != null) {
+ two.getConnector().close();
+ two = null;
+ }
+ if (one != null) {
+ one.getWavePanel().destroy();
+ one = null;
+ }
+ closed = true;
}
+
+ /**
+ * @return a halting provider if this stage is closed. Otherwise, returns the
+ * given provider.
+ */
+ @SuppressWarnings("unchecked") // HALT is safe as a holder for any type
+ private <T> AsyncHolder<T> haltIfClosed(AsyncHolder<T> provider) {
+ return closed ? (AsyncHolder<T>) HALT : provider;
+ }
}
Modified: trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/wave/client/KuneWaveProfileManager.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -31,7 +31,7 @@
/**
* The Class KuneWaveProfileManager is a workaround to show avatars in kune
- * while the Wave part is more mature
+ * while the Wave part is more mature (see in the future RemoteProfileManagerImpl)
*
*/
public class KuneWaveProfileManager extends AbstractProfileManager<ProfileImpl> implements
@@ -58,7 +58,7 @@
}
@Override
- public ProfileImpl getProfile(final ParticipantId participantId) {
+ public ProfileImpl getProfile(ParticipantId participantId) {
ProfileImpl profile = profiles.get(participantId.getAddress());
if (profile == null) {
@@ -73,4 +73,4 @@
profile.update(profile.getFirstName(), profile.getFullName(), avatar);
}
-}
\ No newline at end of file
+}
Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-09-23 17:07:21 UTC (rev 1529)
+++ trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-09-23 21:10:32 UTC (rev 1530)
@@ -282,7 +282,7 @@
}
});
- setupConnectionIndicator();
+ //setupConnectionIndicator();
// Done in StateManager
// HistorySupport.init();
1
0
Author: vjrj_
Date: 2011-09-23 19:07:21 +0200 (Fri, 23 Sep 2011)
New Revision: 1529
Added:
trunk/src/main/java/cc/kune/core/server/LogThis.java
trunk/src/main/java/cc/kune/core/server/UserSessionManager.java
Removed:
trunk/src/main/java/cc/kune/wave/server/AbstractBaseRobotAgent.java
Modified:
trunk/
trunk/.classpath
trunk/DEV-GUIDE
trunk/TODO
trunk/pom.xml
trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
trunk/src/main/java/cc/kune/core/server/UserSession.java
trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java
trunk/src/main/java/cc/kune/core/server/auth/AuthorizatedMethodInterceptor.java
trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java
trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java
trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/I18nRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/RPC.java
trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java
trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java
trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java
trunk/src/main/java/cc/kune/wave/client/WebClient.java
trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java
trunk/src/main/java/cc/kune/wave/server/KuneAgent.java
trunk/src/main/java/cc/kune/wave/server/WaveMain.java
trunk/src/test/java/cc/kune/core/server/integration/IntegrationTest.java
trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java
trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java
Log:
NEW - # 105: Persist user sessions between restarts
http://kune.ourproject.org/issues/ticket/105
NEW - # 53: Add Selenium Framework testing
http://kune.ourproject.org/issues/ticket/53
Property changes on: trunk
___________________________________________________________________
Name: svn:ignore
- pmd-eclipse.log
.pmd
www-test
screenlog.0
client
public
target
target-local
Main-compile
.settings
.gwt-cache
repository
derby.log
star-yellow-grey.png
run.sh
tomcat
gwt-out
synccss.sh
.externalToolBuilders
.wtpmodules
www
testRepository
kune-OLD-jcr
KuneApp.launch
KuneApp NOSERVER.launch
old_src
org.ourproject.kune.app.Kune
org.ourproject.kune.iml
org.ourproject.kune.ipr
org.ourproject.kune.iws
nbproject
hibernate.reveng.xml
.gwt-tmp
target-eclipse
.checkstyle
.classpath-bien
pom.xml.*
.gwt
.jdee_sources
.jdee_classpath
prj.el
.factorypath
.apt_generated
target.old
_accounts
_certificates
_deltas
logs
test-output
.recommenders
+ pmd-eclipse.log
.pmd
www-test
screenlog.0
client
public
target
target-local
Main-compile
.settings
.gwt-cache
repository
derby.log
star-yellow-grey.png
run.sh
tomcat
gwt-out
synccss.sh
.externalToolBuilders
.wtpmodules
www
testRepository
kune-OLD-jcr
KuneApp.launch
KuneApp NOSERVER.launch
old_src
org.ourproject.kune.app.Kune
org.ourproject.kune.iml
org.ourproject.kune.ipr
org.ourproject.kune.iws
nbproject
hibernate.reveng.xml
.gwt-tmp
target-eclipse
.checkstyle
.classpath-bien
pom.xml.*
.gwt
.jdee_sources
.jdee_classpath
prj.el
.factorypath
.apt_generated
target.old
_accounts
_certificates
_deltas
logs
test-output
.recommenders
_sessions
chromedriver.log
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/.classpath 2011-09-23 17:07:21 UTC (rev 1529)
@@ -11,19 +11,19 @@
<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/com/google/appengine/appengine-api-1.0-sdk/1.3.1/appengine-api-1.0-sdk-1.3.1.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/org/waveprotocol/box/0.3.1-SNAPSHOT/box-0.3.1-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.1-SNAPSHOT/box-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box/0.3.2-SNAPSHOT/box-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.2-SNAPSHOT/box-src-0.3.2-SNAPSHOT.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.1-SNAPSHOT/client-0.3.1-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common/0.3.1-SNAPSHOT/client-common-0.3.1-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.1-SNAPSHOT/client-common-src-0.3.1-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.1-SNAPSHOT/client-scheduler-src-0.3.1-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.1-SNAPSHOT/client-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client/0.3.2-SNAPSHOT/client-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common/0.3.2-SNAPSHOT/client-common-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.2-SNAPSHOT/client-common-src-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.2-SNAPSHOT/client-scheduler-src-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.2-SNAPSHOT/client-src-0.3.2-SNAPSHOT.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.1-SNAPSHOT/common-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/common-src/0.3.2-SNAPSHOT/common-src-0.3.2-SNAPSHOT.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"/>
@@ -32,8 +32,8 @@
<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.1-SNAPSHOT/communication-src-0.3.1-SNAPSHOT.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.1-SNAPSHOT/concurrencycontrol-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.2-SNAPSHOT/communication-src-0.3.2-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.2-SNAPSHOT/concurrencycontrol-src-0.3.2-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/crawl_htmlunit/r5662-gae/crawl_htmlunit-r5662-gae.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"/>
@@ -55,7 +55,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.1-SNAPSHOT/gwt-util-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/gwt-util-src/0.3.2-SNAPSHOT/gwt-util-src-0.3.2-SNAPSHOT.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/gwtext/gwtext/2.0.5/gwtext-2.0.5.jar"/>
<classpathentry kind="var" path="M2_REPO/com/gwtextux/gwtextux/0.4.0.924/gwtextux-0.4.0.924.jar"/>
@@ -113,16 +113,16 @@
<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.1-SNAPSHOT/media-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/media-src/0.3.2-SNAPSHOT/media-src-0.3.2-SNAPSHOT.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.1-SNAPSHOT/model-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.2-SNAPSHOT/model-src-0.3.2-SNAPSHOT.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.1-SNAPSHOT/proto-msg-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/proto-msg/0.3.2-SNAPSHOT/proto-msg-0.3.2-SNAPSHOT.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.6.0/selenium-android-driver-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.6.0/selenium-android-driver-2.6.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-api/2.6.0/selenium-api-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-api/2.6.0/selenium-api-2.6.0-sources.jar"/>
@@ -144,9 +144,9 @@
<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.1-SNAPSHOT/util-src-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/util-src/0.3.2-SNAPSHOT/util-src-0.3.2-SNAPSHOT.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.1-SNAPSHOT/waveinabox-server-0.3-0.3.1-SNAPSHOT.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.2-SNAPSHOT/waveinabox-server-0.3-0.3.2-SNAPSHOT.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"/>
@@ -155,4 +155,4 @@
<classpathentry kind="var" path="M2_REPO/org/xwiki/platform/xwiki-web-gwt-dom/2.3-rc-1/xwiki-web-gwt-dom-2.3-rc-1.jar" sourcepath="M2_REPO/org/xwiki/platform/xwiki-web-gwt-dom/2.3-rc-1/xwiki-web-gwt-dom-2.3-rc-1-sources.jar"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="src" path=".apt_generated" including="**/*.java"/> <classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
-</classpath>
\ No newline at end of file
+</classpath>
Modified: trunk/DEV-GUIDE
===================================================================
--- trunk/DEV-GUIDE 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/DEV-GUIDE 2011-09-23 17:07:21 UTC (rev 1529)
@@ -307,6 +307,26 @@
See class WaveClientProvider in Kune (in a short term, we should define this in a .gwt.xml not there, but this is a start point).
+== kune maven repo ==
+
+For upload packages you need to configure in .m2/settings.xml something like:
+
+<?xml version="1.0" encoding="UTF-8"?>
+<settings>
+ <servers>
+ <server>
+ <id>kune.ourproject.org</id>
+ <username>YOUR_USER_IN_OURPROJECT_ORG</username>
+ </server>
+ </servers>
+</settings>
+
+also you have to
+ ssh-copy-id YOUR_USER_IN_OURPROJECT_ORG(a)ourproject.org
+and access via ssh with that key without problems.
+
+We usually upload new packages to this repo via bin/repopubli.sh
+
==Changelog==
Periodically update the Changelog using svn2cl:
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/TODO 2011-09-23 17:07:21 UTC (rev 1529)
@@ -284,6 +284,11 @@
2007-12-21 10:35:16,197 [btpool0-5] DEBUG - ContentManagerDefault.createContent EXCEPTION => javax.persistence.Entity
** vjrj <v> IconHyperlink.java and IconLabel.java to gwt1.5
+** chromium & selenium
+http://www.chromium.org/developers/testing/webdriver-for-chrome
+/usr/bin/chromiumdriver
+chmod og+rx /usr/bin/chromiumdriver
+
** Memory use in demo
http://rimuhosting.com/howto/memory.jsp
Resolving: High Java Memory Usage
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/pom.xml 2011-09-23 17:07:21 UTC (rev 1529)
@@ -562,17 +562,17 @@
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>waveinabox-server-0.3</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>proto-msg</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>gwt-util-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
@@ -582,67 +582,67 @@
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>box</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>box-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>model-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-common</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-common-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>common-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>util-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>concurrencycontrol-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>client-scheduler-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>media-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>org.waveprotocol</groupId>
<artifactId>communication-src</artifactId>
- <version>0.3.1-SNAPSHOT</version>
+ <version>0.3.2-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>net.sourceforge.findbugs</groupId>
Modified: trunk/src/main/java/cc/kune/core/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/KuneRackModule.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -87,7 +87,8 @@
@Override
public void configure() {
install(FinderRegistry.init(new JpaPersistModule(jpaUnit)));
- bindInterceptor(Matchers.any(), new NotInObject(), new LoggerMethodInterceptor());
+ bindInterceptor(Matchers.annotatedWith(LogThis.class), new NotInObject(),
+ new LoggerMethodInterceptor());
bindConstant().annotatedWith(PropertiesFileName.class).to(kuneConfig);
if (sessionScope != null) {
bindScope(SessionScoped.class, sessionScope);
Added: trunk/src/main/java/cc/kune/core/server/LogThis.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/LogThis.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/LogThis.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -0,0 +1,14 @@
+package cc.kune.core.server;
+
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+
+import com.google.inject.BindingAnnotation;
+
+/**
+ * Anotate the classes you want to log via Guice interceptors
+ */
+@BindingAnnotation
+(a)Retention(RetentionPolicy.RUNTIME)
+public @interface LogThis {
+}
Modified: trunk/src/main/java/cc/kune/core/server/UserSession.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/UserSession.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/UserSession.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -19,56 +19,35 @@
*/
package cc.kune.core.server;
+import java.io.Serializable;
-import cc.kune.core.server.manager.UserManager;
-import cc.kune.domain.User;
-
-import com.google.inject.Inject;
import com.google.inject.servlet.SessionScoped;
@SessionScoped
-public class UserSession {
- private String userHash;
- private Long userId;
- private final UserManager manager;
+public class UserSession implements Serializable {
- @Inject
- public UserSession(final UserManager manager) {
- this.manager = manager;
- }
+ private static final long serialVersionUID = 4665523798343705868L;
- public String getHash() {
- return userHash;
- }
+ private String userHash;
+ private Long userId;
- public User getUser() {
- return manager.find(userId);
- }
+ public UserSession() {
+ }
- public boolean isUserLoggedIn() {
- return userId != null;
- }
+ public String getHash() {
+ return userHash;
+ }
- public boolean isUserNotLoggedIn() {
- return !isUserLoggedIn();
- }
+ public Long getUserId() {
+ return userId;
+ }
- public void login(final User user, final String newUserHash) {
- setUser(user);
- setHash(newUserHash);
- }
+ public void setHash(final String hash) {
+ this.userHash = hash;
+ }
- public void logout() {
- userId = null;
- userHash = null;
- }
+ public void setUserId(final Long userId) {
+ this.userId = userId;
+ }
- private void setHash(final String hash) {
- this.userHash = hash;
- }
-
- private void setUser(final User user) {
- userId = user.getId();
- }
-
}
Added: trunk/src/main/java/cc/kune/core/server/UserSessionManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/UserSessionManager.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/UserSessionManager.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -0,0 +1,51 @@
+package cc.kune.core.server;
+
+import cc.kune.core.server.manager.UserManager;
+import cc.kune.domain.User;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.google.inject.Singleton;
+
+@Singleton
+public class UserSessionManager {
+
+ private final UserManager manager;
+ private final Provider<UserSession> userSessionProv;
+
+ @Inject
+ public UserSessionManager(final UserManager manager, final Provider<UserSession> userSessionProv) {
+ this.manager = manager;
+ this.userSessionProv = userSessionProv;
+ }
+
+ public String getHash() {
+ return getUserSession().getHash();
+ }
+
+ public User getUser() {
+ return manager.find(getUserSession().getUserId());
+ }
+
+ private UserSession getUserSession() {
+ return userSessionProv.get();
+ }
+
+ public boolean isUserLoggedIn() {
+ return getUserSession().getUserId() != null;
+ }
+
+ public boolean isUserNotLoggedIn() {
+ return !isUserLoggedIn();
+ }
+
+ public void login(final Long userId, final String newUserHash) {
+ getUserSession().setUserId(userId);
+ getUserSession().setHash(newUserHash);
+ }
+
+ public void logout() {
+ getUserSession().setUserId(null);
+ getUserSession().setHash(null);
+ }
+}
Modified: trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/auth/AuthenticatedMethodInterceptor.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -28,7 +28,7 @@
import cc.kune.core.client.errors.SessionExpiredException;
import cc.kune.core.client.errors.UserMustBeLoggedException;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -47,7 +47,7 @@
// @Inject
// private UnitOfWork unitOfWork;
@Inject
- Provider<UserSession> userSessionProvider;
+ UserSessionManager userSessionManager;
@Override
public Object invoke(final MethodInvocation invocation) throws Throwable {
@@ -63,8 +63,6 @@
LOG.info("Method: " + invocation.getMethod().getName());
LOG.info("Userhash received: " + userHash);
LOG.info("--------------------------------------------------------------------------------");
- final UserSession userSession = userSessionProvider.get();
- // final SessionService sessionService = sessionServiceProvider.get();
final Authenticated authAnnotation = invocation.getStaticPart().getAnnotation(Authenticated.class);
final boolean mandatory = authAnnotation.mandatory();
@@ -72,19 +70,19 @@
if (userHash == null && mandatory) {
// sessionService.getNewSession();
throw new UserMustBeLoggedException();
- } else if (userSession.isUserNotLoggedIn() && mandatory) {
+ } else if (userSessionManager.isUserNotLoggedIn() && mandatory) {
// sessionService.getNewSession();
LOG.info("Session expired (not logged in server and mandatory)");
throw new SessionExpiredException();
- } else if (userSession.isUserNotLoggedIn() && userHash == null) {
+ } else if (userSessionManager.isUserNotLoggedIn() && userHash == null) {
// Ok, do nothing
- } else if (userSession.isUserNotLoggedIn() && userHash != null) {
+ } else if (userSessionManager.isUserNotLoggedIn() && userHash != null) {
// sessionService.getNewSession();
LOG.info("Session expired (not logged in server)");
throw new SessionExpiredException();
- } else if (!userSession.getHash().equals(userHash)) {
- final String serverHash = userSession.getHash();
- userSession.logout();
+ } else if (!userSessionManager.getHash().equals(userHash)) {
+ final String serverHash = userSessionManager.getHash();
+ userSessionManager.logout();
// sessionService.getNewSession();
LOG.info("Session expired (userHash: " + userHash + " different from server hash: " + serverHash
+ ")");
Modified: trunk/src/main/java/cc/kune/core/server/auth/AuthorizatedMethodInterceptor.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/auth/AuthorizatedMethodInterceptor.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/auth/AuthorizatedMethodInterceptor.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -25,7 +25,7 @@
import org.aopalliance.intercept.MethodInvocation;
import cc.kune.core.client.errors.AccessViolationException;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.access.AccessRightsUtils;
import cc.kune.core.server.access.AccessService;
import cc.kune.core.server.content.ContentUtils;
@@ -49,14 +49,14 @@
@Inject
private Provider<GroupManager> groupManagerProvider;
@Inject
- private Provider<UserSession> userSessionProvider;
+ private Provider<UserSessionManager> userSessionProvider;
@Override
public Object invoke(final MethodInvocation invocation) throws Throwable {
final Object[] arguments = invocation.getArguments();
final StateToken token = (StateToken) arguments[1];
- final UserSession userSession = userSessionProvider.get();
+ final UserSessionManager userSession = userSessionProvider.get();
final GroupManager groupManager = groupManagerProvider.get();
final AccessService accessService = accessServiceProvider.get();
Modified: trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/auth/SuperAdminMethodInterceptor.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -29,7 +29,7 @@
import cc.kune.core.client.errors.AccessViolationException;
import cc.kune.core.client.errors.SessionExpiredException;
import cc.kune.core.client.errors.UserMustBeLoggedException;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.access.AccessRightsUtils;
import cc.kune.core.server.properties.KuneProperties;
import cc.kune.core.shared.domain.AccessRol;
@@ -54,7 +54,7 @@
Provider<SessionService> sessionServiceProvider;
private Group siteGroup;
@Inject
- Provider<UserSession> userSessionProvider;
+ UserSessionManager userSessionManager;
@Override
public Object invoke(final MethodInvocation invocation) throws Throwable {
@@ -66,7 +66,6 @@
LOG.info("Method: " + invocation.getMethod().getName());
LOG.info("Userhash received: " + userHash);
LOG.info("--------------------------------------------------------------------------------");
- final UserSession userSession = userSessionProvider.get();
final SuperAdmin authAnnotation = invocation.getStaticPart().getAnnotation(SuperAdmin.class);
final AccessRol rol = authAnnotation.rol();
@@ -78,11 +77,11 @@
if (userHash == null) {
throw new UserMustBeLoggedException();
- } else if (userSession.isUserNotLoggedIn()) {
+ } else if (userSessionManager.isUserNotLoggedIn()) {
LOG.info("Session expired (not logged in server and mandatory)");
throw new SessionExpiredException();
} else {
- User user = userSession.getUser();
+ final User user = userSessionManager.getUser();
if (!AccessRightsUtils.correctMember(user, siteGroup, rol)) {
throw new AccessViolationException();
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/manager/file/FileUploadManager.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -25,7 +25,7 @@
import org.apache.commons.fileupload.FileItem;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.access.AccessService;
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
@@ -60,7 +60,7 @@
@Inject
I18nTranslationService i18n;
@Inject
- UserSession userSession;
+ UserSessionManager userSession;
@Override
protected void beforePostStart() {
Modified: trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -31,7 +31,7 @@
import cc.kune.core.client.errors.NoDefaultContentException;
import cc.kune.core.client.errors.ToolNotFoundException;
import cc.kune.core.client.rpcservices.ContentService;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.access.AccessRightsService;
import cc.kune.core.server.access.AccessService;
import cc.kune.core.server.access.FinderService;
@@ -68,7 +68,6 @@
import cc.kune.domain.User;
import com.google.inject.Inject;
-import com.google.inject.Provider;
import com.google.inject.persist.Transactional;
public class ContentRPC implements ContentService, RPC {
@@ -83,18 +82,18 @@
private final AccessRightsService rightsService;
private final StateService stateService;
private final TagUserContentManager tagManager;
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSession;
private final KuneWaveManager waveManager;
@Inject
- public ContentRPC(final FinderService finderService, final Provider<UserSession> userSessionProvider,
+ public ContentRPC(final FinderService finderService, final UserSessionManager userSession,
final AccessService accessService, final AccessRightsService rightsService,
final StateService stateService, final CreationService creationService,
final GroupManager groupManager, final ContentManager contentManager,
final ContainerManager containerManager, final TagUserContentManager tagManager,
final Mapper mapper, final ChatManager chatManager, final KuneWaveManager waveManager) {
this.finderService = finderService;
- this.userSessionProvider = userSessionProvider;
+ this.userSession = userSession;
this.accessService = accessService;
this.rightsService = rightsService;
this.stateService = stateService;
@@ -249,7 +248,7 @@
}
private User getCurrentUser() {
- return getUserSession().getUser();
+ return userSession.getUser();
}
public StateContainerDTO getState(final Container container) {
@@ -284,12 +283,8 @@
return getSummaryTags(group);
}
- private UserSession getUserSession() {
- return userSessionProvider.get();
- }
-
private boolean isUserLoggedIn() {
- return getUserSession().isUserLoggedIn();
+ return userSession.isUserLoggedIn();
}
private void mapContentRightsInstate(final User user, final AccessLists groupAccessList,
Modified: trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/rpc/GroupRPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -22,7 +22,7 @@
import cc.kune.core.client.errors.AccessViolationException;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.rpcservices.GroupService;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.Authorizated;
@@ -41,7 +41,6 @@
import cc.kune.domain.User;
import com.google.inject.Inject;
-import com.google.inject.Provider;
import com.google.inject.persist.Transactional;
public class GroupRPC implements RPC, GroupService {
@@ -50,13 +49,13 @@
private final GroupManager groupManager;
private final Mapper mapper;
private final ReservedWordsRegistry reserverdWords;
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSessionManager;
@Inject
- public GroupRPC(final Provider<UserSession> userSessionProvider, final GroupManager groupManager,
+ public GroupRPC(final UserSessionManager userSessionManager, final GroupManager groupManager,
final ContentManager contentManager, final Mapper mapper,
final ReservedWordsRegistry reserverdWords, final ContentRPC contentRPC) {
- this.userSessionProvider = userSessionProvider;
+ this.userSessionManager = userSessionManager;
this.groupManager = groupManager;
this.contentManager = contentManager;
this.mapper = mapper;
@@ -120,15 +119,10 @@
}
private User getUserLogged() {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = userSessionManager.getUser();
return user;
}
- private UserSession getUserSession() {
- return userSessionProvider.get();
- }
-
@Override
@Authenticated(mandatory = true)
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
Modified: trunk/src/main/java/cc/kune/core/server/rpc/I18nRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/I18nRPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/rpc/I18nRPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -28,7 +28,7 @@
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.errors.SessionExpiredException;
import cc.kune.core.client.rpcservices.I18nService;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.SuperAdmin;
import cc.kune.core.server.manager.I18nLanguageManager;
@@ -49,15 +49,14 @@
private final I18nLanguageManager languageManager;
private final Mapper mapper;
private final Provider<HttpServletRequest> requestProvider;
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSessionManager;
@Inject
public I18nRPC(final Provider<HttpServletRequest> requestProvider,
- final Provider<UserSession> userSessionProvider,
- final I18nTranslationManager i18nTranslationManager, final I18nLanguageManager languageManager,
- final Mapper mapper) {
+ final UserSessionManager userSessionManager, final I18nTranslationManager i18nTranslationManager,
+ final I18nLanguageManager languageManager, final Mapper mapper) {
this.requestProvider = requestProvider;
- this.userSessionProvider = userSessionProvider;
+ this.userSessionManager = userSessionManager;
this.i18nTranslationManager = i18nTranslationManager;
this.languageManager = languageManager;
this.mapper = mapper;
@@ -68,12 +67,11 @@
public I18nLanguageDTO getInitialLanguage(final String localeParam) {
String initLanguage;
I18nLanguage lang;
- final UserSession userSession = getUserSession();
if (localeParam != null) {
initLanguage = localeParam;
} else {
- if (userSession.isUserLoggedIn()) {
- initLanguage = userSession.getUser().getLanguage().getCode();
+ if (userSessionManager.isUserLoggedIn()) {
+ initLanguage = userSessionManager.getUser().getLanguage().getCode();
} else {
final String browserLang = requestProvider.get().getLocale().getLanguage();
if (browserLang != null) {
@@ -134,10 +132,6 @@
return i18nTranslationManager.getTranslation(language, text, noteForTranslators);
}
- private UserSession getUserSession() {
- return userSessionProvider.get();
- }
-
@Override
@Authenticated
@Transactional
Modified: trunk/src/main/java/cc/kune/core/server/rpc/RPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/RPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/rpc/RPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -19,6 +19,8 @@
*/
package cc.kune.core.server.rpc;
+import cc.kune.core.server.LogThis;
+
import com.google.inject.Singleton;
/**
@@ -35,6 +37,7 @@
*
*/
@Singleton
+@LogThis
public interface RPC {
}
Modified: trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -26,7 +26,7 @@
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.rpcservices.SiteService;
import cc.kune.core.server.InitData;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.manager.ExtMediaDescripManager;
import cc.kune.core.server.manager.I18nCountryManager;
import cc.kune.core.server.manager.I18nLanguageManager;
@@ -45,7 +45,6 @@
import cc.kune.core.shared.dto.UserInfoDTO;
import com.google.inject.Inject;
-import com.google.inject.Provider;
import com.google.inject.persist.Transactional;
public class SiteRPC implements RPC, SiteService {
@@ -61,16 +60,15 @@
private final ServerToolRegistry serverToolRegistry;
private final HashMap<String, GSpaceTheme> siteThemes;
private final UserInfoService userInfoService;
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSessionManager;
- // TODO: refactor: too many parameters! refactor to Facade Pattern
@Inject
- public SiteRPC(final Provider<UserSession> userSessionProvider, final UserManager userManager,
+ public SiteRPC(final UserSessionManager userSessionManager, final UserManager userManager,
final UserInfoService userInfoService, final LicenseManager licenseManager, final Mapper mapper,
final KuneProperties kuneProperties, final ChatProperties chatProperties,
final I18nLanguageManager languageManager, final I18nCountryManager countryManager,
final ServerToolRegistry serverToolRegistry, final ExtMediaDescripManager extMediaDescManager) {
- this.userSessionProvider = userSessionProvider;
+ this.userSessionManager = userSessionManager;
this.userInfoService = userInfoService;
this.licenseManager = licenseManager;
this.mapper = mapper;
@@ -93,9 +91,9 @@
@Transactional
public InitDataDTO getInitData(final String userHash) throws DefaultException {
final InitDataDTO dataMapped = mapper.map(data, InitDataDTO.class);
- final UserSession userSession = getUserSession();
- final UserInfo userInfo = userInfoService.buildInfo(userSession.getUser(), userSession.getHash());
+ final UserInfo userInfo = userInfoService.buildInfo(userSessionManager.getUser(),
+ userSessionManager.getHash());
if (userInfo != null) {
dataMapped.setUserInfo(mapper.map(userInfo, UserInfoDTO.class));
}
@@ -120,10 +118,6 @@
return theme;
}
- private UserSession getUserSession() {
- return userSessionProvider.get();
- }
-
private InitData loadInitData() {
data = new InitData();
data.setSiteUrl(kuneProperties.get(KuneProperties.SITE_URL));
Modified: trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SocialNetworkRPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -21,7 +21,7 @@
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.rpcservices.SocialNetworkService;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.Authorizated;
@@ -36,7 +36,6 @@
import cc.kune.domain.User;
import com.google.inject.Inject;
-import com.google.inject.Provider;
import com.google.inject.persist.Transactional;
public class SocialNetworkRPC implements SocialNetworkService, RPC {
@@ -44,13 +43,12 @@
private final GroupManager groupManager;
private final Mapper mapper;
private final SocialNetworkManager socialNetworkManager;
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSessionManager;
@Inject
- public SocialNetworkRPC(final Provider<UserSession> userSessionProvider,
- final GroupManager groupManager, final SocialNetworkManager socialNetworkManager,
- final Mapper mapper) {
- this.userSessionProvider = userSessionProvider;
+ public SocialNetworkRPC(final UserSessionManager userSessionManager, final GroupManager groupManager,
+ final SocialNetworkManager socialNetworkManager, final Mapper mapper) {
+ this.userSessionManager = userSessionManager;
this.groupManager = groupManager;
this.socialNetworkManager = socialNetworkManager;
this.mapper = mapper;
@@ -62,8 +60,7 @@
@Transactional
public SocialNetworkDataDTO acceptJoinGroup(final String hash, final StateToken groupToken,
final String groupToAcceptShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToAccept = groupManager.findByShortName(groupToAcceptShortName);
@@ -77,8 +74,7 @@
@Transactional
public SocialNetworkDataDTO addAdminMember(final String hash, final StateToken groupToken,
final String groupToAddShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToAdd = groupManager.findByShortName(groupToAddShortName);
@@ -92,8 +88,7 @@
@Transactional
public SocialNetworkDataDTO addCollabMember(final String hash, final StateToken groupToken,
final String groupToAddShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToAdd = groupManager.findByShortName(groupToAddShortName);
@@ -107,8 +102,7 @@
@Transactional
public SocialNetworkDataDTO addViewerMember(final String hash, final StateToken groupToken,
final String groupToAddShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToAdd = groupManager.findByShortName(groupToAddShortName);
@@ -129,8 +123,7 @@
@Transactional
public SocialNetworkDataDTO deleteMember(final String hash, final StateToken groupToken,
final String groupToDeleleShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToDelete = groupManager.findByShortName(groupToDeleleShortName);
@@ -144,8 +137,7 @@
@Transactional
public SocialNetworkDataDTO denyJoinGroup(final String hash, final StateToken groupToken,
final String groupToDenyShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToDenyJoin = groupManager.findByShortName(groupToDenyShortName);
@@ -165,23 +157,17 @@
@Transactional
public SocialNetworkDataDTO getSocialNetwork(final String hash, final StateToken groupToken)
throws DefaultException {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
return generateResponse(user, group);
}
- private UserSession getUserSession() {
- return userSessionProvider.get();
- }
-
@Override
@Authenticated
@Transactional
public SocialNetworkRequestResult requestJoinGroup(final String hash, final StateToken groupToken)
throws DefaultException {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
return socialNetworkManager.requestToJoin(user, group);
@@ -193,8 +179,7 @@
@Transactional
public SocialNetworkDataDTO setAdminAsCollab(final String hash, final StateToken groupToken,
final String groupToSetCollabShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToSetCollab = groupManager.findByShortName(groupToSetCollabShortName);
@@ -208,8 +193,7 @@
@Transactional
public SocialNetworkDataDTO setCollabAsAdmin(final String hash, final StateToken groupToken,
final String groupToSetAdminShortName) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
final Group groupToSetAdmin = groupManager.findByShortName(groupToSetAdminShortName);
@@ -221,8 +205,7 @@
@Authenticated
@Transactional
public void unJoinGroup(final String hash, final StateToken groupToken) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User userLogged = userSession.getUser();
+ final User userLogged = userSessionManager.getUser();
final Group group = groupManager.findByShortName(groupToken.getGroup());
checkIsNotPersonalGroup(group);
socialNetworkManager.unJoinGroup(userLogged.getUserGroup(), group);
Modified: trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -31,6 +31,7 @@
import cc.kune.core.client.errors.UserAuthException;
import cc.kune.core.client.rpcservices.UserService;
import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.Authorizated;
@@ -63,7 +64,7 @@
private final ReservedWordsRegistry reserverdWords;
private final UserInfoService userInfoService;
private final UserManager userManager;
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSessionManager;
private final Boolean useSocketIO;
private final CustomWaveClientServlet waveClientServlet;
private final SessionManager waveSessionManager;
@@ -73,8 +74,8 @@
@Named(CoreSettings.USE_SOCKETIO) final Boolean useSocketIO,
final UserInfoService userInfoService, final Mapper mapper,
final SessionManager waveSessionManager, final CustomWaveClientServlet waveClientServlet,
- final ReservedWordsRegistry reserverdWords, final ContentRPC contentRPC) {
- this.userSessionProvider = userSessionProvider;
+ final ReservedWordsRegistry reserverdWords, final ContentRPC contentRPC,
+ final UserSessionManager userSessionManager) {
this.userManager = userManager;
this.useSocketIO = useSocketIO;
this.userInfoService = userInfoService;
@@ -83,6 +84,7 @@
this.waveClientServlet = waveClientServlet;
this.reserverdWords = reserverdWords;
this.contentRPC = contentRPC;
+ this.userSessionManager = userSessionManager;
}
@Override
@@ -101,8 +103,7 @@
@Authorizated(accessRolRequired = AccessRol.Administrator, actionLevel = ActionLevel.group)
public String getUserAvatarBaser64(final String userHash, final StateToken userToken)
throws DefaultException {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = userSessionManager.getUser();
final Group userGroup = user.getUserGroup();
if (!userGroup.getShortName().equals(userToken.getGroup())) {
throw new AccessViolationException();
@@ -114,10 +115,6 @@
}
}
- private UserSession getUserSession() {
- return userSessionProvider.get();
- }
-
@Override
@Authenticated(mandatory = true)
public WaveClientParams getWaveClientParameters(final String userHash) {
@@ -128,7 +125,7 @@
}
private UserInfoDTO loadUserInfo(final User user) throws DefaultException {
- final UserInfo userInfo = userInfoService.buildInfo(user, getUserSession().getHash());
+ final UserInfo userInfo = userInfoService.buildInfo(user, userSessionManager.getHash());
return mapper.map(userInfo, UserInfoDTO.class);
}
@@ -144,8 +141,7 @@
private UserInfoDTO loginUser(final User user, final String waveToken) throws DefaultException {
if (user != null) {
- // Maybe use terracotta.org for http session clustering
- getUserSession().login(user, waveToken);
+ userSessionManager.login(user.getId(), waveToken);
return loadUserInfo(user);
} else {
throw new UserAuthException();
@@ -156,7 +152,7 @@
@Authenticated
@Transactional
public void logout(final String userHash) throws DefaultException {
- getUserSession().logout();
+ userSessionManager.logout();
// FIXME final SessionService sessionService =
// sessionServiceProvider.get();
// FIXME sessionService.getNewSession();
@@ -173,8 +169,7 @@
@Authenticated
@Transactional
public UserInfoDTO reloadUserInfo(final String userHash) throws DefaultException {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = userSessionManager.getUser();
return loadUserInfo(user);
}
@@ -184,8 +179,7 @@
@Transactional
public void setBuddiesVisibility(final String userHash, final StateToken groupToken,
final UserSNetVisibility visibility) {
- final UserSession userSession = getUserSession();
- final User user = userSession.getUser();
+ final User user = userSessionManager.getUser();
if (!groupToken.getGroup().equals(user.getShortName())) {
throw new AccessViolationException();
}
@@ -197,7 +191,7 @@
@Transactional
public StateAbstractDTO updateUser(final String userHash, final UserDTO user,
final I18nLanguageSimpleDTO lang) throws DefaultException {
- final Long id = getUserSession().getUser().getId();
+ final Long id = userSessionManager.getUser().getId();
if (!id.equals(user.getId())) {
throw new AccessViolationException();
}
Modified: trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -32,7 +32,7 @@
import java.util.Set;
import cc.kune.core.server.AbstractServerTool;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.content.ContainerManager;
import cc.kune.core.server.content.ContentManager;
import cc.kune.core.server.manager.ToolConfigurationManager;
@@ -47,26 +47,25 @@
import cc.kune.wave.server.KuneWaveUtils;
import com.google.inject.Inject;
-import com.google.inject.Provider;
public class ListsServerTool extends AbstractServerTool {
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSessionManager;
private final KuneWaveService waveManager;
@Inject
public ListsServerTool(final ContentManager contentManager, final ContainerManager containerManager,
final ToolConfigurationManager configurationManager, final I18nTranslationService i18n,
- final Provider<UserSession> userSessionProvider, final KuneWaveService waveManager) {
+ final UserSessionManager userSessionManager, final KuneWaveService waveManager) {
super(NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_POST), Arrays.asList(TYPE_LIST),
Arrays.asList(TYPE_LIST), Arrays.asList(TYPE_ROOT), contentManager, containerManager,
configurationManager, i18n, ServerToolTarget.forGroups);
- this.userSessionProvider = userSessionProvider;
+ this.userSessionManager = userSessionManager;
this.waveManager = waveManager;
}
private Group getUserGroup() {
- return userSessionProvider.get().getUser().getUserGroup();
+ return userSessionManager.getUser().getUserGroup();
}
@Override
Modified: trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/lists/server/rpc/ListsRPC.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -1,7 +1,7 @@
package cc.kune.lists.server.rpc;
import cc.kune.core.client.errors.AccessViolationException;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.auth.ActionLevel;
import cc.kune.core.server.auth.Authenticated;
import cc.kune.core.server.auth.Authorizated;
@@ -21,19 +21,18 @@
import cc.kune.lists.shared.ListsConstants;
import com.google.inject.Inject;
-import com.google.inject.Provider;
import com.google.inject.persist.Transactional;
public class ListsRPC implements ListsService, RPC {
private final ContainerManager contentManager;
private final ContentRPC contentRPC;
- private final Provider<UserSession> userSessionProvider;
+ private final UserSessionManager userSessionManager;
@Inject
- public ListsRPC(final ContentRPC contentRPC, final Provider<UserSession> userSessionProvider,
+ public ListsRPC(final ContentRPC contentRPC, final UserSessionManager userSessionManager,
final ContainerManager contentManager) {
this.contentRPC = contentRPC;
- this.userSessionProvider = userSessionProvider;
+ this.userSessionManager = userSessionManager;
this.contentManager = contentManager;
}
@@ -50,7 +49,7 @@
}
private Group getUserGroup() {
- return userSessionProvider.get().getUser().getUserGroup();
+ return userSessionManager.getUser().getUserGroup();
}
@Override
Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -25,7 +25,6 @@
import java.util.Date;
import java.util.logging.Logger;
-import org.apache.commons.lang.NotImplementedException;
import org.waveprotocol.box.webclient.client.ClientEvents;
import org.waveprotocol.box.webclient.client.ClientIdGenerator;
import org.waveprotocol.box.webclient.client.DebugMessagePanel;
@@ -34,6 +33,7 @@
import org.waveprotocol.box.webclient.client.Session;
import org.waveprotocol.box.webclient.client.SimpleWaveStore;
import org.waveprotocol.box.webclient.client.WaveWebSocketClient;
+import org.waveprotocol.box.webclient.client.events.Log;
import org.waveprotocol.box.webclient.client.events.NetworkStatusEvent;
import org.waveprotocol.box.webclient.client.events.NetworkStatusEventHandler;
import org.waveprotocol.box.webclient.client.events.WaveCreationEvent;
@@ -47,7 +47,6 @@
import org.waveprotocol.box.webclient.search.SearchPresenter;
import org.waveprotocol.box.webclient.search.SimpleSearch;
import org.waveprotocol.box.webclient.search.WaveStore;
-import org.waveprotocol.box.webclient.util.Log;
import org.waveprotocol.box.webclient.widget.frame.FramedPanel;
import org.waveprotocol.box.webclient.widget.loading.LoadingIndicator;
import org.waveprotocol.wave.client.account.ProfileManager;
@@ -56,12 +55,16 @@
import org.waveprotocol.wave.client.common.util.AsyncHolder.Accessor;
import org.waveprotocol.wave.client.debug.logger.LogLevel;
import org.waveprotocol.wave.client.widget.common.ImplPanel;
+import org.waveprotocol.wave.client.widget.popup.CenterPopupPositioner;
+import org.waveprotocol.wave.client.widget.popup.PopupChrome;
+import org.waveprotocol.wave.client.widget.popup.PopupChromeFactory;
+import org.waveprotocol.wave.client.widget.popup.PopupFactory;
+import org.waveprotocol.wave.client.widget.popup.UniversalPopup;
import org.waveprotocol.wave.model.id.IdGenerator;
import org.waveprotocol.wave.model.id.WaveId;
import org.waveprotocol.wave.model.wave.ParticipantId;
import org.waveprotocol.wave.model.waveref.WaveRef;
-import cc.kune.common.client.errors.UIException;
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.sitebar.spaces.Space;
@@ -81,9 +84,9 @@
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Timer;
-import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DockLayoutPanel;
+import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.SplitLayoutPanel;
import com.google.gwt.user.client.ui.UIObject;
import com.google.inject.Inject;
@@ -103,31 +106,6 @@
* prepared, it is revealed in the banner via a link.
*/
public static class ErrorHandler implements UncaughtExceptionHandler {
- public static void install() {
- GWT.setUncaughtExceptionHandler(new ErrorHandler(GWT.getUncaughtExceptionHandler()));
- }
-
- private static String maybe(final int value, final String otherwise) {
- return value != -1 ? String.valueOf(value) : otherwise;
- }
-
- private static String maybe(final String value, final String otherwise) {
- return value != null ? value : otherwise;
- }
-
- /**
- * Indicates whether an error has already been reported (at most one error
- * is ever reported by this handler).
- */
- private boolean hasFired;
-
- /** Next handler in the handler chain. */
- private final UncaughtExceptionHandler next;
-
- private ErrorHandler(final UncaughtExceptionHandler next) {
- this.next = next;
- }
-
public static void getStackTraceAsync(final Throwable t, final Accessor<SafeHtml> whenReady) {
// TODO: Request stack-trace de-obfuscation. For now, just use the
// javascript stack trace.
@@ -166,6 +144,31 @@
}.schedule(1);
}
+ public static void install() {
+ GWT.setUncaughtExceptionHandler(new ErrorHandler(GWT.getUncaughtExceptionHandler()));
+ }
+
+ private static String maybe(final int value, final String otherwise) {
+ return value != -1 ? String.valueOf(value) : otherwise;
+ }
+
+ private static String maybe(final String value, final String otherwise) {
+ return value != null ? value : otherwise;
+ }
+
+ /**
+ * Indicates whether an error has already been reported (at most one error
+ * is ever reported by this handler).
+ */
+ private boolean hasFired;
+
+ /** Next handler in the handler chain. */
+ private final UncaughtExceptionHandler next;
+
+ private ErrorHandler(final UncaughtExceptionHandler next) {
+ this.next = next;
+ }
+
@Override
public void onUncaughtException(final Throwable e) {
if (!hasFired) {
@@ -175,8 +178,8 @@
getStackTraceAsync(e, new Accessor<SafeHtml>() {
@Override
public void use(final SafeHtml stack) {
- //NotifyUser.error("Oops! Something has gone wrong. Please contact the site admins with <em>more details</em>");
// error.addDetail(stack, null);
+ // REMOTE_LOG.severe(stack.asString().replace("<br>", "\n"));
final String message = stack.asString().replace("<br>", "\n");
REMOTE_LOG.severe(message);
NotifyUser.logError(message);
@@ -194,41 +197,58 @@
}
private static final Binder BINDER = GWT.create(Binder.class);
- static final Log LOG = Log.get(WebClient.class);
+ static Log LOG = Log.get(WebClient.class);
// Use of GWT logging is only intended for sending exception reports to the
// server, nothing else in the client should use java.util.logging.
// Please also see WebClientDemo.gwt.xml.
private static final Logger REMOTE_LOG = Logger.getLogger("REMOTE_LOG");
- // TODO (Yuri Z.) Change the implementation to RemoteProfileManagerImpl when
- // it will be ready.
- private final ProfileManager profiles;
+ /** Creates a popup that warns about network disconnects. */
+ private static UniversalPopup createTurbulencePopup() {
+ final PopupChrome chrome = PopupChromeFactory.createPopupChrome();
+ final UniversalPopup popup =
+ PopupFactory.createPopup(null, new CenterPopupPositioner(), chrome, true);
+ popup.add(new HTML("<div style='color: red; padding: 5px; text-align: center;'>"
+ + "<b>A turbulence detected!<br></br>"
+ + " Please save your last changes to somewhere and reload the wave.</b></div>"));
+ return popup;
+ }
+ private RemoteViewServiceMultiplexer channel;
- @UiField
- SplitLayoutPanel splitPanel;
-
private final EventBus eventBus;
- @UiField
- Style style;
+ private IdGenerator idGenerator;
+ private final InboxCountPresenter inboxCount;
+
+ private final Element loading = new LoadingIndicator().getElement();
+
+ private ParticipantId loggedInUser;
@UiField
- FramedPanel waveFrame;
+ DebugMessagePanel logPanel;
+ private final ProfileManager profiles;
- ImplPanel waveHolder;
- private final Element loading = new LoadingIndicator().getElement();
-
@UiField(provided = true)
final SearchPanelWidget searchPanel;
@UiField
- DebugMessagePanel logPanel;
+ SplitLayoutPanel splitPanel;
+ @UiField
+ Style style;
+
+ private final UniversalPopup turbulencePopup = createTurbulencePopup();
+
/** The wave panel, if a wave is open. */
private KuneStagesProvider wave;
+ @UiField
+ FramedPanel waveFrame;
+
+ ImplPanel waveHolder;
+
private final WaveStore waveStore = new SimpleWaveStore();
/**
@@ -236,18 +256,11 @@
*/
private WaveWebSocketClient websocket;
- private ParticipantId loggedInUser;
-
- private IdGenerator idGenerator;
-
- private RemoteViewServiceMultiplexer channel;
- private final InboxCountPresenter inboxCount;
-
/**
* This is the entry point method.
*/
@Inject
- public WebClient(final EventBus eventBus, KuneWaveProfileManager profiles, InboxCountPresenter inboxCount, TokenMatcher tokenMatcher) {
+ public WebClient(final EventBus eventBus, final KuneWaveProfileManager profiles, final InboxCountPresenter inboxCount, final TokenMatcher tokenMatcher) {
// Window.alert("webclient! " + new Date());
this.eventBus = eventBus;
this.profiles = profiles;
@@ -274,43 +287,31 @@
// Done in StateManager
// HistorySupport.init();
- //createWebSocket();
-
loginImpl();
setupUi();
- if (tokenMatcher.isWaveToken(History.getToken()))
+ if (tokenMatcher.isWaveToken(History.getToken())) {
History.fireCurrentHistoryState();
+ }
LOG.info("SimpleWebClient.onModuleLoad() done");
}
- private void createWebSocket() {
- websocket = new WaveWebSocketClient(useSocketIO(), getWebSocketBaseUrl(GWT.getModuleBaseURL()));
- websocket.connect();
- }
-
@Override
- public void login() {
- loginImpl();
+ public void clear() {
+ // Duplicate below
+ if (wave != null) {
+ wave.destroy();
+ wave = null;
}
-
- @Override
- public void logout() {
- loggedInUser = null;
- channel = null;
- idGenerator = null;
- websocket = null;
- clear();
+ if (waveHolder.isAttached()) {
+ waveHolder.removeFromParent();
}
+}
- private void loginImpl() {
- createWebSocket();
- if (Session.get().isLoggedIn()) {
- loggedInUser = new ParticipantId(Session.get().getAddress());
- idGenerator = ClientIdGenerator.create();
- loginToServer();
- }
+ private void createWebSocket() {
+ websocket = new WaveWebSocketClient(useSocketIO(), getWebSocketBaseUrl(GWT.getModuleBaseURL()));
+ websocket.connect();
}
@Override
@@ -329,25 +330,42 @@
}
@Override
+ public void getStackTraceAsync(final Throwable caught, final Accessor<SafeHtml> accessor) {
+ ErrorHandler.getStackTraceAsync(caught, accessor);
+ }
+
+ @Override
public ImplPanel getWaveHolder() {
return waveHolder;
}
-@Override
-public WaveWebSocketClient getWebSocket() {
- return websocket;
-}
+
+ @Override
+ public WaveWebSocketClient getWebSocket() {
+ return websocket;
+ }
+
/**
* Returns <code>ws://yourhost[:port]/</code>.
*/
// XXX check formatting wrt GPE
private native String getWebSocketBaseUrl(String moduleBase) /*-{
- return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/";
+ return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/";
}-*/;
- private native boolean useSocketIO() /*-{
- return !!$wnd.__useSocketIO
- }-*/;
+ @Override
+ public void login() {
+ loginImpl();
+ }
+ private void loginImpl() {
+ createWebSocket();
+ if (Session.get().isLoggedIn()) {
+ loggedInUser = new ParticipantId(Session.get().getAddress());
+ idGenerator = ClientIdGenerator.create();
+ loginToServer();
+ }
+ }
+
/**
*/
private void loginToServer() {
@@ -355,16 +373,15 @@
channel = new RemoteViewServiceMultiplexer(websocket, loggedInUser.getAddress());
}
- public void clear() {
- // Duplicate below
- if (wave != null) {
- wave.destroy();
- wave = null;
+ @Override
+ public void logout() {
+ loggedInUser = null;
+ channel = null;
+ idGenerator = null;
+ websocket = null;
+ clear();
}
- if (waveHolder.isAttached()) {
- waveHolder.removeFromParent();
- }
-}
+
/**
* Shows a wave in a wave panel.
*
@@ -385,6 +402,7 @@
waveFrame.remove(waveHolder);
waveFrame.clear();
waveFrame.add(waveHolder);
+
// Release the display:none.
UIObject.setVisible(waveFrame.getElement(), true);
waveHolder.getElement().appendChild(loading);
@@ -399,7 +417,6 @@
}
});
final String encodedToken = History.getToken();
- // NotifyUser.info("Open Wave: " + encodedToken + " waveRef: " + waveRef.getWaveId(), true);
// Kune patch
if (encodedToken != null && !encodedToken.isEmpty() && !encodedToken.equals(SiteTokens.WAVEINBOX)) {
final WaveRef fromWaveRef = HistorySupport.waveRefFromHistoryToken(encodedToken);
@@ -421,6 +438,9 @@
private void setupConnectionIndicator() {
ClientEvents.get().addNetworkStatusEventHandler(new NetworkStatusEventHandler() {
+
+ boolean isTurbulenceDetected = false;
+
@Override
public void onNetworkStatus(final NetworkStatusEvent event) {
final Element element = Document.get().getElementById("netstatus");
@@ -430,10 +450,16 @@
case RECONNECTED:
element.setInnerText("Online");
element.setClassName("online");
+ isTurbulenceDetected = false;
+ turbulencePopup.hide();
break;
case DISCONNECTED:
element.setInnerText("Offline");
element.setClassName("offline");
+ if (!isTurbulenceDetected) {
+ isTurbulenceDetected = true;
+ turbulencePopup.show();
+ }
break;
case RECONNECTING:
element.setInnerText("Connecting...");
@@ -446,45 +472,47 @@
}
private void setupSearchPanel() {
- // On wave selection, fire an event.
- SearchPresenter.WaveSelectionHandler selectHandler =
- new SearchPresenter.WaveSelectionHandler() {
+ // On wave action fire an event.
+ final SearchPresenter.WaveActionHandler actionHandler =
+ new SearchPresenter.WaveActionHandler() {
@Override
- public void onWaveSelected(WaveId id) {
+ public void onCreateWave() {
+ ClientEvents.get().fireEvent(WaveCreationEvent.CREATE_NEW_WAVE);
+ }
+
+ @Override
+ public void onWaveSelected(final WaveId id) {
ClientEvents.get().fireEvent(new WaveSelectionEvent(WaveRef.of(id)));
}
};
- Search search = SimpleSearch.create(RemoteSearchService.create(), waveStore);
+ final Search search = SimpleSearch.create(RemoteSearchService.create(), waveStore);
search.addListener(inboxCount.getSearchListener());
- SearchPresenter.create(search, searchPanel, selectHandler, profiles);
+ SearchPresenter.create(search, searchPanel, actionHandler, profiles);
}
+private void setupUi() {
+ // Set up UI
+ final DockLayoutPanel self = BINDER.createAndBindUi(this);
+ // kune-patch
+ // RootPanel.get("app").add(self);
+ initWidget(self);
+ waveHolder = new ImplPanel("");
+ waveHolder.addStyleName("k-waveHolder");
+ waveFrame.add(waveHolder);
+ // DockLayoutPanel forcibly conflicts with sensible layout control, and
+ // sticks inline styles on elements without permission. They must be
+ // cleared.
+ self.getElement().getStyle().clearPosition();
+ splitPanel.setWidgetMinSize(searchPanel, 300);
-
- private void setupUi() {
- // Set up UI
- final DockLayoutPanel self = BINDER.createAndBindUi(this);
- // kune-patch
- // RootPanel.get("app").add(self);
- initWidget(self);
- waveHolder = new ImplPanel("");
- waveHolder.addStyleName("k-waveHolder");
- waveFrame.add(waveHolder);
- // DockLayoutPanel forcibly conflicts with sensible layout control, and
- // sticks inline styles on elements without permission. They must be
- // cleared.
- self.getElement().getStyle().clearPosition();
- splitPanel.setWidgetMinSize(searchPanel, 300);
-
- if (LogLevel.showDebug()) {
- logPanel.enable();
- } else {
- logPanel.removeFromParent();
- }
-
- setupSearchPanel();
- setupWavePanel();
+ if (LogLevel.showDebug()) {
+ logPanel.enable();
+ } else {
+ logPanel.removeFromParent();
}
+ setupSearchPanel();
+ setupWavePanel();
+}
private void setupWavePanel() {
// Hide the frame until waves start getting opened.
UIObject.setVisible(waveFrame.getElement(), false);
@@ -498,8 +526,7 @@
});
}
- @Override
- public void getStackTraceAsync(Throwable caught, Accessor<SafeHtml> accessor) {
- ErrorHandler.getStackTraceAsync(caught, accessor);
- }
+ private native boolean useSocketIO() /*-{
+ return !!$wnd.__useSocketIO
+ }-*/;
}
Deleted: trunk/src/main/java/cc/kune/wave/server/AbstractBaseRobotAgent.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/AbstractBaseRobotAgent.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/wave/server/AbstractBaseRobotAgent.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -1,162 +0,0 @@
-/**
- * Copyright 2011 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.wave.server;
-
-import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
-
-import org.waveprotocol.box.server.CoreSettings;
-import org.waveprotocol.box.server.account.AccountData;
-import org.waveprotocol.box.server.persistence.AccountStore;
-import org.waveprotocol.box.server.persistence.PersistenceException;
-import org.waveprotocol.box.server.robots.util.RobotsUtil;
-import org.waveprotocol.box.server.robots.util.RobotsUtil.RobotRegistrationException;
-import org.waveprotocol.wave.model.id.TokenGenerator;
-import org.waveprotocol.wave.model.wave.InvalidParticipantAddress;
-import org.waveprotocol.wave.model.wave.ParticipantId;
-
-import com.google.inject.Inject;
-import com.google.inject.Injector;
-import com.google.inject.Key;
-import com.google.inject.name.Named;
-import com.google.inject.name.Names;
-import com.google.wave.api.AbstractRobot;
-
-/**
- * The base for robot agents that run on the WIAB server.
- *
- * @author yurize(a)apache.org (Yuri Zelikov)
- */
-@SuppressWarnings("serial")
-public abstract class AbstractBaseRobotAgent extends AbstractRobot {
-
- static class ServerFrontendAddressHolder {
-
- private final List<String> addresses;
-
- @Inject
- ServerFrontendAddressHolder((a)Named(CoreSettings.HTTP_FRONTEND_ADDRESSES) final List<String> addresses) {
- this.addresses = addresses;
- }
-
- List<String> getAddresses() {
- return addresses;
- }
- }
-
- public static final String AGENT_PREFIX_URI = "/agent";
- private static final Logger LOG = Logger.getLogger(AbstractBaseRobotAgent.class.getName());
-
- /** Account store with user and robot accounts. */
- private final AccountStore accountStore;
-
- private final ServerFrontendAddressHolder frontendAddressHolder;
-
- /** The wave server domain. */
- private final String waveDomain;
-
- /**
- * Constructor. Initializes the agent to serve on the URI provided by
- * {@link #getRobotUri()} and ensures that the agent is registered in the
- * Account store.
- *
- * @param injector
- * the injector instance.
- */
- public AbstractBaseRobotAgent(final Injector injector) {
- this(injector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN))),
- injector.getInstance(AccountStore.class), injector.getInstance(TokenGenerator.class),
- injector.getInstance(ServerFrontendAddressHolder.class));
- }
-
- /**
- * Constructor. Initializes the agent to serve on the URI provided by
- * {@link #getRobotUri()} and ensures that the agent is registered in the
- * Account store.
- */
- AbstractBaseRobotAgent(final String waveDomain, final AccountStore accountStore,
- final TokenGenerator tokenGenerator, final ServerFrontendAddressHolder frontendAddressHolder) {
- this.waveDomain = waveDomain;
- this.accountStore = accountStore;
- this.frontendAddressHolder = frontendAddressHolder;
- ensureRegistered(tokenGenerator, getFrontEndAddress()); // NOPMD by vjrj on
- // 6/07/11 21:15
- }
-
- /**
- * Ensures that the robot agent is registered in the {@link AccountStore}.
- */
- private void ensureRegistered(final TokenGenerator tokenGenerator, final String serverFrontendAddress) {
- ParticipantId robotId = null;
- try {
- robotId = ParticipantId.of(getRobotId() + "@" + waveDomain);
- } catch (final InvalidParticipantAddress e) {
- LOG.log(Level.SEVERE, "Failed to register the agent:" + getRobotId(), e);
- return;
- }
- try {
- final String location = "http://" + serverFrontendAddress + getRobotUri();
- // Register this agent in the account store. The registration is forced
- // in order to re-register the agents if the server frontend address has
- // changed.
- final AccountData account = accountStore.getAccount(robotId);
- if ((account == null || (account != null && !account.asRobot().getUrl().equals(location)))) {
- RobotsUtil.registerRobotUri(location, robotId, accountStore, tokenGenerator, true);
- }
-
- } catch (final RobotRegistrationException e) {
- LOG.log(Level.SEVERE, "Failed to register the agent:" + getRobotId(), e);
- } catch (final PersistenceException e) {
- LOG.log(Level.SEVERE, "Failed to register the agent:" + getRobotId(), e);
- }
- }
-
- /**
- * Returns the account store.
- */
- protected AccountStore getAccountStore() {
- return accountStore;
- }
-
- public String getFrontEndAddress() {
- return frontendAddressHolder.getAddresses().get(0);
- }
-
- /**
- * Returns the robot participant id.
- */
- public abstract String getRobotId();
-
- @Override
- protected String getRobotProfilePageUrl() { // NOPMD by vjrj on 6/07/11 21:15
- return null;
- }
-
- /**
- * Returns the robot URI.
- */
- public abstract String getRobotUri();
-
- /**
- * Returns the wave domain.
- */
- public String getWaveDomain() {
- return waveDomain;
- }
-}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -47,18 +47,22 @@
*
* @author josephg(a)gmail.com (Joseph Gentle)
*/
+@SuppressWarnings("serial")
@Singleton
public final class CustomUserRegistrationServlet extends HttpServlet {
private final AccountStore accountStore;
private final String domain;
+ // private final WelcomeRobot welcomeBot;
private final Log LOG = Log.get(CustomUserRegistrationServlet.class);
@Inject
public CustomUserRegistrationServlet(AccountStore accountStore,
@Named(CoreSettings.WAVE_SERVER_DOMAIN) String domain) {
+ //, WelcomeRobot welcomeBot) {
this.accountStore = accountStore;
this.domain = domain;
+ // this.welcomeBot = welcomeBot;
}
@Override
@@ -113,14 +117,14 @@
if (id.getAddress().indexOf("@") < 1) {
return "Username portion of address cannot be empty";
}
- final String[] usernameSplit = id.getAddress().split("@");
+ String[] usernameSplit = id.getAddress().split("@");
if (usernameSplit.length != 2 || !usernameSplit[0].matches("[\\w\\.]+")) {
return "Only letters (a-z), numbers (0-9), and periods (.) are allowed in Username";
}
if (!id.getDomain().equals(domain)) {
return "You can only create users at the " + domain + " domain";
}
- } catch (final InvalidParticipantAddress e) {
+ } catch (InvalidParticipantAddress e) {
return "Invalid username";
}
@@ -128,7 +132,7 @@
if (accountStore.getAccount(id) != null) {
return "Account already exists";
}
- } catch (final PersistenceException e) {
+ } catch (PersistenceException e) {
LOG.severe("Failed to retreive account data for " + id, e);
return "An unexpected error occured while trying to retrieve account status";
}
@@ -137,16 +141,20 @@
new HumanAccountDataImpl(id, passwordDigest);
try {
accountStore.putAccount(account);
- } catch (final PersistenceException e) {
+ } catch (PersistenceException e) {
LOG.severe("Failed to create new account for " + id, e);
return "An unexpected error occured while trying to create the account";
}
-
+// try {
+ // welcomeBot.greet(account.getId());
+// } catch (IOException e) {
+// LOG.warning("Failed to create a welcome wavelet for " + id, e);
+// }
return null;
}
- private void writeRegistrationPage(final String message, final String responseType, final Locale locale,
- final HttpServletResponse dest) throws IOException {
+ private void writeRegistrationPage(String message, String responseType, Locale locale,
+ HttpServletResponse dest) throws IOException {
dest.setCharacterEncoding("UTF-8");
dest.setContentType("text/html;charset=utf-8");
UserRegistrationPage.write(dest.getWriter(), new GxpContext(locale), domain, message,
Modified: trunk/src/main/java/cc/kune/wave/server/KuneAgent.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneAgent.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/wave/server/KuneAgent.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -25,8 +25,7 @@
import javax.annotation.Nonnull;
-import org.waveprotocol.box.server.persistence.AccountStore;
-import org.waveprotocol.wave.model.id.TokenGenerator;
+import org.waveprotocol.box.server.robots.agent.AbstractBaseRobotAgent;
import org.waveprotocol.wave.model.id.WaveId;
import org.waveprotocol.wave.model.id.WaveletId;
import org.waveprotocol.wave.model.wave.ParticipantId;
@@ -51,10 +50,11 @@
super(injector);
}
- public KuneAgent(final String waveDomain, final AccountStore accountStore,
- final TokenGenerator tokenGenerator, final ServerFrontendAddressHolder frontendAddressHolder) {
- super(waveDomain, accountStore, tokenGenerator, frontendAddressHolder);
- }
+ // public KuneAgent(final String waveDomain, final AccountStore accountStore,
+ // final TokenGenerator tokenGenerator, final ServerFrontendAddressHolder
+ // frontendAddressHolder) {
+ // super(waveDomain, accountStore, tokenGenerator, frontendAddressHolder);
+ // }
@Override
public void addGadget(final WaveRef waveName, final String author, final String gadgetUrl) {
Modified: trunk/src/main/java/cc/kune/wave/server/WaveMain.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/WaveMain.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/main/java/cc/kune/wave/server/WaveMain.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -39,6 +39,7 @@
import org.waveprotocol.box.server.frontend.ClientFrontend;
import org.waveprotocol.box.server.frontend.ClientFrontendImpl;
import org.waveprotocol.box.server.frontend.WaveClientRpcImpl;
+import org.waveprotocol.box.server.frontend.WaveletInfo;
import org.waveprotocol.box.server.persistence.AccountStore;
import org.waveprotocol.box.server.persistence.PersistenceException;
import org.waveprotocol.box.server.persistence.PersistenceModule;
@@ -46,8 +47,6 @@
import org.waveprotocol.box.server.robots.RobotApiModule;
import org.waveprotocol.box.server.robots.RobotRegistrationServlet;
import org.waveprotocol.box.server.robots.active.ActiveApiServlet;
-import org.waveprotocol.box.server.robots.agent.passwd.PasswordAdminRobot;
-import org.waveprotocol.box.server.robots.agent.passwd.PasswordRobot;
import org.waveprotocol.box.server.robots.dataapi.DataApiOAuthServlet;
import org.waveprotocol.box.server.robots.dataapi.DataApiServlet;
import org.waveprotocol.box.server.robots.passive.RobotsGateway;
@@ -59,6 +58,7 @@
import org.waveprotocol.box.server.rpc.ServerRpcProvider;
import org.waveprotocol.box.server.rpc.SignOutServlet;
import org.waveprotocol.box.server.rpc.UserRegistrationServlet;
+import org.waveprotocol.box.server.rpc.WaveRefServlet;
import org.waveprotocol.box.server.waveserver.WaveBus;
import org.waveprotocol.box.server.waveserver.WaveServerException;
import org.waveprotocol.box.server.waveserver.WaveletProvider;
@@ -87,6 +87,13 @@
*/
public class WaveMain {
+ /**
+ * This is the name of the system property used to find the server config file.
+ */
+ private static final String PROPERTIES_FILE_KEY = "wave.server.config";
+
+ private static final Log LOG = Log.get(WaveMain.class);
+
@SuppressWarnings("serial")
@Singleton
public static class GadgetProxyServlet extends HttpServlet {
@@ -94,8 +101,8 @@
ProxyServlet.Transparent proxyServlet;
@Inject
- public GadgetProxyServlet((a)Named(CoreSettings.GADGET_SERVER_HOSTNAME) final String gadgetServerHostname,
- @Named(CoreSettings.GADGET_SERVER_PORT) final int gadgetServerPort){
+ public GadgetProxyServlet((a)Named(CoreSettings.GADGET_SERVER_HOSTNAME) String gadgetServerHostname,
+ @Named(CoreSettings.GADGET_SERVER_PORT) int gadgetServerPort){
LOG.info("Starting GadgetProxyServlet for " + gadgetServerHostname + ":" + gadgetServerPort);
proxyServlet = new ProxyServlet.Transparent("/gadgets", "http", gadgetServerHostname,
@@ -103,82 +110,98 @@
}
@Override
- public void init(final ServletConfig config) throws ServletException {
+ public void init(ServletConfig config) throws ServletException {
proxyServlet.init(config);
}
@Override
- public void service(final ServletRequest req, final ServletResponse res) throws ServletException, IOException {
+ public void service(ServletRequest req, ServletResponse res) throws ServletException, IOException {
proxyServlet.service(req, res);
}
}
- private static final Log LOG = Log.get(WaveMain.class);
+ public static void main(String... args) {
+ try {
+ Module coreSettings = SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, CoreSettings.class);
+ run(coreSettings);
+ return;
+ } catch (PersistenceException e) {
+ LOG.severe("PersistenceException when running server:", e);
+ } catch (ConfigurationException e) {
+ LOG.severe("ConfigurationException when running server:", e);
+ } catch (WaveServerException e) {
+ LOG.severe("WaveServerException when running server:", e);
+ }
+ }
- /**
- * This is the name of the system property used to find the server config file.
- */
- private static final String PROPERTIES_FILE_KEY = "wave.server.config";
+ public static void run(Module coreSettings) throws PersistenceException,
+ ConfigurationException, WaveServerException {
+ Injector settingsInjector = Guice.createInjector(coreSettings);
+ boolean enableFederation = settingsInjector.getInstance(Key.get(Boolean.class,
+ Names.named(CoreSettings.ENABLE_FEDERATION)));
- private static Module buildFederationModule(final Injector settingsInjector, final boolean enableFederation)
- throws ConfigurationException {
- Module federationModule;
if (enableFederation) {
- federationModule = settingsInjector.getInstance(XmppFederationModule.class);
- } else {
- federationModule = settingsInjector.getInstance(NoOpFederationModule.class);
+ Module federationSettings =
+ SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, FederationSettings.class);
+ // This MUST happen first, or bindings will fail if federation is enabled.
+ settingsInjector = settingsInjector.createChildInjector(federationSettings);
}
- return federationModule;
- }
- private static void initializeFederation(final Injector injector) {
- final FederationTransport federationManager = injector.getInstance(FederationTransport.class);
- federationManager.startFederation();
- }
+ Module federationModule = buildFederationModule(settingsInjector, enableFederation);
+ PersistenceModule persistenceModule = settingsInjector.getInstance(PersistenceModule.class);
+ Injector injector =
+ settingsInjector.createChildInjector(new ServerModule(enableFederation),
+ new RobotApiModule(), federationModule, persistenceModule);
- private static void initializeFrontend(final Injector injector, final ServerRpcProvider server,
- final WaveBus waveBus) throws WaveServerException {
- final HashedVersionFactory hashFactory = injector.getInstance(HashedVersionFactory.class);
+ ServerRpcProvider server = injector.getInstance(ServerRpcProvider.class);
+ WaveBus waveBus = injector.getInstance(WaveBus.class);
- final WaveletProvider provider = injector.getInstance(WaveletProvider.class);
- final ClientFrontend frontend =
- ClientFrontendImpl.create(hashFactory, provider, waveBus);
+ String domain =
+ injector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN)));
+ if (!ParticipantIdUtil.isDomainAddress(ParticipantIdUtil.makeDomainAddress(domain))) {
+ throw new WaveServerException("Invalid wave domain: " + domain);
+ }
- final ProtocolWaveClientRpc.Interface rpcImpl = WaveClientRpcImpl.create(frontend, false);
- server.registerService(ProtocolWaveClientRpc.newReflectiveService(rpcImpl));
- }
+ initializeServer(injector, domain);
+ initializeServlets(injector, server);
+ initializeRobotAgents(injector, server);
+ initializeRobots(injector, waveBus);
+ initializeFrontend(injector, server, waveBus);
+ initializeFederation(injector);
- private static void initializeRobotAgents(final Injector injector, final ServerRpcProvider server) {
- final PasswordRobot passRobot = new PasswordRobot(injector);
- final PasswordAdminRobot passAdminRobot = new PasswordAdminRobot(injector);
- injector.injectMembers(passRobot);
- server.addServlet(PasswordRobot.ROBOT_URI + "/*", passRobot);
- server.addServlet(PasswordAdminRobot.ROBOT_URI + "/*", passAdminRobot);
+ LOG.info("Starting server");
+ server.startWebSocketServer(injector);
}
- private static void initializeRobots(final Injector injector, final WaveBus waveBus) {
- final RobotsGateway robotsGateway = injector.getInstance(RobotsGateway.class);
- waveBus.subscribe(robotsGateway);
+ private static Module buildFederationModule(Injector settingsInjector, boolean enableFederation)
+ throws ConfigurationException {
+ Module federationModule;
+ if (enableFederation) {
+ federationModule = settingsInjector.getInstance(XmppFederationModule.class);
+ } else {
+ federationModule = settingsInjector.getInstance(NoOpFederationModule.class);
+ }
+ return federationModule;
}
- private static void initializeServer(final Injector injector, final String waveDomain)
+ private static void initializeServer(Injector injector, String waveDomain)
throws PersistenceException, WaveServerException {
- final AccountStore accountStore = injector.getInstance(AccountStore.class);
+ AccountStore accountStore = injector.getInstance(AccountStore.class);
accountStore.initializeAccountStore();
AccountStoreHolder.init(accountStore, waveDomain);
// Initialize the SignerInfoStore.
- final CertPathStore certPathStore = injector.getInstance(CertPathStore.class);
+ CertPathStore certPathStore = injector.getInstance(CertPathStore.class);
if (certPathStore instanceof SignerInfoStore) {
((SignerInfoStore)certPathStore).initializeSignerInfoStore();
}
// Initialize the server.
- final WaveletProvider waveServer = injector.getInstance(WaveletProvider.class);
+ WaveletProvider waveServer = injector.getInstance(WaveletProvider.class);
waveServer.initialize();
}
- private static void initializeServlets(final Injector injector, final ServerRpcProvider server) {
+ private static void initializeServlets(Injector injector, ServerRpcProvider server) {
server.addServlet("/attachment/*", injector.getInstance(AttachmentServlet.class));
server.addServlet(SessionManager.SIGN_IN_URL, injector.getInstance(AuthenticationServlet.class));
@@ -194,69 +217,46 @@
server.addServlet("/robot/rpc", injector.getInstance(ActiveApiServlet.class));
server.addServlet("/webclient/remote_logging", injector.getInstance(RemoteLoggingServiceImpl.class));
server.addServlet("/profile/*", injector.getInstance(FetchProfilesServlet.class));
+ server.addServlet("/waveref/*", injector.getInstance(WaveRefServlet.class));
- final String gadgetHostName =
+ String gadgetHostName =
injector
.getInstance(Key.get(String.class, Names.named(CoreSettings.GADGET_SERVER_HOSTNAME)));
- final int port =
+ int port =
injector.getInstance(Key.get(Integer.class, Names.named(CoreSettings.GADGET_SERVER_PORT)));
- final Map<String, String> initParams =
+ Map<String, String> initParams =
Collections.singletonMap("HostHeader", gadgetHostName + ":" + port);
server.addServlet("/gadgets/*", injector.getInstance(GadgetProxyServlet.class), initParams);
//server.addServlet("/", injector.getInstance(WaveClientServlet.class));
}
- public static void main(final String... args) {
- try {
- final Module coreSettings = SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, CoreSettings.class);
- run(coreSettings);
- return;
- } catch (final PersistenceException e) {
- LOG.severe("PersistenceException when running server:", e);
- } catch (final ConfigurationException e) {
- LOG.severe("ConfigurationException when running server:", e);
- } catch (final WaveServerException e) {
- LOG.severe("WaveServerException when running server:", e);
- }
+ private static void initializeRobots(Injector injector, WaveBus waveBus) {
+ RobotsGateway robotsGateway = injector.getInstance(RobotsGateway.class);
+ waveBus.subscribe(robotsGateway);
}
- public static void run(final Module coreSettings) throws PersistenceException,
- ConfigurationException, WaveServerException {
- Injector settingsInjector = Guice.createInjector(coreSettings);
- final boolean enableFederation = settingsInjector.getInstance(Key.get(Boolean.class,
- Names.named(CoreSettings.ENABLE_FEDERATION)));
+ private static void initializeRobotAgents(Injector injector, ServerRpcProvider server) {
+ //server.addServlet(PasswordRobot.ROBOT_URI + "/*", injector.getInstance(PasswordRobot.class));
+ //server.addServlet(PasswordAdminRobot.ROBOT_URI + "/*", injector.getInstance(PasswordAdminRobot.class));
+ //server.addServlet(WelcomeRobot.ROBOT_URI + "/*", injector.getInstance(WelcomeRobot.class));
+ }
- if (enableFederation) {
- final Module federationSettings =
- SettingsBinder.bindSettings(PROPERTIES_FILE_KEY, FederationSettings.class);
- // This MUST happen first, or bindings will fail if federation is enabled.
- settingsInjector = settingsInjector.createChildInjector(federationSettings);
- }
+ private static void initializeFrontend(Injector injector, ServerRpcProvider server,
+ WaveBus waveBus) throws WaveServerException {
+ HashedVersionFactory hashFactory = injector.getInstance(HashedVersionFactory.class);
- final Module federationModule = buildFederationModule(settingsInjector, enableFederation);
- final PersistenceModule persistenceModule = settingsInjector.getInstance(PersistenceModule.class);
- final Injector injector =
- settingsInjector.createChildInjector(new ServerModule(enableFederation),
- new RobotApiModule(), federationModule, persistenceModule);
+ WaveletProvider provider = injector.getInstance(WaveletProvider.class);
+ WaveletInfo waveletInfo = WaveletInfo.create(hashFactory, provider);
+ ClientFrontend frontend =
+ ClientFrontendImpl.create(provider, waveBus, waveletInfo);
- final ServerRpcProvider server = injector.getInstance(ServerRpcProvider.class);
- final WaveBus waveBus = injector.getInstance(WaveBus.class);
+ ProtocolWaveClientRpc.Interface rpcImpl = WaveClientRpcImpl.create(frontend, false);
+ server.registerService(ProtocolWaveClientRpc.newReflectiveService(rpcImpl));
+ }
- final String domain =
- injector.getInstance(Key.get(String.class, Names.named(CoreSettings.WAVE_SERVER_DOMAIN)));
- if (!ParticipantIdUtil.isDomainAddress(ParticipantIdUtil.makeDomainAddress(domain))) {
- throw new WaveServerException("Invalid wave domain: " + domain);
- }
-
- initializeServer(injector, domain);
- initializeServlets(injector, server);
- initializeRobotAgents(injector, server);
- initializeRobots(injector, waveBus);
- initializeFrontend(injector, server, waveBus);
- initializeFederation(injector);
-
- LOG.info("Starting server");
- server.startWebSocketServer(injector);
+ private static void initializeFederation(Injector injector) {
+ FederationTransport federationManager = injector.getInstance(FederationTransport.class);
+ federationManager.startFederation();
}
}
Modified: trunk/src/test/java/cc/kune/core/server/integration/IntegrationTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/IntegrationTest.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/test/java/cc/kune/core/server/integration/IntegrationTest.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -25,7 +25,7 @@
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.rpcservices.UserService;
-import cc.kune.core.server.UserSession;
+import cc.kune.core.server.UserSessionManager;
import cc.kune.core.server.properties.KuneBasicProperties;
import cc.kune.core.shared.dto.UserInfoDTO;
@@ -36,7 +36,7 @@
@Inject
KuneBasicProperties properties;
@Inject
- protected UserSession session;
+ protected UserSessionManager session;
protected String token;
@Inject
UserService userService;
Modified: trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -21,8 +21,12 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
+import org.openqa.selenium.By;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.PageFactory;
import org.openqa.selenium.support.events.EventFiringWebDriver;
+import org.openqa.selenium.support.events.WebDriverEventListener;
import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
import org.testng.Assert;
import org.testng.ITestContext;
@@ -51,6 +55,96 @@
webdriver = injector.getInstance(GenericWebDriver.class);
login = injector.getInstance(LoginPageObject.class);
eventFiring = injector.getInstance(EventFiringWebDriver.class);
+ eventFiring.register(new WebDriverEventListener() {
+
+ @Override
+ public void afterChangeValueOf(final WebElement element, final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void afterClickOn(final WebElement element, final WebDriver driver) {
+ sleep(500);
+ }
+
+ @Override
+ public void afterFindBy(final By by, final WebElement element, final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void afterNavigateBack(final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void afterNavigateForward(final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void afterNavigateTo(final String url, final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void afterScript(final String script, final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void beforeChangeValueOf(final WebElement element, final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void beforeClickOn(final WebElement element, final WebDriver driver) {
+ sleep(500);
+ }
+
+ @Override
+ public void beforeFindBy(final By by, final WebElement element, final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void beforeNavigateBack(final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void beforeNavigateForward(final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void beforeNavigateTo(final String url, final WebDriver driver) {
+ // TODO Auto-generated method stub
+ sleep(500);
+ }
+
+ @Override
+ public void beforeScript(final String script, final WebDriver driver) {
+ // TODO Auto-generated method stub
+
+ }
+
+ @Override
+ public void onException(final Throwable throwable, final WebDriver driver) {
+ // TODO Auto-generated method stub
+
+ }
+ });
final ElementLocatorFactory locator = injector.getInstance(ElementLocatorFactory.class);
PageFactory.initElements(locator, login);
}
Modified: trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -36,7 +36,6 @@
public abstract class AbstractWebDriver implements WebDriver {
private final String baseUrl;
private final WebDriver driver;
-
private final Selenium selenium;
public AbstractWebDriver(final WebDriver driver, final String baseUrl) {
@@ -44,6 +43,8 @@
this.baseUrl = baseUrl;
selenium = new WebDriverBackedSelenium(driver, baseUrl);
selenium.setSpeed("500");
+ // driver.manage().timeouts().implicitlyWait(3, TimeUnit.SECONDS);
+
// selenium.setTimeout("5000");
}
Modified: trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java
===================================================================
--- trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java 2011-09-23 03:01:39 UTC (rev 1528)
+++ trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java 2011-09-23 17:07:21 UTC (rev 1529)
@@ -31,13 +31,12 @@
import org.waveprotocol.box.server.account.RobotAccountData;
import org.waveprotocol.box.server.persistence.AccountStore;
import org.waveprotocol.box.server.persistence.PersistenceException;
+import org.waveprotocol.box.server.robots.agent.AbstractBaseRobotAgent.ServerFrontendAddressHolder;
import org.waveprotocol.wave.model.id.TokenGenerator;
import org.waveprotocol.wave.model.wave.InvalidParticipantAddress;
import org.waveprotocol.wave.model.wave.ParticipantId;
import org.waveprotocol.wave.model.waveref.WaveRef;
-import cc.kune.wave.server.AbstractBaseRobotAgent.ServerFrontendAddressHolder;
-
import com.google.common.collect.Lists;
import com.google.wave.api.Wavelet;
@@ -67,7 +66,8 @@
Mockito.when(accountRobotData.getUrl()).thenReturn(KuneAgent.ROBOT_URI);
Mockito.when(accountRobotData.getId()).thenReturn(participantId);
Mockito.when(accountRobotData.getConsumerSecret()).thenReturn("someconsumer");
- manager = new KuneAgent("example.com", accountStore, tokenGenerator, frontendAddressHolder);
+ // manager = new KuneAgent("example.com", accountStore, tokenGenerator,
+ // frontendAddressHolder);
}
private String getSiteAdminShortName() {
1
0
r1528 - in trunk: . src/test/java/cc/kune/selenium src/test/java/cc/kune/selenium/login src/test/java/cc/kune/selenium/tools
by Vicente J. Ruiz Jurado 23 Sep '11
by Vicente J. Ruiz Jurado 23 Sep '11
23 Sep '11
Author: vjrj_
Date: 2011-09-23 05:01:39 +0200 (Fri, 23 Sep 2011)
New Revision: 1528
Added:
trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java
trunk/src/test/java/cc/kune/selenium/tools/GenericWebDriver.java
Removed:
trunk/src/test/java/cc/kune/selenium/tools/AbstractWebTester.java
trunk/src/test/java/cc/kune/selenium/tools/GenericWebTester.java
Modified:
trunk/.classpath
trunk/pom.xml
trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
trunk/src/test/java/cc/kune/selenium/PageObject.java
trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java
trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java
trunk/src/test/java/cc/kune/selenium/tools/SeleniumModule.java
Log:
NEW - # 53: Add Selenium Framework testing
http://kune.ourproject.org/issues/ticket/53
Modified: trunk/.classpath
===================================================================
--- trunk/.classpath 2011-09-23 00:01:57 UTC (rev 1527)
+++ trunk/.classpath 2011-09-23 03:01:39 UTC (rev 1528)
@@ -15,6 +15,7 @@
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.1-SNAPSHOT/box-src-0.3.1-SNAPSHOT.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.1-SNAPSHOT/client-0.3.1-SNAPSHOT.jar"/>
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common/0.3.1-SNAPSHOT/client-common-0.3.1-SNAPSHOT.jar"/>
@@ -28,7 +29,6 @@
<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"/>
<classpathentry kind="var" path="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2.jar" sourcepath="M2_REPO/commons-collections/commons-collections/3.2/commons-collections-3.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/commons-fileupload/commons-fileupload/1.2/commons-fileupload-1.2.jar" sourcepath="M2_REPO/commons-fileupload/commons-fileupload/1.2/commons-fileupload-1.2-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/commons-httpclient/commons-httpclient/3.1/commons-httpclient-3.1.jar"/>
<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"/>
@@ -43,6 +43,7 @@
<classpathentry kind="var" path="M2_REPO/com/calclab/emite/emite-proxy/0.1/emite-proxy-0.1.jar"/>
<classpathentry kind="var" path="M2_REPO/net/sf/ezmorph/ezmorph/1.0.3/ezmorph-1.0.3.jar" sourcepath="M2_REPO/net/sf/ezmorph/ezmorph/1.0.3/ezmorph-1.0.3-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/freemarker/freemarker/2.3.8/freemarker-2.3.8.jar"/>
+ <classpathentry kind="var" path="M2_REPO/com/google/guava/guava/r09/guava-r09.jar" sourcepath="M2_REPO/com/google/guava/guava/r09/guava-r09-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/guava/guava-gwt/r09/guava-gwt-r09.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/inject/guice/3.0/guice-3.0.jar" sourcepath="M2_REPO/com/google/inject/guice/3.0/guice-3.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/google/inject/extensions/guice-assisted-inject/2.0/guice-assisted-inject-2.0.jar"/>
@@ -71,7 +72,6 @@
<classpathentry kind="var" path="M2_REPO/com/extjs/gxt/2.2.1/gxt-2.2.1.jar"/>
<classpathentry kind="var" path="M2_REPO/com/h2database/h2/1.0.20070617/h2-1.0.20070617.jar"/>
<classpathentry kind="var" path="M2_REPO/com/calclab/emite/hablar/r1697/hablar-r1697.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-all/1.1/hamcrest-all-1.1.jar" sourcepath="M2_REPO/org/hamcrest/hamcrest-all/1.1/hamcrest-all-1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1.jar" sourcepath="M2_REPO/org/hamcrest/hamcrest-core/1.1/hamcrest-core-1.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-annotations/3.4.0.GA/hibernate-annotations-3.4.0.GA.jar" sourcepath="M2_REPO/org/hibernate/hibernate-annotations/3.4.0.GA/hibernate-annotations-3.4.0.GA-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-c3p0/3.3.1.GA/hibernate-c3p0-3.3.1.GA.jar" sourcepath="M2_REPO/org/hibernate/hibernate-c3p0/3.3.1.GA/hibernate-c3p0-3.3.1.GA-sources.jar"/>
@@ -81,14 +81,17 @@
<classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-search/3.1.0.GA/hibernate-search-3.1.0.GA.jar" sourcepath="M2_REPO/org/hibernate/hibernate-search/3.1.0.GA/hibernate-search-3.1.0.GA-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-tools/3.2.3.GA/hibernate-tools-3.2.3.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hibernate/hibernate-validator/3.1.0.GA/hibernate-validator-3.1.0.GA.jar" sourcepath="M2_REPO/org/hibernate/hibernate-validator/3.1.0.GA/hibernate-validator-3.1.0.GA-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/htmlunit/2.7/htmlunit-2.7.jar" sourcepath="M2_REPO/net/sourceforge/htmlunit/htmlunit/2.7/htmlunit-2.7-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/htmlunit-core-js/2.7/htmlunit-core-js-2.7.jar" sourcepath="M2_REPO/net/sourceforge/htmlunit/htmlunit-core-js/2.7/htmlunit-core-js-2.7-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/htmlunit/2.9/htmlunit-2.9.jar" sourcepath="M2_REPO/net/sourceforge/htmlunit/htmlunit/2.9/htmlunit-2.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/net/sourceforge/htmlunit/htmlunit-core-js/2.9/htmlunit-core-js-2.9.jar" sourcepath="M2_REPO/net/sourceforge/htmlunit/htmlunit-core-js/2.9/htmlunit-core-js-2.9-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpclient/4.1.2/httpclient-4.1.2.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpclient/4.1.2/httpclient-4.1.2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpcore/4.1.2/httpcore-4.1.2.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpcore/4.1.2/httpcore-4.1.2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/apache/httpcomponents/httpmime/4.1.2/httpmime-4.1.2.jar" sourcepath="M2_REPO/org/apache/httpcomponents/httpmime/4.1.2/httpmime-4.1.2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/javassist/javassist/3.4.GA/javassist-3.4.GA.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/jcl-over-slf4j/1.6.1/jcl-over-slf4j-1.6.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/com/beust/jcommander/1.12/jcommander-1.12.jar" sourcepath="M2_REPO/com/beust/jcommander/1.12/jcommander-1.12-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/codehaus/jettison/jettison/1.0-RC2/jettison-1.0-RC2.jar" sourcepath="M2_REPO/org/codehaus/jettison/jettison/1.0-RC2/jettison-1.0-RC2-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/jmagick/jmagick/6.2.6-0/jmagick-6.2.6-0.jar"/>
- <classpathentry kind="var" path="M2_REPO/net/java/dev/jna/jna/3.2.2/jna-3.2.2.jar" sourcepath="M2_REPO/net/java/dev/jna/jna/3.2.2/jna-3.2.2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/net/java/dev/jna/jna/3.3.0/jna-3.3.0.jar" sourcepath="M2_REPO/net/java/dev/jna/jna/3.3.0/jna-3.3.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jruby/jruby-complete/1.2.0/jruby-complete-1.2.0.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jruby/rack/jruby-rack/0.9.4/jruby-rack-0.9.4.jar"/>
<classpathentry kind="var" path="M2_REPO/org/json/json/20080701/json-20080701.jar" sourcepath="M2_REPO/org/json/json/20080701/json-20080701-sources.jar"/>
@@ -97,7 +100,7 @@
<classpathentry kind="var" path="M2_REPO/net/sourceforge/findbugs/jsr-305/v0r47/jsr-305-v0r47.jar" sourcepath="M2_REPO/net/sourceforge/findbugs/jsr-305/v0r47/jsr-305-v0r47-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/hibernate/jtidy/r8-20060801/jtidy-r8-20060801.jar"/>
<classpathentry kind="var" path="M2_REPO/org/jukito/jukito/1.0/jukito-1.0.jar" sourcepath="M2_REPO/org/jukito/jukito/1.0/jukito-1.0-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/junit/junit/4.8.2/junit-4.8.2.jar" sourcepath="M2_REPO/junit/junit/4.8.2/junit-4.8.2-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/junit/junit/4.9/junit-4.9.jar" sourcepath="M2_REPO/junit/junit/4.9/junit-4.9-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/liquibase/liquibase-core/1.8.1/liquibase-core-1.8.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/liquibase/liquibase-plugin/1.8.1.0/liquibase-plugin-1.8.1.0.jar"/>
<classpathentry kind="var" path="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16.jar" sourcepath="M2_REPO/log4j/log4j/1.2.16/log4j-1.2.16-sources.jar"/>
@@ -115,21 +118,22 @@
<classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.1-SNAPSHOT/model-src-0.3.1-SNAPSHOT.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.14/nekohtml-1.9.14.jar" sourcepath="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.14/nekohtml-1.9.14-sources.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.1-SNAPSHOT/proto-msg-0.3.1-SNAPSHOT.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/2.0a4/selenium-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium/2.0a4/selenium-2.0a4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.0a4/selenium-chrome-driver-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.0a4/selenium-chrome-driver-2.0a4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-common/2.0a4/selenium-common-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-common/2.0a4/selenium-common-2.0a4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-firefox-driver/2.0a4/selenium-firefox-driver-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-firefox-driver/2.0a4/selenium-firefox-driver-2.0a4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-htmlunit-driver/2.0a4/selenium-htmlunit-driver-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-htmlunit-driver/2.0a4/selenium-htmlunit-driver-2.0a4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-ie-driver/2.0a4/selenium-ie-driver-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-ie-driver/2.0a4/selenium-ie-driver-2.0a4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-remote-client/2.0a4/selenium-remote-client-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-remote-client/2.0a4/selenium-remote-client-2.0a4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-remote-common/2.0a4/selenium-remote-common-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-remote-common/2.0a4/selenium-remote-common-2.0a4-sources.jar"/>
- <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-support/2.0a4/selenium-support-2.0a4.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-support/2.0a4/selenium-support-2.0a4-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.6.0/selenium-android-driver-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.6.0/selenium-android-driver-2.6.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-api/2.6.0/selenium-api-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-api/2.6.0/selenium-api-2.6.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.6.0/selenium-chrome-driver-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-chrome-driver/2.6.0/selenium-chrome-driver-2.6.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-firefox-driver/2.6.0/selenium-firefox-driver-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-firefox-driver/2.6.0/selenium-firefox-driver-2.6.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-htmlunit-driver/2.6.0/selenium-htmlunit-driver-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-htmlunit-driver/2.6.0/selenium-htmlunit-driver-2.6.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-ie-driver/2.6.0/selenium-ie-driver-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-ie-driver/2.6.0/selenium-ie-driver-2.6.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-iphone-driver/2.6.0/selenium-iphone-driver-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-iphone-driver/2.6.0/selenium-iphone-driver-2.6.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-java/2.6.0/selenium-java-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-java/2.6.0/selenium-java-2.6.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-remote-driver/2.6.0/selenium-remote-driver-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-remote-driver/2.6.0/selenium-remote-driver-2.6.0-sources.jar"/>
+ <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-support/2.6.0/selenium-support-2.6.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-support/2.6.0/selenium-support-2.6.0-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/xalan/serializer/2.7.1/serializer-2.7.1.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/slf4j-api/1.6.1/slf4j-api-1.6.1-sources.jar"/>
<classpathentry kind="var" path="M2_REPO/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1.jar" sourcepath="M2_REPO/org/slf4j/slf4j-log4j12/1.6.1/slf4j-log4j12-1.6.1-sources.jar"/>
@@ -138,7 +142,7 @@
<classpathentry kind="var" path="M2_REPO/org/jivesoftware/smackx/debugger/smackx-debugger/3.0.4/smackx-debugger-3.0.4.jar"/>
<classpathentry kind="var" path="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6.jar" sourcepath="M2_REPO/org/yaml/snakeyaml/1.6/snakeyaml-1.6-sources.jar"/>
<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.0.1/testng-6.0.1.jar" sourcepath="M2_REPO/org/testng/testng/6.0.1/testng-6.0.1-sources.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.1-SNAPSHOT/util-src-0.3.1-SNAPSHOT.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"/>
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2011-09-23 00:01:57 UTC (rev 1527)
+++ trunk/pom.xml 2011-09-23 03:01:39 UTC (rev 1528)
@@ -23,10 +23,6 @@
</properties>
<repositories>
<repository>
- <id>kune-maven</id>
- <url>http://kune.ourproject.org/mavenrepo/</url>
- </repository>
- <repository>
<id>guice-maven</id>
<name>guice maven</name>
<url>http://guice-maven.googlecode.com/svn/trunk</url>
@@ -115,6 +111,10 @@
</releases>
</repository>
<repository>
+ <id>kune-maven</id>
+ <url>http://kune.ourproject.org/mavenrepo/</url>
+ </repository>
+ <repository>
<id>xwiki-releases</id>
<name>XWiki Maven2 Remote Repository for Releases</name>
<url>http://maven.xwiki.org/releases</url>
@@ -516,14 +516,14 @@
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
- <version>4.8.2</version>
+ <version>4.9</version>
<!-- =roo -->
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
- <artifactId>selenium</artifactId>
- <version>2.0a4</version>
+ <artifactId>selenium-java</artifactId>
+ <version>2.6.0</version>
<exclusions>
<exclusion>
<groupId>com.google.collections</groupId>
@@ -534,7 +534,7 @@
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
- <version>6.0.1</version>
+ <version>6.2.1</version>
<scope>test</scope>
</dependency>
<dependency>
Modified: trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-23 00:01:57 UTC (rev 1527)
+++ trunk/src/test/java/cc/kune/selenium/KuneSeleniumDefaults.java 2011-09-23 03:01:39 UTC (rev 1528)
@@ -22,6 +22,7 @@
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.openqa.selenium.support.PageFactory;
+import org.openqa.selenium.support.events.EventFiringWebDriver;
import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
import org.testng.Assert;
import org.testng.ITestContext;
@@ -30,7 +31,7 @@
import org.testng.annotations.DataProvider;
import cc.kune.selenium.login.LoginPageObject;
-import cc.kune.selenium.tools.GenericWebTester;
+import cc.kune.selenium.tools.GenericWebDriver;
import cc.kune.selenium.tools.SeleniumConstants;
import cc.kune.selenium.tools.SeleniumModule;
@@ -40,16 +41,16 @@
public class KuneSeleniumDefaults {
private static final Log LOG = LogFactory.getLog(KuneSeleniumDefaults.class);
public static boolean mustCloseFinally = true;
-
+ protected EventFiringWebDriver eventFiring;
private final Injector injector;
-
protected LoginPageObject login;
- protected GenericWebTester webtester;
+ protected GenericWebDriver webdriver;
public KuneSeleniumDefaults() {
injector = Guice.createInjector(new SeleniumModule());
- webtester = injector.getInstance(GenericWebTester.class);
+ webdriver = injector.getInstance(GenericWebDriver.class);
login = injector.getInstance(LoginPageObject.class);
+ eventFiring = injector.getInstance(EventFiringWebDriver.class);
final ElementLocatorFactory locator = injector.getInstance(ElementLocatorFactory.class);
PageFactory.initElements(locator, login);
}
@@ -58,7 +59,7 @@
public void closeBrowser() {
// We try to only open one window for all our selenium tests
if (mustCloseFinally) {
- webtester.close();
+ webdriver.close();
}
}
@@ -85,7 +86,7 @@
// if (!Suco.getComponents().hasProvider(WebDriver.class)) {
// Suco.install(new SeleniumModule());
// }
- if (webtester == null) {
+ if (webdriver == null) {
// final ChromeDriver driver = new ChromeDriver();
// // final HtmlUnitDriver driver = new HtmlUnitDriver(true);
//
@@ -115,7 +116,8 @@
// openGroupChat = Suco.get(OpenGroupChatPageObject.class);
}
LOG.info("Going home");
- webtester.home();
+
+ webdriver.home();
}
public void sleep(final int milliseconds) {
Modified: trunk/src/test/java/cc/kune/selenium/PageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/PageObject.java 2011-09-23 00:01:57 UTC (rev 1527)
+++ trunk/src/test/java/cc/kune/selenium/PageObject.java 2011-09-23 03:01:39 UTC (rev 1528)
@@ -23,7 +23,6 @@
import org.apache.commons.logging.LogFactory;
import org.openqa.selenium.By;
import org.openqa.selenium.NoSuchElementException;
-import org.openqa.selenium.RenderedWebElement;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.ByIdOrName;
@@ -39,15 +38,15 @@
@Inject
private WebDriver webdriver;
- protected RenderedWebElement findElement(final By by) {
- return (RenderedWebElement) getWebDriver().findElement(by);
+ protected WebElement findElement(final By by) {
+ return getWebDriver().findElement(by);
}
private WebDriver getWebDriver() {
return webdriver;
}
- public boolean isPresent(final RenderedWebElement element) {
+ public boolean isPresent(final WebElement element) {
// FIXME: find a better way to do this
try {
getWebDriver().findElement(By.id(element.getAttribute("id")));
@@ -57,17 +56,6 @@
}
}
- public void waitFor(final RenderedWebElement element) {
- final String id = element.getAttribute("id");
- LOG.info("WAIT FOR: " + id);
- waitFor(id, new Runnable() {
- @Override
- public void run() {
- Assert.assertTrue(element.isDisplayed());
- }
- });
- }
-
/**
* Thanks to:
* http://groups.google.com/group/webdriver/browse_frm/thread/6e705242
@@ -112,6 +100,17 @@
}
}
+ public void waitFor(final WebElement element) {
+ final String id = element.getAttribute("id");
+ LOG.info("WAIT FOR: " + id);
+ waitFor(id, new Runnable() {
+ @Override
+ public void run() {
+ Assert.assertTrue(element.isDisplayed());
+ }
+ });
+ }
+
protected void waitFor(final WebElement element, final String text) {
LOG.info("WAIT FOR: " + text);
waitFor(text, new Runnable() {
@@ -129,7 +128,7 @@
waitFor(id, new Runnable() {
@Override
public void run() {
- Assert.assertTrue(((RenderedWebElement) getWebDriver().findElement(new ByIdOrName(id))).isDisplayed());
+ Assert.assertTrue(getWebDriver().findElement(new ByIdOrName(id)).isDisplayed());
}
});
}
@@ -139,7 +138,7 @@
waitFor(text, new Runnable() {
@Override
public void run() {
- final String elValue = element.getValue();
+ final String elValue = element.getText();
LOG.info("Element value: " + elValue);
Assert.assertTrue(elValue.contains(text));
}
Modified: trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java 2011-09-23 00:01:57 UTC (rev 1527)
+++ trunk/src/test/java/cc/kune/selenium/login/LoginPageObject.java 2011-09-23 03:01:39 UTC (rev 1528)
@@ -19,7 +19,8 @@
*/
package cc.kune.selenium.login;
-import org.openqa.selenium.RenderedWebElement;
+import org.openqa.selenium.Keys;
+import org.openqa.selenium.WebElement;
import org.openqa.selenium.support.FindBy;
import cc.kune.core.client.auth.SignInForm;
@@ -35,19 +36,19 @@
public class LoginPageObject extends PageObject {
- @FindBy(id = GWTDEV + SignInPanel.SIGN_IN_BUTTON_ID)
- private RenderedWebElement button;
private final I18nHelper i18n;
@FindBy(id = SignInForm.PASSWORD_FIELD_ID + "-input")
- private RenderedWebElement passwd;
+ private WebElement passwd;
+ @FindBy(id = GWTDEV + SignInPanel.SIGN_IN_BUTTON_ID)
+ private WebElement signInButton;
@FindBy(id = GWTDEV + SitebarSignInLink.SITE_SIGN_IN)
- private RenderedWebElement signInLink;
+ private WebElement signInLink;
@FindBy(id = GWTDEV + SitebarSignOutLink.SITE_SIGN_OUT)
- private RenderedWebElement signOutLink;
+ private WebElement signOutLink;
@FindBy(id = SignInForm.USER_FIELD_ID + "-input")
- private RenderedWebElement user;
+ private WebElement user;
@FindBy(id = GWTDEV + SiteUserOptionsPresenter.LOGGED_USER_MENU_ID)
- private RenderedWebElement userMenu;
+ private WebElement userMenu;
public LoginPageObject() {
i18n = new I18nHelper(LoginMessages.class);
@@ -65,11 +66,25 @@
waitFor(signInLink);
}
- public RenderedWebElement getHeader() {
+ public void fillSigInInForm(final String username, final String password, final boolean withReturn) {
+ user.clear();
+ passwd.clear();
+ user.clear();
+ passwd.clear();
+ user.sendKeys(username);
+ passwd.sendKeys(password);
+ if (withReturn) {
+ passwd.sendKeys(Keys.RETURN);
+ } else {
+ signInButton.click();
+ }
+ }
+
+ public WebElement getHeader() {
return signInLink;
}
- public RenderedWebElement header() {
+ public WebElement header() {
return getHeader();
}
@@ -79,17 +94,21 @@
}
public void signIn(final String username, final String password) {
+ signIn(username, password, true);
+ }
+
+ public void signIn(final String username, final String password, final boolean withReturn) {
assertIsDisconnected();
signInLink.click();
- user.clear();
- passwd.clear();
- user.sendKeys(username);
- passwd.sendKeys(password);
- button.click();
+ fillSigInInForm(username, password, withReturn);
}
public void signInDefUser() {
- signIn(SeleniumConstants.USERNAME, SeleniumConstants.PASSWD);
+ signIn(SeleniumConstants.USERNAME, SeleniumConstants.PASSWD, false);
}
+ public void signOut() {
+ logout();
+ }
+
}
Modified: trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java 2011-09-23 00:01:57 UTC (rev 1527)
+++ trunk/src/test/java/cc/kune/selenium/login/LoginSeleniumTests.java 2011-09-23 03:01:39 UTC (rev 1528)
@@ -21,11 +21,12 @@
import org.testng.annotations.Test;
+import cc.kune.core.client.state.SiteTokens;
import cc.kune.selenium.KuneSeleniumTest;
public class LoginSeleniumTests extends KuneSeleniumTest {
- @Test(dataProvider = "correctlogin", enabled = false)
+ @Test(dataProvider = "correctlogin")
public void severalsSignInSingOut(final String user, final String passwd) {
login.assertIsDisconnected();
login.signIn(user, passwd);
@@ -36,7 +37,6 @@
login.signIn(user, passwd);
login.assertIsConnectedAs(user);
login.logout();
-
login.assertIsDisconnected();
}
@@ -45,6 +45,8 @@
login.assertIsDisconnected();
login.signIn(user, passwd);
login.assertIsConnectedAs(user);
+ login.logout();
+ login.assertIsDisconnected();
}
@Test
@@ -53,4 +55,14 @@
login.signIn("nouser", "nopassword");
login.assertIsDisconnected();
}
+
+ @Test(dataProvider = "correctlogin")
+ public void signInWithToken(final String user, final String passwd) {
+ login.assertIsDisconnected();
+ webdriver.gotoToken(SiteTokens.SIGNIN);
+ login.fillSigInInForm(user, passwd, true);
+ login.assertIsConnectedAs(user);
+ login.logout();
+ login.assertIsDisconnected();
+ }
}
Copied: trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java (from rev 1511, trunk/src/test/java/cc/kune/selenium/tools/AbstractWebTester.java)
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/tools/AbstractWebDriver.java 2011-09-23 03:01:39 UTC (rev 1528)
@@ -0,0 +1,149 @@
+/*
+ *
+ * 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.selenium.tools;
+
+import java.util.List;
+import java.util.Set;
+
+import org.openqa.selenium.By;
+import org.openqa.selenium.Point;
+import org.openqa.selenium.WebDriver;
+import org.openqa.selenium.WebDriverBackedSelenium;
+import org.openqa.selenium.WebElement;
+
+import cc.kune.core.shared.domain.utils.StateToken;
+
+import com.google.gwt.user.client.ui.UIObject;
+import com.thoughtworks.selenium.Selenium;
+
+public abstract class AbstractWebDriver implements WebDriver {
+ private final String baseUrl;
+ private final WebDriver driver;
+
+ private final Selenium selenium;
+
+ public AbstractWebDriver(final WebDriver driver, final String baseUrl) {
+ this.driver = driver;
+ this.baseUrl = baseUrl;
+ selenium = new WebDriverBackedSelenium(driver, baseUrl);
+ selenium.setSpeed("500");
+ // selenium.setTimeout("5000");
+ }
+
+ @Override
+ public void close() {
+ driver.close();
+ }
+
+ @Override
+ public WebElement findElement(final By by) {
+ return driver.findElement(by);
+ }
+
+ @Override
+ public List<WebElement> findElements(final By by) {
+ return driver.findElements(by);
+ }
+
+ @Override
+ public void get(final String url) {
+ driver.get(url);
+ }
+
+ public WebElement getById(final String id) {
+ return driver.findElement(By.id(UIObject.DEBUG_ID_PREFIX + id));
+ }
+
+ @Override
+ public String getCurrentUrl() {
+ return driver.getCurrentUrl();
+ }
+
+ @Override
+ public String getPageSource() {
+ return driver.getPageSource();
+ }
+
+ @Override
+ public String getTitle() {
+ return driver.getTitle();
+ }
+
+ @Override
+ public String getWindowHandle() {
+ return driver.getWindowHandle();
+ }
+
+ @Override
+ public Set<String> getWindowHandles() {
+ return driver.getWindowHandles();
+ }
+
+ public void gotoToken(final StateToken token) {
+ get(baseUrl + token);
+ }
+
+ public void gotoToken(final String token) {
+ get(baseUrl + token);
+ }
+
+ public void home() {
+ assert baseUrl != null;
+ driver.get(baseUrl);
+ }
+
+ public boolean isElementPresent(final String id) {
+ // http://stackoverflow.com/questions/5922930/iselementpresent-in-selenium-2-0
+ return selenium.isElementPresent(id);
+ }
+
+ public boolean isTextPresent(final String text) {
+ return selenium.isTextPresent(text);
+ }
+
+ @Override
+ public Options manage() {
+ return driver.manage();
+ }
+
+ public void moveMouseAt(final Point point) {
+ selenium.mouseMoveAt(String.valueOf(point.getX()), String.valueOf(point.getY()));
+ }
+
+ @Override
+ public Navigation navigate() {
+ return driver.navigate();
+ }
+
+ public void open(final String url) {
+ get(url);
+ }
+
+ @Override
+ public void quit() {
+ driver.quit();
+ }
+
+ @Override
+ public TargetLocator switchTo() {
+ return driver.switchTo();
+ }
+
+}
\ No newline at end of file
Deleted: trunk/src/test/java/cc/kune/selenium/tools/AbstractWebTester.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/AbstractWebTester.java 2011-09-23 00:01:57 UTC (rev 1527)
+++ trunk/src/test/java/cc/kune/selenium/tools/AbstractWebTester.java 2011-09-23 03:01:39 UTC (rev 1528)
@@ -1,71 +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.selenium.tools;
-
-import org.openqa.selenium.By;
-import org.openqa.selenium.WebDriver;
-import org.openqa.selenium.WebElement;
-
-import com.google.gwt.user.client.ui.UIObject;
-
-public abstract class AbstractWebTester {
- private final String baseUrl;
- private final WebDriver driver;
-
- // private final Selenium selenium;
-
- public AbstractWebTester(final WebDriver driver, final String baseUrl) {
- this.driver = driver;
- this.baseUrl = baseUrl;
-
- // selenium = new WebDriverBackedSelenium(driver, baseUrl);
- // selenium.setTimeout("5000");
- }
-
- public void close() {
- driver.close();
- }
-
- public WebElement getById(final String id) {
- return driver.findElement(By.id(UIObject.DEBUG_ID_PREFIX + id));
- }
-
- public void home() {
- assert baseUrl != null;
- // selenium.open(baseUrl);
- driver.get(baseUrl);
- }
- //
- // public boolean isElementPresent(final String id) {
- // return true;
- // // return selenium.isElementPresent(id);
- // }
- //
- // public boolean isTextPresent(final String text) {
- // return true;
- // // return selenium.isTextPresent(text);
- // }
- //
- // public void moveMouseAt(final Point point) {
- // // seenium.mouseMoveAt(String.valueOf(point.getX()),
- // // String.valueOf(point.getY()));
- // }
-
-}
\ No newline at end of file
Copied: trunk/src/test/java/cc/kune/selenium/tools/GenericWebDriver.java (from rev 1511, trunk/src/test/java/cc/kune/selenium/tools/GenericWebTester.java)
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/GenericWebDriver.java (rev 0)
+++ trunk/src/test/java/cc/kune/selenium/tools/GenericWebDriver.java 2011-09-23 03:01:39 UTC (rev 1528)
@@ -0,0 +1,33 @@
+/*
+ *
+ * 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.selenium.tools;
+
+import org.openqa.selenium.WebDriver;
+
+import com.google.inject.Inject;
+
+public class GenericWebDriver extends AbstractWebDriver {
+
+ @Inject
+ public GenericWebDriver(final WebDriver driver) {
+ super(driver, "http://kune.beta.iepala.es/ws/?locale=en#");
+ }
+
+}
Deleted: trunk/src/test/java/cc/kune/selenium/tools/GenericWebTester.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/GenericWebTester.java 2011-09-23 00:01:57 UTC (rev 1527)
+++ trunk/src/test/java/cc/kune/selenium/tools/GenericWebTester.java 2011-09-23 03:01:39 UTC (rev 1528)
@@ -1,33 +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.selenium.tools;
-
-import org.openqa.selenium.WebDriver;
-
-import com.google.inject.Inject;
-
-public class GenericWebTester extends AbstractWebTester {
-
- @Inject
- public GenericWebTester(final WebDriver driver) {
- super(driver, "http://kune.beta.iepala.es/ws/?locale=en#");
- }
-
-}
Modified: trunk/src/test/java/cc/kune/selenium/tools/SeleniumModule.java
===================================================================
--- trunk/src/test/java/cc/kune/selenium/tools/SeleniumModule.java 2011-09-23 00:01:57 UTC (rev 1527)
+++ trunk/src/test/java/cc/kune/selenium/tools/SeleniumModule.java 2011-09-23 03:01:39 UTC (rev 1528)
@@ -19,11 +19,15 @@
*/
package cc.kune.selenium.tools;
+import java.util.Arrays;
+
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.firefox.FirefoxProfile;
import org.openqa.selenium.firefox.internal.ProfilesIni;
+import org.openqa.selenium.remote.DesiredCapabilities;
+import org.openqa.selenium.support.events.EventFiringWebDriver;
import org.openqa.selenium.support.pagefactory.AjaxElementLocatorFactory;
import org.openqa.selenium.support.pagefactory.ElementLocatorFactory;
@@ -40,22 +44,30 @@
protected void configure() {
// bind(WebDriver.class).toInstance(creatFirefoxDriver());
- final ChromeDriver driver = createChromeDriver();
+ final WebDriver driver = createChromeDriver();
bind(WebDriver.class).toInstance(driver);
+ bind(GenericWebDriver.class).in(Singleton.class);
- bind(GenericWebTester.class).in(Singleton.class);
-
// "http://127.0.0.1:8888/ws/?locale=en&log_level=INFO&gwt.codesvr=127.0.0.1:99…");
bind(ElementLocatorFactory.class).toInstance(
new AjaxElementLocatorFactory(driver, SeleniumConstants.TIMEOUT));
+ final EventFiringWebDriver eventFiring = new EventFiringWebDriver(driver);
+ bind(EventFiringWebDriver.class).toInstance(eventFiring);
+
// Page Objects here!
bind(LoginPageObject.class).in(Singleton.class);
}
- private ChromeDriver createChromeDriver() {
- final ChromeDriver driver = new ChromeDriver();
+ private WebDriver createChromeDriver() {
+ // http://code.google.com/p/selenium/wiki/ChromeDriver
+ System.setProperty("webdriver.chrome.driver", "/usr/bin/chromedriver");
+ final DesiredCapabilities capabilities = DesiredCapabilities.chrome();
+ // http://peter.sh/experiments/chromium-command-line-switches/
+ capabilities.setCapability("chrome.switches", Arrays.asList("--disable-translate"));
+ capabilities.setCapability("chrome.binary", "/usr/bin/chromium-browser");
+ final WebDriver driver = new ChromeDriver(capabilities);
return driver;
}
@@ -65,6 +77,7 @@
// profile.setPreference("webdriver.firefox.profile",
// SeleniumConstants.FIREFOX_PROFILE_NAME);
// profile.setPreference("webdriver.firefox.useExisting",true);
+
final ProfilesIni allProfiles = new ProfilesIni();
final FirefoxProfile profile = allProfiles.getProfile(SeleniumConstants.FIREFOX_PROFILE_NAME);
// profile.setPreferences("foo.bar", 23);
1
0
23 Sep '11
Author: vjrj_
Date: 2011-09-23 02:01:57 +0200 (Fri, 23 Sep 2011)
New Revision: 1527
Modified:
trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java
trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
trunk/src/main/java/cc/kune/core/server/InitData.java
trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java
trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java
trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralView.java
trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java
trunk/src/main/resources/ConstantsTest_en.properties
trunk/src/test/java/cc/kune/core/client/i18n/ConstantsTest.java
trunk/src/test/java/cc/kune/core/client/i18n/I18nUtilsTest.java
Log:
CLOSED - # 68: Change your language and name in User Options
http://kune.ourproject.org/issues/ticket/68
Modified: trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java 2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/common/client/ui/dialogs/tabbed/AbstractTabbedDialogPanel.java 2011-09-23 00:01:57 UTC (rev 1527)
@@ -144,7 +144,7 @@
}
messageErrorBar = new MessageToolbar(images, errorLabelId);
tabPanel = new TabLayoutPanel(25, Unit.PX);
- tabPanel.addStyleName("oc-noselect");
+ // tabPanel.addStyleName("oc-noselect");
dialog.getInnerPanel().add(tabPanel);
tabPanel.addSelectionHandler(new SelectionHandler<Integer>() {
@Override
Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java 2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java 2011-09-23 00:01:57 UTC (rev 1527)
@@ -10,6 +10,7 @@
public static String convertMethodName(final String name) {
String result = name;
+ result = result.replaceAll("\\\n", " ");
result = result.replaceAll("\\[%d\\]", "N");
result = result.replaceAll("\\[%s\\]", "Param");
final char[] delimiters = { ' ', '.', '?', ',', ';', '&', '(', ')', '"', '$', '!', '/', '\'', '-',
Modified: trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java 2011-09-23 00:01:57 UTC (rev 1527)
@@ -398,8 +398,11 @@
@Override
public void setRetrievedStateAndGo(final StateAbstractDTO newState) {
setRetrievedState(newState);
- // setState(newState);
- history.newItem(newState.getStateToken().toString());
+ final String token = newState.getStateToken().toString();
+ if (history.getToken().equals(token)) {
+ setState(newState);
+ }
+ history.newItem(token);
}
@Override
Modified: trunk/src/main/java/cc/kune/core/server/InitData.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/InitData.java 2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/core/server/InitData.java 2011-09-23 00:01:57 UTC (rev 1527)
@@ -59,6 +59,7 @@
private ReservedWordsRegistryDTO reservedWords;
private String siteDomain;
private String siteLogoUrl;
+ private String siteShortName;
private String siteUrl;
private String[] timezones;
private UserInfo userInfo;
@@ -165,6 +166,10 @@
return siteLogoUrl;
}
+ public String getSiteShortName() {
+ return siteShortName;
+ }
+
public String getSiteUrl() {
return siteUrl;
}
@@ -290,6 +295,10 @@
this.siteLogoUrl = siteLogoUrl;
}
+ public void setSiteShortName(final String siteShortName) {
+ this.siteShortName = siteShortName;
+ }
+
public void setSiteUrl(final String siteUrl) {
this.siteUrl = siteUrl;
}
Modified: trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java 2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java 2011-09-23 00:01:57 UTC (rev 1527)
@@ -153,6 +153,7 @@
data.setAviEmbedObject(kuneProperties.get(KuneProperties.AVI_EMBEDED_OBJECT));
data.setExtMediaDescrips(extMediaDescManager.getAll());
data.setFeedbackEnabled(kuneProperties.getBoolean(KuneProperties.FEEDBACK_ENABLED));
+ data.setSiteShortName(kuneProperties.get(KuneProperties.SITE_SHORTNAME));
return data;
}
}
Modified: trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java 2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java 2011-09-23 00:01:57 UTC (rev 1527)
@@ -52,6 +52,7 @@
private ReservedWordsRegistryDTO reservedWords;
private String siteDomain;
private String siteLogoUrl;
+ private String siteShortName;
private String siteUrl;
private String[] timezones;
private UserInfoDTO userInfo;
@@ -161,6 +162,10 @@
return siteLogoUrl;
}
+ public String getSiteShortName() {
+ return siteShortName;
+ }
+
public String getSiteUrl() {
return siteUrl;
}
@@ -290,6 +295,10 @@
this.siteLogoUrl = siteLogoUrl;
}
+ public void setSiteShortName(final String siteShortName) {
+ this.siteShortName = siteShortName;
+ }
+
public void setSiteUrl(final String siteUrl) {
this.siteUrl = siteUrl;
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java 2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java 2011-09-23 00:01:57 UTC (rev 1527)
@@ -64,4 +64,9 @@
this.shortName.setValue(shortName);
}
+ @Override
+ public void setShortNameEnabled(final boolean enabled) {
+ this.shortName.setEnabled(enabled);
+ }
+
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java 2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java 2011-09-23 00:01:57 UTC (rev 1527)
@@ -70,6 +70,7 @@
@Override
protected void setState() {
final GroupDTO group = session.getCurrentState().getGroup();
+ groupView.setShortNameEnabled(!session.getInitData().getSiteShortName().equals(group.getShortName()));
groupView.setShortName(group.getShortName());
groupView.setLongName(group.getLongName());
}
Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralView.java 2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralView.java 2011-09-23 00:01:57 UTC (rev 1527)
@@ -29,4 +29,6 @@
void setShortName(String shortName);
+ void setShortNameEnabled(boolean enabled);
+
}
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 2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java 2011-09-23 00:01:57 UTC (rev 1527)
@@ -82,7 +82,8 @@
final UserSimpleDTO currentUser = session.getCurrentUser();
final UserDTO user = new UserDTO();
user.setId(currentUser.getId());
- user.setName(userView.getLongName());
+ final String longName = userView.getLongName();
+ user.setName(longName);
userService.get().updateUser(session.getUserHash(), user, userView.getLanguage(),
new AsyncCallbackSimple<StateAbstractDTO>() {
@Override
Modified: trunk/src/main/resources/ConstantsTest_en.properties
===================================================================
--- trunk/src/main/resources/ConstantsTest_en.properties 2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/main/resources/ConstantsTest_en.properties 2011-09-23 00:01:57 UTC (rev 1527)
@@ -4,4 +4,5 @@
someMultipleLines = \
some \
multiple \
-lines
\ No newline at end of file
+lines
+someMultipleLinesWithCarriage = some\nmultiple\nlines\nwith\ncarriage
\ No newline at end of file
Modified: trunk/src/test/java/cc/kune/core/client/i18n/ConstantsTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/i18n/ConstantsTest.java 2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/test/java/cc/kune/core/client/i18n/ConstantsTest.java 2011-09-23 00:01:57 UTC (rev 1527)
@@ -51,4 +51,10 @@
assertEquals("some multiple lines",
english.getString(I18nUtils.convertMethodName("some multiple lines")));
}
+
+ @Test
+ public void multipleLinesWithCarriageReturn() {
+ assertEquals("some\nmultiple\nlines\nwith\ncarriage",
+ english.getString(I18nUtils.convertMethodName("some\nmultiple\nlines\nwith\ncarriage")));
+ }
}
Modified: trunk/src/test/java/cc/kune/core/client/i18n/I18nUtilsTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/i18n/I18nUtilsTest.java 2011-09-22 16:08:44 UTC (rev 1526)
+++ trunk/src/test/java/cc/kune/core/client/i18n/I18nUtilsTest.java 2011-09-23 00:01:57 UTC (rev 1527)
@@ -29,6 +29,11 @@
}
@Test
+ public void carriageReturn() {
+ assertEquals("yesNo", I18nUtils.convertMethodName("yes\nno"));
+ }
+
+ @Test
public void testParams() {
assertEquals("nOfParamItems", I18nUtils.convertMethodName("[%d] of [%s] items"));
assertEquals("nOfNItems", I18nUtils.convertMethodName("[%d] of [%d] items"));
1
0
r1526 - in trunk/src/main/java/cc/kune: common/client/utils core/client core/client/auth core/client/cookies core/client/state
by Vicente J. Ruiz Jurado 22 Sep '11
by Vicente J. Ruiz Jurado 22 Sep '11
22 Sep '11
Author: vjrj_
Date: 2011-09-22 18:08:44 +0200 (Thu, 22 Sep 2011)
New Revision: 1526
Added:
trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java
Modified:
trunk/src/main/java/cc/kune/common/client/utils/TextUtils.java
trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
trunk/src/main/java/cc/kune/core/client/CoreParts.java
trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPresenter.java
trunk/src/main/java/cc/kune/core/client/cookies/CookiesManager.java
trunk/src/main/java/cc/kune/core/client/cookies/CookiesManagerImpl.java
trunk/src/main/java/cc/kune/core/client/state/Session.java
trunk/src/main/java/cc/kune/core/client/state/SessionDefault.java
Log:
CLOSED - # 102: Highlight Sign-In and/or show "New" button disabled to anonymous user
http://kune.ourproject.org/issues/ticket/102
Modified: trunk/src/main/java/cc/kune/common/client/utils/TextUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/utils/TextUtils.java 2011-09-20 23:21:27 UTC (rev 1525)
+++ trunk/src/main/java/cc/kune/common/client/utils/TextUtils.java 2011-09-22 16:08:44 UTC (rev 1526)
@@ -24,8 +24,10 @@
import org.apache.commons.lang.WordUtils;
import cc.kune.common.client.errors.NotImplementedException;
+import cc.kune.common.client.errors.UIException;
import com.google.gwt.safehtml.shared.SimpleHtmlSanitizer;
+import com.google.gwt.safehtml.shared.UriUtils;
public class TextUtils {
@@ -169,15 +171,25 @@
}
/**
- * FIXME: Is this safe? Try to use {@link SimpleHtmlSanitizer} also in the
- * method
+ * Generates a href link
*
*/
- @Deprecated
public static String generateHtmlLink(final String href, final String text) {
- return "<a href=\"" + href + "\" target=\"_blank\">" + text + "</a>";
+ return generateHtmlLink(href, text, true);
}
+ /**
+ * Generates a href link
+ *
+ */
+ public static String generateHtmlLink(final String href, final String text, final boolean targetBlank) {
+ if (!UriUtils.isSafeUri(href)) {
+ throw new UIException("Unsafe href");
+ }
+ return "<a href=\"" + UriUtils.sanitizeUri(href) + "\"" + (targetBlank ? "target=\"_blank\"" : "")
+ + ">" + text + "</a>";
+ }
+
private static boolean isDelimiter(final char ch, final char[] delimiters) {
if (delimiters == null) {
throw new NotImplementedException();
Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-09-20 23:21:27 UTC (rev 1525)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-09-22 16:08:44 UTC (rev 1526)
@@ -31,6 +31,7 @@
import cc.kune.common.client.ui.MaskWidgetView;
import cc.kune.core.client.actions.ActionRegistryByType;
import cc.kune.core.client.actions.xml.XMLActionsParser;
+import cc.kune.core.client.auth.AnonUsersManager;
import cc.kune.core.client.auth.Register;
import cc.kune.core.client.auth.RegisterPanel;
import cc.kune.core.client.auth.RegisterPresenter;
@@ -137,6 +138,7 @@
s(I18nUITranslationService.class);
bind(I18nTranslationService.class).to(I18nUITranslationService.class).in(Singleton.class);
bind(GlobalShortcutRegister.class).to(DefaultGlobalShortcutRegister.class).in(Singleton.class);
+ s(AnonUsersManager.class);
// DnD
s(KuneDragController.class);
Modified: trunk/src/main/java/cc/kune/core/client/CoreParts.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreParts.java 2011-09-20 23:21:27 UTC (rev 1525)
+++ trunk/src/main/java/cc/kune/core/client/CoreParts.java 2011-09-22 16:08:44 UTC (rev 1526)
@@ -19,6 +19,7 @@
*/
package cc.kune.core.client;
+import cc.kune.core.client.auth.AnonUsersManager;
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
@@ -37,7 +38,7 @@
public CoreParts(final Session session, final Provider<GroupSNPresenter> groupMembersPresenter,
final Provider<UserSNPresenter> buddiesAndParticipationPresenter,
final Provider<GroupSNConfActions> groupMembersConfActions,
- final Provider<UserSNConfActions> userSNConfActions,
+ final Provider<UserSNConfActions> userSNConfActions, final Provider<AnonUsersManager> anonUsers,
final Provider<SiteUserOptionsPresenter> userOptions) {
session.onAppStart(true, new AppStartHandler() {
@Override
@@ -47,6 +48,7 @@
groupMembersPresenter.get();
buddiesAndParticipationPresenter.get();
userOptions.get();
+ anonUsers.get();
}
});
}
Added: trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java 2011-09-22 16:08:44 UTC (rev 1526)
@@ -0,0 +1,57 @@
+package cc.kune.core.client.auth;
+
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.utils.TextUtils;
+import cc.kune.core.client.cookies.CookiesManager;
+import cc.kune.core.client.init.AppStartEvent;
+import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.SiteTokens;
+import cc.kune.core.client.state.UserSignInEvent;
+import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class AnonUsersManager {
+
+ @Inject
+ public AnonUsersManager(final Session session, final CookiesManager cookiesManager,
+ final I18nTranslationService i18n) {
+ session.onAppStart(true, new AppStartHandler() {
+ @Override
+ public void onAppStart(final AppStartEvent event) {
+ if (session.isNotLogged()) {
+ final String anonCookie = cookiesManager.getAnonCookie();
+ if (anonCookie == null) {
+ // First access, set cookie to short period (1day), and show message
+ cookiesManager.setAnonCookie(false);
+ final String register = TextUtils.generateHtmlLink("#" + SiteTokens.REGISTER,
+ i18n.tWithNT("register", "register, in lowercase"), false);
+ final String signin = TextUtils.generateHtmlLink("#" + SiteTokens.SIGNIN,
+ i18n.tWithNT("sign in", "register, in lowercase"), false);
+ NotifyUser.info(
+ i18n.tWithNT(
+ "You did not sign-in, so you can just see some public contents in this website, "
+ + "but not edit or collaborate with others. Please [%s] or [%s] in order to get full access to this site tools and contents",
+ "This will be something like 'Please register or sign in', but instead of %s some links",
+ register, signin), true);
+ } else {
+ if (Boolean.valueOf(anonCookie)) {
+ // Registered already: we set the cookie for some big period again
+ cookiesManager.setAnonCookie(true);
+ } else {
+ // Non registered yet: but we show the message already today
+ }
+ }
+ }
+ }
+ });
+ session.onUserSignIn(true, new UserSignInHandler() {
+ @Override
+ public void onUserSignIn(final UserSignInEvent event) {
+ cookiesManager.setAnonCookie(true);
+ }
+ });
+ }
+}
Modified: trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPresenter.java 2011-09-20 23:21:27 UTC (rev 1525)
+++ trunk/src/main/java/cc/kune/core/client/auth/SignInAbstractPresenter.java 2011-09-22 16:08:44 UTC (rev 1526)
@@ -76,7 +76,7 @@
protected void onSignIn(final UserInfoDTO userInfoDTO) {
final String userHash = userInfoDTO.getUserHash();
- cookiesManager.setCookie(userHash);
+ cookiesManager.setAuthCookie(userHash);
getView().reset();
session.setUserHash(userHash);
session.setCurrentUserInfo(userInfoDTO);
Modified: trunk/src/main/java/cc/kune/core/client/cookies/CookiesManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/cookies/CookiesManager.java 2011-09-20 23:21:27 UTC (rev 1525)
+++ trunk/src/main/java/cc/kune/core/client/cookies/CookiesManager.java 2011-09-22 16:08:44 UTC (rev 1526)
@@ -20,9 +20,16 @@
package cc.kune.core.client.cookies;
public interface CookiesManager {
- String getCurrentCookie();
+ String getAnonCookie();
- void removeCookie();
+ String getAuthCookie();
- void setCookie(String userHash);
+ void removeAnonCookie();
+
+ void removeAuthCookie();
+
+ void setAnonCookie(Boolean userRegister);
+
+ void setAuthCookie(String userHash);
+
}
Modified: trunk/src/main/java/cc/kune/core/client/cookies/CookiesManagerImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/cookies/CookiesManagerImpl.java 2011-09-20 23:21:27 UTC (rev 1525)
+++ trunk/src/main/java/cc/kune/core/client/cookies/CookiesManagerImpl.java 2011-09-22 16:08:44 UTC (rev 1526)
@@ -28,31 +28,50 @@
public class CookiesManagerImpl implements CookiesManager {
- public CookiesManagerImpl() {
- }
+ private static final String ANON = "annon";
- @Override
- public String getCurrentCookie() {
- return Cookies.getCookie(Session.USERHASH);
- }
+ public CookiesManagerImpl() {
+ }
- @Override
- public void removeCookie() {
- // FIXME: Remove cookie doesn't works in all browsers, know
- // issue:
- // http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/ded8…
- // http://code.google.com/p/google-web-toolkit/issues/detail?id=1735&q=removeC…
- Cookies.removeCookie(Session.USERHASH);
- // Workaround:
- Cookies.setCookie(Session.USERHASH, null, new Date(0), null, "/", false);
- }
+ @Override
+ public String getAnonCookie() {
+ return Cookies.getCookie(ANON);
+ }
- @Override
- public void setCookie(final String userHash) {
- // http://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecurityFAQ
- final long duration = Session.SESSION_DURATION;
- final Date expires = new Date(System.currentTimeMillis() + duration);
- Cookies.setCookie(Session.USERHASH, userHash, expires, null, "/", false);
- Log.info("Received hash: " + userHash, null);
- }
+ @Override
+ public String getAuthCookie() {
+ return Cookies.getCookie(Session.USERHASH);
+ }
+
+ @Override
+ public void removeAnonCookie() {
+ Cookies.removeCookie(ANON);
+ Cookies.setCookie(ANON, null, new Date(0), null, "/", false);
+ }
+
+ @Override
+ public void removeAuthCookie() {
+ // FIXME: Remove cookie doesn't works in all browsers, know
+ // issue:
+ // http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/ded8…
+ // http://code.google.com/p/google-web-toolkit/issues/detail?id=1735&q=removeC…
+ Cookies.removeCookie(Session.USERHASH);
+ // Workaround:
+ Cookies.setCookie(Session.USERHASH, null, new Date(0), null, "/", false);
+ }
+
+ @Override
+ public void setAnonCookie(final Boolean userRegister) {
+ final Date expires = new Date(System.currentTimeMillis()
+ + (userRegister ? Session.ANON_SESSION_DURATION_AFTER_REG : Session.ANON_SESSION_DURATION));
+ Cookies.setCookie(ANON, userRegister.toString(), expires, null, "/", false);
+ }
+
+ @Override
+ public void setAuthCookie(final String userHash) {
+ // http://code.google.com/p/google-web-toolkit-incubator/wiki/LoginSecurityFAQ
+ final Date expires = new Date(System.currentTimeMillis() + Session.SESSION_DURATION);
+ Cookies.setCookie(Session.USERHASH, userHash, expires, null, "/", false);
+ Log.info("Received hash: " + userHash, null);
+ }
}
Modified: trunk/src/main/java/cc/kune/core/client/state/Session.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/Session.java 2011-09-20 23:21:27 UTC (rev 1525)
+++ trunk/src/main/java/cc/kune/core/client/state/Session.java 2011-09-22 16:08:44 UTC (rev 1526)
@@ -61,11 +61,11 @@
public interface Session {
- /**
- * Duration remembering login: 2 weeks
- */
- int SESSION_DURATION = 1000 * 60 * 60 * 24 * 14;
- // int SESSION_DURATION = 1000;
+ long A_DAY = 1000 * 60 * 60 * 24;
+ long ANON_SESSION_DURATION = A_DAY;
+ long ANON_SESSION_DURATION_AFTER_REG = A_DAY * 365;
+ long SESSION_DURATION = A_DAY * 14; // two weeks login session duration
+ // long SESSION_DURATION = 1000;
String USERHASH = "k007userHash";
Modified: trunk/src/main/java/cc/kune/core/client/state/SessionDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/SessionDefault.java 2011-09-20 23:21:27 UTC (rev 1525)
+++ trunk/src/main/java/cc/kune/core/client/state/SessionDefault.java 2011-09-22 16:08:44 UTC (rev 1526)
@@ -71,7 +71,7 @@
final Provider<UserServiceAsync> userServiceProvider, final EventBus eventBus) {
this.cookieManager = cookieManager;
this.eventBus = eventBus;
- this.userHash = cookieManager.getCurrentCookie();
+ this.userHash = cookieManager.getAuthCookie();
this.userHash = userHash == null || userHash.equals("null") ? null : userHash;
this.userServiceProvider = userServiceProvider;
languagesArray = null;
@@ -391,7 +391,7 @@
@Override
public void signOut() {
- cookieManager.removeCookie();
+ cookieManager.removeAuthCookie();
setUserHash(null);
setCurrentUserInfo(null);
}
1
0
r1525 - in trunk/src/main/java/cc/kune: core/client core/client/auth core/client/groups/newgroup core/client/sn/actions gspace/client/options/general
by Vicente J. Ruiz Jurado 20 Sep '11
by Vicente J. Ruiz Jurado 20 Sep '11
20 Sep '11
Author: vjrj_
Date: 2011-09-21 01:21:27 +0200 (Wed, 21 Sep 2011)
New Revision: 1525
Modified:
trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
trunk/src/main/java/cc/kune/core/client/CoreParts.java
trunk/src/main/java/cc/kune/core/client/auth/RegisterForm.java
trunk/src/main/java/cc/kune/core/client/auth/RegisterPanel.java
trunk/src/main/java/cc/kune/core/client/auth/UserFieldFactory.java
trunk/src/main/java/cc/kune/core/client/groups/newgroup/GroupFieldFactory.java
trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java
trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java
trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java
trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java
Log:
NEW - # 102: Highlight Sign-In and/or show "New" button disabled to anonymous user
http://kune.ourproject.org/issues/ticket/102
Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-09-20 14:28:24 UTC (rev 1524)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java 2011-09-20 23:21:27 UTC (rev 1525)
@@ -39,6 +39,7 @@
import cc.kune.core.client.auth.SignInPanel;
import cc.kune.core.client.auth.SignInPresenter;
import cc.kune.core.client.auth.SignInPresenter.SignInView;
+import cc.kune.core.client.auth.UserFieldFactory;
import cc.kune.core.client.auth.UserPassAutocompleteManager;
import cc.kune.core.client.auth.UserPassAutocompleteManagerImpl;
import cc.kune.core.client.cookies.CookiesManager;
@@ -46,6 +47,7 @@
import cc.kune.core.client.dnd.KuneDragController;
import cc.kune.core.client.dnd.NotImplementedDropManager;
import cc.kune.core.client.errors.ErrorHandler;
+import cc.kune.core.client.groups.newgroup.GroupFieldFactory;
import cc.kune.core.client.groups.newgroup.NewGroup;
import cc.kune.core.client.groups.newgroup.NewGroupPanel;
import cc.kune.core.client.groups.newgroup.NewGroupPresenter;
@@ -140,6 +142,9 @@
s(KuneDragController.class);
s(NotImplementedDropManager.class);
+ s(UserFieldFactory.class);
+ s(GroupFieldFactory.class);
+
// Presenters
bindPresenter(CorePresenter.class, CorePresenter.CoreView.class, CoreViewImpl.class,
CorePresenter.CoreProxy.class);
Modified: trunk/src/main/java/cc/kune/core/client/CoreParts.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreParts.java 2011-09-20 14:28:24 UTC (rev 1524)
+++ trunk/src/main/java/cc/kune/core/client/CoreParts.java 2011-09-20 23:21:27 UTC (rev 1525)
@@ -19,8 +19,6 @@
*/
package cc.kune.core.client;
-import cc.kune.core.client.auth.UserFieldFactory;
-import cc.kune.core.client.groups.newgroup.GroupFieldFactory;
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
@@ -40,8 +38,6 @@
final Provider<UserSNPresenter> buddiesAndParticipationPresenter,
final Provider<GroupSNConfActions> groupMembersConfActions,
final Provider<UserSNConfActions> userSNConfActions,
- final Provider<UserFieldFactory> userFielFactory,
- final Provider<GroupFieldFactory> groupFielFactory,
final Provider<SiteUserOptionsPresenter> userOptions) {
session.onAppStart(true, new AppStartHandler() {
@Override
@@ -51,8 +47,6 @@
groupMembersPresenter.get();
buddiesAndParticipationPresenter.get();
userOptions.get();
- userFielFactory.get();
- groupFielFactory.get();
}
});
}
Modified: trunk/src/main/java/cc/kune/core/client/auth/RegisterForm.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/RegisterForm.java 2011-09-20 14:28:24 UTC (rev 1524)
+++ trunk/src/main/java/cc/kune/core/client/auth/RegisterForm.java 2011-09-20 23:21:27 UTC (rev 1525)
@@ -48,14 +48,15 @@
private final TextField<String> shortNameRegField;
- public RegisterForm(final I18nTranslationService i18n, final Session session) {
+ public RegisterForm(final I18nTranslationService i18n, final Session session,
+ final UserFieldFactory userFieldFactory) {
super.addStyleName("kune-Margin-Large-l");
- shortNameRegField = UserFieldFactory.createUserShortName(NICK_FIELD);
+ shortNameRegField = userFieldFactory.createUserShortName(NICK_FIELD);
shortNameRegField.setTabIndex(1);
add(shortNameRegField);
- longNameRegField = UserFieldFactory.createUserLongName(LONGNAME_FIELD);
+ longNameRegField = userFieldFactory.createUserLongName(LONGNAME_FIELD);
longNameRegField.setTabIndex(2);
add(longNameRegField);
Modified: trunk/src/main/java/cc/kune/core/client/auth/RegisterPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/RegisterPanel.java 2011-09-20 14:28:24 UTC (rev 1524)
+++ trunk/src/main/java/cc/kune/core/client/auth/RegisterPanel.java 2011-09-20 23:21:27 UTC (rev 1525)
@@ -47,11 +47,11 @@
@Inject
public RegisterPanel(final I18nTranslationService i18n, final Session session,
- final MaskWidgetView mask, final NotifyLevelImages images) {
+ final MaskWidgetView mask, final NotifyLevelImages images, final UserFieldFactory userFieldFactory) {
super(REGISTER_DIALOG, mask, i18n, i18n.t(CoreMessages.REGISTER_TITLE), true, true, true, "",
i18n.t(CoreMessages.REGISTER_TITLE), REGISTER_BUTTON_ID,
i18n.tWithNT("Cancel", "used in button"), CANCEL_BUTTON_ID, images, ERRMSG, 5);
- registerForm = new RegisterForm(i18n, session);
+ registerForm = new RegisterForm(i18n, session, userFieldFactory);
registerForm.setWidth(330);
registerForm.getFormPanel().setId(REGISTER_FORM);
messageErrorBar = new MessageToolbar(images, errorLabelId);
Modified: trunk/src/main/java/cc/kune/core/client/auth/UserFieldFactory.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/UserFieldFactory.java 2011-09-20 14:28:24 UTC (rev 1524)
+++ trunk/src/main/java/cc/kune/core/client/auth/UserFieldFactory.java 2011-09-20 23:21:27 UTC (rev 1525)
@@ -11,9 +11,14 @@
@Singleton
public class UserFieldFactory {
- private static I18nTranslationService i18n;
+ private final I18nTranslationService i18n;
- public static TextField<String> createUserLongName(final String fieldId) {
+ @Inject
+ public UserFieldFactory(final I18nTranslationService i18n) {
+ this.i18n = i18n;
+ }
+
+ public TextField<String> createUserLongName(final String fieldId) {
final TextField<String> longNameRegField = new TextField<String>();
longNameRegField.setFieldLabel(i18n.t("Name"));
longNameRegField.setName(fieldId);
@@ -25,7 +30,7 @@
return longNameRegField;
}
- public static TextField<String> createUserShortName(final String fieldId) {
+ public TextField<String> createUserShortName(final String fieldId) {
final String minMaxText = i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15);
final TextField<String> field = new TextField<String>();
field.setFieldLabel(i18n.t("Username"));
@@ -43,9 +48,4 @@
return field;
}
- @Inject
- public UserFieldFactory(final I18nTranslationService i18n) {
- UserFieldFactory.i18n = i18n;
- }
-
}
Modified: trunk/src/main/java/cc/kune/core/client/groups/newgroup/GroupFieldFactory.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/groups/newgroup/GroupFieldFactory.java 2011-09-20 14:28:24 UTC (rev 1524)
+++ trunk/src/main/java/cc/kune/core/client/groups/newgroup/GroupFieldFactory.java 2011-09-20 23:21:27 UTC (rev 1525)
@@ -11,9 +11,14 @@
@Singleton
public class GroupFieldFactory {
- private static I18nTranslationService i18n;
+ private final I18nTranslationService i18n;
- public static TextField<String> createUserLongName(final String fieldId) {
+ @Inject
+ public GroupFieldFactory(final I18nTranslationService i18n) {
+ this.i18n = i18n;
+ }
+
+ public TextField<String> createUserLongName(final String fieldId) {
final TextField<String> field = new TextField<String>();
field.setFieldLabel(i18n.t("Long name"));
field.setName(fieldId);
@@ -26,7 +31,7 @@
return field;
}
- public static TextField<String> createUserShortName(final String fieldId) {
+ public TextField<String> createUserShortName(final String fieldId) {
final String minMaxText = i18n.t(CoreMessages.FIELD_MUST_BE_BETWEEN_3_AND_15);
final TextField<String> field = new TextField<String>();
field.setFieldLabel(i18n.t("Short name"));
@@ -43,9 +48,4 @@
field.setValidationDelay(1000);
return field;
}
-
- @Inject
- public GroupFieldFactory(final I18nTranslationService i18n) {
- GroupFieldFactory.i18n = i18n;
- }
}
Modified: trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java 2011-09-20 14:28:24 UTC (rev 1524)
+++ trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPanel.java 2011-09-20 23:21:27 UTC (rev 1525)
@@ -64,6 +64,7 @@
private final BasicTopDialog dialog;
private final FormPanel form;
+ private final GroupFieldFactory groupFieldFactory;
private final I18nTranslationService i18n;
private TextField<String> longNameField;
private final MaskWidgetView mask;
@@ -71,15 +72,16 @@
private Radio orgRadio;
private Radio projectRadio;
private TextArea publicDescField;
+
private TextField<String> shortNameField;
-
private TextField<String> tag1;
private TextField<String> tag2;
private TextField<String> tag3;
@Inject
public NewGroupPanel(final I18nTranslationService i18n, final NotifyLevelImages img,
- final MaskWidgetView mask) {
+ final MaskWidgetView mask, final GroupFieldFactory groupFieldFactory) {
+ this.groupFieldFactory = groupFieldFactory;
final Builder builder = new BasicTopDialog.Builder(NEWGROUP_WIZARD, false, true).autoscroll(true).title(
i18n.t("Register a new group"));
builder.icon("k-newgroup-icon");
@@ -124,11 +126,11 @@
// intro.setStyleName("k-form-intro");
// form.add(intro);
- shortNameField = GroupFieldFactory.createUserShortName(SHORTNAME_FIELD);
+ shortNameField = groupFieldFactory.createUserShortName(SHORTNAME_FIELD);
shortNameField.setTabIndex(1);
form.add(shortNameField);
- longNameField = GroupFieldFactory.createUserLongName(LONGNAME_FIELD);
+ longNameField = groupFieldFactory.createUserLongName(LONGNAME_FIELD);
longNameField.setTabIndex(2);
form.add(longNameField);
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java 2011-09-20 14:28:24 UTC (rev 1524)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/JoinGroupAction.java 2011-09-20 23:21:27 UTC (rev 1525)
@@ -21,13 +21,18 @@
import cc.kune.common.client.actions.Action;
import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.notify.NotifyLevel;
import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.utils.SimpleResponseCallback;
+import cc.kune.core.client.auth.SignIn;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.SocialNetworkServiceAsync;
import cc.kune.core.client.state.AccessRightsClientManager;
import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.SiteTokens;
import cc.kune.core.client.state.StateManager;
+import cc.kune.core.client.state.TokenUtils;
import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.core.shared.dto.SocialNetworkRequestResult;
import cc.kune.core.shared.i18n.I18nTranslationService;
@@ -37,42 +42,66 @@
public class JoinGroupAction extends SNRolAction {
- @Inject
- public JoinGroupAction(final StateManager stateManager, final Session session, final I18nTranslationService i18n,
- final CoreResources res, final Provider<SocialNetworkServiceAsync> snServiceProvider,
- final AccessRightsClientManager rightsClientManager) {
- super(stateManager, session, i18n, res, snServiceProvider, rightsClientManager, AccessRolDTO.Viewer, false,
- true, false);
- putValue(NAME, i18n.t("Participate"));
- putValue(SHORT_DESCRIPTION, i18n.t("Request to participate in this group"));
- putValue(Action.SMALL_ICON, res.addGreen());
- putValue(Action.STYLES, "k-sn-join");
- }
+ private final Provider<SignIn> signIn;
- @Override
- public void actionPerformed(final ActionEvent event) {
- NotifyUser.showProgressProcessing();
- snServiceProvider.get().requestJoinGroup(session.getUserHash(), session.getCurrentState().getStateToken(),
- new AsyncCallbackSimple<SocialNetworkRequestResult>() {
+ @Inject
+ public JoinGroupAction(final StateManager stateManager, final Session session,
+ final I18nTranslationService i18n, final CoreResources res,
+ final Provider<SocialNetworkServiceAsync> snServiceProvider, final Provider<SignIn> signIn,
+ final AccessRightsClientManager rightsClientManager) {
+ super(stateManager, session, i18n, res, snServiceProvider, rightsClientManager, AccessRolDTO.Viewer,
+ false, true, false);
+ this.signIn = signIn;
+ putValue(NAME, i18n.t("Participate"));
+ putValue(SHORT_DESCRIPTION, i18n.t("Request to participate in this group"));
+ putValue(Action.SMALL_ICON, res.addGreen());
+ putValue(Action.STYLES, "k-sn-join");
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ if (session.isLogged()) {
+ NotifyUser.askConfirmation(i18n.t("Confirm, please:"), i18n.t("Do you want to join this group?"),
+ new SimpleResponseCallback() {
+ @Override
+ public void onCancel() {
+ // Do nothing
+ }
+
+ @Override
+ public void onSuccess() {
+ NotifyUser.showProgressProcessing();
+ snServiceProvider.get().requestJoinGroup(session.getUserHash(),
+ session.getCurrentState().getStateToken(),
+ new AsyncCallbackSimple<SocialNetworkRequestResult>() {
@Override
public void onSuccess(final SocialNetworkRequestResult result) {
- NotifyUser.hideProgress();
- switch ((result)) {
- case accepted:
- NotifyUser.info(i18n.t("You are now member of this group"));
- stateManager.refreshCurrentStateWithoutCache();
- break;
- case denied:
- NotifyUser.important(i18n.t("Sorry this is a closed group"));
- break;
- case moderated:
- NotifyUser.info(i18n.t("Membership requested. Waiting for admins decision"));
- break;
- default:
- NotifyUser.info(i18n.t("Programatic error in ParticipateAction"));
- }
+ NotifyUser.hideProgress();
+ switch ((result)) {
+ case accepted:
+ NotifyUser.info(i18n.t("You are now member of this group"));
+ stateManager.refreshCurrentStateWithoutCache();
+ break;
+ case denied:
+ NotifyUser.important(i18n.t("Sorry this is a closed group"));
+ break;
+ case moderated:
+ NotifyUser.info(i18n.t("Membership requested. Waiting for admins decision"));
+ break;
+ default:
+ NotifyUser.info(i18n.t("Programatic error in ParticipateAction"));
+ }
}
- });
+ });
+ }
+ });
+ } else {
+ signIn.get().setErrorMessage(i18n.t("Sign in or create an account to participate in this group"),
+ NotifyLevel.info);
+ stateManager.gotoHistoryToken(TokenUtils.addRedirect(SiteTokens.SIGNIN,
+ session.getCurrentStateToken().toString()));
}
+ }
+
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java 2011-09-20 14:28:24 UTC (rev 1524)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPanel.java 2011-09-20 23:21:27 UTC (rev 1525)
@@ -36,10 +36,10 @@
@Inject
public GroupOptGeneralPanel(final I18nTranslationService i18n, final CoreResources res,
- final MaskWidget maskWidget) {
+ final MaskWidget maskWidget, final GroupFieldFactory groupFieldFactory) {
super(i18n, res, maskWidget);
- shortName = GroupFieldFactory.createUserShortName(SHORT_NAME_FIELD);
- longName = GroupFieldFactory.createUserLongName(LONG_NAME_FIELD);
+ shortName = groupFieldFactory.createUserShortName(SHORT_NAME_FIELD);
+ longName = groupFieldFactory.createUserLongName(LONG_NAME_FIELD);
add(shortName);
add(longName);
}
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 2011-09-20 14:28:24 UTC (rev 1524)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java 2011-09-20 23:21:27 UTC (rev 1525)
@@ -38,10 +38,11 @@
@Inject
public UserOptGeneralPanel(final I18nTranslationService i18n, final CoreResources res,
- final MaskWidget maskWidget, final LanguageSelectorPanel langSelector) {
+ final MaskWidget maskWidget, final LanguageSelectorPanel langSelector,
+ final UserFieldFactory userFieldFactory) {
super(i18n, res, maskWidget);
this.langSelector = langSelector;
- longName = UserFieldFactory.createUserLongName(LONG_NAME_FIELD);
+ longName = userFieldFactory.createUserLongName(LONG_NAME_FIELD);
add(longName);
langSelector.setLangTitle(i18n.t("Your language"));
langSelector.setLabelAlign(LabelAlign.LEFT);
1
0
Author: vjrj_
Date: 2011-09-20 16:28:24 +0200 (Tue, 20 Sep 2011)
New Revision: 1524
Added:
trunk/src/main/java/cc/kune/core/client/sn/actions/EventTargetUtils.java
trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAdmins.java
trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToBuddieHeaderButton.java
trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToMembers.java
trunk/src/main/java/cc/kune/core/server/manager/KuneWaveManager.java
trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java
trunk/src/main/java/cc/kune/wave/server/KuneWaveService.java
trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java
trunk/src/main/java/cc/kune/wave/server/KuneWaveUtils.java
trunk/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java
Removed:
trunk/src/main/java/cc/kune/wave/server/KuneWaveManager.java
trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java
trunk/src/main/java/cc/kune/wave/server/KuneWaveUtils.java
trunk/src/test/java/cc/kune/wave/server/KuneWaveManagerDefaultTest.java
Modified:
trunk/src/main/java/cc/kune/core/client/errors/AccessViolationException.java
trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java
trunk/src/main/java/cc/kune/core/client/sn/actions/GotoGroupAction.java
trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNAdminsMenuItemsRegistry.java
trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNCollabsMenuItemsRegistry.java
trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java
trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java
trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java
trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java
trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
trunk/src/main/java/cc/kune/domain/User.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java
trunk/src/main/java/cc/kune/wave/server/KuneAgent.java
trunk/src/main/java/cc/kune/wave/server/ParticipantUtils.java
trunk/src/main/resources/kune.properties
Log:
CLOSED - # 67: Write to this buddie/members/admins
http://kune.ourproject.org/issues/ticket/67
Modified: trunk/src/main/java/cc/kune/core/client/errors/AccessViolationException.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/errors/AccessViolationException.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/client/errors/AccessViolationException.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -20,5 +20,13 @@
package cc.kune.core.client.errors;
public class AccessViolationException extends DefaultException {
- private static final long serialVersionUID = -3786772632052256999L;
+ private static final long serialVersionUID = -3786772632052256999L;
+
+ public AccessViolationException() {
+ super();
+ }
+
+ public AccessViolationException(final String msg) {
+ super(msg);
+ }
}
Modified: trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/client/errors/ErrorHandler.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -82,8 +82,10 @@
eventBus.fireEvent(new ProgressHideEvent());
if (caught instanceof AccessViolationException) {
logException(caught);
+ final String msg = caught.getMessage();
eventBus.fireEvent(new UserNotifyEvent(NotifyLevel.error,
- i18n.t("You do not have rights to perform that action")));
+ i18n.t("You do not have rights to perform that action")
+ + (TextUtils.empty(msg) ? "" : ". " + i18n.t(msg))));
goHome();
} else if (caught instanceof SessionExpiredException) {
logException(caught);
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -88,4 +88,6 @@
StateAbstractDTO setStatusAsAdmin(String userHash, StateToken stateToken, ContentStatus status);
TagCloudResult setTags(String userHash, StateToken token, String tags) throws DefaultException;
+
+ String writeTo(String userHash, StateToken token, boolean onlyToAdmins) throws DefaultException;
}
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -97,4 +97,6 @@
void setTags(String userHash, StateToken token, String tags,
AsyncCallback<TagCloudResult> asyncCallback);
+ void writeTo(String userHash, StateToken token, boolean onlyToAdmins, AsyncCallback<String> callback);
+
}
Added: trunk/src/main/java/cc/kune/core/client/sn/actions/EventTargetUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/EventTargetUtils.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/EventTargetUtils.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -0,0 +1,28 @@
+package cc.kune.core.client.sn.actions;
+
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.dto.UserSimpleDTO;
+
+public class EventTargetUtils {
+
+ public static StateToken getTargetToken(final ActionEvent event) {
+ StateToken token;
+ final Object target = event.getTarget();
+ if (target instanceof GroupDTO) {
+ token = ((GroupDTO) target).getStateToken();
+ } else {
+ token = ((UserSimpleDTO) target).getStateToken();
+ }
+ return token;
+ }
+
+ public static boolean isPerson(final ActionEvent event) {
+ final Object target = event.getTarget();
+ final boolean isUserDTO = target instanceof UserSimpleDTO;
+ final boolean isGroup = target instanceof GroupDTO;
+ return isUserDTO || (isGroup && ((GroupDTO) target).isPersonal());
+ }
+
+}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/GotoGroupAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/GotoGroupAction.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/GotoGroupAction.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -24,34 +24,25 @@
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.core.shared.dto.UserSimpleDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
import com.google.inject.Inject;
public class GotoGroupAction extends AbstractExtendedAction {
- private final StateManager stateManager;
+ private final StateManager stateManager;
- @Inject
- public GotoGroupAction(final StateManager stateManager, final I18nTranslationService i18n, final CoreResources res) {
- this.stateManager = stateManager;
- putValue(NAME, i18n.t("Visit this group homepage"));
- putValue(Action.SMALL_ICON, res.groupHome());
- }
+ @Inject
+ public GotoGroupAction(final StateManager stateManager, final I18nTranslationService i18n,
+ final CoreResources res) {
+ this.stateManager = stateManager;
+ putValue(NAME, i18n.t("Visit this group homepage"));
+ putValue(Action.SMALL_ICON, res.groupHome());
+ }
- @Override
- public void actionPerformed(final ActionEvent event) {
- StateToken token;
- final Object target = event.getTarget();
- if (target instanceof GroupDTO) {
- token = ((GroupDTO) target).getStateToken();
- } else {
- token = ((UserSimpleDTO) target).getStateToken();
- }
- stateManager.gotoStateToken(token);
- }
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ stateManager.gotoStateToken(EventTargetUtils.getTargetToken(event));
+ }
}
Added: trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAction.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAction.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -0,0 +1,77 @@
+package cc.kune.core.client.sn.actions;
+
+import cc.kune.common.client.actions.AbstractAction;
+import cc.kune.common.client.actions.AbstractExtendedAction;
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.utils.SimpleResponseCallback;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class WriteToAction extends AbstractExtendedAction {
+
+ private final Provider<ContentServiceAsync> contentService;
+ private final I18nTranslationService i18n;
+ private boolean onlyToAdmins;
+ private final Session session;
+ private final StateManager stateManager;
+
+ @Inject
+ public WriteToAction(final Provider<ContentServiceAsync> contentService,
+ final I18nTranslationService i18n, final Session session, final StateManager stateManager,
+ final NavResources res) {
+ this.contentService = contentService;
+ this.i18n = i18n;
+ this.session = session;
+ this.stateManager = stateManager;
+ onlyToAdmins = false;
+ putValue(AbstractAction.SMALL_ICON, res.pageText());
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ boolean isPerson = false;
+ final StateToken token;
+ if (event.getTarget() == null) {
+ token = session.getCurrentStateToken();
+ } else {
+ isPerson = EventTargetUtils.isPerson(event);
+ token = EventTargetUtils.getTargetToken(event);
+ }
+ NotifyUser.askConfirmation(
+ i18n.t("Confirm, please:"),
+ isPerson ? i18n.t("Do you want to write a message to your buddy?")
+ : onlyToAdmins ? i18n.t("Do you want to write a message to the admins of this group?")
+ : i18n.t("Do you want to write a message to the members of this group?"),
+ new SimpleResponseCallback() {
+ @Override
+ public void onCancel() {
+ // Do nothing
+ }
+
+ @Override
+ public void onSuccess() {
+ contentService.get().writeTo(session.getUserHash(), token, onlyToAdmins,
+ new AsyncCallbackSimple<String>() {
+ @Override
+ public void onSuccess(final String url) {
+ stateManager.gotoHistoryToken(url);
+ NotifyUser.info("Now you can edit this message");
+ }
+ });
+ }
+ });
+ }
+
+ public void setOnlyToAdmin(final boolean onlyToAdmins) {
+ this.onlyToAdmins = onlyToAdmins;
+ }
+}
Added: trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAdmins.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAdmins.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAdmins.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -0,0 +1,38 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.core.client.sn.actions;
+
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.core.client.sn.actions.registry.GroupSNConfActions;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class WriteToAdmins extends MenuItemDescriptor {
+
+ @Inject
+ public WriteToAdmins(final WriteToAction action, final I18nTranslationService i18n) {
+ super(action);
+ action.setOnlyToAdmin(true);
+ withText(i18n.t("Write to the admins of this group"));
+ setParent(GroupSNConfActions.OPTIONS_MENU);
+ setPosition(0);
+ }
+}
Added: trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToBuddieHeaderButton.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToBuddieHeaderButton.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToBuddieHeaderButton.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -0,0 +1,73 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.core.client.sn.actions;
+
+import cc.kune.chat.client.ChatClient;
+import cc.kune.common.client.actions.AbstractAction;
+import cc.kune.common.client.actions.PropertyChangeEvent;
+import cc.kune.common.client.actions.PropertyChangeListener;
+import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateChangedEvent;
+import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.client.ws.entheader.EntityHeader;
+import cc.kune.core.shared.dto.GroupDTO;
+import cc.kune.core.shared.dto.StateAbstractDTO;
+
+import com.google.inject.Inject;
+
+public class WriteToBuddieHeaderButton {
+
+ @Inject
+ public WriteToBuddieHeaderButton(final WriteToAction writeToAction, final EntityHeader entityHeader,
+ final StateManager stateManager, final Session session, final ChatClient chatEngine) {
+ final ButtonDescriptor button = new ButtonDescriptor(writeToAction);
+ // button.setVisible(false);
+ button.withText("Write to your buddie");
+ // button.setStyles("k-chat-add-as-buddie");
+ writeToAction.addPropertyChangeListener(new PropertyChangeListener() {
+ @Override
+ public void propertyChange(final PropertyChangeEvent event) {
+ if (event.getPropertyName().equals(AbstractAction.ENABLED)) {
+ button.setVisible((Boolean) event.getNewValue());
+ }
+ }
+ });
+ entityHeader.addAction(button);
+ stateManager.onStateChanged(true, new StateChangedHandler() {
+ @Override
+ public void onStateChanged(final StateChangedEvent event) {
+ final StateAbstractDTO state = event.getState();
+ final GroupDTO group = state.getGroup();
+ final String groupName = group.getShortName();
+ final boolean imLogged = session.isLogged();
+ final boolean isBuddie = chatEngine.isBuddie(groupName);
+ if (imLogged && group.isPersonal() && isBuddie
+ && !session.getCurrentUser().getShortName().equals(groupName)) {
+ button.setTarget(group);
+ writeToAction.setEnabled(true);
+ } else {
+ writeToAction.setEnabled(false);
+ }
+ }
+ });
+ }
+}
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToMembers.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToMembers.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToMembers.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -0,0 +1,38 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.core.client.sn.actions;
+
+import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
+import cc.kune.core.client.sn.actions.registry.GroupSNConfActions;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+
+public class WriteToMembers extends MenuItemDescriptor {
+
+ @Inject
+ public WriteToMembers(final WriteToAction action, final I18nTranslationService i18n) {
+ super(action);
+ action.setOnlyToAdmin(false);
+ withText(i18n.t("Write to the members of this group"));
+ setParent(GroupSNConfActions.OPTIONS_MENU);
+ setPosition(0);
+ }
+}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNAdminsMenuItemsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNAdminsMenuItemsRegistry.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNAdminsMenuItemsRegistry.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -19,6 +19,7 @@
*/
package cc.kune.core.client.sn.actions.registry;
+import cc.kune.chat.client.actions.conditions.IsBuddieCondition;
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.core.client.sn.actions.AcceptJoinGroupAction;
import cc.kune.core.client.sn.actions.ChangeToAdminAction;
@@ -28,6 +29,7 @@
import cc.kune.core.client.sn.actions.GotoMemberAction;
import cc.kune.core.client.sn.actions.GotoYourHomePageAction;
import cc.kune.core.client.sn.actions.RemoveMemberAction;
+import cc.kune.core.client.sn.actions.WriteToAction;
import cc.kune.core.client.sn.actions.conditions.IsCurrentStateAdministrableCondition;
import cc.kune.core.client.sn.actions.conditions.IsGroupCondition;
import cc.kune.core.client.sn.actions.conditions.IsLoggedCondition;
@@ -35,65 +37,81 @@
import cc.kune.core.client.sn.actions.conditions.IsNotMeCondition;
import cc.kune.core.client.sn.actions.conditions.IsPersonCondition;
import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.i18n.I18nTranslationService;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class GroupSNAdminsMenuItemsRegistry extends AbstractSNMembersActionsRegistry {
- @Inject
- public GroupSNAdminsMenuItemsRegistry(final Session session, final IsLoggedCondition isLogged,
- final IsCurrentStateAdministrableCondition isAdministrableCondition, final IsPersonCondition isPersonCondition,
- final IsGroupCondition isGroupCondition, final IsMeCondition isMe, final IsNotMeCondition isNotMe,
- final ChangeToCollabAction changeToCollabAction, final ChangeToAdminAction changeToAdminAction,
- final RemoveMemberAction removeMemberAction, final AcceptJoinGroupAction acceptJoinGroupAction,
- final DenyJoinGroupAction denyJoinGroupAction, final GotoGroupAction gotoGroupAction,
- final GotoMemberAction gotoMemberAction, final GotoYourHomePageAction gotoYourHomePageAction) {
- add(new Provider<MenuItemDescriptor>() {
- @Override
- public MenuItemDescriptor get() {
- final MenuItemDescriptor item = new MenuItemDescriptor(gotoMemberAction);
- item.add(isPersonCondition);
- item.add(isNotMe);
- return item;
- }
- });
- add(new Provider<MenuItemDescriptor>() {
- @Override
- public MenuItemDescriptor get() {
- final MenuItemDescriptor item = new MenuItemDescriptor(gotoYourHomePageAction);
- item.add(isPersonCondition);
- item.add(isMe);
- return item;
- }
- });
- add(new Provider<MenuItemDescriptor>() {
- @Override
- public MenuItemDescriptor get() {
- final MenuItemDescriptor item = new MenuItemDescriptor(gotoGroupAction);
- item.add(isGroupCondition);
- return item;
- }
- });
- add(new Provider<MenuItemDescriptor>() {
- @Override
- public MenuItemDescriptor get() {
- final MenuItemDescriptor item = new MenuItemDescriptor(changeToCollabAction);
- item.add(isAdministrableCondition);
- item.add(isNotMe);
- item.add(isLogged);
- return item;
- }
- });
- add(new Provider<MenuItemDescriptor>() {
- @Override
- public MenuItemDescriptor get() {
- final MenuItemDescriptor item = new MenuItemDescriptor(removeMemberAction);
- item.add(isAdministrableCondition);
- item.add(isNotMe);
- item.add(isLogged);
- return item;
- }
- });
- }
+ @Inject
+ public GroupSNAdminsMenuItemsRegistry(final Session session, final I18nTranslationService i18n,
+ final IsLoggedCondition isLogged,
+ final IsCurrentStateAdministrableCondition isAdministrable,
+ final IsPersonCondition isPerson, final IsGroupCondition isGroup,
+ final IsBuddieCondition isBuddie, final IsMeCondition isMe, final IsNotMeCondition isNotMe,
+ final ChangeToCollabAction changeToCollabAction, final ChangeToAdminAction changeToAdminAction,
+ final RemoveMemberAction removeMemberAction, final AcceptJoinGroupAction acceptJoinGroupAction,
+ final DenyJoinGroupAction denyJoinGroupAction, final GotoGroupAction gotoGroupAction,
+ final GotoMemberAction gotoMemberAction, final GotoYourHomePageAction gotoYourHomePageAction,
+ final WriteToAction writeToAction) {
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(gotoMemberAction);
+ item.add(isPerson);
+ item.add(isNotMe);
+ return item;
+ }
+ });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(gotoYourHomePageAction);
+ item.add(isPerson);
+ item.add(isMe);
+ return item;
+ }
+ });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(writeToAction);
+ item.add(isPerson);
+ item.withText(i18n.t("Write to your buddie"));
+ item.add(isNotMe);
+ item.add(isBuddie);
+ item.add(isLogged);
+ return item;
+ }
+ });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(gotoGroupAction);
+ item.add(isGroup);
+ return item;
+ }
+ });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(changeToCollabAction);
+ item.add(isAdministrable);
+ item.add(isNotMe);
+ item.add(isLogged);
+ return item;
+ }
+ });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(removeMemberAction);
+ item.add(isAdministrable);
+ item.add(isNotMe);
+ item.add(isLogged);
+ return item;
+ }
+ });
+ }
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNCollabsMenuItemsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNCollabsMenuItemsRegistry.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNCollabsMenuItemsRegistry.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -19,6 +19,7 @@
*/
package cc.kune.core.client.sn.actions.registry;
+import cc.kune.chat.client.actions.conditions.IsBuddieCondition;
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.core.client.sn.actions.AcceptJoinGroupAction;
import cc.kune.core.client.sn.actions.ChangeToAdminAction;
@@ -28,69 +29,87 @@
import cc.kune.core.client.sn.actions.GotoMemberAction;
import cc.kune.core.client.sn.actions.GotoYourHomePageAction;
import cc.kune.core.client.sn.actions.RemoveMemberAction;
+import cc.kune.core.client.sn.actions.WriteToAction;
import cc.kune.core.client.sn.actions.conditions.IsCurrentStateAdministrableCondition;
import cc.kune.core.client.sn.actions.conditions.IsGroupCondition;
+import cc.kune.core.client.sn.actions.conditions.IsLoggedCondition;
import cc.kune.core.client.sn.actions.conditions.IsMeCondition;
import cc.kune.core.client.sn.actions.conditions.IsNotMeCondition;
import cc.kune.core.client.sn.actions.conditions.IsPersonCondition;
import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.i18n.I18nTranslationService;
import com.google.inject.Inject;
import com.google.inject.Provider;
public class GroupSNCollabsMenuItemsRegistry extends AbstractSNMembersActionsRegistry {
- @Inject
- public GroupSNCollabsMenuItemsRegistry(final Session session, final IsCurrentStateAdministrableCondition isAdministrableCondition,
- final IsPersonCondition isPersonCondition, final IsGroupCondition isGroupCondition,
- final IsMeCondition isMe, final IsNotMeCondition isNotMe, final ChangeToCollabAction changeToCollabAction,
- final ChangeToAdminAction changeToAdminAction, final RemoveMemberAction removeMemberAction,
- final AcceptJoinGroupAction acceptJoinGroupAction, final DenyJoinGroupAction denyJoinGroupAction,
- final GotoGroupAction gotoGroupAction, final GotoMemberAction gotoMemberAction,
- final GotoYourHomePageAction gotoYourHomePageAction) {
- add(new Provider<MenuItemDescriptor>() {
- @Override
- public MenuItemDescriptor get() {
- final MenuItemDescriptor item = new MenuItemDescriptor(changeToAdminAction);
- item.add(isAdministrableCondition);
- return item;
- }
- });
- add(new Provider<MenuItemDescriptor>() {
- @Override
- public MenuItemDescriptor get() {
- final MenuItemDescriptor item = new MenuItemDescriptor(removeMemberAction);
- item.add(isAdministrableCondition);
- return item;
- }
- });
- add(new Provider<MenuItemDescriptor>() {
- @Override
- public MenuItemDescriptor get() {
- final MenuItemDescriptor item = new MenuItemDescriptor(gotoMemberAction);
- item.add(isPersonCondition);
- item.add(isNotMe);
- return item;
- }
- });
- add(new Provider<MenuItemDescriptor>() {
- @Override
- public MenuItemDescriptor get() {
- final MenuItemDescriptor item = new MenuItemDescriptor(gotoYourHomePageAction);
- item.add(isPersonCondition);
- item.add(isMe);
- return item;
- }
- });
- add(new Provider<MenuItemDescriptor>() {
- @Override
- public MenuItemDescriptor get() {
- final MenuItemDescriptor item = new MenuItemDescriptor(gotoGroupAction);
- item.add(isGroupCondition);
- return item;
- }
- });
+ @Inject
+ public GroupSNCollabsMenuItemsRegistry(final Session session, final I18nTranslationService i18n,
+ final IsLoggedCondition isLogged,
+ final IsCurrentStateAdministrableCondition isAdministrableCondition,
+ final IsPersonCondition isPersonCondition, final IsGroupCondition isGroupCondition,
+ final IsBuddieCondition isBuddie, final IsMeCondition isMe, final IsNotMeCondition isNotMe,
+ final ChangeToCollabAction changeToCollabAction, final ChangeToAdminAction changeToAdminAction,
+ final RemoveMemberAction removeMemberAction, final AcceptJoinGroupAction acceptJoinGroupAction,
+ final DenyJoinGroupAction denyJoinGroupAction, final GotoGroupAction gotoGroupAction,
+ final GotoMemberAction gotoMemberAction, final GotoYourHomePageAction gotoYourHomePageAction,
+ final WriteToAction writeToAction) {
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(changeToAdminAction);
+ item.add(isAdministrableCondition);
+ return item;
+ }
+ });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(removeMemberAction);
+ item.add(isAdministrableCondition);
+ return item;
+ }
+ });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(writeToAction);
+ item.add(isPersonCondition);
+ item.withText(i18n.t("Write to your buddie"));
+ item.add(isNotMe);
+ item.add(isBuddie);
+ item.add(isLogged);
+ return item;
+ }
+ });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(gotoMemberAction);
+ item.add(isPersonCondition);
+ item.add(isNotMe);
+ return item;
+ }
+ });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(gotoYourHomePageAction);
+ item.add(isPersonCondition);
+ item.add(isMe);
+ return item;
+ }
+ });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(gotoGroupAction);
+ item.add(isGroupCondition);
+ return item;
+ }
+ });
- }
+ }
}
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -31,6 +31,8 @@
import cc.kune.core.client.sn.actions.MembersModerationMenuItem;
import cc.kune.core.client.sn.actions.MembersVisibilityMenuItem;
import cc.kune.core.client.sn.actions.UnJoinFromCurrentGroupAction;
+import cc.kune.core.client.sn.actions.WriteToAdmins;
+import cc.kune.core.client.sn.actions.WriteToMembers;
import cc.kune.core.client.sn.actions.conditions.IsGroupCondition;
import cc.kune.core.client.sn.actions.conditions.IsLoggedCondition;
import cc.kune.core.client.state.Session;
@@ -66,6 +68,7 @@
final I18nTranslationService i18n, final Provider<MembersVisibilityMenuItem> membersVisibility,
final Provider<MembersModerationMenuItem> membersModeration, final CoreResources res,
final IsLoggedCondition isLoggedCondition, final JoinGroupAction joinGroupAction,
+ final WriteToMembers writeToMembers, final WriteToAdmins writeToAdmins,
final IsGroupCondition isGroupCondition, final UnJoinFromCurrentGroupAction unJoinGroupAction) {
OPTIONS_MENU.withToolTip(i18n.t("Options")).withIcon(res.arrowdownsitebar()).withStyles(
OPTIONS_STYLES);
Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNMenuItemsRegistry.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -19,6 +19,7 @@
*/
package cc.kune.core.client.sn.actions.registry;
+import cc.kune.chat.client.actions.conditions.IsBuddieCondition;
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
import cc.kune.core.client.sn.actions.AcceptJoinGroupAction;
import cc.kune.core.client.sn.actions.ChangeToAdminAction;
@@ -29,6 +30,7 @@
import cc.kune.core.client.sn.actions.GotoYourHomePageAction;
import cc.kune.core.client.sn.actions.RemoveMemberAction;
import cc.kune.core.client.sn.actions.UnJoinFromThisGroupAction;
+import cc.kune.core.client.sn.actions.WriteToAction;
import cc.kune.core.client.sn.actions.conditions.ImPartOfGroupCondition;
import cc.kune.core.client.sn.actions.conditions.IsCurrentStateAdministrableCondition;
import cc.kune.core.client.sn.actions.conditions.IsGroupCondition;
@@ -37,6 +39,7 @@
import cc.kune.core.client.sn.actions.conditions.IsNotMeCondition;
import cc.kune.core.client.sn.actions.conditions.IsPersonCondition;
import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.i18n.I18nTranslationService;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -45,21 +48,22 @@
public class UserSNMenuItemsRegistry extends AbstractSNMembersActionsRegistry {
@Inject
- public UserSNMenuItemsRegistry(final Session session,
+ public UserSNMenuItemsRegistry(final Session session, final I18nTranslationService i18n,
final IsCurrentStateAdministrableCondition isAdministrableCondition,
- final IsPersonCondition isPersonCondition, final IsGroupCondition isGroupCondition,
- final ImPartOfGroupCondition imPartOfGroup, final IsLoggedCondition isLoggedCondition,
- final IsMeCondition isMe, final IsNotMeCondition isNotMe,
+ final IsPersonCondition isPerson, final IsGroupCondition isGroup,
+ final ImPartOfGroupCondition imPartOfGroup, final IsLoggedCondition isLogged,
+ final IsBuddieCondition isBuddie, final IsMeCondition isMe, final IsNotMeCondition isNotMe,
final ChangeToCollabAction changeToCollabAction, final ChangeToAdminAction changeToAdminAction,
final RemoveMemberAction removeMemberAction, final AcceptJoinGroupAction acceptJoinGroupAction,
final DenyJoinGroupAction denyJoinGroupAction, final GotoGroupAction gotoGroupAction,
final GotoPersonAction gotoPersonAction, final UnJoinFromThisGroupAction unjoinAction,
+ final WriteToAction writeToAction, final WriteToAction writeToActionOnlyAdmins,
final GotoYourHomePageAction gotoYourHomePageAction) {
add(new Provider<MenuItemDescriptor>() {
@Override
public MenuItemDescriptor get() {
final MenuItemDescriptor item = new MenuItemDescriptor(gotoPersonAction);
- item.add(isPersonCondition);
+ item.add(isPerson);
item.add(isNotMe);
return item;
}
@@ -68,30 +72,63 @@
@Override
public MenuItemDescriptor get() {
final MenuItemDescriptor item = new MenuItemDescriptor(gotoGroupAction);
- item.add(isGroupCondition);
+ item.add(isGroup);
return item;
}
});
add(new Provider<MenuItemDescriptor>() {
@Override
public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(writeToAction);
+ item.add(isPerson);
+ item.withText(i18n.t("Write to your buddie"));
+ item.add(isBuddie);
+ item.add(isNotMe);
+ item.add(isLogged);
+ return item;
+ }
+ });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
final MenuItemDescriptor item = new MenuItemDescriptor(gotoYourHomePageAction);
- item.add(isPersonCondition);
+ item.add(isPerson);
item.add(isMe);
return item;
}
});
- // This doesn't works, because its unregister from current state not
- // from target group
add(new Provider<MenuItemDescriptor>() {
@Override
public MenuItemDescriptor get() {
final MenuItemDescriptor item = new MenuItemDescriptor(unjoinAction);
- item.add(isLoggedCondition);
- item.add(isGroupCondition);
+ item.add(isLogged);
+ item.add(isGroup);
item.add(imPartOfGroup);
return item;
}
});
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ writeToActionOnlyAdmins.setOnlyToAdmin(true);
+ final MenuItemDescriptor item = new MenuItemDescriptor(writeToActionOnlyAdmins);
+ item.withText(i18n.t("Write to the admins of this group"));
+ item.add(isLogged);
+ item.add(isGroup);
+ item.add(imPartOfGroup);
+ return item;
+ }
+ });
+ add(new Provider<MenuItemDescriptor>() {
+ @Override
+ public MenuItemDescriptor get() {
+ final MenuItemDescriptor item = new MenuItemDescriptor(writeToAction);
+ item.withText(i18n.t("Write to the members of this group"));
+ item.add(isLogged);
+ item.add(isGroup);
+ item.add(imPartOfGroup);
+ return item;
+ }
+ });
}
}
Modified: trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -57,6 +57,7 @@
import cc.kune.core.server.manager.I18nCountryManager;
import cc.kune.core.server.manager.I18nLanguageManager;
import cc.kune.core.server.manager.I18nTranslationManager;
+import cc.kune.core.server.manager.KuneWaveManager;
import cc.kune.core.server.manager.LicenseManager;
import cc.kune.core.server.manager.RateManager;
import cc.kune.core.server.manager.SocialNetworkManager;
@@ -75,6 +76,7 @@
import cc.kune.core.server.manager.impl.I18nCountryManagerDefault;
import cc.kune.core.server.manager.impl.I18nLanguageManagerDefault;
import cc.kune.core.server.manager.impl.I18nTranslationManagerDefault;
+import cc.kune.core.server.manager.impl.KuneWaveManagerDefault;
import cc.kune.core.server.manager.impl.LicenseManagerDefault;
import cc.kune.core.server.manager.impl.RateManagerDefault;
import cc.kune.core.server.manager.impl.SocialNetworkManagerDefault;
@@ -102,8 +104,8 @@
import cc.kune.domain.SocialNetwork;
import cc.kune.lists.client.rpc.ListsService;
import cc.kune.lists.server.rpc.ListsRPC;
-import cc.kune.wave.server.KuneWaveManager;
-import cc.kune.wave.server.KuneWaveManagerDefault;
+import cc.kune.wave.server.KuneWaveService;
+import cc.kune.wave.server.KuneWaveServiceDefault;
import cc.kune.wave.server.ParticipantUtils;
import com.google.inject.matcher.Matchers;
@@ -158,6 +160,7 @@
bind(StateService.class).to(StateServiceDefault.class);
bind(I18nTranslationService.class).to(I18nTranslationServiceDefault.class);
bind(SessionService.class).to(SessionServiceDefault.class);
+ bind(KuneWaveService.class).to(KuneWaveServiceDefault.class);
bind(XMLActionReader.class);
}
Modified: trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -56,7 +56,7 @@
import cc.kune.domain.finders.ContentFinder;
import cc.kune.domain.finders.I18nLanguageFinder;
import cc.kune.domain.finders.UserFinder;
-import cc.kune.wave.server.KuneWaveManager;
+import cc.kune.wave.server.KuneWaveService;
import cc.kune.wave.server.KuneWaveUtils;
import cc.kune.wave.server.ParticipantUtils;
@@ -70,7 +70,7 @@
private final ContainerFinder containerFinder;
private final ContentFinder contentFinder;
private final FinderService finder;
- private final KuneWaveManager kuneWaveManager;
+ private final KuneWaveService kuneWaveManager;
private final I18nLanguageFinder languageFinder;
private final ParticipantUtils participantUtils;
private final TagUserContentManager tagManager;
@@ -80,7 +80,7 @@
public ContentManagerDefault(final ContentFinder contentFinder, final ContainerFinder containerFinder,
final Provider<EntityManager> provider, final FinderService finder, final UserFinder userFinder,
final I18nLanguageFinder languageFinder, final TagUserContentManager tagManager,
- final KuneWaveManager kuneWaveManager, final ParticipantUtils participantUtils) {
+ final KuneWaveService kuneWaveManager, final ParticipantUtils participantUtils) {
super(provider, Content.class);
this.contentFinder = contentFinder;
this.containerFinder = containerFinder;
@@ -115,7 +115,7 @@
@Override
public Content createContent(final String title, final String body, final User author,
final Container container, final String typeId) {
- return createContent(title, body, author, container, typeId, KuneWaveManager.WITHOUT_GADGET);
+ return createContent(title, body, author, container, typeId, KuneWaveService.WITHOUT_GADGET);
}
@Override
Modified: trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -35,7 +35,7 @@
import cc.kune.domain.Group;
import cc.kune.domain.I18nLanguage;
import cc.kune.domain.User;
-import cc.kune.wave.server.KuneWaveManager;
+import cc.kune.wave.server.KuneWaveService;
import com.google.inject.Inject;
import com.google.inject.Singleton;
@@ -65,7 +65,7 @@
final ServerTool tool = tools.get(toolName);
tool.checkTypesBeforeContentCreation(container.getTypeId(), typeId);
final URL gagdetUrl = tool instanceof ServerWaveTool ? ((ServerWaveTool) tool).getGadgetUrl()
- : KuneWaveManager.WITHOUT_GADGET;
+ : KuneWaveService.WITHOUT_GADGET;
final Content content = contentManager.createContent(title, body, user, container, typeId, gagdetUrl);
tool.onCreateContent(content, container);
return content;
Modified: trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -44,7 +44,7 @@
import cc.kune.domain.I18nTranslation;
import cc.kune.domain.License;
import cc.kune.domain.User;
-import cc.kune.wave.server.KuneWaveManager;
+import cc.kune.wave.server.KuneWaveService;
import com.google.inject.Inject;
import com.google.inject.persist.Transactional;
@@ -53,7 +53,7 @@
private final ContentManager contentManager;
private final I18nCountryManager countryManager;
private final GroupManager groupManager;
- private final KuneWaveManager kuneWaveManager;
+ private final KuneWaveService kuneWaveManager;
private final I18nLanguageManager languageManager;
private final LicenseManager licenseManager;
private final KuneBasicProperties properties;
@@ -65,7 +65,7 @@
final GroupManager groupManager, final LicenseManager licenseManager,
final I18nLanguageManager languageManager, final I18nCountryManager countryManager,
final I18nTranslationManager translationManager, final ContentManager contentManager,
- final KuneWaveManager kuneWaveManager) {
+ final KuneWaveService kuneWaveManager) {
this.properties = properties;
this.userManager = userManager;
this.groupManager = groupManager;
Added: trunk/src/main/java/cc/kune/core/server/manager/KuneWaveManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/KuneWaveManager.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/manager/KuneWaveManager.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -0,0 +1,11 @@
+package cc.kune.core.server.manager;
+
+import cc.kune.domain.User;
+
+public interface KuneWaveManager {
+
+ String sendFeedback(User user, String title, String body);
+
+ String writeTo(User user, String groupName, boolean onlyToAdmins);
+
+}
Added: trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -0,0 +1,84 @@
+package cc.kune.core.server.manager.impl;
+
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import org.waveprotocol.wave.model.wave.ParticipantId;
+
+import cc.kune.core.client.errors.AccessViolationException;
+import cc.kune.core.server.access.AccessRightsUtils;
+import cc.kune.core.server.manager.KuneWaveManager;
+import cc.kune.core.server.manager.UserManager;
+import cc.kune.core.server.properties.KuneProperties;
+import cc.kune.core.shared.domain.AccessRol;
+import cc.kune.domain.Group;
+import cc.kune.domain.User;
+import cc.kune.domain.finders.GroupFinder;
+import cc.kune.domain.utils.UserBuddiesData;
+import cc.kune.wave.server.KuneWaveService;
+import cc.kune.wave.server.KuneWaveUtils;
+import cc.kune.wave.server.ParticipantUtils;
+
+import com.google.inject.Inject;
+import com.google.inject.Singleton;
+
+@Singleton
+public class KuneWaveManagerDefault implements KuneWaveManager {
+
+ private final GroupFinder groupFinder;
+ private final KuneProperties kuneProperties;
+ private final ParticipantUtils participantUtils;
+ private final UserManager userManager;
+ private final KuneWaveService waveService;
+
+ @Inject
+ public KuneWaveManagerDefault(final KuneWaveService waveService,
+ final ParticipantUtils participantUtils, final KuneProperties kuneProperties,
+ final GroupFinder groupFinder, final UserManager userManager) {
+ this.waveService = waveService;
+ this.participantUtils = participantUtils;
+ this.kuneProperties = kuneProperties;
+ this.groupFinder = groupFinder;
+ this.userManager = userManager;
+ }
+
+ @Override
+ public String sendFeedback(final User user, final String title, final String body) {
+ final List<String> participants = kuneProperties.getList(KuneProperties.FEEDBACK_TO);
+ participants.add(0, user.getShortName());
+ final List<ParticipantId> partIds = new ArrayList<ParticipantId>();
+ for (final String part : participants) {
+ partIds.add(participantUtils.of(part));
+ }
+ return KuneWaveUtils.getUrl(waveService.createWave(title, body,
+ partIds.toArray(new ParticipantId[0])));
+ }
+
+ @Override
+ public String writeTo(final User user, final String groupName, final boolean onlyToAdmins) {
+ final Group group = groupFinder.findByShortName(groupName);
+ final Set<Group> toList = new HashSet<Group>();
+ toList.add(user.getUserGroup());
+ if (group.isPersonal()) {
+ final UserBuddiesData userBuddies = userManager.getUserBuddies(groupName);
+ if (userBuddies.contains(user.getShortName())) {
+ toList.add(group);
+ } else {
+ throw new AccessViolationException("You cannot write to non buddies");
+ }
+ } else {
+ if (!AccessRightsUtils.correctMember(user, group, AccessRol.Editor)) {
+ throw new AccessViolationException("You cannot write because you are not a member");
+ }
+ if (onlyToAdmins) {
+ toList.addAll(group.getSocialNetwork().getAccessLists().getAdmins().getList());
+ } else {
+ toList.addAll(group.getSocialNetwork().getAccessLists().getAdmins().getList());
+ toList.addAll(group.getSocialNetwork().getAccessLists().getEditors().getList());
+ }
+ }
+ return KuneWaveUtils.getUrl(waveService.createWave("", participantUtils.listFrom(toList)));
+ }
+}
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -64,7 +64,7 @@
import cc.kune.domain.finders.UserFinder;
import cc.kune.domain.utils.UserBuddiesData;
import cc.kune.wave.server.CustomUserRegistrationServlet;
-import cc.kune.wave.server.KuneWaveManager;
+import cc.kune.wave.server.KuneWaveService;
import cc.kune.wave.server.ParticipantUtils;
import com.google.inject.Inject;
@@ -78,7 +78,7 @@
private final I18nCountryManager countryManager;
private final GroupManager groupManager;
private final I18nTranslationService i18n;
- private final KuneWaveManager kuneWaveManager;
+ private final KuneWaveService kuneWaveManager;
private final I18nLanguageManager languageManager;
private final ParticipantUtils participantUtils;
private final KuneBasicProperties properties;
@@ -92,7 +92,7 @@
final I18nLanguageManager languageManager, final I18nCountryManager countryManager,
final XmppManager xmppManager, final ChatProperties chatProperties,
final I18nTranslationService i18n, final CustomUserRegistrationServlet waveUserRegister,
- final AccountStore waveAccountStore, final KuneWaveManager kuneWaveManager,
+ final AccountStore waveAccountStore, final KuneWaveService kuneWaveManager,
final ParticipantUtils participantUtils, final KuneBasicProperties properties,
final GroupManager groupManager) {
super(provider, User.class);
Modified: trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -19,15 +19,10 @@
*/
package cc.kune.core.server.rpc;
-import java.util.ArrayList;
import java.util.Date;
-import java.util.List;
import javax.persistence.NoResultException;
-import org.waveprotocol.wave.model.wave.ParticipantId;
-import org.waveprotocol.wave.util.escapers.jvm.JavaWaverefEncoder;
-
import cc.kune.chat.server.ChatManager;
import cc.kune.core.client.errors.AccessViolationException;
import cc.kune.core.client.errors.ContentNotFoundException;
@@ -48,9 +43,9 @@
import cc.kune.core.server.content.ContentUtils;
import cc.kune.core.server.content.CreationService;
import cc.kune.core.server.manager.GroupManager;
+import cc.kune.core.server.manager.KuneWaveManager;
import cc.kune.core.server.manager.TagUserContentManager;
import cc.kune.core.server.mapper.Mapper;
-import cc.kune.core.server.properties.KuneProperties;
import cc.kune.core.server.state.StateContainer;
import cc.kune.core.server.state.StateContent;
import cc.kune.core.server.state.StateService;
@@ -71,8 +66,6 @@
import cc.kune.domain.Content;
import cc.kune.domain.Group;
import cc.kune.domain.User;
-import cc.kune.wave.server.KuneWaveManager;
-import cc.kune.wave.server.ParticipantUtils;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -86,14 +79,12 @@
private final CreationService creationService;
private final FinderService finderService;
private final GroupManager groupManager;
- private final KuneProperties kuneProperties;
- private final KuneWaveManager kuneWaveManager;
private final Mapper mapper;
- private final ParticipantUtils participantUtils;
private final AccessRightsService rightsService;
private final StateService stateService;
private final TagUserContentManager tagManager;
private final Provider<UserSession> userSessionProvider;
+ private final KuneWaveManager waveManager;
@Inject
public ContentRPC(final FinderService finderService, final Provider<UserSession> userSessionProvider,
@@ -101,8 +92,7 @@
final StateService stateService, final CreationService creationService,
final GroupManager groupManager, final ContentManager contentManager,
final ContainerManager containerManager, final TagUserContentManager tagManager,
- final Mapper mapper, final ChatManager chatManager, final KuneWaveManager kuneWaveManager,
- final KuneProperties kuneProperties, final ParticipantUtils participantUtils) {
+ final Mapper mapper, final ChatManager chatManager, final KuneWaveManager waveManager) {
this.finderService = finderService;
this.userSessionProvider = userSessionProvider;
this.accessService = accessService;
@@ -115,9 +105,7 @@
this.tagManager = tagManager;
this.mapper = mapper;
this.chatManager = chatManager;
- this.kuneWaveManager = kuneWaveManager;
- this.kuneProperties = kuneProperties;
- this.participantUtils = participantUtils;
+ this.waveManager = waveManager;
}
@Override
@@ -455,14 +443,7 @@
public String sendFeedback(final String userHash, final String title, final String body)
throws DefaultException {
final User user = getCurrentUser();
- final List<String> participants = kuneProperties.getList(KuneProperties.FEEDBACK_TO);
- participants.add(0, user.getShortName());
- final List<ParticipantId> partIds = new ArrayList<ParticipantId>();
- for (final String part : participants) {
- partIds.add(participantUtils.of(part));
- }
- return JavaWaverefEncoder.encodeToUriPathSegment(kuneWaveManager.createWave(title, body,
- partIds.toArray(new ParticipantId[0])));
+ return waveManager.sendFeedback(user, title, body);
}
@Override
@@ -536,4 +517,13 @@
return getSummaryTags(group);
}
+ @Override
+ @Authenticated
+ @Transactional
+ public String writeTo(final String userHash, final StateToken token, final boolean onlyToAdmins)
+ throws DefaultException {
+ final User user = getCurrentUser();
+ return waveManager.writeTo(user, token.getGroup(), onlyToAdmins);
+ }
+
}
Modified: trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -35,7 +35,7 @@
import cc.kune.domain.License;
import cc.kune.domain.Revision;
import cc.kune.domain.User;
-import cc.kune.wave.server.KuneWaveManager;
+import cc.kune.wave.server.KuneWaveService;
import com.google.inject.Inject;
import com.google.inject.Singleton;
@@ -47,7 +47,7 @@
private final ContentManager contentManager;
private final GroupManager groupManager;
private final I18nTranslationService i18n;
- private final KuneWaveManager kuneWaveManager;
+ private final KuneWaveService kuneWaveManager;
private final AccessRightsService rightsService;
private final SocialNetworkManager socialNetworkManager;
private final TagUserContentManager tagManager;
@@ -56,7 +56,7 @@
public StateServiceDefault(final GroupManager groupManager,
final SocialNetworkManager socialNetworkManager, final ContentManager contentManager,
final TagUserContentManager tagManager, final AccessRightsService rightsService,
- final I18nTranslationService i18n, final KuneWaveManager kuneWaveManager) {
+ final I18nTranslationService i18n, final KuneWaveService kuneWaveManager) {
this.groupManager = groupManager;
this.socialNetworkManager = socialNetworkManager;
this.contentManager = contentManager;
Modified: trunk/src/main/java/cc/kune/domain/User.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/User.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/domain/User.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -75,9 +75,6 @@
@Column(nullable = false)
private byte[] diggest;
- // @OneToOne(cascade = CascadeType.REMOVE)
- // private final CustomProperties customProperties;
-
@Column(unique = true, nullable = false)
@Email
@Length(min = 1)
@@ -88,6 +85,9 @@
@GeneratedValue
private Long id;
+ // @OneToOne(cascade = CascadeType.REMOVE)
+ // private final CustomProperties customProperties;
+
@ManyToOne
@NotNull
private I18nLanguage language;
@@ -125,23 +125,10 @@
@OneToOne(cascade = CascadeType.REMOVE)
private Group userGroup;
- // @OneToOne
- // @OnDelete(action = OnDeleteAction.CASCADE)
- // private Properties properties;
-
public User() {
this(null, null, null, null, null, null, null, null, null);
}
- //
- // public User(final String shortName, final String longName, final String
- // email, final String passwd,
- // final I18nLanguage language, final I18nCountry country, final TimeZone
- // timezone) {
- // this(shortName, longName, email, passwd, language, country, timezone,
- // null);
- // }
-
public User(final String shortName, final String longName, final String email, final String passwd,
final byte[] diggets, final byte[] salt, final I18nLanguage language, final I18nCountry country,
final TimeZone timezone) {
@@ -162,6 +149,41 @@
// this.properties = properties;
}
+ // @OneToOne
+ // @OnDelete(action = OnDeleteAction.CASCADE)
+ // private Properties properties;
+
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ final User other = (User) obj;
+ if (shortName == null) {
+ if (other.shortName != null) {
+ return false;
+ }
+ } else if (!shortName.equals(other.shortName)) {
+ return false;
+ }
+ return true;
+ }
+
+ //
+ // public User(final String shortName, final String longName, final String
+ // email, final String passwd,
+ // final I18nLanguage language, final I18nCountry country, final TimeZone
+ // timezone) {
+ // this(shortName, longName, email, passwd, language, country, timezone,
+ // null);
+ // }
+
public I18nCountry getCountry() {
return country;
}
@@ -174,14 +196,14 @@
return diggest;
}
+ public String getEmail() {
+ return email;
+ }
+
// public CustomProperties getCustomProperties() {
// return customProperties;
// }
- public String getEmail() {
- return email;
- }
-
public boolean getHasLogo() {
return hasLogo();
}
@@ -207,14 +229,14 @@
return password;
}
+ public byte[] getSalt() {
+ return salt;
+ }
+
// public Properties getProperties() {
// return properties;
// }
- public byte[] getSalt() {
- return salt;
- }
-
public String getShortName() {
return shortName;
}
@@ -236,6 +258,14 @@
return userGroup;
}
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + ((shortName == null) ? 0 : shortName.hashCode());
+ return result;
+ }
+
@Transient
public boolean hasLogo() {
return getUserGroup().hasLogo();
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -22,6 +22,7 @@
import cc.kune.common.client.ExtendedGinModule;
import cc.kune.core.client.sitebar.search.SitebarSearchPanel;
import cc.kune.core.client.sitebar.search.SitebarSearchPresenter;
+import cc.kune.core.client.sn.actions.WriteToBuddieHeaderButton;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
import cc.kune.gspace.client.actions.GiveUsFeedbackBtn;
import cc.kune.gspace.client.actions.RenameAction;
@@ -186,6 +187,7 @@
s(ContentViewerOptionsMenu.class);
s(RenameAction.class);
s(GiveUsFeedbackBtn.class);
+ s(WriteToBuddieHeaderButton.class);
// LicenseWizard
bindPresenter(LicenseWizardPresenter.class, LicenseWizardView.class, LicenseWizardPanel.class,
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -22,6 +22,7 @@
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
import cc.kune.core.client.sitebar.search.SitebarSearchPresenter;
+import cc.kune.core.client.sn.actions.WriteToBuddieHeaderButton;
import cc.kune.core.client.state.Session;
import cc.kune.gspace.client.actions.GiveUsFeedbackBtn;
import cc.kune.gspace.client.i18n.I18nToTranslateGridPanel;
@@ -70,7 +71,8 @@
final Provider<SiteOptionsI18nTranslatorAction> transAction,
final Provider<GiveUsFeedbackBtn> giveUsFeedback,
final Provider<I18nToTranslateGridPanel> toTrans,
- final Provider<I18nTranslatorTabsCollection> gtranslator) {
+ final Provider<I18nTranslatorTabsCollection> gtranslator,
+ final Provider<WriteToBuddieHeaderButton> writeToBuddie) {
session.onAppStart(true, new AppStartHandler() {
@Override
@@ -109,6 +111,9 @@
if (event.getInitData().isFeedbackEnabled()) {
giveUsFeedback.get();
}
+
+ // Others
+ writeToBuddie.get();
}
});
}
Modified: trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -43,7 +43,7 @@
import cc.kune.domain.Content;
import cc.kune.domain.Group;
import cc.kune.domain.User;
-import cc.kune.wave.server.KuneWaveManager;
+import cc.kune.wave.server.KuneWaveService;
import cc.kune.wave.server.KuneWaveUtils;
import com.google.inject.Inject;
@@ -52,12 +52,12 @@
public class ListsServerTool extends AbstractServerTool {
private final Provider<UserSession> userSessionProvider;
- private final KuneWaveManager waveManager;
+ private final KuneWaveService waveManager;
@Inject
public ListsServerTool(final ContentManager contentManager, final ContainerManager containerManager,
final ToolConfigurationManager configurationManager, final I18nTranslationService i18n,
- final Provider<UserSession> userSessionProvider, final KuneWaveManager waveManager) {
+ final Provider<UserSession> userSessionProvider, final KuneWaveService waveManager) {
super(NAME, ROOT_NAME, TYPE_ROOT, Arrays.asList(TYPE_POST), Arrays.asList(TYPE_LIST),
Arrays.asList(TYPE_LIST), Arrays.asList(TYPE_ROOT), contentManager, containerManager,
configurationManager, i18n, ServerToolTarget.forGroups);
Modified: trunk/src/main/java/cc/kune/wave/server/KuneAgent.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneAgent.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/wave/server/KuneAgent.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -39,7 +39,7 @@
@SuppressWarnings("serial")
@Singleton
-public class KuneAgent extends AbstractBaseRobotAgent implements KuneWaveManager {
+public class KuneAgent extends AbstractBaseRobotAgent implements KuneWaveService {
private static final Logger LOG = Logger.getLogger(KuneAgent.class.getName());
Deleted: trunk/src/main/java/cc/kune/wave/server/KuneWaveManager.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveManager.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveManager.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -1,61 +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.wave.server;
-
-import java.net.URL;
-
-import org.waveprotocol.wave.model.id.WaveId;
-import org.waveprotocol.wave.model.id.WaveletId;
-import org.waveprotocol.wave.model.wave.ParticipantId;
-import org.waveprotocol.wave.model.waveref.WaveRef;
-
-import com.google.wave.api.Wavelet;
-
-public interface KuneWaveManager {
- public static final URL WITHOUT_GADGET = null;
-
- void addGadget(WaveRef waveName, String author, String gadgetUrl);
-
- void addParticipants(WaveRef waveName, String author, String userWhoAdd, String... newParticipants);
-
- WaveRef createWave(String message, ParticipantId... participants);
-
- WaveRef createWave(String title, String message, ParticipantId... participantsArray);
-
- WaveRef createWave(String title, String message, String waveIdToCopy, URL gadgetUrl,
- ParticipantId... participantsArray);
-
- WaveRef createWave(String title, String message, URL gadgetUrl, ParticipantId... participantsArray);
-
- void delParticipants(WaveRef waveName, String whoDel, String... participants);
-
- Wavelet fetchWave(WaveId waveId, WaveletId waveletId, String author);
-
- Wavelet fetchWave(WaveRef waveRef, String author);
-
- boolean isParticipant(Wavelet wavelet, String user);
-
- String render(Wavelet wavelet);
-
- String render(WaveRef waveRef, String author);
-
- void setTitle(WaveRef waveName, String title, String author);
-
-}
Deleted: trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -1,446 +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.wave.server;
-
-import java.net.URL;
-import java.util.Collections;
-import java.util.HashMap;
-import java.util.HashSet;
-import java.util.List;
-import java.util.Map;
-import java.util.Map.Entry;
-import java.util.Set;
-
-import javax.annotation.Nonnull;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.waveprotocol.box.server.CoreSettings;
-import org.waveprotocol.box.server.robots.OperationContextImpl;
-import org.waveprotocol.box.server.robots.OperationServiceRegistry;
-import org.waveprotocol.box.server.robots.util.ConversationUtil;
-import org.waveprotocol.box.server.robots.util.OperationUtil;
-import org.waveprotocol.box.server.waveserver.WaveletProvider;
-import org.waveprotocol.box.server.waveserver.WaveletProvider.SubmitRequestListener;
-import org.waveprotocol.wave.model.id.InvalidIdException;
-import org.waveprotocol.wave.model.id.WaveId;
-import org.waveprotocol.wave.model.id.WaveletId;
-import org.waveprotocol.wave.model.version.HashedVersion;
-import org.waveprotocol.wave.model.wave.ParticipantId;
-import org.waveprotocol.wave.model.waveref.WaveRef;
-
-import cc.kune.common.client.utils.TextUtils;
-import cc.kune.core.client.errors.DefaultException;
-
-import com.google.common.collect.Lists;
-import com.google.common.collect.Maps;
-import com.google.inject.Inject;
-import com.google.inject.name.Named;
-import com.google.wave.api.Annotation;
-import com.google.wave.api.ApiIdSerializer;
-import com.google.wave.api.Blip;
-import com.google.wave.api.BlipContent;
-import com.google.wave.api.BlipData;
-import com.google.wave.api.BlipThread;
-import com.google.wave.api.Element;
-import com.google.wave.api.ElementType;
-import com.google.wave.api.FormElement;
-import com.google.wave.api.Gadget;
-import com.google.wave.api.Image;
-import com.google.wave.api.JsonRpcConstant.ParamsProperty;
-import com.google.wave.api.JsonRpcResponse;
-import com.google.wave.api.Line;
-import com.google.wave.api.OperationQueue;
-import com.google.wave.api.OperationRequest;
-import com.google.wave.api.OperationRequest.Parameter;
-import com.google.wave.api.ProtocolVersion;
-import com.google.wave.api.Range;
-import com.google.wave.api.Wavelet;
-import com.google.wave.api.data.converter.EventDataConverterManager;
-import com.google.wave.api.impl.DocumentModifyAction;
-import com.google.wave.api.impl.DocumentModifyAction.BundledAnnotation;
-import com.google.wave.api.impl.DocumentModifyAction.ModifyHow;
-import com.google.wave.api.impl.WaveletData;
-import com.google.wave.splash.rpc.ClientAction;
-import com.google.wave.splash.web.template.WaveRenderer;
-
-public class KuneWaveManagerDefault implements KuneWaveManager {
- public static final Log LOG = LogFactory.getLog(KuneWaveManagerDefault.class);
-
- // See: DocumentModifyServiceTest
- private static final String NO_ANNOTATION_KEY = null;
- private static final List<BundledAnnotation> NO_BUNDLED_ANNOTATIONS = Collections.emptyList();
- private static final String NO_TITLE = "";
- private static final List<String> NO_VALUES = Collections.<String> emptyList();
- private static final String NO_WAVE_TO_COPY = null;
-
- /**
- *
- * Copy blips
- *
- * @param fromBlip
- * @param toBlip
- *
- * @author yurize(a)apache.org (Yuri Zelikov)
- *
- */
- public static void copyWavelet(final Blip fromBlip, final Blip toBlip) {
- for (final BlipContent blipContent : fromBlip.all().values()) {
- toBlip.append(blipContent);
- }
- // Deep copy annotations
- for (final Annotation annotation : fromBlip.getAnnotations()) {
- final Range range = annotation.getRange();
- try {
- toBlip.range(range.getStart() + 1, range.getEnd() + 1).annotate(annotation.getName(),
- annotation.getValue());
- } catch (final IndexOutOfBoundsException e) {
- // Don't copy faulty annotations
- }
- }
- }
-
- public static void copyWaveletElements(final Blip fromBlip, final Blip toBlip) {
- // Deep copy form elements.
- // DocumentModifyService don't permit this:
- // "Can't insert other elements than text and gadgets at the moment");
- for (final Entry<Integer, Element> entry : fromBlip.getElements().entrySet()) {
- final ElementType type = entry.getValue().getType();
- Element result = null;
- if (FormElement.getFormElementTypes().contains(type)) {
- result = new FormElement(type, entry.getValue().getProperties());
- } else if (type == ElementType.GADGET) {
- result = new Gadget(entry.getValue().getProperties());
- } else if (type == ElementType.IMAGE) {
- result = new Image(entry.getValue().getProperties());
- } else if (type == ElementType.LINE) {
- result = new Line(entry.getValue().getProperties());
- } else {
- result = new Element(type, entry.getValue().getProperties());
- }
- toBlip.append(result);
- }
- }
-
- private final ConversationUtil conversationUtil;
- private final EventDataConverterManager converterManager;
- private final String domain;
- private final OperationServiceRegistry operationRegistry;
- private final ParticipantUtils participantUtils;
- private final WaveletProvider waveletProvider;
- private final WaveRenderer waveRenderer;
-
- @Inject
- public KuneWaveManagerDefault(final EventDataConverterManager converterManager,
- @Named("DataApiRegistry") final OperationServiceRegistry operationRegistry,
- final WaveletProvider waveletProvider, final ConversationUtil conversationUtil,
- final ParticipantUtils participantUtils, final WaveRenderer waveRenderer,
- @Named(CoreSettings.WAVE_SERVER_DOMAIN) final String domain) {
- this.converterManager = converterManager;
- this.waveletProvider = waveletProvider;
- this.conversationUtil = conversationUtil;
- this.operationRegistry = operationRegistry;
- this.participantUtils = participantUtils;
- this.waveRenderer = waveRenderer;
- this.domain = domain;
- }
-
- @Override
- public void addGadget(final WaveRef waveName, final String author, final String gadgetUrl) {
- // See DocumentModifyServiceTest
- final List<Element> elementsIn = Lists.newArrayListWithCapacity(1);
- final Map<String, String> properties = Maps.newHashMap();
- properties.put(Gadget.URL, gadgetUrl);
- properties.put(Gadget.AUTHOR, participantUtils.of(author).getAddress());
- final Gadget gadget = new Gadget(properties);
-
- elementsIn.add(gadget);
- final Wavelet wavelet = fetchWave(waveName, author);
- final OperationQueue opQueue = new OperationQueue();
- final Blip rootBlip = wavelet.getRootBlip();
-
- opQueue.modifyDocument(rootBlip).addParameter(
- Parameter.of(ParamsProperty.MODIFY_ACTION, new DocumentModifyAction(ModifyHow.INSERT, NO_VALUES,
- NO_ANNOTATION_KEY, elementsIn, NO_BUNDLED_ANNOTATIONS, false)));
- opQueue.modifyDocument(rootBlip).addParameter(Parameter.of(ParamsProperty.INDEX, 1));
- doOperation(author, opQueue, "add gadget");
- }
-
- @Override
- public void addParticipants(final WaveRef waveName, final String author, final String userWhoAdds,
- final String... newLocalParticipants) {
- final Wavelet wavelet = fetchWave(waveName, author);
- final OperationQueue opQueue = new OperationQueue();
-
- for (final String newLocalParticipant : newLocalParticipants) {
- final String newPartWithDomain = participantUtils.of(newLocalParticipant).toString();
- boolean mustAdd = true;
- for (final String current : wavelet.getParticipants()) {
- if (current.equals(newPartWithDomain)) {
- // Current user is a participant already (issue #73)
- mustAdd = false;
- break;
- }
- }
- if (mustAdd) {
- opQueue.addParticipantToWavelet(wavelet, newPartWithDomain);
- }
- }
- if (opQueue.getPendingOperations().size() > 0) {
- final String whoAdd = wavelet.getParticipants().contains(participantUtils.of(userWhoAdds)) ? userWhoAdds
- : author;
- doOperation(whoAdd, opQueue, "add participant");
- }
- }
-
- @Override
- public WaveRef createWave(final String message, final ParticipantId... participants) {
- return createWave(NO_TITLE, message, participants);
- }
-
- @Override
- public WaveRef createWave(@Nonnull final String title, final String message,
- @Nonnull final ParticipantId... participantsArray) {
- return createWave(title, message, WITHOUT_GADGET, participantsArray);
- }
-
- @Override
- public WaveRef createWave(@Nonnull final String title, final String message,
- final String waveIdToCopy, final URL gadgetUrl, @Nonnull final ParticipantId... participantsArray) {
- String newWaveId = null;
- String newWaveletId = null;
- final Set<String> participants = new HashSet<String>();
- for (final ParticipantId participant : participantsArray) {
- participants.add(participant.toString());
- }
- final ParticipantId user = participantsArray[0];
- final OperationQueue opQueue = new OperationQueue();
- final Wavelet newWavelet = opQueue.createWavelet(domain, participants);
- opQueue.setTitleOfWavelet(newWavelet, title);
- final Blip rootBlip = newWavelet.getRootBlip();
- rootBlip.append(new com.google.wave.api.Markup(message).getText());
-
- if (waveIdToCopy != NO_WAVE_TO_COPY) {
- try {
- WaveId copyWaveId;
- copyWaveId = WaveId.ofChecked(domain, waveIdToCopy);
- final Wavelet waveletToCopy = fetchWave(copyWaveId, WaveletId.of(domain, "conv+root"),
- participantsArray[0].toString());
- if (waveletToCopy != null) {
- copyWavelet(waveletToCopy.getRootBlip(), rootBlip);
- }
- } catch (final InvalidIdException e) {
- LOG.error("Error copying wave content", e);
- } catch (final DefaultException e2) {
- LOG.error("Error copying wave content", e2);
- }
- }
-
- if (gadgetUrl != WITHOUT_GADGET) {
- final Gadget gadget = new Gadget(gadgetUrl.toString());
- rootBlip.append(gadget);
- }
-
- final OperationContextImpl context = new OperationContextImpl(waveletProvider,
- converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
- for (final OperationRequest req : opQueue.getPendingOperations()) {
- OperationUtil.executeOperation(req, operationRegistry, context, user);
- final String reqId = req.getId();
- final JsonRpcResponse response = context.getResponse(reqId);
- if (response != null) {
- if (response.isError()) {
- onFailure(context.getResponse(reqId).getErrorMessage());
- } else {
- final Object responseWaveId = response.getData().get(ParamsProperty.WAVE_ID);
- final Object responseWaveletId = response.getData().get(ParamsProperty.WAVELET_ID);
- if (responseWaveId != null && responseWaveletId != null) {
- // This is serialized use
- // ApiIdSerializer.instance().deserialiseWaveId (see
- // WaveService)
- newWaveId = (String) responseWaveId;
- newWaveletId = (String) responseWaveletId;
- }
- }
- }
- }
- OperationUtil.submitDeltas(context, waveletProvider, new SubmitRequestListener() {
- @Override
- public void onFailure(final String arg0) {
- KuneWaveManagerDefault.this.onFailure("Wave creation failed, onFailure: " + arg0);
- }
-
- @Override
- public void onSuccess(final int arg0, final HashedVersion arg1, final long arg2) {
- LOG.info("Wave creation success: " + arg1);
- }
- });
- LOG.info("WaveId: " + newWaveId + " waveletId: " + newWaveletId);
- WaveRef wavename;
- try {
- wavename = WaveRef.of(ApiIdSerializer.instance().deserialiseWaveId(newWaveId),
- ApiIdSerializer.instance().deserialiseWaveletId(newWaveletId));
- } catch (final InvalidIdException e) {
- throw new DefaultException("Error getting wave id");
- }
- return wavename;
- }
-
- @Override
- public WaveRef createWave(@Nonnull final String title, final String message, final URL gadgetUrl,
- @Nonnull final ParticipantId... participantsArray) {
- return createWave(title, message, NO_WAVE_TO_COPY, gadgetUrl, participantsArray);
- }
-
- @Override
- public void delParticipants(final WaveRef waveName, final String whoDel, final String... participants) {
- final Wavelet wavelet = fetchWave(waveName, whoDel);
- final OperationQueue opQueue = new OperationQueue();
-
- for (final String participant : participants) {
- final String partWithDomain = participantUtils.of(participant).toString();
- boolean mustDel = false;
- for (final String current : wavelet.getParticipants()) {
- if (current.equals(partWithDomain)) {
- mustDel = true;
- break;
- }
- }
- if (mustDel) {
- opQueue.removeParticipantFromWavelet(wavelet, partWithDomain);
- }
- }
- if (opQueue.getPendingOperations().size() > 0) {
- doOperation(whoDel, opQueue, "add participant");
- }
- }
-
- private void doOperation(final String author, final OperationQueue opQueue, final String logComment) {
- final OperationContextImpl context = new OperationContextImpl(waveletProvider,
- converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
- final OperationRequest request = opQueue.getPendingOperations().get(0);
- OperationUtil.executeOperation(request, operationRegistry, context, participantUtils.of(author));
- final String reqId = request.getId();
- final JsonRpcResponse response = context.getResponse(reqId);
- if (response != null && response.isError()) {
- onFailure(context.getResponse(reqId).getErrorMessage());
- }
- OperationUtil.submitDeltas(context, waveletProvider, new SubmitRequestListener() {
- @Override
- public void onFailure(final String arg0) {
- KuneWaveManagerDefault.this.onFailure("Wave " + logComment + " failed, onFailure: " + arg0);
- }
-
- @Override
- public void onSuccess(final int arg0, final HashedVersion arg1, final long arg2) {
- LOG.info("Wave " + logComment + " success: " + arg1);
- }
- });
- }
-
- public void doOperations(final WaveRef waveName, final String author, final OperationQueue opQueue,
- final SubmitRequestListener listener) {
- final OperationContextImpl context = new OperationContextImpl(waveletProvider,
- converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
- for (final OperationRequest req : opQueue.getPendingOperations()) {
- OperationUtil.executeOperation(req, operationRegistry, context, participantUtils.of(author));
- }
- OperationUtil.submitDeltas(context, waveletProvider, listener);
- }
-
- @Override
- public Wavelet fetchWave(final WaveId waveId, final WaveletId waveletId, final String author) {
- final OperationQueue opQueue = new OperationQueue();
- opQueue.fetchWavelet(waveId, waveletId);
- Wavelet wavelet = null;
- final OperationContextImpl context = new OperationContextImpl(waveletProvider,
- converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
- final OperationRequest request = opQueue.getPendingOperations().get(0);
- OperationUtil.executeOperation(request, operationRegistry, context, participantUtils.of(author));
- final String reqId = request.getId();
- final JsonRpcResponse response = context.getResponse(reqId);
- if (response != null && response.isError()) {
- onFailure(context.getResponse(reqId).getErrorMessage());
- } else {
- // Duplicate code from WaveService
- final WaveletData waveletData = (WaveletData) response.getData().get(ParamsProperty.WAVELET_DATA);
- final Map<String, Blip> blips = new HashMap<String, Blip>();
- final Map<String, BlipThread> threads = new HashMap<String, BlipThread>();
- wavelet = Wavelet.deserialize(opQueue, blips, threads, waveletData);
-
- // Deserialize threads.
- @SuppressWarnings("unchecked")
- final Map<String, BlipThread> tempThreads = (Map<String, BlipThread>) response.getData().get(
- ParamsProperty.THREADS);
- for (final Map.Entry<String, BlipThread> entry : tempThreads.entrySet()) {
- final BlipThread thread = entry.getValue();
- threads.put(entry.getKey(),
- new BlipThread(thread.getId(), thread.getLocation(), thread.getBlipIds(), blips));
- }
-
- // Deserialize blips.
- @SuppressWarnings("unchecked")
- final Map<String, BlipData> blipDatas = (Map<String, BlipData>) response.getData().get(
- ParamsProperty.BLIPS);
- for (final Map.Entry<String, BlipData> entry : blipDatas.entrySet()) {
- blips.put(entry.getKey(), Blip.deserialize(opQueue, wavelet, entry.getValue()));
- }
- }
- return wavelet;
- }
-
- @Override
- public Wavelet fetchWave(final WaveRef waveName, final String author) {
- final WaveId waveId = waveName.getWaveId();
- final WaveletId waveletId = waveName.getWaveletId();
- return fetchWave(waveId, waveletId, author);
- }
-
- @Override
- public boolean isParticipant(final Wavelet wavelet, final String user) {
- return wavelet.getParticipants().contains(participantUtils.of(user).toString());
- }
-
- private void onFailure(final String message) {
- final String errorMsg = TextUtils.notEmpty(message) ? message : "Wave operation failed";
- LOG.error(errorMsg);
- throw new DefaultException(errorMsg);
- }
-
- @Override
- public String render(final Wavelet wavelet) {
- final ClientAction clientPage = waveRenderer.render(wavelet, 0);
- final String html = clientPage.getHtml();
- return html;
- }
-
- @Override
- public String render(final WaveRef waveRef, final String author) {
- return render(fetchWave(waveRef, author));
- }
-
- @Override
- public void setTitle(final WaveRef waveName, final String title, final String author) {
- final Wavelet wavelet = fetchWave(waveName, author);
- final OperationQueue opQueue = new OperationQueue();
- opQueue.setTitleOfWavelet(wavelet, title);
- doOperation(author, opQueue, "set title");
- }
-
-}
Copied: trunk/src/main/java/cc/kune/wave/server/KuneWaveService.java (from rev 1523, trunk/src/main/java/cc/kune/wave/server/KuneWaveManager.java)
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveService.java (rev 0)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveService.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -0,0 +1,61 @@
+/*
+ *
+ * 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.wave.server;
+
+import java.net.URL;
+
+import org.waveprotocol.wave.model.id.WaveId;
+import org.waveprotocol.wave.model.id.WaveletId;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+import org.waveprotocol.wave.model.waveref.WaveRef;
+
+import com.google.wave.api.Wavelet;
+
+public interface KuneWaveService {
+ public static final URL WITHOUT_GADGET = null;
+
+ void addGadget(WaveRef waveName, String author, String gadgetUrl);
+
+ void addParticipants(WaveRef waveName, String author, String userWhoAdd, String... newParticipants);
+
+ WaveRef createWave(String message, ParticipantId... participants);
+
+ WaveRef createWave(String title, String message, ParticipantId... participantsArray);
+
+ WaveRef createWave(String title, String message, String waveIdToCopy, URL gadgetUrl,
+ ParticipantId... participantsArray);
+
+ WaveRef createWave(String title, String message, URL gadgetUrl, ParticipantId... participantsArray);
+
+ void delParticipants(WaveRef waveName, String whoDel, String... participants);
+
+ Wavelet fetchWave(WaveId waveId, WaveletId waveletId, String author);
+
+ Wavelet fetchWave(WaveRef waveRef, String author);
+
+ boolean isParticipant(Wavelet wavelet, String user);
+
+ String render(Wavelet wavelet);
+
+ String render(WaveRef waveRef, String author);
+
+ void setTitle(WaveRef waveName, String title, String author);
+
+}
Copied: trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java (from rev 1523, trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java)
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java (rev 0)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -0,0 +1,446 @@
+/*
+ *
+ * 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.wave.server;
+
+import java.net.URL;
+import java.util.Collections;
+import java.util.HashMap;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Map;
+import java.util.Map.Entry;
+import java.util.Set;
+
+import javax.annotation.Nonnull;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.waveprotocol.box.server.CoreSettings;
+import org.waveprotocol.box.server.robots.OperationContextImpl;
+import org.waveprotocol.box.server.robots.OperationServiceRegistry;
+import org.waveprotocol.box.server.robots.util.ConversationUtil;
+import org.waveprotocol.box.server.robots.util.OperationUtil;
+import org.waveprotocol.box.server.waveserver.WaveletProvider;
+import org.waveprotocol.box.server.waveserver.WaveletProvider.SubmitRequestListener;
+import org.waveprotocol.wave.model.id.InvalidIdException;
+import org.waveprotocol.wave.model.id.WaveId;
+import org.waveprotocol.wave.model.id.WaveletId;
+import org.waveprotocol.wave.model.version.HashedVersion;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+import org.waveprotocol.wave.model.waveref.WaveRef;
+
+import cc.kune.common.client.utils.TextUtils;
+import cc.kune.core.client.errors.DefaultException;
+
+import com.google.common.collect.Lists;
+import com.google.common.collect.Maps;
+import com.google.inject.Inject;
+import com.google.inject.name.Named;
+import com.google.wave.api.Annotation;
+import com.google.wave.api.ApiIdSerializer;
+import com.google.wave.api.Blip;
+import com.google.wave.api.BlipContent;
+import com.google.wave.api.BlipData;
+import com.google.wave.api.BlipThread;
+import com.google.wave.api.Element;
+import com.google.wave.api.ElementType;
+import com.google.wave.api.FormElement;
+import com.google.wave.api.Gadget;
+import com.google.wave.api.Image;
+import com.google.wave.api.JsonRpcConstant.ParamsProperty;
+import com.google.wave.api.JsonRpcResponse;
+import com.google.wave.api.Line;
+import com.google.wave.api.OperationQueue;
+import com.google.wave.api.OperationRequest;
+import com.google.wave.api.OperationRequest.Parameter;
+import com.google.wave.api.ProtocolVersion;
+import com.google.wave.api.Range;
+import com.google.wave.api.Wavelet;
+import com.google.wave.api.data.converter.EventDataConverterManager;
+import com.google.wave.api.impl.DocumentModifyAction;
+import com.google.wave.api.impl.DocumentModifyAction.BundledAnnotation;
+import com.google.wave.api.impl.DocumentModifyAction.ModifyHow;
+import com.google.wave.api.impl.WaveletData;
+import com.google.wave.splash.rpc.ClientAction;
+import com.google.wave.splash.web.template.WaveRenderer;
+
+public class KuneWaveServiceDefault implements KuneWaveService {
+ public static final Log LOG = LogFactory.getLog(KuneWaveServiceDefault.class);
+
+ // See: DocumentModifyServiceTest
+ private static final String NO_ANNOTATION_KEY = null;
+ private static final List<BundledAnnotation> NO_BUNDLED_ANNOTATIONS = Collections.emptyList();
+ private static final String NO_TITLE = "";
+ private static final List<String> NO_VALUES = Collections.<String> emptyList();
+ private static final String NO_WAVE_TO_COPY = null;
+
+ /**
+ *
+ * Copy blips
+ *
+ * @param fromBlip
+ * @param toBlip
+ *
+ * @author yurize(a)apache.org (Yuri Zelikov)
+ *
+ */
+ public static void copyWavelet(final Blip fromBlip, final Blip toBlip) {
+ for (final BlipContent blipContent : fromBlip.all().values()) {
+ toBlip.append(blipContent);
+ }
+ // Deep copy annotations
+ for (final Annotation annotation : fromBlip.getAnnotations()) {
+ final Range range = annotation.getRange();
+ try {
+ toBlip.range(range.getStart() + 1, range.getEnd() + 1).annotate(annotation.getName(),
+ annotation.getValue());
+ } catch (final IndexOutOfBoundsException e) {
+ // Don't copy faulty annotations
+ }
+ }
+ }
+
+ public static void copyWaveletElements(final Blip fromBlip, final Blip toBlip) {
+ // Deep copy form elements.
+ // DocumentModifyService don't permit this:
+ // "Can't insert other elements than text and gadgets at the moment");
+ for (final Entry<Integer, Element> entry : fromBlip.getElements().entrySet()) {
+ final ElementType type = entry.getValue().getType();
+ Element result = null;
+ if (FormElement.getFormElementTypes().contains(type)) {
+ result = new FormElement(type, entry.getValue().getProperties());
+ } else if (type == ElementType.GADGET) {
+ result = new Gadget(entry.getValue().getProperties());
+ } else if (type == ElementType.IMAGE) {
+ result = new Image(entry.getValue().getProperties());
+ } else if (type == ElementType.LINE) {
+ result = new Line(entry.getValue().getProperties());
+ } else {
+ result = new Element(type, entry.getValue().getProperties());
+ }
+ toBlip.append(result);
+ }
+ }
+
+ private final ConversationUtil conversationUtil;
+ private final EventDataConverterManager converterManager;
+ private final String domain;
+ private final OperationServiceRegistry operationRegistry;
+ private final ParticipantUtils participantUtils;
+ private final WaveletProvider waveletProvider;
+ private final WaveRenderer waveRenderer;
+
+ @Inject
+ public KuneWaveServiceDefault(final EventDataConverterManager converterManager,
+ @Named("DataApiRegistry") final OperationServiceRegistry operationRegistry,
+ final WaveletProvider waveletProvider, final ConversationUtil conversationUtil,
+ final ParticipantUtils participantUtils, final WaveRenderer waveRenderer,
+ @Named(CoreSettings.WAVE_SERVER_DOMAIN) final String domain) {
+ this.converterManager = converterManager;
+ this.waveletProvider = waveletProvider;
+ this.conversationUtil = conversationUtil;
+ this.operationRegistry = operationRegistry;
+ this.participantUtils = participantUtils;
+ this.waveRenderer = waveRenderer;
+ this.domain = domain;
+ }
+
+ @Override
+ public void addGadget(final WaveRef waveName, final String author, final String gadgetUrl) {
+ // See DocumentModifyServiceTest
+ final List<Element> elementsIn = Lists.newArrayListWithCapacity(1);
+ final Map<String, String> properties = Maps.newHashMap();
+ properties.put(Gadget.URL, gadgetUrl);
+ properties.put(Gadget.AUTHOR, participantUtils.of(author).getAddress());
+ final Gadget gadget = new Gadget(properties);
+
+ elementsIn.add(gadget);
+ final Wavelet wavelet = fetchWave(waveName, author);
+ final OperationQueue opQueue = new OperationQueue();
+ final Blip rootBlip = wavelet.getRootBlip();
+
+ opQueue.modifyDocument(rootBlip).addParameter(
+ Parameter.of(ParamsProperty.MODIFY_ACTION, new DocumentModifyAction(ModifyHow.INSERT, NO_VALUES,
+ NO_ANNOTATION_KEY, elementsIn, NO_BUNDLED_ANNOTATIONS, false)));
+ opQueue.modifyDocument(rootBlip).addParameter(Parameter.of(ParamsProperty.INDEX, 1));
+ doOperation(author, opQueue, "add gadget");
+ }
+
+ @Override
+ public void addParticipants(final WaveRef waveName, final String author, final String userWhoAdds,
+ final String... newLocalParticipants) {
+ final Wavelet wavelet = fetchWave(waveName, author);
+ final OperationQueue opQueue = new OperationQueue();
+
+ for (final String newLocalParticipant : newLocalParticipants) {
+ final String newPartWithDomain = participantUtils.of(newLocalParticipant).toString();
+ boolean mustAdd = true;
+ for (final String current : wavelet.getParticipants()) {
+ if (current.equals(newPartWithDomain)) {
+ // Current user is a participant already (issue #73)
+ mustAdd = false;
+ break;
+ }
+ }
+ if (mustAdd) {
+ opQueue.addParticipantToWavelet(wavelet, newPartWithDomain);
+ }
+ }
+ if (opQueue.getPendingOperations().size() > 0) {
+ final String whoAdd = wavelet.getParticipants().contains(participantUtils.of(userWhoAdds)) ? userWhoAdds
+ : author;
+ doOperation(whoAdd, opQueue, "add participant");
+ }
+ }
+
+ @Override
+ public WaveRef createWave(final String message, final ParticipantId... participants) {
+ return createWave(NO_TITLE, message, participants);
+ }
+
+ @Override
+ public WaveRef createWave(@Nonnull final String title, final String message,
+ @Nonnull final ParticipantId... participantsArray) {
+ return createWave(title, message, WITHOUT_GADGET, participantsArray);
+ }
+
+ @Override
+ public WaveRef createWave(@Nonnull final String title, final String message,
+ final String waveIdToCopy, final URL gadgetUrl, @Nonnull final ParticipantId... participantsArray) {
+ String newWaveId = null;
+ String newWaveletId = null;
+ final Set<String> participants = new HashSet<String>();
+ for (final ParticipantId participant : participantsArray) {
+ participants.add(participant.toString());
+ }
+ final ParticipantId user = participantsArray[0];
+ final OperationQueue opQueue = new OperationQueue();
+ final Wavelet newWavelet = opQueue.createWavelet(domain, participants);
+ opQueue.setTitleOfWavelet(newWavelet, title);
+ final Blip rootBlip = newWavelet.getRootBlip();
+ rootBlip.append(new com.google.wave.api.Markup(message).getText());
+
+ if (waveIdToCopy != NO_WAVE_TO_COPY) {
+ try {
+ WaveId copyWaveId;
+ copyWaveId = WaveId.ofChecked(domain, waveIdToCopy);
+ final Wavelet waveletToCopy = fetchWave(copyWaveId, WaveletId.of(domain, "conv+root"),
+ participantsArray[0].toString());
+ if (waveletToCopy != null) {
+ copyWavelet(waveletToCopy.getRootBlip(), rootBlip);
+ }
+ } catch (final InvalidIdException e) {
+ LOG.error("Error copying wave content", e);
+ } catch (final DefaultException e2) {
+ LOG.error("Error copying wave content", e2);
+ }
+ }
+
+ if (gadgetUrl != WITHOUT_GADGET) {
+ final Gadget gadget = new Gadget(gadgetUrl.toString());
+ rootBlip.append(gadget);
+ }
+
+ final OperationContextImpl context = new OperationContextImpl(waveletProvider,
+ converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
+ for (final OperationRequest req : opQueue.getPendingOperations()) {
+ OperationUtil.executeOperation(req, operationRegistry, context, user);
+ final String reqId = req.getId();
+ final JsonRpcResponse response = context.getResponse(reqId);
+ if (response != null) {
+ if (response.isError()) {
+ onFailure(context.getResponse(reqId).getErrorMessage());
+ } else {
+ final Object responseWaveId = response.getData().get(ParamsProperty.WAVE_ID);
+ final Object responseWaveletId = response.getData().get(ParamsProperty.WAVELET_ID);
+ if (responseWaveId != null && responseWaveletId != null) {
+ // This is serialized use
+ // ApiIdSerializer.instance().deserialiseWaveId (see
+ // WaveService)
+ newWaveId = (String) responseWaveId;
+ newWaveletId = (String) responseWaveletId;
+ }
+ }
+ }
+ }
+ OperationUtil.submitDeltas(context, waveletProvider, new SubmitRequestListener() {
+ @Override
+ public void onFailure(final String arg0) {
+ KuneWaveServiceDefault.this.onFailure("Wave creation failed, onFailure: " + arg0);
+ }
+
+ @Override
+ public void onSuccess(final int arg0, final HashedVersion arg1, final long arg2) {
+ LOG.info("Wave creation success: " + arg1);
+ }
+ });
+ LOG.info("WaveId: " + newWaveId + " waveletId: " + newWaveletId);
+ WaveRef wavename;
+ try {
+ wavename = WaveRef.of(ApiIdSerializer.instance().deserialiseWaveId(newWaveId),
+ ApiIdSerializer.instance().deserialiseWaveletId(newWaveletId));
+ } catch (final InvalidIdException e) {
+ throw new DefaultException("Error getting wave id");
+ }
+ return wavename;
+ }
+
+ @Override
+ public WaveRef createWave(@Nonnull final String title, final String message, final URL gadgetUrl,
+ @Nonnull final ParticipantId... participantsArray) {
+ return createWave(title, message, NO_WAVE_TO_COPY, gadgetUrl, participantsArray);
+ }
+
+ @Override
+ public void delParticipants(final WaveRef waveName, final String whoDel, final String... participants) {
+ final Wavelet wavelet = fetchWave(waveName, whoDel);
+ final OperationQueue opQueue = new OperationQueue();
+
+ for (final String participant : participants) {
+ final String partWithDomain = participantUtils.of(participant).toString();
+ boolean mustDel = false;
+ for (final String current : wavelet.getParticipants()) {
+ if (current.equals(partWithDomain)) {
+ mustDel = true;
+ break;
+ }
+ }
+ if (mustDel) {
+ opQueue.removeParticipantFromWavelet(wavelet, partWithDomain);
+ }
+ }
+ if (opQueue.getPendingOperations().size() > 0) {
+ doOperation(whoDel, opQueue, "add participant");
+ }
+ }
+
+ private void doOperation(final String author, final OperationQueue opQueue, final String logComment) {
+ final OperationContextImpl context = new OperationContextImpl(waveletProvider,
+ converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
+ final OperationRequest request = opQueue.getPendingOperations().get(0);
+ OperationUtil.executeOperation(request, operationRegistry, context, participantUtils.of(author));
+ final String reqId = request.getId();
+ final JsonRpcResponse response = context.getResponse(reqId);
+ if (response != null && response.isError()) {
+ onFailure(context.getResponse(reqId).getErrorMessage());
+ }
+ OperationUtil.submitDeltas(context, waveletProvider, new SubmitRequestListener() {
+ @Override
+ public void onFailure(final String arg0) {
+ KuneWaveServiceDefault.this.onFailure("Wave " + logComment + " failed, onFailure: " + arg0);
+ }
+
+ @Override
+ public void onSuccess(final int arg0, final HashedVersion arg1, final long arg2) {
+ LOG.info("Wave " + logComment + " success: " + arg1);
+ }
+ });
+ }
+
+ public void doOperations(final WaveRef waveName, final String author, final OperationQueue opQueue,
+ final SubmitRequestListener listener) {
+ final OperationContextImpl context = new OperationContextImpl(waveletProvider,
+ converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
+ for (final OperationRequest req : opQueue.getPendingOperations()) {
+ OperationUtil.executeOperation(req, operationRegistry, context, participantUtils.of(author));
+ }
+ OperationUtil.submitDeltas(context, waveletProvider, listener);
+ }
+
+ @Override
+ public Wavelet fetchWave(final WaveId waveId, final WaveletId waveletId, final String author) {
+ final OperationQueue opQueue = new OperationQueue();
+ opQueue.fetchWavelet(waveId, waveletId);
+ Wavelet wavelet = null;
+ final OperationContextImpl context = new OperationContextImpl(waveletProvider,
+ converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
+ final OperationRequest request = opQueue.getPendingOperations().get(0);
+ OperationUtil.executeOperation(request, operationRegistry, context, participantUtils.of(author));
+ final String reqId = request.getId();
+ final JsonRpcResponse response = context.getResponse(reqId);
+ if (response != null && response.isError()) {
+ onFailure(context.getResponse(reqId).getErrorMessage());
+ } else {
+ // Duplicate code from WaveService
+ final WaveletData waveletData = (WaveletData) response.getData().get(ParamsProperty.WAVELET_DATA);
+ final Map<String, Blip> blips = new HashMap<String, Blip>();
+ final Map<String, BlipThread> threads = new HashMap<String, BlipThread>();
+ wavelet = Wavelet.deserialize(opQueue, blips, threads, waveletData);
+
+ // Deserialize threads.
+ @SuppressWarnings("unchecked")
+ final Map<String, BlipThread> tempThreads = (Map<String, BlipThread>) response.getData().get(
+ ParamsProperty.THREADS);
+ for (final Map.Entry<String, BlipThread> entry : tempThreads.entrySet()) {
+ final BlipThread thread = entry.getValue();
+ threads.put(entry.getKey(),
+ new BlipThread(thread.getId(), thread.getLocation(), thread.getBlipIds(), blips));
+ }
+
+ // Deserialize blips.
+ @SuppressWarnings("unchecked")
+ final Map<String, BlipData> blipDatas = (Map<String, BlipData>) response.getData().get(
+ ParamsProperty.BLIPS);
+ for (final Map.Entry<String, BlipData> entry : blipDatas.entrySet()) {
+ blips.put(entry.getKey(), Blip.deserialize(opQueue, wavelet, entry.getValue()));
+ }
+ }
+ return wavelet;
+ }
+
+ @Override
+ public Wavelet fetchWave(final WaveRef waveName, final String author) {
+ final WaveId waveId = waveName.getWaveId();
+ final WaveletId waveletId = waveName.getWaveletId();
+ return fetchWave(waveId, waveletId, author);
+ }
+
+ @Override
+ public boolean isParticipant(final Wavelet wavelet, final String user) {
+ return wavelet.getParticipants().contains(participantUtils.of(user).toString());
+ }
+
+ private void onFailure(final String message) {
+ final String errorMsg = TextUtils.notEmpty(message) ? message : "Wave operation failed";
+ LOG.error(errorMsg);
+ throw new DefaultException(errorMsg);
+ }
+
+ @Override
+ public String render(final Wavelet wavelet) {
+ final ClientAction clientPage = waveRenderer.render(wavelet, 0);
+ final String html = clientPage.getHtml();
+ return html;
+ }
+
+ @Override
+ public String render(final WaveRef waveRef, final String author) {
+ return render(fetchWave(waveRef, author));
+ }
+
+ @Override
+ public void setTitle(final WaveRef waveName, final String title, final String author) {
+ final Wavelet wavelet = fetchWave(waveName, author);
+ final OperationQueue opQueue = new OperationQueue();
+ opQueue.setTitleOfWavelet(wavelet, title);
+ doOperation(author, opQueue, "set title");
+ }
+
+}
Deleted: trunk/src/main/java/cc/kune/wave/server/KuneWaveUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveUtils.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveUtils.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -1,18 +0,0 @@
-package cc.kune.wave.server;
-
-import org.waveprotocol.wave.model.waveref.InvalidWaveRefException;
-import org.waveprotocol.wave.model.waveref.WaveRef;
-import org.waveprotocol.wave.util.escapers.jvm.JavaWaverefEncoder;
-
-import cc.kune.core.client.errors.DefaultException;
-import cc.kune.domain.Content;
-
-public class KuneWaveUtils {
- public static WaveRef getWaveRef(final Content content) {
- try {
- return JavaWaverefEncoder.decodeWaveRefFromPath(String.valueOf(content.getWaveId()));
- } catch (final InvalidWaveRefException e) {
- throw new DefaultException("Error getting the wave");
- }
- }
-}
Added: trunk/src/main/java/cc/kune/wave/server/KuneWaveUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveUtils.java (rev 0)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveUtils.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -0,0 +1,22 @@
+package cc.kune.wave.server;
+
+import org.waveprotocol.wave.model.waveref.InvalidWaveRefException;
+import org.waveprotocol.wave.model.waveref.WaveRef;
+import org.waveprotocol.wave.util.escapers.jvm.JavaWaverefEncoder;
+
+import cc.kune.core.client.errors.DefaultException;
+import cc.kune.domain.Content;
+
+public class KuneWaveUtils {
+ public static String getUrl(final WaveRef waveref) {
+ return JavaWaverefEncoder.encodeToUriPathSegment(waveref);
+ }
+
+ public static WaveRef getWaveRef(final Content content) {
+ try {
+ return JavaWaverefEncoder.decodeWaveRefFromPath(String.valueOf(content.getWaveId()));
+ } catch (final InvalidWaveRefException e) {
+ throw new DefaultException("Error getting the wave");
+ }
+ }
+}
Modified: trunk/src/main/java/cc/kune/wave/server/ParticipantUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/ParticipantUtils.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/java/cc/kune/wave/server/ParticipantUtils.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -19,12 +19,16 @@
*/
package cc.kune.wave.server;
+import java.util.Iterator;
+import java.util.Set;
+
import org.waveprotocol.box.server.CoreSettings;
import org.waveprotocol.wave.model.wave.InvalidParticipantAddress;
import org.waveprotocol.wave.model.wave.ParticipantId;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.server.properties.KuneBasicProperties;
+import cc.kune.domain.Group;
import com.google.inject.Inject;
import com.google.inject.Singleton;
@@ -33,33 +37,42 @@
@Singleton
public class ParticipantUtils {
- private final String domain;
- private final ParticipantId superAdmin;
+ private final String domain;
+ private final ParticipantId superAdmin;
- @Inject
- public ParticipantUtils((a)Named(CoreSettings.WAVE_SERVER_DOMAIN) final String domain,
- final KuneBasicProperties databaseProperties) throws InvalidParticipantAddress {
- this.domain = domain;
- superAdmin = ofImpl(databaseProperties.getAdminShortName());
- }
+ @Inject
+ public ParticipantUtils((a)Named(CoreSettings.WAVE_SERVER_DOMAIN) final String domain,
+ final KuneBasicProperties databaseProperties) throws InvalidParticipantAddress {
+ this.domain = domain;
+ superAdmin = ofImpl(databaseProperties.getAdminShortName());
+ }
- public ParticipantId getSuperAdmin() {
- return superAdmin;
- }
+ public ParticipantId getSuperAdmin() {
+ return superAdmin;
+ }
- public ParticipantId of(final String username) {
- return ofImpl(username);
+ public ParticipantId[] listFrom(final Set<Group> list) {
+ final ParticipantId[] array = new ParticipantId[list.size()];
+ final Iterator<Group> iterator = list.iterator();
+ for (int i = 0; i < list.size(); i++) {
+ array[i] = of(iterator.next().getShortName());
}
+ return array;
+ }
- private ParticipantId ofImpl(final String username) {
- try {
- if (username.contains(ParticipantId.DOMAIN_PREFIX)) {
- return ParticipantId.of(username);
- } else {
- return ParticipantId.of(username + ParticipantId.DOMAIN_PREFIX + domain);
- }
- } catch (final InvalidParticipantAddress e) {
- throw new DefaultException("Error getting Wave participant Id");
- }
+ public ParticipantId of(final String username) {
+ return ofImpl(username);
+ }
+
+ private ParticipantId ofImpl(final String username) {
+ try {
+ if (username.contains(ParticipantId.DOMAIN_PREFIX)) {
+ return ParticipantId.of(username);
+ } else {
+ return ParticipantId.of(username + ParticipantId.DOMAIN_PREFIX + domain);
+ }
+ } catch (final InvalidParticipantAddress e) {
+ throw new DefaultException("Error getting Wave participant Id");
}
+ }
}
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/main/resources/kune.properties 2011-09-20 14:28:24 UTC (rev 1524)
@@ -29,7 +29,7 @@
kune.chat.domain = localhost
kune.chat.roomHost = rooms.localhost
-### Feedback syste
+### Feedback system
kune.feedback.enabled = true
# List of participants to give feedback, comma-separated
kune.feedback.to = admin
@@ -98,7 +98,8 @@
kune.upload.location = /var/lib/kune/uploads/
kune.upload.maxfilesizeinmegas = 10
kune.upload.maxfilesizeinks = 10000000
-kune.upload.delayfortest = 50
+# to test in development phase, you can use values as 50
+kune.upload.delayfortest = 0
### Gallery options
kune.upload.gallerypermittedextensions = jpg,jpeg,png,gif,bmp,svg,avi,mpg,mpeg,ogg,mov,tif,tiff,mp3,wav
Deleted: trunk/src/test/java/cc/kune/wave/server/KuneWaveManagerDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/wave/server/KuneWaveManagerDefaultTest.java 2011-09-20 01:32:58 UTC (rev 1523)
+++ trunk/src/test/java/cc/kune/wave/server/KuneWaveManagerDefaultTest.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -1,189 +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.wave.server;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNotNull;
-import static org.junit.Assert.assertTrue;
-
-import java.io.IOException;
-import java.net.URL;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.waveprotocol.wave.model.waveref.WaveRef;
-
-import cc.kune.core.client.errors.DefaultException;
-import cc.kune.core.server.integration.IntegrationTest;
-import cc.kune.core.server.integration.IntegrationTestHelper;
-
-import com.google.inject.Inject;
-import com.google.wave.api.Wavelet;
-
-public class KuneWaveManagerDefaultTest extends IntegrationTest {
-
- private static final String MESSAGE = "testing";
- private static final String NEW_PARTICIPANT = "newparti";
- private static final String RICHTEXT_MESSAGE = "<b>" + MESSAGE + "</b>";
- private static final String TEST_GADGET = "http://wave-api.appspot.com/public/gadgets/areyouin/gadget.xml";
- private static final String TITLE = "title";
- private static final String TITLENEW = "titleNew";
- @Inject
- KuneWaveManager manager;
- @Inject
- ParticipantUtils participantUtils;
-
- @Test
- public void addAndRemoveParticipant() throws IOException {
- doLogin();
- final String whoDels = getSiteAdminShortName();
- final WaveRef waveletName = createTestWave();
- assertNotNull(waveletName);
- manager.addParticipants(waveletName, getSiteAdminShortName(), whoDels, NEW_PARTICIPANT);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertEquals(2, fetchWavelet.getParticipants().size());
- assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
- assertTrue(manager.isParticipant(fetchWavelet, getSiteAdminShortName()));
- manager.delParticipants(waveletName, whoDels, NEW_PARTICIPANT);
- final Wavelet fetchDelWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchDelWavelet);
- assertEquals(1, fetchDelWavelet.getParticipants().size());
- assertTrue(manager.isParticipant(fetchDelWavelet, getSiteAdminShortName()));
- assertFalse(manager.isParticipant(fetchDelWavelet, NEW_PARTICIPANT));
- manager.addParticipants(waveletName, getSiteAdminShortName(), whoDels, NEW_PARTICIPANT);
- // Del all
- manager.delParticipants(waveletName, whoDels, getSiteAdminShortName(), NEW_PARTICIPANT);
- }
-
- @Test
- public void addGadget() throws DefaultException, IOException {
- doLogin();
- final WaveRef waveletName = createTestWave();
- assertNotNull(waveletName);
- manager.addGadget(waveletName, getSiteAdminShortName(), TEST_GADGET);
- }
-
- private void addParticipant(final String whoAdds) throws IOException {
- doLogin();
- final WaveRef waveletName = createTestWave();
- assertNotNull(waveletName);
- manager.addParticipants(waveletName, getSiteAdminShortName(), whoAdds, NEW_PARTICIPANT);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertEquals(2, fetchWavelet.getParticipants().size());
- assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
- assertTrue(manager.isParticipant(fetchWavelet, getSiteAdminShortName()));
- }
-
- @Test
- public void addParticipantTwice() throws IOException {
- doLogin();
- final WaveRef waveletName = createTestWave();
- assertNotNull(waveletName);
- manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
- NEW_PARTICIPANT);
- manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
- NEW_PARTICIPANT, NEW_PARTICIPANT);
- manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
- NEW_PARTICIPANT, NEW_PARTICIPANT, NEW_PARTICIPANT);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertEquals(2, fetchWavelet.getParticipants().size());
- assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
- assertTrue(manager.isParticipant(fetchWavelet, getSiteAdminShortName()));
- }
-
- @Test
- public void authorAddParticipant() throws DefaultException, IOException {
- final String whoAdds = getSiteAdminShortName();
- addParticipant(whoAdds);
- }
-
- @Before
- public void before() {
- new IntegrationTestHelper(this);
- }
-
- private WaveRef createTestWave() {
- return manager.createWave(TITLE, RICHTEXT_MESSAGE, participantUtils.of(getSiteAdminShortName()));
- }
-
- @Test
- public void createWave() throws DefaultException, IOException {
- doLogin();
- final WaveRef waveletName = manager.createWave(RICHTEXT_MESSAGE,
- participantUtils.of(getSiteAdminShortName()));
- assertNotNull(waveletName);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertTrue(fetchWavelet.getRootBlip().getAnnotations().size() > 0);
- assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
- }
-
- @Test
- public void createWaveWithGadget() throws DefaultException, IOException {
- doLogin();
- final WaveRef waveletName = manager.createWave(TITLE, RICHTEXT_MESSAGE, new URL(TEST_GADGET),
- participantUtils.of(getSiteAdminShortName()));
- assertNotNull(waveletName);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
- }
-
- @Test
- public void createWaveWithTitle() throws DefaultException, IOException {
- doLogin();
- final WaveRef waveletName = createTestWave();
- assertNotNull(waveletName);
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
- assertEquals(TITLE, fetchWavelet.getTitle());
- }
-
- @Test
- public void otherMemberAddParticipant() throws DefaultException, IOException {
- final String whoAdds = "otherMember";
- addParticipant(whoAdds);
- }
-
- @Test
- public void renderWave() throws DefaultException, IOException {
- doLogin();
- final WaveRef waveletName = createTestWave();
- assertNotNull(manager.render(waveletName, getSiteAdminShortName()));
- }
-
- @Test
- public void setTitle() throws DefaultException, IOException {
- doLogin();
- final WaveRef waveletName = createTestWave();
- assertNotNull(waveletName);
- manager.setTitle(waveletName, TITLENEW, getSiteAdminShortName());
- final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
- assertNotNull(fetchWavelet);
- assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
- assertEquals(TITLENEW, fetchWavelet.getTitle());
- }
-
-}
Copied: trunk/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java (from rev 1511, trunk/src/test/java/cc/kune/wave/server/KuneWaveManagerDefaultTest.java)
===================================================================
--- trunk/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java (rev 0)
+++ trunk/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java 2011-09-20 14:28:24 UTC (rev 1524)
@@ -0,0 +1,189 @@
+/*
+ *
+ * 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.wave.server;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertTrue;
+
+import java.io.IOException;
+import java.net.URL;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.waveprotocol.wave.model.waveref.WaveRef;
+
+import cc.kune.core.client.errors.DefaultException;
+import cc.kune.core.server.integration.IntegrationTest;
+import cc.kune.core.server.integration.IntegrationTestHelper;
+
+import com.google.inject.Inject;
+import com.google.wave.api.Wavelet;
+
+public class KuneWaveServiceDefaultTest extends IntegrationTest {
+
+ private static final String MESSAGE = "testing";
+ private static final String NEW_PARTICIPANT = "newparti";
+ private static final String RICHTEXT_MESSAGE = "<b>" + MESSAGE + "</b>";
+ private static final String TEST_GADGET = "http://wave-api.appspot.com/public/gadgets/areyouin/gadget.xml";
+ private static final String TITLE = "title";
+ private static final String TITLENEW = "titleNew";
+ @Inject
+ KuneWaveService manager;
+ @Inject
+ ParticipantUtils participantUtils;
+
+ @Test
+ public void addAndRemoveParticipant() throws IOException {
+ doLogin();
+ final String whoDels = getSiteAdminShortName();
+ final WaveRef waveletName = createTestWave();
+ assertNotNull(waveletName);
+ manager.addParticipants(waveletName, getSiteAdminShortName(), whoDels, NEW_PARTICIPANT);
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertEquals(2, fetchWavelet.getParticipants().size());
+ assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
+ assertTrue(manager.isParticipant(fetchWavelet, getSiteAdminShortName()));
+ manager.delParticipants(waveletName, whoDels, NEW_PARTICIPANT);
+ final Wavelet fetchDelWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchDelWavelet);
+ assertEquals(1, fetchDelWavelet.getParticipants().size());
+ assertTrue(manager.isParticipant(fetchDelWavelet, getSiteAdminShortName()));
+ assertFalse(manager.isParticipant(fetchDelWavelet, NEW_PARTICIPANT));
+ manager.addParticipants(waveletName, getSiteAdminShortName(), whoDels, NEW_PARTICIPANT);
+ // Del all
+ manager.delParticipants(waveletName, whoDels, getSiteAdminShortName(), NEW_PARTICIPANT);
+ }
+
+ @Test
+ public void addGadget() throws DefaultException, IOException {
+ doLogin();
+ final WaveRef waveletName = createTestWave();
+ assertNotNull(waveletName);
+ manager.addGadget(waveletName, getSiteAdminShortName(), TEST_GADGET);
+ }
+
+ private void addParticipant(final String whoAdds) throws IOException {
+ doLogin();
+ final WaveRef waveletName = createTestWave();
+ assertNotNull(waveletName);
+ manager.addParticipants(waveletName, getSiteAdminShortName(), whoAdds, NEW_PARTICIPANT);
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertEquals(2, fetchWavelet.getParticipants().size());
+ assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
+ assertTrue(manager.isParticipant(fetchWavelet, getSiteAdminShortName()));
+ }
+
+ @Test
+ public void addParticipantTwice() throws IOException {
+ doLogin();
+ final WaveRef waveletName = createTestWave();
+ assertNotNull(waveletName);
+ manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
+ NEW_PARTICIPANT);
+ manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
+ NEW_PARTICIPANT, NEW_PARTICIPANT);
+ manager.addParticipants(waveletName, getSiteAdminShortName(), getSiteAdminShortName(),
+ NEW_PARTICIPANT, NEW_PARTICIPANT, NEW_PARTICIPANT);
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertEquals(2, fetchWavelet.getParticipants().size());
+ assertTrue(manager.isParticipant(fetchWavelet, NEW_PARTICIPANT));
+ assertTrue(manager.isParticipant(fetchWavelet, getSiteAdminShortName()));
+ }
+
+ @Test
+ public void authorAddParticipant() throws DefaultException, IOException {
+ final String whoAdds = getSiteAdminShortName();
+ addParticipant(whoAdds);
+ }
+
+ @Before
+ public void before() {
+ new IntegrationTestHelper(this);
+ }
+
+ private WaveRef createTestWave() {
+ return manager.createWave(TITLE, RICHTEXT_MESSAGE, participantUtils.of(getSiteAdminShortName()));
+ }
+
+ @Test
+ public void createWave() throws DefaultException, IOException {
+ doLogin();
+ final WaveRef waveletName = manager.createWave(RICHTEXT_MESSAGE,
+ participantUtils.of(getSiteAdminShortName()));
+ assertNotNull(waveletName);
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertTrue(fetchWavelet.getRootBlip().getAnnotations().size() > 0);
+ assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
+ }
+
+ @Test
+ public void createWaveWithGadget() throws DefaultException, IOException {
+ doLogin();
+ final WaveRef waveletName = manager.createWave(TITLE, RICHTEXT_MESSAGE, new URL(TEST_GADGET),
+ participantUtils.of(getSiteAdminShortName()));
+ assertNotNull(waveletName);
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
+ }
+
+ @Test
+ public void createWaveWithTitle() throws DefaultException, IOException {
+ doLogin();
+ final WaveRef waveletName = createTestWave();
+ assertNotNull(waveletName);
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
+ assertEquals(TITLE, fetchWavelet.getTitle());
+ }
+
+ @Test
+ public void otherMemberAddParticipant() throws DefaultException, IOException {
+ final String whoAdds = "otherMember";
+ addParticipant(whoAdds);
+ }
+
+ @Test
+ public void renderWave() throws DefaultException, IOException {
+ doLogin();
+ final WaveRef waveletName = createTestWave();
+ assertNotNull(manager.render(waveletName, getSiteAdminShortName()));
+ }
+
+ @Test
+ public void setTitle() throws DefaultException, IOException {
+ doLogin();
+ final WaveRef waveletName = createTestWave();
+ assertNotNull(waveletName);
+ manager.setTitle(waveletName, TITLENEW, getSiteAdminShortName());
+ final Wavelet fetchWavelet = manager.fetchWave(waveletName, getSiteAdminShortName());
+ assertNotNull(fetchWavelet);
+ assertTrue(fetchWavelet.getRootBlip().getContent().contains(MESSAGE));
+ assertEquals(TITLENEW, fetchWavelet.getTitle());
+ }
+
+}
1
0
Author: vjrj_
Date: 2011-09-20 03:32:58 +0200 (Tue, 20 Sep 2011)
New Revision: 1523
Added:
trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackAction.java
trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackBtn.java
Modified:
trunk/script/i18n-db2gwt.sh
trunk/src/main/java/cc/kune/chat/client/actions/ChatAboutContentBtn.java
trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.java
trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_es.properties
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java
trunk/src/main/java/cc/kune/core/server/InitData.java
trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java
trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java
trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java
trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
trunk/src/main/java/cc/kune/wave/client/WaveClientManager.java
trunk/src/main/java/cc/kune/wave/client/WaveGinModule.java
trunk/src/main/java/cc/kune/wave/client/WebClient.java
trunk/src/main/java/cc/kune/wave/server/KuneAgent.java
trunk/src/main/java/cc/kune/wave/server/KuneWaveManager.java
trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java
trunk/src/main/resources/kune.properties
Log:
NEW - # 79: I18n refactorization
http://kune.ourproject.org/issues/ticket/79
CLOSED - # 108: Send Feedback button
http://kune.ourproject.org/issues/ticket/108
Modified: trunk/script/i18n-db2gwt.sh
===================================================================
--- trunk/script/i18n-db2gwt.sh 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/script/i18n-db2gwt.sh 2011-09-20 01:32:58 UTC (rev 1523)
@@ -41,10 +41,13 @@
if [[ $J -eq 1 ]]
then
-mysql -B --skip-column-names --password="db4kune" -u kune kune_dev -e "$SEL" \
+mysql -B --skip-column-names --default-character-set=utf8 --password="db4kune" -u kune kune_dev -e "$SEL" \
| sed 's/ /ł/g' \
| awk -F "ł" '
BEGIN {
+ print "/**"
+ print " * Autogenerated by trunk/bin/i18n-db2gwt.sh, please not edit directly"
+ print " */"
print "public interface KuneConstants extends ConstantsWithLookup {"
}
{
@@ -69,6 +72,10 @@
| sed 's/ /ł/g' \
| awk -F "ł" '
BEGIN {
+ print "#"
+ print "# Autogenerated by trunk/bin/i18n-db2gwt.sh, please not edit directly"
+ print "#"
+ print
}
{
lang=$4
Modified: trunk/src/main/java/cc/kune/chat/client/actions/ChatAboutContentBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/ChatAboutContentBtn.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/chat/client/actions/ChatAboutContentBtn.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -22,6 +22,8 @@
import cc.kune.chat.client.ChatClient;
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.utils.SimpleResponseCallback;
import cc.kune.core.client.actions.RolAction;
import cc.kune.core.client.resources.CoreResources;
import cc.kune.core.client.state.Session;
@@ -51,11 +53,23 @@
@Override
public void actionPerformed(final ActionEvent event) {
- final String subject = i18n.t("Chat about: [%s]", session.getContentState().getTitle());
- final StateToken token = session.getCurrentStateToken();
- chatClient.get().joinRoom(token.toString().replaceAll("\\.", "-"), subject,
- session.getCurrentUserInfo().getShortName());
- chatClient.get().show();
+ NotifyUser.askConfirmation(
+ i18n.t("Confirm, please:"),
+ i18n.t("This will open a specific chatroom to chat about this page or document (it's useful to chat with others about something while reading/modifing it). Are you sure?"),
+ new SimpleResponseCallback() {
+ @Override
+ public void onCancel() {
+ }
+
+ @Override
+ public void onSuccess() {
+ final String subject = i18n.t("Chat about: [%s]", session.getContentState().getTitle());
+ final StateToken token = session.getCurrentStateToken();
+ chatClient.get().joinRoom(token.toString().replaceAll("\\.", "-"), subject,
+ session.getCurrentUserInfo().getShortName());
+ chatClient.get().show();
+ }
+ });
}
}
Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -24,7 +24,6 @@
import java.util.MissingResourceException;
import cc.kune.common.client.log.Log;
-import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.utils.Location;
import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.client.utils.WindowUtils;
@@ -64,7 +63,6 @@
@Override
public void onSuccess(final I18nLanguageDTO result) {
currentLang = result;
- NotifyUser.info("lang: " + result.getCode());
currentLanguageCode = currentLang.getCode();
session.setCurrentLanguage(currentLang);
i18nService.getLexicon(currentLang.getCode(), new AsyncCallback<HashMap<String, String>>() {
Modified: trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -1,5 +1,8 @@
package cc.kune.core.client.i18n;
+/**
+ * Autogenerated by trunk/bin/i18n-db2gwt.sh, please not edit directly
+ */
import com.google.gwt.i18n.client.ConstantsWithLookup;
public interface KuneConstants extends ConstantsWithLookup {
Modified: trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_es.properties
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_es.properties 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_es.properties 2011-09-20 01:32:58 UTC (rev 1523)
@@ -1,3 +1,6 @@
+#
+# Autogenerated by trunk/bin/i18n-db2gwt.sh, please not edit directly
+#
addAsABuddienull = Añadir como colega
chatNull = Chat ;)
search = Buscar
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentService.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -74,6 +74,8 @@
void save(String user, StateToken token, String content) throws DefaultException;
+ String sendFeedback(String userHash, String title, String body);
+
ContentSimpleDTO setAsDefaultContent(String userHash, StateToken token);
I18nLanguageDTO setLanguage(String userHash, StateToken token, String languageCode)
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceAsync.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -77,6 +77,8 @@
void save(String user, StateToken token, String content, AsyncCallback<Void> asyncCallback);
+ void sendFeedback(String userHash, String title, String body, AsyncCallback<String> callback);
+
void setAsDefaultContent(String userHash, StateToken token,
AsyncCallback<ContentSimpleDTO> asyncCallback);
Modified: trunk/src/main/java/cc/kune/core/server/InitData.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/InitData.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/core/server/InitData.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -42,6 +42,7 @@
private License defaultLicense;
private String defaultWsTheme;
private List<ExtMediaDescrip> extMediaDescrips;
+ private boolean feedbackEnabled;
private String flvEmbedObject;
private String galleryPermittedExtensions;
private List<ToolSimple> groupTools;
@@ -180,6 +181,10 @@
return userTools;
}
+ public boolean isFeedbackEnabled() {
+ return feedbackEnabled;
+ }
+
public void setAviEmbedObject(final String aviEmbedObject) {
this.aviEmbedObject = aviEmbedObject;
}
@@ -216,6 +221,10 @@
this.extMediaDescrips = extMediaDescrips;
}
+ public void setFeedbackEnabled(final boolean feedbackEnabled) {
+ this.feedbackEnabled = feedbackEnabled;
+ }
+
public void setFlvEmbedObject(final String flvEmbedObject) {
this.flvEmbedObject = flvEmbedObject;
}
Modified: trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -46,7 +46,6 @@
private final ContainerManager containerManager;
private final ContentManager contentManager;
private final Log LOG = LogFactory.getLog(CreationServiceDefault.class);
-
private final ServerToolRegistry tools;
@Inject
Modified: trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/core/server/properties/KuneProperties.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -28,6 +28,8 @@
String CHAT_ROOM_HOST = "kune.chat.roomHost";
String CURRENT_CC_VERSION = "kune.currentccversion";
String DEFAULT_SITE_SHORT_NAME = "kune.default.site.shortName";
+ String FEEDBACK_ENABLED = "kune.feedback.enabled";
+ String FEEDBACK_TO = "kune.feedback.to";
String FLV_EMBEDED_OBJECT = "kune.media.flvembededobject";
String IMAGES_CROPSIZE = "kune.images.cropsize";
String IMAGES_ICONSIZE = "kune.images.iconsize";
@@ -63,6 +65,8 @@
String get(String key, String defaultValue);
+ boolean getBoolean(String key);
+
Integer getInteger(String key);
List<String> getList(String key);
Modified: trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -70,6 +70,13 @@
}
@Override
+ public boolean getBoolean(final String key) {
+ final Boolean value = config.getBoolean(key);
+ checkNull(key, value);
+ return value;
+ }
+
+ @Override
public Integer getInteger(final String key) {
final Integer value = config.getInt(key);
checkNull(key, value);
Modified: trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -19,10 +19,15 @@
*/
package cc.kune.core.server.rpc;
+import java.util.ArrayList;
import java.util.Date;
+import java.util.List;
import javax.persistence.NoResultException;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+import org.waveprotocol.wave.util.escapers.jvm.JavaWaverefEncoder;
+
import cc.kune.chat.server.ChatManager;
import cc.kune.core.client.errors.AccessViolationException;
import cc.kune.core.client.errors.ContentNotFoundException;
@@ -45,6 +50,7 @@
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.manager.TagUserContentManager;
import cc.kune.core.server.mapper.Mapper;
+import cc.kune.core.server.properties.KuneProperties;
import cc.kune.core.server.state.StateContainer;
import cc.kune.core.server.state.StateContent;
import cc.kune.core.server.state.StateService;
@@ -65,6 +71,8 @@
import cc.kune.domain.Content;
import cc.kune.domain.Group;
import cc.kune.domain.User;
+import cc.kune.wave.server.KuneWaveManager;
+import cc.kune.wave.server.ParticipantUtils;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -78,7 +86,10 @@
private final CreationService creationService;
private final FinderService finderService;
private final GroupManager groupManager;
+ private final KuneProperties kuneProperties;
+ private final KuneWaveManager kuneWaveManager;
private final Mapper mapper;
+ private final ParticipantUtils participantUtils;
private final AccessRightsService rightsService;
private final StateService stateService;
private final TagUserContentManager tagManager;
@@ -90,7 +101,8 @@
final StateService stateService, final CreationService creationService,
final GroupManager groupManager, final ContentManager contentManager,
final ContainerManager containerManager, final TagUserContentManager tagManager,
- final Mapper mapper, final ChatManager chatManager) {
+ final Mapper mapper, final ChatManager chatManager, final KuneWaveManager kuneWaveManager,
+ final KuneProperties kuneProperties, final ParticipantUtils participantUtils) {
this.finderService = finderService;
this.userSessionProvider = userSessionProvider;
this.accessService = accessService;
@@ -103,6 +115,9 @@
this.tagManager = tagManager;
this.mapper = mapper;
this.chatManager = chatManager;
+ this.kuneWaveManager = kuneWaveManager;
+ this.kuneProperties = kuneProperties;
+ this.participantUtils = participantUtils;
}
@Override
@@ -436,6 +451,22 @@
@Override
@Authenticated
+ @Transactional
+ public String sendFeedback(final String userHash, final String title, final String body)
+ throws DefaultException {
+ final User user = getCurrentUser();
+ final List<String> participants = kuneProperties.getList(KuneProperties.FEEDBACK_TO);
+ participants.add(0, user.getShortName());
+ final List<ParticipantId> partIds = new ArrayList<ParticipantId>();
+ for (final String part : participants) {
+ partIds.add(participantUtils.of(part));
+ }
+ return JavaWaverefEncoder.encodeToUriPathSegment(kuneWaveManager.createWave(title, body,
+ partIds.toArray(new ParticipantId[0])));
+ }
+
+ @Override
+ @Authenticated
@Authorizated(accessRolRequired = AccessRol.Administrator)
@Transactional
public ContentSimpleDTO setAsDefaultContent(final String userHash, final StateToken token) {
Modified: trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/core/server/rpc/SiteRPC.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -152,6 +152,7 @@
data.setOggEmbedObject(kuneProperties.get(KuneProperties.OGG_EMBEDED_OBJECT));
data.setAviEmbedObject(kuneProperties.get(KuneProperties.AVI_EMBEDED_OBJECT));
data.setExtMediaDescrips(extMediaDescManager.getAll());
+ data.setFeedbackEnabled(kuneProperties.getBoolean(KuneProperties.FEEDBACK_ENABLED));
return data;
}
}
Modified: trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/core/shared/dto/InitDataDTO.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -35,6 +35,7 @@
private LicenseDTO defaultLicense;
private String defaultWsTheme;
private List<ExtMediaDescripDTO> extMediaDescrips;
+ private boolean feedbackEnabled;
private String flvEmbedObject;
private String galleryPermittedExtensions;
private List<ToolSimpleDTO> groupTools;
@@ -180,6 +181,10 @@
return getUserInfo() != null;
}
+ public boolean isFeedbackEnabled() {
+ return feedbackEnabled;
+ }
+
public void setAviEmbedObject(final String aviEmbedObject) {
this.aviEmbedObject = aviEmbedObject;
}
@@ -216,6 +221,10 @@
this.extMediaDescrips = extMediaDescrips;
}
+ public void setFeedbackEnabled(final boolean feedbackEnabled) {
+ this.feedbackEnabled = feedbackEnabled;
+ }
+
public void setFlvEmbedObject(final String flvEmbedObject) {
this.flvEmbedObject = flvEmbedObject;
}
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -61,6 +61,8 @@
IsActionExtensible getSubheaderToolbar();
+ IsActionExtensible getToolsSouthToolbar();
+
ForIsWidget getUserSpace();
void selectGroupSpace();
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -95,6 +95,8 @@
private final ActionFlowPanel subheaderToolbar;
@UiField
TabLayoutPanel tabs;
+ private final ActionFlowPanel toolsSouthToolbar;
+
@UiField
FlowPanel userSpace;
@@ -110,9 +112,11 @@
footerToolbar = toolbarProv.get();
headerToolbar = toolbarProv.get();
subheaderToolbar = toolbarProv.get();
+ toolsSouthToolbar = toolbarProv.get();
getDocHeader().add(headerToolbar);
getDocSubheader().add(subheaderToolbar);
getDocFooter().add(footerToolbar);
+ getEntityToolsSouth().add(toolsSouthToolbar);
entityToolsNorth.getElement().getStyle().setPosition(Position.RELATIVE);
// entityToolsSouth.setVisible(false);
mainpanel.getWidgetContainerElement(tabs).addClassName("k-spaces");
@@ -215,6 +219,11 @@
}
@Override
+ public IsActionExtensible getToolsSouthToolbar() {
+ return toolsSouthToolbar;
+ }
+
+ @Override
public ForIsWidget getUserSpace() {
return userSpace;
}
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -23,13 +23,14 @@
import cc.kune.core.client.sitebar.search.SitebarSearchPanel;
import cc.kune.core.client.sitebar.search.SitebarSearchPresenter;
import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
+import cc.kune.gspace.client.actions.GiveUsFeedbackBtn;
import cc.kune.gspace.client.actions.RenameAction;
import cc.kune.gspace.client.i18n.I18nTranslator;
import cc.kune.gspace.client.i18n.I18nTranslatorPanel;
import cc.kune.gspace.client.i18n.I18nTranslatorPresenter;
import cc.kune.gspace.client.i18n.I18nTranslatorPresenter.I18nTranslatorView;
+import cc.kune.gspace.client.i18n.I18nTranslatorTabsCollection;
import cc.kune.gspace.client.i18n.SiteOptionsI18nTranslatorAction;
-import cc.kune.gspace.client.i18n.I18nTranslatorTabsCollection;
import cc.kune.gspace.client.licensewizard.LicenseChangeAction;
import cc.kune.gspace.client.licensewizard.LicenseWizard;
import cc.kune.gspace.client.licensewizard.LicenseWizardPanel;
@@ -184,6 +185,7 @@
// Actions
s(ContentViewerOptionsMenu.class);
s(RenameAction.class);
+ s(GiveUsFeedbackBtn.class);
// LicenseWizard
bindPresenter(LicenseWizardPresenter.class, LicenseWizardView.class, LicenseWizardPanel.class,
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -23,9 +23,10 @@
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
import cc.kune.core.client.sitebar.search.SitebarSearchPresenter;
import cc.kune.core.client.state.Session;
+import cc.kune.gspace.client.actions.GiveUsFeedbackBtn;
import cc.kune.gspace.client.i18n.I18nToTranslateGridPanel;
+import cc.kune.gspace.client.i18n.I18nTranslatorTabsCollection;
import cc.kune.gspace.client.i18n.SiteOptionsI18nTranslatorAction;
-import cc.kune.gspace.client.i18n.I18nTranslatorTabsCollection;
import cc.kune.gspace.client.options.GroupOptions;
import cc.kune.gspace.client.options.GroupOptionsCollection;
import cc.kune.gspace.client.options.UserOptions;
@@ -67,6 +68,7 @@
final Provider<UserOptStyle> ups, final Provider<UserOptLogo> ul,
final Provider<UserOptTools> utc, final Provider<SitebarSearchPresenter> siteSearch,
final Provider<SiteOptionsI18nTranslatorAction> transAction,
+ final Provider<GiveUsFeedbackBtn> giveUsFeedback,
final Provider<I18nToTranslateGridPanel> toTrans,
final Provider<I18nTranslatorTabsCollection> gtranslator) {
@@ -102,6 +104,11 @@
// i18n
transAction.get();
gtranslator.get().add(toTrans);
+
+ // Feedback
+ if (event.getInitData().isFeedbackEnabled()) {
+ giveUsFeedback.get();
+ }
}
});
}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackAction.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackAction.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackAction.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -0,0 +1,69 @@
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.AbstractExtendedAction;
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.notify.NotifyLevel;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.utils.SimpleResponseCallback;
+import cc.kune.core.client.auth.SignIn;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.SiteTokens;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.client.state.TokenUtils;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class GiveUsFeedbackAction extends AbstractExtendedAction {
+
+ private final Provider<ContentServiceAsync> contentService;
+ private final I18nTranslationService i18n;
+ private final Session session;
+ private final Provider<SignIn> signIn;
+ private final StateManager stateManager;
+
+ @Inject
+ public GiveUsFeedbackAction(final Session session, final Provider<SignIn> signIn,
+ final StateManager stateManager, final I18nTranslationService i18n,
+ final Provider<ContentServiceAsync> contentService) {
+ this.session = session;
+ this.signIn = signIn;
+ this.stateManager = stateManager;
+ this.i18n = i18n;
+ this.contentService = contentService;
+ }
+
+ @Override
+ public void actionPerformed(final ActionEvent event) {
+ if (session.isLogged()) {
+ NotifyUser.askConfirmation(
+ i18n.t("Confirm, please:"),
+ i18n.t("Do you want to write us with some positive or negative feedback? This can help us to improve these services"),
+ new SimpleResponseCallback() {
+ @Override
+ public void onCancel() {
+ }
+
+ @Override
+ public void onSuccess() {
+ contentService.get().sendFeedback(session.getUserHash(),
+ i18n.t("Feedback of [%s]", session.getCurrentUser().getShortName()),
+ i18n.t("Edit and write here your feedback."), new AsyncCallbackSimple<String>() {
+ @Override
+ public void onSuccess(final String url) {
+ stateManager.gotoHistoryToken(url);
+ }
+ });
+ }
+ });
+ } else {
+ signIn.get().setErrorMessage(i18n.t("Sign in or create an account to give us feedback"),
+ NotifyLevel.info);
+ stateManager.gotoHistoryToken(TokenUtils.addRedirect(SiteTokens.SIGNIN,
+ session.getCurrentStateToken().toString()));
+ }
+ }
+}
Added: trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackBtn.java (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackBtn.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -0,0 +1,23 @@
+package cc.kune.gspace.client.actions;
+
+import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.GSpaceArmor;
+
+import com.google.inject.Inject;
+
+public class GiveUsFeedbackBtn extends ButtonDescriptor {
+
+ @Inject
+ public GiveUsFeedbackBtn(final GiveUsFeedbackAction action, final I18nTranslationService i18n,
+ final NavResources res, final GSpaceArmor armor) {
+ super(action);
+ withIcon(res.refresh());
+ withText(i18n.t("Give us feedback!"));
+ withToolTip(i18n.t("Write us with some feedback for help us to improve these services"));
+ withStyles("k-noborder, k-nobackcolor, k-no-backimage");
+ armor.getToolsSouthToolbar().add(this);
+ }
+
+}
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -42,6 +42,7 @@
import cc.kune.gspace.client.actions.RenameAction;
import cc.kune.gspace.client.actions.RenameListener;
import cc.kune.gspace.client.tool.ContentViewer;
+import cc.kune.wave.client.WaveClientManager;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.event.shared.HandlerRegistration;
@@ -96,7 +97,7 @@
public ContentViewerPresenter(final EventBus eventBus, final ContentViewerView view,
final StateManager stateManager, final ContentViewerProxy proxy, final Session session,
final ActionRegistryByType actionsRegistry, final Provider<RenameAction> renameAction,
- final PathToolbarUtils pathToolbarUtils) {
+ final PathToolbarUtils pathToolbarUtils, final WaveClientManager wavClientManager) {
super(eventBus, view, proxy);
this.session = session;
this.actionsRegistry = actionsRegistry;
@@ -109,7 +110,6 @@
}
});
session.onUserSignIn(true, new UserSignInHandler() {
-
@Override
public void onUserSignIn(final UserSignInEvent event) {
getView().signIn();
@@ -174,7 +174,8 @@
if (session.isLogged() && rights.isEditable()) {
if (stateContent.isParticipant()) {
// is already participant, show wave editor
- if (org.waveprotocol.box.webclient.client.Session.get().isLoggedIn()) {
+ final org.waveprotocol.box.webclient.client.Session waveSession = org.waveprotocol.box.webclient.client.Session.get();
+ if (waveSession != null && waveSession.isLoggedIn()) {
// final String typeId = stateContent.getTypeId();
// if (typeId.equals(BartersConstants.TYPE_BARTER)
// || typeId.equals(MeetingsConstants.TYPE_MEETING)) {
Modified: trunk/src/main/java/cc/kune/wave/client/WaveClientManager.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveClientManager.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/wave/client/WaveClientManager.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -19,6 +19,7 @@
*/
package cc.kune.wave.client;
+import cc.kune.common.client.log.Log;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.UserServiceAsync;
import cc.kune.core.client.state.Session;
@@ -34,6 +35,8 @@
import com.google.gwt.core.client.JavaScriptObject;
import com.google.gwt.core.client.JsonUtils;
+import com.google.gwt.core.client.Scheduler;
+import com.google.gwt.core.client.Scheduler.ScheduledCommand;
import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
import com.google.inject.Inject;
@@ -56,18 +59,24 @@
setUseSocketIO(result.useSocketIO());
setSessionJSON(JsonUtils.safeEval(result.getSessionJSON()));
setClientFlags(JsonUtils.safeEval(result.getClientFlags()));
- final ForIsWidget userSpace = wsArmor.getUserSpace();
- if (webClient == null) {
- if (userSpace.getWidgetCount() > 0) {
- userSpace.remove(0);
+ Log.info("Wave client session: " + result.getSessionJSON());
+ Scheduler.get().scheduleDeferred(new ScheduledCommand() {
+ @Override
+ public void execute() {
+ final ForIsWidget userSpace = wsArmor.getUserSpace();
+ if (webClient == null) {
+ if (userSpace.getWidgetCount() > 0) {
+ userSpace.remove(0);
+ }
+ webClient = webclientView.get();
+ userSpace.add(webClient);
+ } else {
+ // this is done with the first webclient creation above
+ webClient.login();
+ webClient.asWidget().setVisible(true);
+ }
}
- webClient = webclientView.get();
- userSpace.add(webClient);
- } else {
- // this is done with the first webclient creation above
- webClient.login();
- webClient.asWidget().setVisible(true);
- }
+ });
}
});
}
@@ -91,14 +100,14 @@
}
private native void setClientFlags(JavaScriptObject object) /*-{
- $wnd.__client_flags = object;
- }-*/;
+ $wnd.__client_flags = object;
+ }-*/;
private native void setSessionJSON(JavaScriptObject object) /*-{
- $wnd.__session = object;
- }-*/;
+ $wnd.__session = object;
+ }-*/;
private native void setUseSocketIO(boolean use) /*-{
- $wnd.__useSocketIO = use;
- }-*/;
+ $wnd.__useSocketIO = use;
+ }-*/;
}
Modified: trunk/src/main/java/cc/kune/wave/client/WaveGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveGinModule.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/wave/client/WaveGinModule.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -32,14 +32,14 @@
*/
@Override
protected void configure() {
+ s(WebClientMock.class);
+ s(WebClient.class);
+ s(WaveClientProvider.class);
s(WaveClientManager.class);
s(WaveStatusIndicator.class);
eagle(WaveParts.class);
s(KuneWaveProfileManager.class);
s(InboxCountView.class, InboxCountPanel.class);
s(InboxCountPresenter.class);
- s(WaveClientProvider.class);
- s(WebClientMock.class);
- s(WebClient.class);
}
}
Modified: trunk/src/main/java/cc/kune/wave/client/WebClient.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/wave/client/WebClient.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -25,6 +25,7 @@
import java.util.Date;
import java.util.logging.Logger;
+import org.apache.commons.lang.NotImplementedException;
import org.waveprotocol.box.webclient.client.ClientEvents;
import org.waveprotocol.box.webclient.client.ClientIdGenerator;
import org.waveprotocol.box.webclient.client.DebugMessagePanel;
@@ -32,7 +33,6 @@
import org.waveprotocol.box.webclient.client.RemoteViewServiceMultiplexer;
import org.waveprotocol.box.webclient.client.Session;
import org.waveprotocol.box.webclient.client.SimpleWaveStore;
-import org.waveprotocol.box.webclient.client.StagesProvider;
import org.waveprotocol.box.webclient.client.WaveWebSocketClient;
import org.waveprotocol.box.webclient.client.events.NetworkStatusEvent;
import org.waveprotocol.box.webclient.client.events.NetworkStatusEventHandler;
@@ -51,7 +51,6 @@
import org.waveprotocol.box.webclient.widget.frame.FramedPanel;
import org.waveprotocol.box.webclient.widget.loading.LoadingIndicator;
import org.waveprotocol.wave.client.account.ProfileManager;
-import org.waveprotocol.wave.client.account.impl.ProfileManagerImpl;
import org.waveprotocol.wave.client.common.safehtml.SafeHtml;
import org.waveprotocol.wave.client.common.safehtml.SafeHtmlBuilder;
import org.waveprotocol.wave.client.common.util.AsyncHolder.Accessor;
@@ -62,6 +61,7 @@
import org.waveprotocol.wave.model.wave.ParticipantId;
import org.waveprotocol.wave.model.waveref.WaveRef;
+import cc.kune.common.client.errors.UIException;
import cc.kune.common.client.notify.NotifyUser;
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.sitebar.spaces.Space;
@@ -81,15 +81,18 @@
import com.google.gwt.user.client.Command;
import com.google.gwt.user.client.History;
import com.google.gwt.user.client.Timer;
+import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.DockLayoutPanel;
import com.google.gwt.user.client.ui.SplitLayoutPanel;
import com.google.gwt.user.client.ui.UIObject;
import com.google.inject.Inject;
+import com.google.inject.Singleton;
/**
* Entry point classes define <code>onModuleLoad()</code>.
*/
+@Singleton
public class WebClient extends Composite implements WaveClientView {
interface Binder extends UiBinder<DockLayoutPanel, WebClient> {
}
@@ -245,7 +248,7 @@
*/
@Inject
public WebClient(final EventBus eventBus, KuneWaveProfileManager profiles, InboxCountPresenter inboxCount, TokenMatcher tokenMatcher) {
-
+ // Window.alert("webclient! " + new Date());
this.eventBus = eventBus;
this.profiles = profiles;
this.inboxCount = inboxCount;
@@ -338,11 +341,11 @@
*/
// XXX check formatting wrt GPE
private native String getWebSocketBaseUrl(String moduleBase) /*-{
- return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/";
+ return "ws" + /:\/\/[^\/]+/.exec(moduleBase)[0] + "/";
}-*/;
private native boolean useSocketIO() /*-{
- return !!$wnd.__useSocketIO
+ return !!$wnd.__useSocketIO
}-*/;
/**
Modified: trunk/src/main/java/cc/kune/wave/server/KuneAgent.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneAgent.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/wave/server/KuneAgent.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -70,8 +70,8 @@
}
@Override
- public WaveRef createWave(final String message, final ParticipantId participant) {
- return createWave(NO_TITLE, message, participant);
+ public WaveRef createWave(final String message, final ParticipantId... participants) {
+ return createWave(NO_TITLE, message, participants);
}
@Override
Modified: trunk/src/main/java/cc/kune/wave/server/KuneWaveManager.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveManager.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveManager.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -35,7 +35,7 @@
void addParticipants(WaveRef waveName, String author, String userWhoAdd, String... newParticipants);
- WaveRef createWave(String message, ParticipantId participants);
+ WaveRef createWave(String message, ParticipantId... participants);
WaveRef createWave(String title, String message, ParticipantId... participantsArray);
Modified: trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveManagerDefault.java 2011-09-20 01:32:58 UTC (rev 1523)
@@ -211,8 +211,8 @@
}
@Override
- public WaveRef createWave(final String message, final ParticipantId participant) {
- return createWave(NO_TITLE, message, participant);
+ public WaveRef createWave(final String message, final ParticipantId... participants) {
+ return createWave(NO_TITLE, message, participants);
}
@Override
Modified: trunk/src/main/resources/kune.properties
===================================================================
--- trunk/src/main/resources/kune.properties 2011-09-19 20:25:07 UTC (rev 1522)
+++ trunk/src/main/resources/kune.properties 2011-09-20 01:32:58 UTC (rev 1523)
@@ -29,6 +29,11 @@
kune.chat.domain = localhost
kune.chat.roomHost = rooms.localhost
+### Feedback syste
+kune.feedback.enabled = true
+# List of participants to give feedback, comma-separated
+kune.feedback.to = admin
+
### Other params
# Reserved words to avoid it's use in the client side for user and group names
1
0
Author: vjrj_
Date: 2011-09-19 22:25:07 +0200 (Mon, 19 Sep 2011)
New Revision: 1522
Added:
trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.java
trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties
trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_es.properties
Modified:
trunk/script/i18n-db2gwt.sh
trunk/src/main/java/cc/kune/Kune.gwt.xml
trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java
trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java
trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java
trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java
trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java
trunk/src/main/java/cc/kune/core/client/sitebar/AboutKuneDialog.java
trunk/src/main/java/cc/kune/core/server/manager/UserManager.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/I18nLanguageSimpleDTO.java
trunk/src/main/java/cc/kune/core/shared/dto/I18nTranslationDTO.java
trunk/src/main/java/cc/kune/domain/I18nTranslation.java
trunk/src/main/java/cc/kune/domain/finders/I18nTranslationFinder.java
trunk/src/main/java/cc/kune/gspace/client/i18n/AbstractLanguageSelectorPanel.java
trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.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/themes/GSpaceThemeSelectorPresenter.java
trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java
Log:
NEW - # 79: I18n refactorization
http://kune.ourproject.org/issues/ticket/79
Modified: trunk/script/i18n-db2gwt.sh
===================================================================
--- trunk/script/i18n-db2gwt.sh 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/script/i18n-db2gwt.sh 2011-09-19 20:25:07 UTC (rev 1522)
@@ -7,7 +7,7 @@
echo "$0 -l en"
}
-while getopts “hl:” OPTION
+while getopts “hl:j” OPTION
do
case $OPTION in
h)
@@ -17,6 +17,9 @@
l)
L=$OPTARG
;;
+ j)
+ J=1
+ ;;
?)
usage
exit
@@ -29,6 +32,63 @@
usage
exit 1
fi
+if [[ $L = "en" ]]
+then
+ SEL="SELECT g.tr_key,g.tr_key,g.text,l.code,g.noteForTranslators FROM globalize_translations g, globalize_languages l where g.language_id = l.id AND l.code='en';"
+else
+ SEL="SELECT g.tr_key,p.tr_key,g.text,l.code,g.noteForTranslators FROM globalize_translations g, globalize_translations p, globalize_languages l where g.language_id = l.id AND l.code='$L' AND (g.parent_id = p.id OR g.parent_id = NULL) AND g.text != '';"
+fi
+if [[ $J -eq 1 ]]
+then
+mysql -B --skip-column-names --password="db4kune" -u kune kune_dev -e "$SEL" \
+| sed 's/ /ł/g' \
+| awk -F "ł" '
+BEGIN {
+ print "public interface KuneConstants extends ConstantsWithLookup {"
+}
+{
+ lang=$4
+ nt=$5
+ if (lang != "en") {
+ trkey=$2
+ trad=$3
+ } else {
+ trkey=$1
+ trad=$2
+ }
+ cmd="echo \" String \"`bin/convertI18nMsgToMethods.sh \""trkey" "nt"\"`\"();\""
+ result = system(cmd)
+}
+END {
+ print "}"
+}'
+else
+mysql -B --skip-column-names --password="db4kune" -u kune kune_dev -e "$SEL" \
+| sed 's/ /ł/g' \
+| awk -F "ł" '
+BEGIN {
+}
+{
+ lang=$4
+ nt=$5
+ if (lang != "en") {
+ trkey=$2
+ trad=$3
+ } else {
+ trkey=$1
+ trad=$2
+ }
+ #gsub(/\[/, "\\[", trkey)
+ #gsub(/\]/, "\\]", trkey)
+ #print trkey "--->" trad
+ cmd="echo `bin/convertI18nMsgToMethods.sh \""trkey" "nt"\"` = \""trad"\""
+ #print cmd
+ #exit
+ result = system(cmd)
+}
+END {
+}'
+fi
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/Kune.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/Kune.gwt.xml 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/Kune.gwt.xml 2011-09-19 20:25:07 UTC (rev 1522)
@@ -2,6 +2,7 @@
<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.0.1//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.0.1/distro-source/core/…">
<module rename-to="ws">
<inherits name="com.google.gwt.user.User" />
+ <inherits name="com.google.gwt.i18n.I18N"/>
<inherits name='com.google.gwt.logging.Logging' />
<inherits name="cc.kune.core.KuneCore" />
<inherits name="cc.kune.wave.KuneWave" />
@@ -53,9 +54,11 @@
<!-- For make CSS obfuscation more pretty -->
<set-configuration-property name="CssResource.style"
value="pretty" />
+ <!-- I18n ===================================================== -->
+ <extend-property name="locale" values="en" />
+ <extend-property name="locale" values="es" />
<!-- Hardcoded locale (to override emite italian support) ===== -->
- <extend-property name="locale" values="en" />
- <set-property name="locale" value="en" />
+ <!-- <set-property name="locale" value="en" /> -->
<!-- Hardcoded log level ====================================== -->
<!-- Turn off logging in wave -->
<set-property name="loglevel" value="none" />
Modified: trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/client/actions/xml/XMLActionsParser.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -157,7 +157,10 @@
@Override
public GuiActionDescrip get() {
final MenuItemDescriptor menuItem = new MenuItemDescriptor(action);
- menuItem.withText(descrip.getDescName()).withToolTip(descrip.getDescription());
+ // Warning: getDescription returns \n we have to replace this to
+ // spaces before use i18n in the tooltips (anyway tooltips are not
+ // working in menu items)
+ menuItem.withText(i18n.t(descrip.getDescName())).withToolTip(descrip.getDescription());
menuItem.setParent(TextUtils.notEmpty(path) ? submenu : menu, false);
return menuItem;
}
Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -21,8 +21,10 @@
import java.util.Date;
import java.util.HashMap;
+import java.util.MissingResourceException;
import cc.kune.common.client.log.Log;
+import cc.kune.common.client.notify.NotifyUser;
import cc.kune.common.client.utils.Location;
import cc.kune.common.client.utils.TextUtils;
import cc.kune.common.client.utils.WindowUtils;
@@ -41,14 +43,16 @@
private I18nLanguageDTO currentLang;
private String currentLanguageCode;
private final I18nServiceAsync i18nService;
+ private final KuneConstants kuneConstants;
private HashMap<String, String> lexicon;
private final Session session;
@Inject
public I18nUITranslationService(final Session session, final I18nServiceAsync i18nService,
- final EventBus eventBus) {
+ final EventBus eventBus, final KuneConstants kuneConstants) {
this.session = session;
this.i18nService = i18nService;
+ this.kuneConstants = kuneConstants;
final Location loc = WindowUtils.getLocation();
final String locale = loc.getParameter("locale");
i18nService.getInitialLanguage(locale, new AsyncCallback<I18nLanguageDTO>() {
@@ -60,6 +64,7 @@
@Override
public void onSuccess(final I18nLanguageDTO result) {
currentLang = result;
+ NotifyUser.info("lang: " + result.getCode());
currentLanguageCode = currentLang.getCode();
session.setCurrentLanguage(currentLang);
i18nService.getLexicon(currentLang.getCode(), new AsyncCallback<HashMap<String, String>>() {
@@ -193,36 +198,39 @@
*/
@Override
public String tWithNT(final String text, final String noteForTranslators) {
- if (lexicon == null) {
- Log.warn("i18n not initialized");
- return text;
- }
final String encodeText = TextUtils.escapeHtmlLight(text);
- String translation = lexicon.get(encodeText);
- if (lexicon.containsKey(encodeText)) {
- if (translation == UNTRANSLATED_VALUE) {
- // Not translated but in db, return text
- translation = encodeText;
+ try {
+ return kuneConstants.getString(I18nUtils.convertMethodName(text + " " + noteForTranslators));
+ } catch (final MissingResourceException e) {
+ if (lexicon == null) {
+ Log.warn("i18n not initialized");
+ return text;
}
- } else {
- // Not translated and not in db, make a petition for translation
- if (session.isLogged()) {
- i18nService.getTranslation(session.getUserHash(), currentLanguageCode, text, noteForTranslators,
- new AsyncCallback<String>() {
- @Override
- public void onFailure(final Throwable caught) {
- }
+ String translation = lexicon.get(encodeText);
+ if (lexicon.containsKey(encodeText)) {
+ if (translation == UNTRANSLATED_VALUE) {
+ // Not translated but in db, return text
+ translation = encodeText;
+ }
+ } else {
+ // Not translated and not in db, make a petition for translation
+ if (session.isLogged()) {
+ i18nService.getTranslation(session.getUserHash(), currentLanguageCode, text,
+ noteForTranslators, new AsyncCallback<String>() {
+ @Override
+ public void onFailure(final Throwable caught) {
+ }
- @Override
- public void onSuccess(final String result) {
- }
- });
- Log.debug("Registering in db '" + text + "' as pending translation");
- lexicon.put(encodeText, UNTRANSLATED_VALUE);
+ @Override
+ public void onSuccess(final String result) {
+ }
+ });
+ Log.debug("Registering in db '" + text + "' as pending translation");
+ lexicon.put(encodeText, UNTRANSLATED_VALUE);
+ }
+ translation = encodeText;
}
- translation = encodeText;
+ return decodeHtml(translation);
}
- return decodeHtml(translation);
}
-
}
Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUtils.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -15,7 +15,9 @@
final char[] delimiters = { ' ', '.', '?', ',', ';', '&', '(', ')', '"', '$', '!', '/', '\'', '-',
'%', ':', '{', '}', '[', ']', '©', '«', '»' };
result = TextUtils.capitalizeFully(result, delimiters);
- result = result.replaceAll("[ \\.\\?,;&\\(\\)\"\\$!\\/\\'\\-%:{}\\[\\]]", "");
+ // result = result.replaceAll("[ \\.\\?,;&\\(\\)\"\\$!\\/\\'\\-%:{}\\[\\]]",
+ // "");
+ result = result.replaceAll("[^a-zA-Z0-9]", "");
return TextUtils.abbreviate(
new StringBuffer(result.length()).append(Character.toLowerCase(result.charAt(0))).append(
result.substring(1)).toString(), 0, 100, "");
Added: trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -0,0 +1,513 @@
+package cc.kune.core.client.i18n;
+
+import com.google.gwt.i18n.client.ConstantsWithLookup;
+
+public interface KuneConstants extends ConstantsWithLookup {
+ String aboutKune();
+
+ String aboutKuneTitleOfDialog();
+
+ String acceptThisMember();
+
+ String actions();
+
+ String addANewBuddy();
+
+ String addAsABuddie();
+
+ String admins();
+
+ String allowAnyUsesOfYourWorkIncludingCommercial();
+
+ String allowModificationsOfYourWork();
+
+ String alsoYouCanUploadABackground();
+
+ String anOrganizationWorksAsAProjectButOrganizationsMustBeALegalEntity();
+
+ String anyone();
+
+ String apacheWavePowered();
+
+ String aProjectIsAKindOfGroupInWhichNewMembersJoiningIsModeratedByTheProjectAdministratorsAnAdministratorIs();
+
+ String areYouSure();
+
+ String autoAcceptRequestToJoin();
+
+ String available();
+
+ String availableForChat();
+
+ String away();
+
+ String backusedInButton();
+
+ String blackwhiteAThemeName();
+
+ String blueAThemeName();
+
+ String buddies();
+
+ String busy();
+
+ String calendar();
+
+ String campAThemeName();
+
+ String cancel();
+
+ String change();
+
+ String changeThisWorkspaceTheme();
+
+ String changeToAdmin();
+
+ String changeToCollaborator();
+
+ String chat();
+
+ String chatAbout();
+
+ String chatAndCommentThis();
+
+ String chatWithThisMember();
+
+ String chatWithThisPerson();
+
+ String chatWithYourBuddie();
+
+ String choose();
+
+ String clear();
+
+ String clickToRename();
+
+ String clickToSelectAndConfigureThisTheme();
+
+ String close();
+
+ String closed();
+
+ String closedForNewMembers();
+
+ String closedGroupsAreSocialGroupsOfPersonsLikeFamilyFriendsBuddiesEtcWhichAreModeratedToNewMembersAndWithP();
+
+ String collaborators();
+
+ String commonLicensesForCulturalWorks();
+
+ String communitiesAreSocialGroupsOfPersonsWithSharedInterestsWhichAreOpenToNewMembersForInstanceTheEnvironm();
+
+ String community();
+
+ String connecting();
+
+ String copyleft();
+
+ String copyTheTextToTranslate();
+
+ String create();
+
+ String createANewBlog();
+
+ String createANewBlogPost();
+
+ String createANewChatRoom();
+
+ String createANewDocumentHereThisDocumentWillBeANewPageInThePublicWebIfYouPublishIt();
+
+ String createANewDocumentThisDocumentWillBeANewPageInThePublicWebIfYouPublishIt();
+
+ String createANewFolder();
+
+ String createANewFolderHereAFolderWillBeASectionInThePublicWeb();
+
+ String createANewList();
+
+ String createANewMeetingHere();
+
+ String createANewPost();
+
+ String createANewTask();
+
+ String createANewWikipageHereThisDocumentWillBeANewPageInThePublicWebIfYouPublishIt();
+
+ String createNewGroup();
+
+ String currentBackgroundImage();
+
+ String defaultAThemeName();
+
+ String delete();
+
+ String doNotParticipateAnymoreInThisGroup();
+
+ String doubleClickToOpen();
+
+ String edit();
+
+ String enterLanguage();
+
+ String enterToThisGroupPublicChatRoom();
+
+ String enterToThisGroupPublicChatRoomAndInviteMembers();
+
+ String enterToThisRoom();
+
+ String errorsInfo();
+
+ String finishusedInButton();
+
+ String general();
+
+ String goUpOpenTheContainerFolder();
+
+ String greenAThemeName();
+
+ String greyAThemeName();
+
+ String groupAndPersonalSpaceWhereYouCanCreateAndPublishContentsForYourPersonalOrGroupWebSpaces();
+
+ String groupMembers();
+
+ String groupOptions();
+
+ String groupsInWhichThisUserParticipates();
+
+ String groupSPublicRoom();
+
+ String groupTags();
+
+ String groupType();
+
+ String helpToTranslateKune();
+
+ String helpWithTheTranslation();
+
+ String hereYouCanChangeThisValues();
+
+ String hereYouCanSelectTheToolsUsed();
+
+ String hereYouWillSeeTheArchiveOfOldConversationsInDevelopment();
+
+ String highcontrastAThemeName();
+
+ String hisHerNetwork();
+
+ String keywordsOrTermsAssociatedWithThisGroup();
+
+ String kuneDevelopmentSite();
+
+ String leaveThisGroup();
+
+ String license();
+
+ String licenseWizard();
+
+ String loading();
+
+ String longName();
+
+ String makeThisListNotPublic();
+
+ String media();
+
+ String moderateRequestToJoin();
+
+ String name();
+
+ String nConversationsUnread();
+
+ String newBlog();
+
+ String newDocument();
+
+ String newFolder();
+
+ String newGadget();
+
+ String newList();
+
+ String newMeeting();
+
+ String newMembersPolicy();
+
+ String newPoll();
+
+ String newPost();
+
+ String newRoom();
+
+ String newTask();
+
+ String newTaskFolder();
+
+ String newWikipage();
+
+ String nextusedInButton();
+
+ String no();
+
+ String notes();
+
+ String notPublicable();
+
+ String nSubscribedNPosts();
+
+ String offline();
+
+ String ok();
+
+ String onlyAdmins();
+
+ String onlyMembers();
+
+ String onlyYou();
+
+ String onlyYourBuddies();
+
+ String oopsSomethingHasGoneWrongWithOurServersRetryLaterPlease();
+
+ String open();
+
+ String openArchive();
+
+ String openTheConversationsArchiveOfThisRoom();
+
+ String options();
+
+ String organization();
+
+ String otherKindOfLicenses();
+
+ String otherPeopleThatCollaborateWithThisGroup();
+
+ String others();
+
+ String paramCreatednewContentCreatedForInstance();
+
+ String paramUnderLicenseParam();
+
+ String participate();
+
+ String participatesIn();
+
+ String pending();
+
+ String peopleAndGroupsCollaboratingInThisGroup();
+
+ String peoplePendingToBeAcceptedInThisGroupByTheAdmins();
+
+ String peopleThatCanAdminThisGroup();
+
+ String pinkAThemeName();
+
+ String pleaseConfirm();
+
+ String post();
+
+ String preview();
+
+ String project();
+
+ String publicDescription();
+
+ String publicSpaceInThisSpaceYouCanSeeAPreviewOfHowThePersonalOrGroupSpaceLooksLikeOnTheWebOutsideThisSite();
+
+ String pulseAltpageupOrAltpagedownToMoveUpDownInTheListWhileTranslatingAndAltVToCopyTheOriginalTextTheTrans();
+
+ String purpleAThemeName();
+
+ String reasonsNotToUseANonCommercialLicense();
+
+ String recommendations();
+
+ String redAThemeName();
+
+ String redblackAThemeName();
+
+ String register();
+
+ String registerANewGroup();
+
+ String rejectAsMember();
+
+ String reloadCurrentPage();
+
+ String reloadThis();
+
+ String removeCurrentBackgroundImage();
+
+ String removeThisMember();
+
+ String reportKuneIssuesProblems();
+
+ String requestToParticipateInThisGroup();
+
+ String saharaAThemeName();
+
+ String saving();
+
+ String search();
+
+ String searching();
+
+ String select();
+
+ String selectACreativeCommonsLicenseRecommendedForCulturalWorks();
+
+ String selectALicenseToShareYourGroupContentsWithOtherPeople();
+
+ String selectAndConfigureThePublicSpaceThemeOfThisGroup();
+
+ String selectAnImageInYourComputerAsTheLogoForThisGroupForBestResultsUseANxnPixelImageWeWillAutomaticallyRe();
+
+ String selectAnImageInYourComputerAsYourAvatarForBestResultsUseANxnPixelImageWeWillAutomaticallyResizeBigge();
+
+ String selectAsTheHomepage();
+
+ String selectLicense();
+
+ String selectOtherKindOfLicenses();
+
+ String selectTheLicenseType();
+
+ String setYourChatStatus();
+
+ String setYourGroupPreferencesHere();
+
+ String shortName();
+
+ String showHideTheChatWindow();
+
+ String signInToCollaborate();
+
+ String signOut();
+
+ String signOutOfChat();
+
+ String startAPublicAssemblyWithMembers();
+
+ String style();
+
+ String subscribe();
+
+ String subscribeToThisList();
+
+ String tags();
+
+ String theLicensorPermitsOthersToCopyDistributeDisplayAndPerformOnlyUnalteredCopiesOfTheWorkNotDerivativeWo();
+
+ String theLicensorPermitsOthersToCopyDistributeDisplayAndPerformTheWorkAsWellAsMakeDerivativeWorksBasedOnIt();
+
+ String theLicensorPermitsOthersToCopyDistributeDisplayAndPerformTheWorkForNonCommercialPurposesOnly();
+
+ String theLicensorPermitsOthersToCopyDistributeDisplayAndPerformTheWorkIncludingForCommercialPurposes();
+
+ String theLicensorPermitsOthersToDistributeDerivativeWorksOnlyUnderTheSameLicenseOrOneCompatibleWithTheOneT();
+
+ String theMembersOfThisGroupAreNotPublic();
+
+ String theNameMustBeBetween3And15LowercaseCharactersItCanOnlyContainWesternCharactersAndNumbers();
+
+ String theNameMustContainOnlyCharactersNumbersAndDashes();
+
+ String thisFolderIsEmpty();
+
+ String thisIsACopyleftLicense();
+
+ String thisIsAnOrphanedProjectIfYouAreInterestedPleaseRequestToJoinToWorkOnIt();
+
+ String thisIsAppropriateForFreeCulturalWorks();
+
+ String thisIsNotACopyleftLicense();
+
+ String thisIsNotAppropriateForFreeCulturalWorks();
+
+ String thisIsOnlyAPreviewOfHowThisPageLooksLikeToTheGeneralPublicOnTheWebOutsideThisSite();
+
+ String thisIsTheDefaultLicenseForAllTheContentsOfThisGroupYouCanAlsoSelectAnotherDifferentLicensePerContent();
+
+ String thisPageIsNotPublicable();
+
+ String thisUserBuddies();
+
+ String thisUserBuddiesAndGroupsWhereParticipes();
+
+ String thisUserDoesNotHaveAHomepage();
+
+ String thoseWhoCanViewThisMemberList();
+
+ String thoseWhoCanViewYourNetwork();
+
+ String tip();
+
+ String to();
+
+ String tools();
+
+ String toParamForExampleToSpanish();
+
+ String translated();
+
+ String translateThis();
+
+ String transparentAThemeName();
+
+ String typeSomeKeywordThatDefineYourGroup();
+
+ String typeSomethingToSearchUsersAndGroupsInThisSite();
+
+ String untranslated();
+
+ String useACopyleftLicenseRecommended();
+
+ String useAnotherKindOfLicenseAdvanced();
+
+ String userOptions();
+
+ String userSpaceItShowsAListOfAllYourDocumentsAndContentsInWhichYouParticipate();
+
+ String useTheGnuLicensesRecommendedForFreeSoftwareWorksAndOtherKindOfLicenses();
+
+ String visitHisHerHomepage();
+
+ String visitThisGroupHomepage();
+
+ String visitThisMemberHomepage();
+
+ String visitYourHomepage();
+
+ String voting();
+
+ String welcomeToTheParamPublicChatRoom();
+
+ String weRecommendParamLicensesSpeciallyForPracticalWorks();
+
+ String whiteblackAThemeName();
+
+ String whyDoWeNeedALicense();
+
+ String withACreativeCommonsLicenseYouKeepYourCopyrightButAllowPeopleToCopyAndDistributeYourWorkProvidedThey();
+
+ String yes();
+
+ String yesAsLongAsOtherShareAlike();
+
+ String youCanChangeThisLicenseLater();
+
+ String youCannotDisableThisToolBecauseItSWhereTheCurrentGroupHomePageIsLocatedToDoThatYouHaveToSelectOtherC();
+
+ String yourGroups();
+
+ String yourHomepage();
+
+ String yourHomePageInThisSite();
+
+ String yourLanguage();
+
+ String yourPreferences();
+
+ String youWillDeleteItWithAllItsContentsAreYouSure();
+}
Added: trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties 2011-09-19 20:25:07 UTC (rev 1522)
@@ -0,0 +1,256 @@
+chatWithYourBuddie = Chat with your buddie
+chatWithThisMember = Chat with this member
+addAsABuddie = Add as a buddie
+chat = Chat ;)
+thisIsOnlyAPreviewOfHowThisPageLooksLikeToTheGeneralPublicOnTheWebOutsideThisSite = This is only a preview of how this page looks like to the general public on the web, outside this site.
+preview = Preview
+paramUnderLicenseParam = © [%s], under license: [%s]
+clickToRename = Click to rename
+createANewDocumentThisDocumentWillBeANewPageInThePublicWebIfYouPublishIt = Create a New Document. This document will be a new 'Page' in the public web if you publish it
+reloadCurrentPage = Reload current page
+newDocument = New document
+goUpOpenTheContainerFolder = Go up: Open the container folder
+edit = Edit
+chatAndCommentThis = Chat and comment this
+chatAbout = Chat about
+available = Available
+nConversationsUnread = [%d] conversations unread
+offline = Offline
+connecting = Connecting
+newGadget = New Gadget
+voting = Voting
+calendar = Calendar
+media = Media
+others = Others
+loading = Loading
+participate = Participate
+options = Options
+doNotParticipateAnymoreInThisGroup = Do not participate anymore in this group
+requestToParticipateInThisGroup = Request to participate in this group
+leaveThisGroup = Leave this group
+thoseWhoCanViewThisMemberList = Those who can view this member list
+newMembersPolicy = New members policy
+anyone = anyone
+onlyMembers = only members
+onlyAdmins = only admins
+moderateRequestToJoin = moderate request to join
+autoAcceptRequestToJoin = auto accept request to join
+closedForNewMembers = closed for new members
+addANewBuddy = Add a new buddy
+thoseWhoCanViewYourNetwork = Those who can view your network
+onlyYourBuddies = only your buddies
+onlyYou = only you
+groupMembers = Group members
+peopleAndGroupsCollaboratingInThisGroup = People and groups collaborating in this group
+admins = Admins
+peopleThatCanAdminThisGroup = People that can admin this group
+collaborators = Collaborators
+otherPeopleThatCollaborateWithThisGroup = Other people that collaborate with this group
+pending = Pending
+peoplePendingToBeAcceptedInThisGroupByTheAdmins = People pending to be accepted in this group by the admins
+thisIsAnOrphanedProjectIfYouAreInterestedPleaseRequestToJoinToWorkOnIt = This is an orphaned project, if you are interested please request to join to work on it
+theMembersOfThisGroupAreNotPublic = The members of this group are not public
+changeToCollaborator = Change to collaborator
+changeToAdmin = Change to admin
+removeThisMember = Remove this member
+acceptThisMember = Accept this member
+rejectAsMember = Reject as member
+visitThisGroupHomepage = Visit this group homepage
+visitThisMemberHomepage = Visit this member homepage
+visitYourHomepage = Visit your homepage
+visitHisHerHomepage = Visit his/her homepage
+hisHerNetwork = His/her network:
+thisUserBuddiesAndGroupsWhereParticipes = This user buddies and groups where participes
+buddies = Buddies
+thisUserBuddies = This user buddies
+participatesIn = Participates in
+groupsInWhichThisUserParticipates = Groups in which this user participates
+yourGroups = Your groups
+yourHomepage = Your homepage
+yourHomePageInThisSite = Your home page in this site
+userSpaceItShowsAListOfAllYourDocumentsAndContentsInWhichYouParticipate = User space: it shows a list of all your documents and contents in which you participate
+groupAndPersonalSpaceWhereYouCanCreateAndPublishContentsForYourPersonalOrGroupWebSpaces = Group and personal space: Where you can create and publish contents for your personal or group web spaces
+publicSpaceInThisSpaceYouCanSeeAPreviewOfHowThePersonalOrGroupSpaceLooksLikeOnTheWebOutsideThisSite = Public space: In this space you can see a preview of how the Personal or Group Space looks like on the web, outside this site
+tags = Tags
+keywordsOrTermsAssociatedWithThisGroup = Keywords or terms associated with this group
+typeSomethingToSearchUsersAndGroupsInThisSite = Type something to search users and groups in this site
+search = Search
+close = Close
+groupOptions = Group options
+setYourGroupPreferencesHere = Set your group preferences here
+userOptions = User options
+yourPreferences = Your preferences
+helpWithTheTranslation = Help with the translation
+showHideTheChatWindow = Show/hide the chat window
+setYourChatStatus = Set your chat status
+availableForChat = Available for chat
+away = Away
+busy = Busy
+signOutOfChat = Sign out of chat
+groupSPublicRoom = Group's public room
+enterToThisGroupPublicChatRoom = Enter to this group public chat room
+startAPublicAssemblyWithMembers = Start a public assembly with members
+enterToThisGroupPublicChatRoomAndInviteMembers = Enter to this group public chat room and invite members
+reportKuneIssuesProblems = Report Kune issues/problems
+apacheWavePowered = Apache Wave powered
+aboutKune = About kune
+errorsInfo = Errors info
+signInToCollaborate = Sign in to collaborate
+signOut = Sign out
+createNewGroup = Create New Group
+kuneDevelopmentSite = kune development site
+enterLanguage = Enter language
+searching = Searching...
+copyTheTextToTranslate = Copy the text to translate
+translateThis = translate this:
+notes = Notes:
+tip = Tip:
+pulseAltpageupOrAltpagedownToMoveUpDownInTheListWhileTranslatingAndAltVToCopyTheOriginalTextTheTrans = Pulse Alt+PageUp or Alt+PageDown to move up/down in the list while translating, and Alt-V to copy the original text. The translations are autosaved
+untranslated = Untranslated
+translated = Translated
+recommendations = Recommendations
+helpToTranslateKune = Help to translate kune
+to = to
+general = General
+name = Name
+hereYouCanChangeThisValues = Here you can change this values:
+tools = Tools
+hereYouCanSelectTheToolsUsed = Here you can select the tools used:
+choose = Choose
+selectAnImageInYourComputerAsYourAvatarForBestResultsUseANxnPixelImageWeWillAutomaticallyResizeBigge = Select an image in your computer as your avatar. For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.
+style = Style
+changeThisWorkspaceTheme = Change this workspace theme:
+currentBackgroundImage = Current background image:
+alsoYouCanUploadABackground = Also you can upload a background:
+change = Change
+clear = Clear
+thisUserDoesNotHaveAHomepage = This user does not have a homepage
+removeCurrentBackgroundImage = Remove current background image
+selectAndConfigureThePublicSpaceThemeOfThisGroup = Select and configure the public space theme of this group:
+clickToSelectAndConfigureThisTheme = Click to select and configure this theme
+license = License
+thisIsTheDefaultLicenseForAllTheContentsOfThisGroupYouCanAlsoSelectAnotherDifferentLicensePerContent = This is the default license for all the contents of this group (you can also select another different license per content):
+notPublicable = Not Publicable
+thisPageIsNotPublicable = This page is not publicable
+chatWithThisPerson = Chat with this person
+toParamForExampleToSpanish = to [%s]:
+saving = Saving
+ok = Ok
+registerANewGroup = Register a new group
+register = Register
+cancel = Cancel
+shortName = Short name
+theNameMustBeBetween3And15LowercaseCharactersItCanOnlyContainWesternCharactersAndNumbers = The name must be between 3 and 15 lowercase characters. It can only contain Western characters and numbers
+longName = Long name
+publicDescription = Public description
+groupTags = Group tags
+typeSomeKeywordThatDefineYourGroup = type some keyword that define your group
+groupType = Group type
+project = Project
+aProjectIsAKindOfGroupInWhichNewMembersJoiningIsModeratedByTheProjectAdministratorsAnAdministratorIs = A project is a kind of group in which new members joining is moderated by the project administrators. An administrator is the person who creates the project and other people she/he chooses to be administrator as well.
+organization = Organization
+anOrganizationWorksAsAProjectButOrganizationsMustBeALegalEntity = An organization works as a project, but organizations must be a legal entity.
+closed = Closed
+closedGroupsAreSocialGroupsOfPersonsLikeFamilyFriendsBuddiesEtcWhichAreModeratedToNewMembersAndWithP = Closed groups are social groups of persons like family, friends, buddies, etc, which are moderated to new members and with private contents (by default)
+community = Community
+communitiesAreSocialGroupsOfPersonsWithSharedInterestsWhichAreOpenToNewMembersForInstanceTheEnvironm = Communities are social groups of persons with shared interests, which are open to new members (for instance the environmental community or the LGBT community). They rarely are a legal entity.
+createANewDocumentHereThisDocumentWillBeANewPageInThePublicWebIfYouPublishIt = Create a New Document here. This document will be a new 'Page' in the public web if you publish it
+newFolder = New folder
+createANewFolderHereAFolderWillBeASectionInThePublicWeb = Create a new folder here. A folder will be a 'section' in the public web
+doubleClickToOpen = Double click to open
+delete = Delete
+open = Open
+selectAsTheHomepage = Select as the homepage
+actions = Actions
+newBlog = New blog
+createANewBlog = Create a new blog
+reloadThis = Reload this
+newList = New list
+createANewList = Create a new list
+newPost = New post
+createANewBlogPost = Create a new blog post
+makeThisListNotPublic = Make this list not public
+createANewPost = Create a new post
+subscribe = Subscribe
+subscribeToThisList = Subscribe to this list
+nSubscribedNPosts = [%d] subscribed, [%d] posts
+newMeeting = New meeting
+createANewMeetingHere = Create a New Meeting here
+createANewTask = Create a new task
+newTask = New task
+newTaskFolder = New task folder
+createANewFolder = Create a new folder
+newWikipage = New wikipage
+createANewWikipageHereThisDocumentWillBeANewPageInThePublicWebIfYouPublishIt = Create a New Wikipage here. This document will be a new 'Page' in the public web if you publish it
+youCannotDisableThisToolBecauseItSWhereTheCurrentGroupHomePageIsLocatedToDoThatYouHaveToSelectOtherC = You cannot disable this tool because it's where the current group home page is located. To do that you have to select other content as the default group home page but in another tool.
+selectAnImageInYourComputerAsTheLogoForThisGroupForBestResultsUseANxnPixelImageWeWillAutomaticallyRe = Select an image in your computer as the logo for this group. For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.
+licenseWizard = License wizard
+backusedInButton = « Back
+nextusedInButton = Next »
+finishusedInButton = Finish
+select = Select
+selectALicenseToShareYourGroupContentsWithOtherPeople = Select a license to share your group contents with other people:
+useACopyleftLicenseRecommended = Use a copyleft license (recommended)
+useAnotherKindOfLicenseAdvanced = Use another kind of license (advanced)
+copyleft = copyleft
+weRecommendParamLicensesSpeciallyForPracticalWorks = We recommend [%s] licenses, specially for practical works
+whyDoWeNeedALicense = Why do we need a license?
+youCanChangeThisLicenseLater = You can change this license later
+selectTheLicenseType = Select the license type:
+commonLicensesForCulturalWorks = Common licenses for cultural works
+selectACreativeCommonsLicenseRecommendedForCulturalWorks = Select a Creative Commons license (recommended for cultural works)
+otherKindOfLicenses = Other kind of licenses
+useTheGnuLicensesRecommendedForFreeSoftwareWorksAndOtherKindOfLicenses = Use the GNU licenses (recommended for free software works) and other kind of licenses
+withACreativeCommonsLicenseYouKeepYourCopyrightButAllowPeopleToCopyAndDistributeYourWorkProvidedThey = With a Creative Commons license, you keep your copyright but allow people to copy and distribute your work provided they give you credit � and only on the conditions you specify here. What do you want to do?
+allowAnyUsesOfYourWorkIncludingCommercial = Allow any uses of your work, including commercial?
+allowModificationsOfYourWork = Allow modifications of your work?
+yes = Yes
+theLicensorPermitsOthersToCopyDistributeDisplayAndPerformTheWorkIncludingForCommercialPurposes = The licensor permits others to copy, distribute, display, and perform the work, including for commercial purposes
+no = No
+theLicensorPermitsOthersToCopyDistributeDisplayAndPerformTheWorkForNonCommercialPurposesOnly = The licensor permits others to copy, distribute, display, and perform the work for non-commercial purposes only
+theLicensorPermitsOthersToCopyDistributeDisplayAndPerformTheWorkAsWellAsMakeDerivativeWorksBasedOnIt = The licensor permits others to copy, distribute, display and perform the work, as well as make derivative works based on it
+yesAsLongAsOtherShareAlike = Yes, as long as other share alike
+theLicensorPermitsOthersToDistributeDerivativeWorksOnlyUnderTheSameLicenseOrOneCompatibleWithTheOneT = The licensor permits others to distribute derivative works only under the same license or one compatible with the one that governs the licensor's work
+theLicensorPermitsOthersToCopyDistributeDisplayAndPerformOnlyUnalteredCopiesOfTheWorkNotDerivativeWo = The licensor permits others to copy, distribute, display and perform only unaltered copies of the work � not derivative works based on it
+thisIsACopyleftLicense = This is a copyleft license.
+thisIsNotACopyleftLicense = This is not a copyleft license.
+thisIsAppropriateForFreeCulturalWorks = This is appropriate for free cultural works.
+thisIsNotAppropriateForFreeCulturalWorks = This is not appropriate for free cultural works.
+reasonsNotToUseANonCommercialLicense = Reasons not to use a non commercial license.
+selectOtherKindOfLicenses = Select other kind of licenses:
+selectLicense = Select license
+areYouSure = Are you sure?
+paramCreatednewContentCreatedForInstance = [%s] created
+pleaseConfirm = Please confirm
+thisFolderIsEmpty = This folder is empty
+youWillDeleteItWithAllItsContentsAreYouSure = You will delete it with all its contents. Are you sure?
+welcomeToTheParamPublicChatRoom = Welcome to the [%s] public chat room
+createANewChatRoom = Create a new chat room
+newRoom = New room
+enterToThisRoom = Enter to this room
+openArchive = Open archive
+openTheConversationsArchiveOfThisRoom = Open the conversations archive of this room
+hereYouWillSeeTheArchiveOfOldConversationsInDevelopment = Here you will see the archive of old conversations (in development)
+create = Create
+theNameMustContainOnlyCharactersNumbersAndDashes = The name must contain only characters, numbers and dashes
+post = Post
+newPoll = New poll
+thisUserDoesNotHaveAHomepage = This user does not have a homepage
+oopsSomethingHasGoneWrongWithOurServersRetryLaterPlease = Oops! Something has gone wrong with our servers. Retry later, please.
+yourLanguage = Your language
+redblackAThemeName = redblack
+purpleAThemeName = purple
+greenAThemeName = green
+highcontrastAThemeName = highcontrast
+blackwhiteAThemeName = blackwhite
+campAThemeName = camp
+defaultAThemeName = default
+redAThemeName = red
+blueAThemeName = blue
+greyAThemeName = grey
+saharaAThemeName = sahara
+pinkAThemeName = pink
+whiteblackAThemeName = whiteblack
+transparentAThemeName = transparent
+aboutKuneTitleOfDialog = About Kune
+
Added: trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_es.properties
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_es.properties (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_es.properties 2011-09-19 20:25:07 UTC (rev 1522)
@@ -0,0 +1,5 @@
+addAsABuddienull = Añadir como colega
+chatNull = Chat ;)
+search = Buscar
+thisUserDoesNotHaveAHomepage = Este/a usuario/a no tiene una página personal
+openArchive = Abrir archivo
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/client/notify/confirm/UserConfirmPanel.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -44,8 +44,8 @@
@Inject
public UserConfirmPanel(final I18nTranslationService i18n) {
- dialog = new BasicTopDialog.Builder(DIALOG_ID, false, true).autoscroll(false).width(100).height(100).firstButtonId(
- OK_ID).sndButtonId(CANCEL_ID).tabIndexStart(1).build();
+ dialog = new BasicTopDialog.Builder(DIALOG_ID, false, true).autoscroll(false).firstButtonId(OK_ID).sndButtonId(
+ CANCEL_ID).tabIndexStart(1).build();
askLabel = new HTML();
askLabel.addStyleName("k-userconfirm-label");
dialog.getInnerPanel().add(askLabel);
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/UserService.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -22,6 +22,7 @@
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.shared.domain.UserSNetVisibility;
import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
import cc.kune.core.shared.dto.StateAbstractDTO;
import cc.kune.core.shared.dto.UserDTO;
import cc.kune.core.shared.dto.UserInfoDTO;
@@ -49,6 +50,6 @@
void setBuddiesVisibility(String userHash, StateToken groupToken, UserSNetVisibility visibility);
- StateAbstractDTO updateUser(String userHash, UserDTO user) throws DefaultException;
+ StateAbstractDTO updateUser(String userHash, UserDTO user, I18nLanguageSimpleDTO lang);
}
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/UserServiceAsync.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -21,6 +21,7 @@
import cc.kune.core.shared.domain.UserSNetVisibility;
import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
import cc.kune.core.shared.dto.StateAbstractDTO;
import cc.kune.core.shared.dto.UserDTO;
import cc.kune.core.shared.dto.UserInfoDTO;
@@ -48,5 +49,6 @@
void setBuddiesVisibility(String userHash, StateToken groupToken, UserSNetVisibility visibility,
AsyncCallback<Void> asyncCallback);
- void updateUser(String userHash, UserDTO user, AsyncCallback<StateAbstractDTO> callback);
+ void updateUser(String userHash, UserDTO user, I18nLanguageSimpleDTO lang,
+ AsyncCallback<StateAbstractDTO> callback);
}
Modified: trunk/src/main/java/cc/kune/core/client/sitebar/AboutKuneDialog.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/AboutKuneDialog.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/AboutKuneDialog.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -47,9 +47,9 @@
@Inject
public AboutKuneDialog(final I18nTranslationService i18n) {
- dialog = new BasicTopDialog.Builder(ABOUT_KUNE_ID, true, true).title(i18n.t("About Kune")).autoscroll(
- false).firstButtonTitle(i18n.t("Ok")).firstButtonId(ABOUT_KUNE_BTN_ID).tabIndexStart(1).height(
- "300px").width("410px").build();
+ dialog = new BasicTopDialog.Builder(ABOUT_KUNE_ID, true, true).title(
+ i18n.tWithNT("About Kune", "title of dialog")).autoscroll(false).firstButtonTitle(i18n.t("Ok")).firstButtonId(
+ ABOUT_KUNE_BTN_ID).tabIndexStart(1).height("300px").width("410px").build();
dialog.getInnerPanel().add(BINDER.createAndBindUi(this));
dialog.getFirstBtn().addClickHandler(new ClickHandler() {
@Override
Modified: trunk/src/main/java/cc/kune/core/server/manager/UserManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/UserManager.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/server/manager/UserManager.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -24,6 +24,7 @@
import cc.kune.core.client.errors.I18nNotFoundException;
import cc.kune.core.server.manager.impl.SearchResult;
import cc.kune.core.shared.domain.UserSNetVisibility;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
import cc.kune.core.shared.dto.UserDTO;
import cc.kune.domain.User;
import cc.kune.domain.utils.UserBuddiesData;
@@ -76,8 +77,9 @@
* the userId to change
* @param user
* the userDTO with values to change
+ * @param lang
* @return the User after updated
*/
- User update(Long userId, UserDTO user);
+ User update(Long userId, UserDTO user, I18nLanguageSimpleDTO lang);
}
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -54,6 +54,7 @@
import cc.kune.core.server.xmpp.ChatException;
import cc.kune.core.server.xmpp.XmppManager;
import cc.kune.core.shared.domain.UserSNetVisibility;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
import cc.kune.core.shared.dto.UserDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
import cc.kune.domain.Group;
@@ -325,9 +326,9 @@
}
@Override
- public User update(final Long userId, final UserDTO userDTO) {
+ public User update(final Long userId, final UserDTO userDTO, final I18nLanguageSimpleDTO lang) {
final User user = find(userId);
- final String shortName = userDTO.getShortName();
+ // final String shortName = userDTO.getShortName();
final String longName = userDTO.getName();
final String email = userDTO.getEmail();
final Group userGroup = user.getUserGroup();
@@ -347,7 +348,8 @@
checkIfEmailAreInUse(email);
user.setEmail(email);
}
- user.setLanguage(findLanguage(userDTO.getLanguage().getCode()));
+ user.setLanguage(findLanguage(lang.getCode()));
+ // user.setLanguage(findLanguage(userDTO.getLanguage().getCode()));
persist(user);
groupManager.persist(userGroup);
return user;
Modified: trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/server/rpc/UserRPC.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -42,6 +42,7 @@
import cc.kune.core.shared.domain.AccessRol;
import cc.kune.core.shared.domain.UserSNetVisibility;
import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
import cc.kune.core.shared.dto.StateAbstractDTO;
import cc.kune.core.shared.dto.UserDTO;
import cc.kune.core.shared.dto.UserInfoDTO;
@@ -194,12 +195,13 @@
@Override
@Authenticated
@Transactional
- public StateAbstractDTO updateUser(final String userHash, final UserDTO user) throws DefaultException {
+ public StateAbstractDTO updateUser(final String userHash, final UserDTO user,
+ final I18nLanguageSimpleDTO lang) throws DefaultException {
final Long id = getUserSession().getUser().getId();
if (!id.equals(user.getId())) {
throw new AccessViolationException();
}
- final User userUpdated = userManager.update(id, user);
+ final User userUpdated = userManager.update(id, user, lang);
return contentRPC.getContent(userHash, userUpdated.getUserGroup().getStateToken());
}
}
Modified: trunk/src/main/java/cc/kune/core/shared/dto/I18nLanguageSimpleDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/I18nLanguageSimpleDTO.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/shared/dto/I18nLanguageSimpleDTO.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -23,7 +23,12 @@
public class I18nLanguageSimpleDTO implements IsSerializable {
+ public static I18nLanguageSimpleDTO create(final I18nLanguageDTO language) {
+ return new I18nLanguageSimpleDTO(language.getCode(), language.getEnglishName());
+ }
+
private String code;
+
private String englishName;
public I18nLanguageSimpleDTO() {
Modified: trunk/src/main/java/cc/kune/core/shared/dto/I18nTranslationDTO.java
===================================================================
--- trunk/src/main/java/cc/kune/core/shared/dto/I18nTranslationDTO.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/core/shared/dto/I18nTranslationDTO.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -42,11 +42,11 @@
private String trKey;
public I18nTranslationDTO() {
- this(null, null, null, null, null);
+ this(null, null, null, null, null, null);
}
public I18nTranslationDTO(final Long id, final String trKey, final String text, final Long parentId,
- final String parentTrKey) {
+ final String parentTrKey, final String noteForTranslators) {
this.id = id;
this.trKey = trKey;
this.text = text;
Modified: trunk/src/main/java/cc/kune/domain/I18nTranslation.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/I18nTranslation.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/domain/I18nTranslation.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -113,6 +113,7 @@
this.setNoteForTranslators(noteForTranslators);
if (parent == null) {
assert trKey != null;
+ this.parent = this;
}
if (parent != null) {
assert trKey == null;
@@ -151,7 +152,10 @@
}
public String getNoteForTranslators() {
- return noteForTranslators;
+ if (parent == this) {
+ return noteForTranslators;
+ }
+ return parent.getNoteForTranslators();
}
/**
@@ -165,7 +169,10 @@
}
public Long getParentId() {
- return parent == null ? null : parent.getId();
+ if (parent == this) {
+ return id;
+ }
+ return parent.getId();
}
public Integer getPluralizationIndex() {
@@ -181,11 +188,10 @@
}
public String getTrKey() {
- if (parent != null) {
- return parent.getTrKey();
- } else {
- return this.trKey;
+ if (parent == this) {
+ return trKey;
}
+ return parent.getTrKey();
}
public String getType() {
Modified: trunk/src/main/java/cc/kune/domain/finders/I18nTranslationFinder.java
===================================================================
--- trunk/src/main/java/cc/kune/domain/finders/I18nTranslationFinder.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/domain/finders/I18nTranslationFinder.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -33,9 +33,9 @@
public interface I18nTranslationFinder {
String TRANSLATED_COUNT_QUERY = "SELECT COUNT(gt.id) FROM I18nTranslation gt WHERE gt.language = :language and text!=null";
- String TRANSLATED_QUERY = "SELECT NEW cc.kune.core.shared.dto.I18nTranslationDTO(gt.id, gt.trKey, gt.text, gt.parent.id, gt.parent.trKey) FROM I18nTranslation gt LEFT JOIN gt.parent gp WHERE gt.language = :language AND gt.text!=null";
+ String TRANSLATED_QUERY = "SELECT NEW cc.kune.core.shared.dto.I18nTranslationDTO(gt.id, gt.trKey, gt.text, gt.parent.id, gt.parent.trKey, gt.parent.noteForTranslators) FROM I18nTranslation gt LEFT JOIN gt.parent gp WHERE gt.language = :language AND gt.text!=null";
String UNTRANSLATED_COUNT_QUERY = "SELECT COUNT(gt.id) FROM I18nTranslation gt WHERE gt.language = :language and text=null";
- String UNTRANSLATED_QUERY = "SELECT NEW cc.kune.core.shared.dto.I18nTranslationDTO(gt.id, gt.trKey, gt.text, gt.parent.id, gt.parent.trKey) FROM I18nTranslation gt LEFT JOIN gt.parent gp WHERE gt.language = :language AND gt.text=null";
+ String UNTRANSLATED_QUERY = "SELECT NEW cc.kune.core.shared.dto.I18nTranslationDTO(gt.id, gt.trKey, gt.text, gt.parent.id, gt.parent.trKey, gt.parent.noteForTranslators) FROM I18nTranslation gt LEFT JOIN gt.parent gp WHERE gt.language = :language AND gt.text=null";
@Finder(query = "SELECT gt FROM I18nTranslation gt JOIN gt.language gl WHERE gl.code = :language", returnAs = ArrayList.class)
public List<I18nTranslation> findByLanguage(@Named("language") final String language);
Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/AbstractLanguageSelectorPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/AbstractLanguageSelectorPanel.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/AbstractLanguageSelectorPanel.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -22,6 +22,7 @@
import cc.kune.common.client.errors.UIException;
import cc.kune.common.client.utils.SimpleCallback;
import cc.kune.core.client.state.Session;
+import cc.kune.core.client.ui.DefaultForm;
import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
@@ -47,6 +48,20 @@
set(ENGLISH_NAME, englishName);
}
+ @Override
+ public boolean equals(final Object obj) {
+ if (this == obj) {
+ return true;
+ }
+ if (obj == null) {
+ return false;
+ }
+ if (getClass() != obj.getClass()) {
+ return false;
+ }
+ return getCode().equals(((LanguageData) obj).getCode());
+ }
+
public String getCode() {
return get(CODE);
}
@@ -54,6 +69,14 @@
public String getEnglishName() {
return get(ENGLISH_NAME);
}
+
+ @Override
+ public int hashCode() {
+ final int prime = 31;
+ int result = 1;
+ result = prime * result + (getCode() == null ? 0 : getCode().hashCode());
+ return result;
+ }
}
public static final String LANG_FIELD = "k-langsp-lf";
@@ -71,6 +94,9 @@
setFrame(false);
setHeaderVisible(false);
setBodyBorder(false);
+ // setWidth(300);
+ setLabelWidth(DefaultForm.DEF_FIELD_LABEL_WITH + 25);
+ setPadding(0);
createLangCombo(withEnglish);
super.add(langCombo);
}
@@ -112,12 +138,16 @@
for (final I18nLanguageSimpleDTO lang : session.getLanguages()) {
final boolean isEnglish = lang.getCode().equals("en");
if (!isEnglish || (isEnglish && withEnglish)) {
- list.add(new LanguageData(lang.getCode(), lang.getEnglishName()));
+ list.add(getLangData(lang));
}
}
return list;
}
+ private LanguageData getLangData(final I18nLanguageSimpleDTO lang) {
+ return new LanguageData(lang.getCode(), lang.getEnglishName());
+ }
+
public I18nLanguageSimpleDTO getLanguage() {
final String langCode = langCombo.getValue().getCode();
for (final I18nLanguageSimpleDTO lang : session.getLanguages()) {
@@ -156,6 +186,6 @@
}
public void setLanguage(final I18nLanguageSimpleDTO language) {
- langCombo.setRawValue(language.getEnglishName());
+ langCombo.setValue(getLangData(language));
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/gspace/client/i18n/I18nTranslatorForm.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -141,7 +141,7 @@
item.setDirty(true);
dataProvider.refreshDisplays();
saver.save(new I18nTranslationDTO(item.getId(), item.getTrKey(), newTranslation,
- item.getParentId(), item.getParentTrKey()));
+ item.getParentId(), item.getParentTrKey(), item.getNoteForTranslators()));
}
}
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 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPanel.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -22,30 +22,49 @@
import cc.kune.common.client.ui.MaskWidget;
import cc.kune.core.client.auth.UserFieldFactory;
import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.i18n.LanguageSelectorPanel;
+import com.extjs.gxt.ui.client.widget.form.FormPanel.LabelAlign;
import com.extjs.gxt.ui.client.widget.form.TextField;
import com.google.inject.Inject;
public class UserOptGeneralPanel extends EntityOptGeneralPanel implements UserOptGeneralView {
private static final String LONG_NAME_FIELD = "k-uogp-lname";
+ private final LanguageSelectorPanel langSelector;
private final TextField<String> longName;
@Inject
public UserOptGeneralPanel(final I18nTranslationService i18n, final CoreResources res,
- final MaskWidget maskWidget) {
+ final MaskWidget maskWidget, final LanguageSelectorPanel langSelector) {
super(i18n, res, maskWidget);
+ this.langSelector = langSelector;
longName = UserFieldFactory.createUserLongName(LONG_NAME_FIELD);
add(longName);
+ langSelector.setLangTitle(i18n.t("Your language"));
+ langSelector.setLabelAlign(LabelAlign.LEFT);
+ langSelector.setLangSeparator(":");
+ add(langSelector);
}
@Override
+ public I18nLanguageSimpleDTO getLanguage() {
+ return langSelector.getLanguage();
+ }
+
+ @Override
public String getLongName() {
return longName.getValue();
}
@Override
+ public void setLanguage(final I18nLanguageSimpleDTO language) {
+ langSelector.setLanguage(language);
+ }
+
+ @Override
public void setLongName(final String longName) {
this.longName.setValue(longName);
}
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 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -26,6 +26,7 @@
import cc.kune.core.client.state.StateManager;
import cc.kune.core.client.state.UserSignInEvent;
import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
import cc.kune.core.shared.dto.StateAbstractDTO;
import cc.kune.core.shared.dto.UserDTO;
import cc.kune.core.shared.dto.UserSimpleDTO;
@@ -71,6 +72,7 @@
protected void setState() {
final UserSimpleDTO currentUser = session.getCurrentUser();
userView.setLongName(currentUser.getName());
+ userView.setLanguage(I18nLanguageSimpleDTO.create(currentUser.getLanguage()));
}
@Override
@@ -81,8 +83,7 @@
final UserDTO user = new UserDTO();
user.setId(currentUser.getId());
user.setName(userView.getLongName());
- user.setLanguage(currentUser.getLanguage());
- userService.get().updateUser(session.getUserHash(), user,
+ userService.get().updateUser(session.getUserHash(), user, userView.getLanguage(),
new AsyncCallbackSimple<StateAbstractDTO>() {
@Override
public void onSuccess(final StateAbstractDTO result) {
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 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralView.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -19,10 +19,15 @@
*/
package cc.kune.gspace.client.options.general;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
+
public interface UserOptGeneralView extends EntityOptGeneralView {
+ I18nLanguageSimpleDTO getLanguage();
+
String getLongName();
+ void setLanguage(I18nLanguageSimpleDTO language);
+
void setLongName(String longName);
-
}
Modified: trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -50,7 +50,7 @@
super();
this.theme = theme;
this.manager = manager;
- putValue(NAME, i18n.t(theme.getName()));
+ putValue(NAME, i18n.tWithNT(theme.getName(), "a theme name"));
putValue(SMALL_ICON, theme.getBackColors()[0]);
}
Modified: trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java 2011-09-19 13:00:39 UTC (rev 1521)
+++ trunk/src/test/java/cc/kune/core/server/integration/site/UserServiceTest.java 2011-09-19 20:25:07 UTC (rev 1522)
@@ -52,6 +52,7 @@
import cc.kune.core.shared.dto.GroupDTO;
import cc.kune.core.shared.dto.I18nCountryDTO;
import cc.kune.core.shared.dto.I18nLanguageDTO;
+import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
import cc.kune.core.shared.dto.SocialNetworkDataDTO;
import cc.kune.core.shared.dto.StateAbstractDTO;
import cc.kune.core.shared.dto.StateContentDTO;
@@ -75,6 +76,7 @@
Mapper mapper;
@Inject
KuneBasicProperties properties;
+ private I18nLanguageSimpleDTO simpleLang;
@Inject
SocialNetworkRPC sn;
private TimeZoneDTO timezone;
@@ -142,6 +144,7 @@
public void init() {
new IntegrationTestHelper(this);
lang = new I18nLanguageDTO();
+ simpleLang = new I18nLanguageSimpleDTO(lang.getCode(), lang.getEnglishName());
country = new I18nCountryDTO();
timezone = new TimeZoneDTO();
lang.setCode("en");
@@ -204,7 +207,7 @@
userService.createUser(user, false);
// do login as admin
doLogin();
- userService.updateUser(getHash(), user);
+ userService.updateUser(getHash(), user, simpleLang);
}
@Test
@@ -235,7 +238,7 @@
final UserDTO userChanged = new UserDTO(shortName, longName, "123456", email, lang, country,
timezone, null, true, SubscriptionMode.manual, "blue");
userChanged.setId(session.getUser().getId());
- userService.updateUser(getHash(), userChanged);
+ userService.updateUser(getHash(), userChanged, simpleLang);
}
@Test(expected = GroupLongNameInUseException.class)
1
0