[kune-commits] r1656 - in trunk: . src/main/java/cc/kune/chat/client src/main/java/cc/kune/chat/client/actions src/main/java/cc/kune/client src/main/java/cc/kune/core/client src/main/java/cc/kune/core/client/actions src/main/java/cc/kune/core/client/auth src/main/java/cc/kune/core/client/cnt src/main/java/cc/kune/core/client/contacts src/main/java/cc/kune/core/client/dnd src/main/java/cc/kune/core/client/events src/main/java/cc/kune/core/client/i18n src/main/java/cc/kune/core/client/init src/main/java/cc/kune/core/client/sitebar src/main/java/cc/kune/core/client/sitebar/logo src/main/java/cc/kune/core/client/sitebar/search src/main/java/cc/kune/core/client/sitebar/spaces src/main/java/cc/kune/core/client/sn src/main/java/cc/kune/core/client/sn/actions src/main/java/cc/kune/core/client/sn/actions/conditions src/main/java/cc/kune/core/client/sn/actions/registry src/main/java/cc/kune/core/client/state src/main/java/cc/kune/core/client/state/impl src/main/java/cc/kune/core/client/ws src/main/java/cc/kune/core/client/ws/entheader src/main/java/cc/kune/core/server src/main/java/cc/kune/core/server/content src/main/java/cc/kune/core/server/i18n src/main/java/cc/kune/core/server/i18n/impl src/main/java/cc/kune/core/server/init src/main/java/cc/kune/core/server/manager src/main/java/cc/kune/core/server/manager/impl src/main/java/cc/kune/core/server/mapper src/main/java/cc/kune/core/server/notifier src/main/java/cc/kune/core/server/rack src/main/java/cc/kune/core/server/rack/filters src/main/java/cc/kune/core/server/rack/filters/gwts src/main/java/cc/kune/core/server/rack/filters/rest src/main/java/cc/kune/core/server/rack/filters/servlet src/main/java/cc/kune/core/server/rack/utils src/main/java/cc/kune/core/server/rest src/main/java/cc/kune/core/server/state src/main/java/cc/kune/events/client/viewer src/main/java/cc/kune/gspace/client src/main/java/cc/kune/gspace/client/actions src/main/java/cc/kune/gspace/client/armor src/main/java/cc/kune/gspace/client/armor/impl src/main/java/cc/kune/gspace/client/armor/resources src/main/java/cc/kune/gspace/client/events src/main/java/cc/kune/gspace/client/options src/main/java/cc/kune/gspace/client/options/general src/main/java/cc/kune/gspace/client/options/license src/main/java/cc/kune/gspace/client/options/logo src/main/java/cc/kune/gspace/client/options/style src/main/java/cc/kune/gspace/client/options/tools src/main/java/cc/kune/gspace/client/style src/main/java/cc/kune/gspace/client/tags src/main/java/cc/kune/gspace/client/themes src/main/java/cc/kune/gspace/client/tool src/main/java/cc/kune/gspace/client/tool/selector src/main/java/cc/kune/gspace/client/ui/footer/license src/main/java/cc/kune/gspace/client/viewers src/main/java/cc/kune/gspace/client/viewers/items src/main/java/cc/kune/hspace/client src/main/java/cc/kune/lists/server src/main/java/cc/kune/pspace/client src/main/java/cc/kune/wave/client src/main/java/cc/kune/wave/client/inboxcount src/main/java/cc/kune/wave/client/resources src/main/java/cc/kune/wave/server src/main/java/cc/kune/wave/server/kspecific src/main/java/org/waveprotocol/wave/client/wavepanel/view/dom/full src/test/java/cc/kune/core/client/state src/test/java/cc/kune/core/client/state/impl src/test/java/cc/kune/core/server/manager src/test/java/cc/kune/gspace/client/tags src/test/java/cc/kune/gspace/client/tool/selector src/test/java/cc/kune/wave/server

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Mon Jan 9 00:06:55 CET 2012


Author: vjrj_
Date: 2012-01-09 00:06:53 +0100 (Mon, 09 Jan 2012)
New Revision: 1656

Added:
   trunk/src/main/java/cc/kune/core/client/actions/RolComparator.java
   trunk/src/main/java/cc/kune/core/client/contacts/
   trunk/src/main/java/cc/kune/core/client/contacts/SimpleContactManager.java
   trunk/src/main/java/cc/kune/core/client/events/AccessRightsChangedEvent.java
   trunk/src/main/java/cc/kune/core/client/events/AppStartEvent.java
   trunk/src/main/java/cc/kune/core/client/events/AppStopEvent.java
   trunk/src/main/java/cc/kune/core/client/events/GroupChangedEvent.java
   trunk/src/main/java/cc/kune/core/client/events/SocialNetworkChangedEvent.java
   trunk/src/main/java/cc/kune/core/client/events/StateChangedEvent.java
   trunk/src/main/java/cc/kune/core/client/events/ToolChangedEvent.java
   trunk/src/main/java/cc/kune/core/client/events/UserSignInEvent.java
   trunk/src/main/java/cc/kune/core/client/events/UserSignInOrSignOutEvent.java
   trunk/src/main/java/cc/kune/core/client/events/UserSignOutEvent.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/GroupSNModerationSubMenu.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/GroupSNOptionsMenu.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/GroupSNVisibilitySubMenu.java
   trunk/src/main/java/cc/kune/core/client/state/impl/
   trunk/src/main/java/cc/kune/core/client/state/impl/ContentCacheDefault.java
   trunk/src/main/java/cc/kune/core/client/state/impl/HistoryWrapperDefault.java
   trunk/src/main/java/cc/kune/core/client/state/impl/SessionDefault.java
   trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/i18n/I18nTranslationServiceMultiLang.java
   trunk/src/main/java/cc/kune/core/server/i18n/impl/
   trunk/src/main/java/cc/kune/core/server/i18n/impl/I18nTranslationServiceDefault.java
   trunk/src/main/java/cc/kune/core/server/manager/SearchResult.java
   trunk/src/main/java/cc/kune/core/server/manager/impl/TagUserContentManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/rack/RackServletFilter.java
   trunk/src/main/java/cc/kune/core/server/rack/utils/
   trunk/src/main/java/cc/kune/core/server/rack/utils/RackHelper.java
   trunk/src/main/java/cc/kune/gspace/client/armor/
   trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmor.java
   trunk/src/main/java/cc/kune/gspace/client/armor/impl/
   trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.java
   trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/armor/resources/
   trunk/src/main/java/cc/kune/gspace/client/events/
   trunk/src/main/java/cc/kune/gspace/client/events/CurrentEntityChangedEvent.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/items/
   trunk/src/main/java/cc/kune/gspace/client/viewers/items/FolderItemDescriptor.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/items/FolderItemWidget.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/items/FolderItemWidget.ui.xml
   trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java.seg
   trunk/src/main/java/cc/kune/wave/client/WaveClientClearEvent.java
   trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java
   trunk/src/main/java/cc/kune/wave/client/resources/
   trunk/src/main/java/cc/kune/wave/client/resources/KuneConversation.css
   trunk/src/main/java/cc/kune/wave/client/resources/KuneWaveResources.java
   trunk/src/main/java/cc/kune/wave/client/resources/toolbar_empty.png
   trunk/src/main/java/cc/kune/wave/server/kspecific/
   trunk/src/main/java/cc/kune/wave/server/kspecific/KuneAgent.java
   trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveService.java
   trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveServiceDefault.java
   trunk/src/main/java/cc/kune/wave/server/kspecific/WaveEmailNotifier.java
   trunk/src/test/java/cc/kune/core/client/state/impl/
   trunk/src/test/java/cc/kune/core/client/state/impl/EventBusTester.java
   trunk/src/test/java/cc/kune/core/client/state/impl/StateManagerDefaultTest.java
   trunk/src/test/java/cc/kune/core/client/state/impl/StateTokenTest.java
   trunk/src/test/java/cc/kune/core/client/state/impl/TokenMatcherTest.java
Removed:
   trunk/src/main/java/cc/kune/core/client/init/AppStartEvent.java
   trunk/src/main/java/cc/kune/core/client/init/AppStopEvent.java
   trunk/src/main/java/cc/kune/core/client/sn/SimpleContactManager.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/RolComparator.java
   trunk/src/main/java/cc/kune/core/client/state/AccessRightsChangedEvent.java
   trunk/src/main/java/cc/kune/core/client/state/ContentCacheDefault.java
   trunk/src/main/java/cc/kune/core/client/state/GroupChangedEvent.java
   trunk/src/main/java/cc/kune/core/client/state/HistoryWrapperDefault.java
   trunk/src/main/java/cc/kune/core/client/state/SessionDefault.java
   trunk/src/main/java/cc/kune/core/client/state/SocialNetworkChangedEvent.java
   trunk/src/main/java/cc/kune/core/client/state/StateChangedEvent.java
   trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
   trunk/src/main/java/cc/kune/core/client/state/ToolChangedEvent.java
   trunk/src/main/java/cc/kune/core/client/state/UserSignInEvent.java
   trunk/src/main/java/cc/kune/core/client/state/UserSignInOrSignOutEvent.java
   trunk/src/main/java/cc/kune/core/client/state/UserSignOutEvent.java
   trunk/src/main/java/cc/kune/core/server/i18n/I18nTranslationServiceDefault.java
   trunk/src/main/java/cc/kune/core/server/manager/TagUserContentManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/manager/impl/SearchResult.java
   trunk/src/main/java/cc/kune/core/server/rack/RackHelper.java
   trunk/src/main/java/cc/kune/core/server/rack/RackServletFilter.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/GSpaceArmorImpl.ui.xml
   trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentEntityChangedEvent.java
   trunk/src/main/java/cc/kune/gspace/client/resources/
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemDescriptor.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml
   trunk/src/main/java/cc/kune/wave/client/KuneConversation.css
   trunk/src/main/java/cc/kune/wave/client/KuneWaveResources.java
   trunk/src/main/java/cc/kune/wave/client/WaveClientClearEvent.java
   trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java
   trunk/src/main/java/cc/kune/wave/client/toolbar_empty.png
   trunk/src/main/java/cc/kune/wave/server/KuneAgent.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/WaveEmailNotifier.java
   trunk/src/test/java/cc/kune/core/client/state/EventBusTester.java
   trunk/src/test/java/cc/kune/core/client/state/StateManagerDefaultTest.java
   trunk/src/test/java/cc/kune/core/client/state/StateTokenTest.java
   trunk/src/test/java/cc/kune/core/client/state/TokenMatcherTest.java
Modified:
   trunk/.classpath
   trunk/pom.xml
   trunk/src/main/java/cc/kune/chat/client/ChatClient.java
   trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
   trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java
   trunk/src/main/java/cc/kune/chat/client/ChatParts.java
   trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java
   trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java
   trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembers.java
   trunk/src/main/java/cc/kune/client/OnAppStartFactory.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/actions/RolActionAutoUpdated.java
   trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java
   trunk/src/main/java/cc/kune/core/client/auth/WaveClientSimpleAuthenticator.java
   trunk/src/main/java/cc/kune/core/client/cnt/AbstractContentPanel.java
   trunk/src/main/java/cc/kune/core/client/cnt/ActionContentToolbarImpl.java
   trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPanel.java
   trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPresenter.java
   trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java
   trunk/src/main/java/cc/kune/core/client/dnd/KuneDragController.java
   trunk/src/main/java/cc/kune/core/client/dnd/NotImplementedDropManager.java
   trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
   trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties
   trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_fr.properties
   trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java
   trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java
   trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPanel.java
   trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java
   trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java
   trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignOutLink.java
   trunk/src/main/java/cc/kune/core/client/sitebar/logo/SiteLogo.java
   trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPanel.java
   trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPanel.java
   trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPanel.ui.xml
   trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
   trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java
   trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java
   trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java
   trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java
   trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/SessionAction.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAdmins.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToBuddyHeaderButton.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToMembers.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsBuddieCondition.java
   trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotBuddieCondition.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/UserSNConfActions.java
   trunk/src/main/java/cc/kune/core/client/state/AccessRightsClientManager.java
   trunk/src/main/java/cc/kune/core/client/state/Session.java
   trunk/src/main/java/cc/kune/core/client/state/StateManager.java
   trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java
   trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java
   trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java
   trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
   trunk/src/main/java/cc/kune/core/server/content/ContainerManager.java
   trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/content/ContentManager.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/GroupManager.java
   trunk/src/main/java/cc/kune/core/server/manager/Manager.java
   trunk/src/main/java/cc/kune/core/server/manager/UserManager.java
   trunk/src/main/java/cc/kune/core/server/manager/impl/DefaultManager.java
   trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
   trunk/src/main/java/cc/kune/core/server/mapper/DozerMapper.java
   trunk/src/main/java/cc/kune/core/server/mapper/Mapper.java
   trunk/src/main/java/cc/kune/core/server/notifier/NotifySenderDefault.java
   trunk/src/main/java/cc/kune/core/server/notifier/NotifyService.java
   trunk/src/main/java/cc/kune/core/server/rack/filters/AbstractInjectedFilter.java
   trunk/src/main/java/cc/kune/core/server/rack/filters/ForwardFilter.java
   trunk/src/main/java/cc/kune/core/server/rack/filters/LogFilter.java
   trunk/src/main/java/cc/kune/core/server/rack/filters/gwts/GWTServiceFilter.java
   trunk/src/main/java/cc/kune/core/server/rack/filters/rest/RESTServiceFilter.java
   trunk/src/main/java/cc/kune/core/server/rack/filters/servlet/ServletServiceFilter.java
   trunk/src/main/java/cc/kune/core/server/rest/ContentJSONService.java
   trunk/src/main/java/cc/kune/core/server/rest/GroupJSONService.java
   trunk/src/main/java/cc/kune/core/server/rest/UserJSONService.java
   trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
   trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorEntryPoint.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/actions/AbstractEditorsMenu.java
   trunk/src/main/java/cc/kune/gspace/client/actions/AbstractFoldableToolActions.java
   trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackBtn.java
   trunk/src/main/java/cc/kune/gspace/client/actions/GotoTokenAction.java
   trunk/src/main/java/cc/kune/gspace/client/armor/resources/GSpaceArmorResources.java
   trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicensePresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicensePresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java
   trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPanel.java
   trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeManager.java
   trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java
   trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java
   trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePanel.java
   trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePresenter.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerView.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/ContentTitleWidget.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsFlowPanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java
   trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java
   trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.java
   trunk/src/main/java/cc/kune/hspace/client/HSpaceParts.java
   trunk/src/main/java/cc/kune/hspace/client/HSpacePresenter.java
   trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java
   trunk/src/main/java/cc/kune/pspace/client/PSpaceInDevelopment.java
   trunk/src/main/java/cc/kune/pspace/client/PSpacePanel.java
   trunk/src/main/java/cc/kune/pspace/client/PSpaceParts.java
   trunk/src/main/java/cc/kune/pspace/client/PSpacePresenter.java
   trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java
   trunk/src/main/java/cc/kune/wave/client/WaveClientManager.java
   trunk/src/main/java/cc/kune/wave/client/WaveParts.java
   trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPresenter.java
   trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java
   trunk/src/main/java/org/waveprotocol/wave/client/wavepanel/view/dom/full/KuneWavePanelResourceLoader.java
   trunk/src/test/java/cc/kune/core/server/manager/ContentManagerDefaultTest.java
   trunk/src/test/java/cc/kune/core/server/manager/GroupManagerDefaultTest.java
   trunk/src/test/java/cc/kune/core/server/manager/TagUserContentTest.java
   trunk/src/test/java/cc/kune/core/server/manager/UserManagerDefaultTest.java
   trunk/src/test/java/cc/kune/gspace/client/tags/TagsSummaryPresenterTest.java
   trunk/src/test/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenterTest.java
   trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java
   trunk/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java
Log:
Refactorization and Wave update

Modified: trunk/.classpath
===================================================================
--- trunk/.classpath	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/.classpath	2012-01-08 23:06:53 UTC (rev 1656)
@@ -13,19 +13,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/avalon-framework/avalon-framework/4.1.3/avalon-framework-4.1.3.jar"/>
   <classpathentry kind="var" path="M2_REPO/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1.jar" sourcepath="M2_REPO/backport-util-concurrent/backport-util-concurrent/3.1/backport-util-concurrent-3.1-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box/0.3.8/box-0.3.8.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.8/box-src-0.3.8.jar" sourcepath="M2_REPO/org/waveprotocol/box-src/0.3.8/box-src-0.3.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box/0.3.9/box-0.3.9.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/box-src/0.3.9/box-src-0.3.9.jar" sourcepath="M2_REPO/org/waveprotocol/box-src/0.3.9/box-src-0.3.9-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/beanshell/bsh/2.0b4/bsh-2.0b4.jar"/>
   <classpathentry kind="var" path="M2_REPO/c3p0/c3p0/0.9.1/c3p0-0.9.1.jar" sourcepath="M2_REPO/c3p0/c3p0/0.9.1/c3p0-0.9.1-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3.jar" sourcepath="M2_REPO/cglib/cglib-nodep/2.1_3/cglib-nodep-2.1_3-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/classworlds/classworlds/1.1-alpha-2/classworlds-1.1-alpha-2.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client/0.3.8/client-0.3.8.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common/0.3.8/client-common-0.3.8.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.8/client-common-src-0.3.8.jar" sourcepath="M2_REPO/org/waveprotocol/client-common-src/0.3.8/client-common-src-0.3.8-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.8/client-scheduler-src-0.3.8.jar" sourcepath="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.8/client-scheduler-src-0.3.8-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.8/client-src-0.3.8.jar" sourcepath="M2_REPO/org/waveprotocol/client-src/0.3.8/client-src-0.3.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client/0.3.9/client-0.3.9.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common/0.3.9/client-common-0.3.9.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-common-src/0.3.9/client-common-src-0.3.9.jar" sourcepath="M2_REPO/org/waveprotocol/client-common-src/0.3.9/client-common-src-0.3.9-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.9/client-scheduler-src-0.3.9.jar" sourcepath="M2_REPO/org/waveprotocol/client-scheduler-src/0.3.9/client-scheduler-src-0.3.9-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/client-src/0.3.9/client-src-0.3.9.jar" sourcepath="M2_REPO/org/waveprotocol/client-src/0.3.9/client-src-0.3.9-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/cobogw/gwt/cobogw/1.3.1/cobogw-1.3.1.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/common-src/0.3.8/common-src-0.3.8.jar" sourcepath="M2_REPO/org/waveprotocol/common-src/0.3.8/common-src-0.3.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/common-src/0.3.9/common-src-0.3.9.jar" sourcepath="M2_REPO/org/waveprotocol/common-src/0.3.9/common-src-0.3.9-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0.jar" sourcepath="M2_REPO/commons-beanutils/commons-beanutils/1.7.0/commons-beanutils-1.7.0-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2.jar" sourcepath="M2_REPO/commons-cli/commons-cli/1.2/commons-cli-1.2-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4.jar" sourcepath="M2_REPO/commons-codec/commons-codec/1.4/commons-codec-1.4-sources.jar"/>
@@ -34,8 +34,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.8/communication-src-0.3.8.jar" sourcepath="M2_REPO/org/waveprotocol/communication-src/0.3.8/communication-src-0.3.8-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.8/concurrencycontrol-src-0.3.8.jar" sourcepath="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.8/concurrencycontrol-src-0.3.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/communication-src/0.3.9/communication-src-0.3.9.jar" sourcepath="M2_REPO/org/waveprotocol/communication-src/0.3.9/communication-src-0.3.9-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.9/concurrencycontrol-src-0.3.9.jar" sourcepath="M2_REPO/org/waveprotocol/concurrencycontrol-src/0.3.9/concurrencycontrol-src-0.3.9-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5.jar" sourcepath="M2_REPO/net/sourceforge/cssparser/cssparser/0.9.5/cssparser-0.9.5-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1.jar" sourcepath="M2_REPO/dom4j/dom4j/1.6.1/dom4j-1.6.1-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/net/sf/dozer/dozer/4.0/dozer-4.0.jar" sourcepath="M2_REPO/net/sf/dozer/dozer/4.0/dozer-4.0-sources.jar"/>
@@ -57,7 +57,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.8/gwt-util-src-0.3.8.jar" sourcepath="M2_REPO/org/waveprotocol/gwt-util-src/0.3.8/gwt-util-src-0.3.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/gwt-util-src/0.3.9/gwt-util-src-0.3.9.jar" sourcepath="M2_REPO/org/waveprotocol/gwt-util-src/0.3.9/gwt-util-src-0.3.9-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/com/allen_sauer/gwt/voices/gwt-voices/gwt-voices/2.0.0/gwt-voices-2.0.0.jar"/>
   <classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-all/0.5/gwtp-all-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-all/0.5/gwtp-all-0.5-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/com/gwtplatform/gwtp-clients-common/0.5/gwtp-clients-common-0.5.jar" sourcepath="M2_REPO/com/gwtplatform/gwtp-clients-common/0.5/gwtp-clients-common-0.5-sources.jar"/>
@@ -114,16 +114,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.8/media-src-0.3.8.jar" sourcepath="M2_REPO/org/waveprotocol/media-src/0.3.8/media-src-0.3.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/media-src/0.3.9/media-src-0.3.9.jar" sourcepath="M2_REPO/org/waveprotocol/media-src/0.3.9/media-src-0.3.9-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/mockito/mockito-core/1.8.5/mockito-core-1.8.5.jar" sourcepath="M2_REPO/org/mockito/mockito-core/1.8.5/mockito-core-1.8.5-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.8/model-src-0.3.8.jar" sourcepath="M2_REPO/org/waveprotocol/model-src/0.3.8/model-src-0.3.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/model-src/0.3.9/model-src-0.3.9.jar" sourcepath="M2_REPO/org/waveprotocol/model-src/0.3.9/model-src-0.3.9-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/mvel/mvel2/2.0.16/mvel2-2.0.16.jar" sourcepath="M2_REPO/org/mvel/mvel2/2.0.16/mvel2-2.0.16-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/mysql/mysql-connector-java/5.1.13/mysql-connector-java-5.1.13.jar"/>
   <classpathentry kind="var" path="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.15/nekohtml-1.9.15.jar" sourcepath="M2_REPO/net/sourceforge/nekohtml/nekohtml/1.9.15/nekohtml-1.9.15-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/objenesis/objenesis/1.0/objenesis-1.0.jar" sourcepath="M2_REPO/org/objenesis/objenesis/1.0/objenesis-1.0-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-container-default/1.0-alpha-8/plexus-container-default-1.0-alpha-8-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4.jar" sourcepath="M2_REPO/org/codehaus/plexus/plexus-utils/1.0.4/plexus-utils-1.0.4-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/proto-msg/0.3.8/proto-msg-0.3.8.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/proto-msg/0.3.9/proto-msg-0.3.9.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/quartz-scheduler/quartz/2.1.0/quartz-2.1.0.jar" sourcepath="M2_REPO/org/quartz-scheduler/quartz/2.1.0/quartz-2.1.0-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/w3c/css/sac/1.3/sac-1.3.jar" sourcepath="M2_REPO/org/w3c/css/sac/1.3/sac-1.3-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.12.0/selenium-android-driver-2.12.0.jar" sourcepath="M2_REPO/org/seleniumhq/selenium/selenium-android-driver/2.12.0/selenium-android-driver-2.12.0-sources.jar"/>
@@ -148,9 +148,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.8/util-src-0.3.8.jar" sourcepath="M2_REPO/org/waveprotocol/util-src/0.3.8/util-src-0.3.8-sources.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/util-src/0.3.9/util-src-0.3.9.jar" sourcepath="M2_REPO/org/waveprotocol/util-src/0.3.9/util-src-0.3.9-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5.jar" sourcepath="M2_REPO/org/apache/maven/wagon/wagon-provider-api/1.0-alpha-5/wagon-provider-api-1.0-alpha-5-sources.jar"/>
-  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.8/waveinabox-server-0.3-0.3.8.jar"/>
+  <classpathentry kind="var" path="M2_REPO/org/waveprotocol/waveinabox-server-0.3/0.3.9/waveinabox-server-0.3-0.3.9.jar"/>
   <classpathentry kind="var" path="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1.jar" sourcepath="M2_REPO/xalan/xalan/2.7.1/xalan-2.7.1-sources.jar"/>
   <classpathentry kind="var" path="M2_REPO/xerces/xercesImpl/2.9.1/xercesImpl-2.9.1.jar"/>
   <classpathentry kind="var" path="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2.jar" sourcepath="M2_REPO/xml-apis/xml-apis/1.0.b2/xml-apis-1.0.b2-sources.jar"/>

Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/pom.xml	2012-01-08 23:06:53 UTC (rev 1656)
@@ -19,7 +19,7 @@
     <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
     <slf4j.version>1.6.1</slf4j.version>
     <openjpa.version>2.0.1</openjpa.version>
-    <wiab.version>0.3.8</wiab.version>
+    <wiab.version>0.3.9</wiab.version>
     <skipTests>true</skipTests>
   </properties>
   <repositories>

Modified: trunk/src/main/java/cc/kune/chat/client/ChatClient.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClient.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClient.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -19,7 +19,7 @@
  */
 package cc.kune.chat.client;
 
-import cc.kune.core.client.sn.SimpleContactManager;
+import cc.kune.core.client.contacts.SimpleContactManager;
 
 import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
 import com.calclab.emite.xep.muc.client.Room;

Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -40,18 +40,18 @@
 import cc.kune.common.client.utils.WindowUtils;
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.common.shared.utils.TextUtils;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.AppStopEvent;
 import cc.kune.core.client.events.AvatarChangedEvent;
 import cc.kune.core.client.events.NewUserRegisteredEvent;
-import cc.kune.core.client.init.AppStartEvent;
-import cc.kune.core.client.init.AppStopEvent;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignOutEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.client.services.ClientFileDownloadUtils;
 import cc.kune.core.client.sitebar.SitebarActions;
 import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.UserSignInEvent;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
-import cc.kune.core.client.state.UserSignOutEvent;
-import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.shared.dto.UserInfoDTO;
 
 import com.calclab.emite.core.client.xmpp.session.XmppSession;

Modified: trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/chat/client/ChatGinModule.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -25,7 +25,7 @@
 import cc.kune.core.client.ExtendedGinModule;
 import cc.kune.core.client.avatar.MediumAvatarDecorator;
 import cc.kune.core.client.avatar.SmallAvatarDecorator;
-import cc.kune.core.client.sn.SimpleContactManager;
+import cc.kune.core.client.contacts.SimpleContactManager;
 
 public class ChatGinModule extends ExtendedGinModule {
   /*

Modified: trunk/src/main/java/cc/kune/chat/client/ChatParts.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatParts.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/chat/client/ChatParts.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -34,8 +34,8 @@
 import cc.kune.common.client.actions.PropertyChangeListener;
 import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
 import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.core.client.init.AppStartEvent;
-import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.sn.GroupSNPresenter;
 import cc.kune.core.client.sn.actions.conditions.IsBuddieCondition;
 import cc.kune.core.client.sn.actions.conditions.IsCurrentStateAGroupCondition;

Modified: trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/chat/client/actions/AddAsBuddieHeaderButton.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -29,11 +29,11 @@
 import cc.kune.common.client.actions.PropertyChangeListener;
 import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
 import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
 import cc.kune.core.client.resources.CoreMessages;
 import cc.kune.core.client.resources.CoreResources;
 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.StateAbstractDTO;

Modified: trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/chat/client/actions/OpenGroupPublicChatRoomAction.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -29,10 +29,10 @@
 import cc.kune.common.client.actions.ActionEvent;
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.core.client.actions.RolActionAutoUpdated;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
 import cc.kune.core.client.state.AccessRightsClientManager;
 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.shared.dto.AccessRolDTO;
 import cc.kune.core.shared.dto.GroupDTO;

Modified: trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembers.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembers.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/chat/client/actions/StartAssemblyWithMembers.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -21,7 +21,7 @@
 
 import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
 import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.core.client.sn.actions.registry.GroupSNConfActions;
+import cc.kune.core.client.sn.actions.GroupSNOptionsMenu;
 
 import com.google.inject.Inject;
 
@@ -29,12 +29,12 @@
 
   @Inject
   public StartAssemblyWithMembers(final StartAssemblyWithMembersAction action,
-      final I18nTranslationService i18n) {
+      final I18nTranslationService i18n, final GroupSNOptionsMenu optionsMenu) {
     super(action);
     action.setInviteMembers(true);
     withText(i18n.t("Start a public assembly with members")).withToolTip(
         i18n.t("Enter to this group public chat room and invite members"));
-    setParent(GroupSNConfActions.OPTIONS_MENU);
+    setParent(optionsMenu);
     setPosition(0);
   }
 }

Modified: trunk/src/main/java/cc/kune/client/OnAppStartFactory.java
===================================================================
--- trunk/src/main/java/cc/kune/client/OnAppStartFactory.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/client/OnAppStartFactory.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,9 +20,9 @@
 package cc.kune.client;
 
 import cc.kune.core.client.auth.SignIn;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.groups.newgroup.NewGroup;
-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.SiteTokenListeners;
 

Modified: trunk/src/main/java/cc/kune/core/client/CoreGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreGinModule.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/CoreGinModule.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -93,17 +93,17 @@
 import cc.kune.core.client.sn.actions.registry.UserSNMenuItemsRegistry;
 import cc.kune.core.client.state.AccessRightsClientManager;
 import cc.kune.core.client.state.ContentCache;
-import cc.kune.core.client.state.ContentCacheDefault;
 import cc.kune.core.client.state.HistoryWrapper;
-import cc.kune.core.client.state.HistoryWrapperDefault;
 import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.SessionDefault;
 import cc.kune.core.client.state.SessionExpirationManager;
 import cc.kune.core.client.state.SiteTokenListeners;
 import cc.kune.core.client.state.SiteTokens;
 import cc.kune.core.client.state.StateManager;
-import cc.kune.core.client.state.StateManagerDefault;
 import cc.kune.core.client.state.TokenMatcher;
+import cc.kune.core.client.state.impl.ContentCacheDefault;
+import cc.kune.core.client.state.impl.HistoryWrapperDefault;
+import cc.kune.core.client.state.impl.SessionDefault;
+import cc.kune.core.client.state.impl.StateManagerDefault;
 import cc.kune.core.client.sub.SubtitlesManager;
 import cc.kune.core.client.sub.SubtitlesWidget;
 import cc.kune.core.client.ws.CorePresenter;

Modified: trunk/src/main/java/cc/kune/core/client/CoreParts.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreParts.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/CoreParts.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -22,9 +22,9 @@
 import cc.kune.core.client.auth.AnonUsersManager;
 import cc.kune.core.client.auth.Register;
 import cc.kune.core.client.auth.SignIn;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.groups.newgroup.NewGroup;
-import cc.kune.core.client.init.AppStartEvent;
-import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.sitebar.AboutKuneDialog;
 import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
 import cc.kune.core.client.sitebar.spaces.Space;

Modified: trunk/src/main/java/cc/kune/core/client/actions/RolActionAutoUpdated.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/RolActionAutoUpdated.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/actions/RolActionAutoUpdated.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -21,9 +21,8 @@
 
 import cc.kune.common.client.actions.AbstractExtendedAction;
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
-import cc.kune.core.client.sn.actions.RolComparator;
-import cc.kune.core.client.state.AccessRightsChangedEvent;
-import cc.kune.core.client.state.AccessRightsChangedEvent.AccessRightsChangedHandler;
+import cc.kune.core.client.events.AccessRightsChangedEvent;
+import cc.kune.core.client.events.AccessRightsChangedEvent.AccessRightsChangedHandler;
 import cc.kune.core.client.state.AccessRightsClientManager;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;

Copied: trunk/src/main/java/cc/kune/core/client/actions/RolComparator.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/sn/actions/RolComparator.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/actions/RolComparator.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/actions/RolComparator.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,45 @@
+/*
+ *
+ * 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.actions;
+
+import cc.kune.core.shared.domain.utils.AccessRights;
+import cc.kune.core.shared.dto.AccessRolDTO;
+
+public final class RolComparator {
+
+    public static boolean isEnabled(final AccessRolDTO rolRequired, final AccessRights rights) {
+        switch (rolRequired) {
+        case Administrator:
+            return rights.isAdministrable();
+        case Editor:
+            return rights.isEditable();
+        case Viewer:
+            return rights.isVisible();
+        }
+        return false;
+    }
+
+    public static boolean isMember(final AccessRights newRights) {
+        return newRights.isAdministrable() || newRights.isEditable();
+    }
+
+    private RolComparator() {
+    }
+}

Modified: trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/auth/AnonUsersManager.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -23,13 +23,13 @@
 import cc.kune.common.client.notify.UserNotifyEvent;
 import cc.kune.common.shared.utils.TextUtils;
 import cc.kune.core.client.cookies.CookiesManager;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
-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 com.google.gwt.event.shared.EventBus;
 import com.google.inject.Inject;

Modified: trunk/src/main/java/cc/kune/core/client/auth/WaveClientSimpleAuthenticator.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/WaveClientSimpleAuthenticator.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/auth/WaveClientSimpleAuthenticator.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,7 +20,7 @@
 package cc.kune.core.client.auth;
 
 import cc.kune.core.client.events.StackErrorEvent;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 
 import com.google.gwt.event.shared.EventBus;
 import com.google.gwt.http.client.Request;

Modified: trunk/src/main/java/cc/kune/core/client/cnt/AbstractContentPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/cnt/AbstractContentPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/cnt/AbstractContentPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -19,7 +19,7 @@
  */
 package cc.kune.core.client.cnt;
 
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 
 import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
 import com.google.gwt.user.client.ui.Widget;

Modified: trunk/src/main/java/cc/kune/core/client/cnt/ActionContentToolbarImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/cnt/ActionContentToolbarImpl.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/cnt/ActionContentToolbarImpl.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -22,7 +22,7 @@
 import cc.kune.common.client.actions.ui.ActionFlowPanel;
 import cc.kune.common.client.actions.ui.GuiProvider;
 import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 
 import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
 import com.google.inject.Inject;

Modified: trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -24,7 +24,7 @@
 import cc.kune.common.client.resources.CommonResources;
 import cc.kune.common.client.ui.IconLabel;
 import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 import cc.kune.wave.client.WaveClientManager;
 
 import com.google.gwt.event.dom.client.ClickEvent;

Modified: trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/cnt/FoldableContentPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -22,12 +22,12 @@
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
 import cc.kune.common.client.notify.NotifyUser;
 import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
 import cc.kune.core.client.services.ClientFileDownloadUtils;
 import cc.kune.core.client.services.ImageSize;
 import cc.kune.core.client.services.MediaUtils;
 import cc.kune.core.client.state.Session;
-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.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.BasicMimeTypeDTO;

Copied: trunk/src/main/java/cc/kune/core/client/contacts/SimpleContactManager.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/sn/SimpleContactManager.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/contacts/SimpleContactManager.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/contacts/SimpleContactManager.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,30 @@
+/*
+ *
+ * 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.contacts;
+
+public interface SimpleContactManager {
+
+  void addNewBuddy(String shortName);
+
+  void chat(String shortName);
+
+  boolean isBuddy(String shortName);
+
+}

Modified: trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/dnd/FolderViewerDropController.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -30,7 +30,7 @@
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.StateContainerDTO;
-import cc.kune.gspace.client.viewers.FolderItemWidget;
+import cc.kune.gspace.client.viewers.items.FolderItemWidget;
 
 import com.allen_sauer.gwt.dnd.client.DragContext;
 import com.allen_sauer.gwt.dnd.client.VetoDragException;
@@ -41,14 +41,6 @@
 import com.google.gwt.user.client.ui.Widget;
 import com.google.inject.Inject;
 
-/**
- * @author vjrj
- *
- */
-/**
- * @author vjrj
- * 
- */
 public class FolderViewerDropController implements DropTarget {
 
   private final ContentCache contentCache;

Modified: trunk/src/main/java/cc/kune/core/client/dnd/KuneDragController.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/dnd/KuneDragController.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/dnd/KuneDragController.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -19,7 +19,7 @@
  */
 package cc.kune.core.client.dnd;
 
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 
 import com.allen_sauer.gwt.dnd.client.PickupDragController;
 import com.google.gwt.core.client.Scheduler;

Modified: trunk/src/main/java/cc/kune/core/client/dnd/NotImplementedDropManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/dnd/NotImplementedDropManager.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/dnd/NotImplementedDropManager.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,7 +20,7 @@
 package cc.kune.core.client.dnd;
 
 import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 
 import com.google.gwt.event.logical.shared.AttachEvent;
 import com.google.gwt.event.logical.shared.AttachEvent.Handler;

Copied: trunk/src/main/java/cc/kune/core/client/events/AccessRightsChangedEvent.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/state/AccessRightsChangedEvent.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/events/AccessRightsChangedEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/events/AccessRightsChangedEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,115 @@
+/*
+ *
+ * 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.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class AccessRightsChangedEvent extends GwtEvent<AccessRightsChangedEvent.AccessRightsChangedHandler> { 
+
+  public interface HasAccessRightsChangedHandlers extends HasHandlers {
+    HandlerRegistration addAccessRightsChangedHandler(AccessRightsChangedHandler handler);
+  }
+
+  public interface AccessRightsChangedHandler extends EventHandler {
+    public void onAccessRightsChanged(AccessRightsChangedEvent event);
+  }
+
+  private static final Type<AccessRightsChangedHandler> TYPE = new Type<AccessRightsChangedHandler>();
+
+  public static void fire(HasHandlers source, cc.kune.core.shared.domain.utils.AccessRights previousRights, cc.kune.core.shared.domain.utils.AccessRights currentRights) {
+    source.fireEvent(new AccessRightsChangedEvent(previousRights, currentRights));
+  }
+
+  public static Type<AccessRightsChangedHandler> getType() {
+    return TYPE;
+  }
+
+  cc.kune.core.shared.domain.utils.AccessRights previousRights;
+  cc.kune.core.shared.domain.utils.AccessRights currentRights;
+
+  public AccessRightsChangedEvent(cc.kune.core.shared.domain.utils.AccessRights previousRights, cc.kune.core.shared.domain.utils.AccessRights currentRights) {
+    this.previousRights = previousRights;
+    this.currentRights = currentRights;
+  }
+
+  protected AccessRightsChangedEvent() {
+    // Possibly for serialization.
+  }
+
+  @Override
+  public Type<AccessRightsChangedHandler> getAssociatedType() {
+    return TYPE;
+  }
+
+  public cc.kune.core.shared.domain.utils.AccessRights getPreviousRights() {
+    return previousRights;
+  }
+
+  public cc.kune.core.shared.domain.utils.AccessRights getCurrentRights() {
+    return currentRights;
+  }
+
+  @Override
+  protected void dispatch(AccessRightsChangedHandler handler) {
+    handler.onAccessRightsChanged(this);
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj)
+        return true;
+    if (obj == null)
+        return false;
+    if (getClass() != obj.getClass())
+        return false;
+    AccessRightsChangedEvent other = (AccessRightsChangedEvent) obj;
+    if (previousRights == null) {
+      if (other.previousRights != null)
+        return false;
+    } else if (!previousRights.equals(other.previousRights))
+      return false;
+    if (currentRights == null) {
+      if (other.currentRights != null)
+        return false;
+    } else if (!currentRights.equals(other.currentRights))
+      return false;
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int hashCode = 23;
+    hashCode = (hashCode * 37) + (previousRights == null ? 1 : previousRights.hashCode());
+    hashCode = (hashCode * 37) + (currentRights == null ? 1 : currentRights.hashCode());
+    return hashCode;
+  }
+
+  @Override
+  public String toString() {
+    return "AccessRightsChangedEvent["
+                 + previousRights
+                 + ","
+                 + currentRights
+    + "]";
+  }
+}

Copied: trunk/src/main/java/cc/kune/core/client/events/AppStartEvent.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/init/AppStartEvent.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/events/AppStartEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/events/AppStartEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,94 @@
+/*
+ *
+ * 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.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+import com.gwtplatform.mvp.client.HasEventBus;
+
+public class AppStartEvent extends GwtEvent<AppStartEvent.AppStartHandler> { 
+
+  public interface HasAppStartHandlers extends HasHandlers {
+    HandlerRegistration addAppStartHandler(AppStartHandler handler);
+  }
+
+  public interface AppStartHandler extends EventHandler {
+    public void onAppStart(AppStartEvent event);
+  }
+
+  private static final Type<AppStartHandler> TYPE = new Type<AppStartHandler>();
+
+  public static void fire(HasEventBus source, cc.kune.core.shared.dto.InitDataDTO initData) {
+    source.fireEvent(new AppStartEvent(initData));
+  }
+
+  public static Type<AppStartHandler> getType() {
+    return TYPE;
+  }
+
+  private final cc.kune.core.shared.dto.InitDataDTO initData;
+
+  public AppStartEvent(cc.kune.core.shared.dto.InitDataDTO initData) {
+    this.initData = initData;
+  }
+
+  @Override
+  public Type<AppStartHandler> getAssociatedType() {
+    return TYPE;
+  }
+
+  public cc.kune.core.shared.dto.InitDataDTO getInitData() {
+    return initData;
+  }
+
+  @Override
+  protected void dispatch(AppStartHandler handler) {
+    handler.onAppStart(this);
+  }
+
+  @Override
+  public boolean equals(Object other) {
+    if (other != null && other.getClass().equals(this.getClass())) {
+          AppStartEvent o = (AppStartEvent) other;
+      return true
+          && ((o.initData == null && this.initData == null) || (o.initData != null && o.initData.equals(this.initData)))
+        ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    int hashCode = 23;
+    hashCode = (hashCode * 37) + getClass().hashCode();
+    hashCode = (hashCode * 37) + (initData == null ? 1 : initData.hashCode());
+    return hashCode;
+  }
+
+  @Override
+  public String toString() {
+    return "AppStartEvent["
+                 + initData
+    + "]";
+  }
+
+}

Copied: trunk/src/main/java/cc/kune/core/client/events/AppStopEvent.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/init/AppStopEvent.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/events/AppStopEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/events/AppStopEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,85 @@
+/*
+ *
+ * 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.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+import com.gwtplatform.mvp.client.HasEventBus;
+
+public class AppStopEvent extends GwtEvent<AppStopEvent.AppStopHandler> { 
+
+  public interface HasAppStopHandlers extends HasHandlers {
+    HandlerRegistration addAppStopHandler(AppStopHandler handler);
+  }
+
+  public interface AppStopHandler extends EventHandler {
+    public void onAppStop(AppStopEvent event);
+  }
+
+  private static final Type<AppStopHandler> TYPE = new Type<AppStopHandler>();
+
+  public static void fire(HasEventBus source) {
+    source.fireEvent(new AppStopEvent());
+  }
+
+  public static Type<AppStopHandler> getType() {
+    return TYPE;
+  }
+
+
+  public AppStopEvent() {
+  }
+
+  @Override
+  public Type<AppStopHandler> getAssociatedType() {
+    return TYPE;
+  }
+
+  @Override
+  protected void dispatch(AppStopHandler handler) {
+    handler.onAppStop(this);
+  }
+
+  @Override
+  public boolean equals(Object other) {
+    if (other != null && other.getClass().equals(this.getClass())) {
+          AppStopEvent o = (AppStopEvent) other;
+      return true
+        ;
+    }
+    return false;
+  }
+
+  @Override
+  public int hashCode() {
+    int hashCode = 23;
+    hashCode = (hashCode * 37) + getClass().hashCode();
+    return hashCode;
+  }
+
+  @Override
+  public String toString() {
+    return "AppStopEvent["
+    + "]";
+  }
+
+}

Copied: trunk/src/main/java/cc/kune/core/client/events/GroupChangedEvent.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/state/GroupChangedEvent.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/events/GroupChangedEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/events/GroupChangedEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,115 @@
+/*
+ *
+ * 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.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class GroupChangedEvent extends GwtEvent<GroupChangedEvent.GroupChangedHandler> { 
+
+  public interface HasGroupChangedHandlers extends HasHandlers {
+    HandlerRegistration addGroupChangedHandler(GroupChangedHandler handler);
+  }
+
+  public interface GroupChangedHandler extends EventHandler {
+    public void onGroupChanged(GroupChangedEvent event);
+  }
+
+  private static final Type<GroupChangedHandler> TYPE = new Type<GroupChangedHandler>();
+
+  public static void fire(HasHandlers source, java.lang.String previousGroup, java.lang.String newGroup) {
+    source.fireEvent(new GroupChangedEvent(previousGroup, newGroup));
+  }
+
+  public static Type<GroupChangedHandler> getType() {
+    return TYPE;
+  }
+
+  java.lang.String previousGroup;
+  java.lang.String newGroup;
+
+  public GroupChangedEvent(java.lang.String previousGroup, java.lang.String newGroup) {
+    this.previousGroup = previousGroup;
+    this.newGroup = newGroup;
+  }
+
+  protected GroupChangedEvent() {
+    // Possibly for serialization.
+  }
+
+  @Override
+  public Type<GroupChangedHandler> getAssociatedType() {
+    return TYPE;
+  }
+
+  public java.lang.String getPreviousGroup() {
+    return previousGroup;
+  }
+
+  public java.lang.String getNewGroup() {
+    return newGroup;
+  }
+
+  @Override
+  protected void dispatch(GroupChangedHandler handler) {
+    handler.onGroupChanged(this);
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj)
+        return true;
+    if (obj == null)
+        return false;
+    if (getClass() != obj.getClass())
+        return false;
+    GroupChangedEvent other = (GroupChangedEvent) obj;
+    if (previousGroup == null) {
+      if (other.previousGroup != null)
+        return false;
+    } else if (!previousGroup.equals(other.previousGroup))
+      return false;
+    if (newGroup == null) {
+      if (other.newGroup != null)
+        return false;
+    } else if (!newGroup.equals(other.newGroup))
+      return false;
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int hashCode = 23;
+    hashCode = (hashCode * 37) + (previousGroup == null ? 1 : previousGroup.hashCode());
+    hashCode = (hashCode * 37) + (newGroup == null ? 1 : newGroup.hashCode());
+    return hashCode;
+  }
+
+  @Override
+  public String toString() {
+    return "GroupChangedEvent["
+                 + previousGroup
+                 + ","
+                 + newGroup
+    + "]";
+  }
+}

Copied: trunk/src/main/java/cc/kune/core/client/events/SocialNetworkChangedEvent.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/state/SocialNetworkChangedEvent.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/events/SocialNetworkChangedEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/events/SocialNetworkChangedEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,101 @@
+/*
+ *
+ * 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.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class SocialNetworkChangedEvent extends GwtEvent<SocialNetworkChangedEvent.SocialNetworkChangedHandler> { 
+
+  public interface HasSocialNetworkChangedHandlers extends HasHandlers {
+    HandlerRegistration addSocialNetworkChangedHandler(SocialNetworkChangedHandler handler);
+  }
+
+  public interface SocialNetworkChangedHandler extends EventHandler {
+    public void onSocialNetworkChanged(SocialNetworkChangedEvent event);
+  }
+
+  private static final Type<SocialNetworkChangedHandler> TYPE = new Type<SocialNetworkChangedHandler>();
+
+  public static void fire(HasHandlers source, cc.kune.core.shared.dto.StateAbstractDTO state) {
+    source.fireEvent(new SocialNetworkChangedEvent(state));
+  }
+
+  public static Type<SocialNetworkChangedHandler> getType() {
+    return TYPE;
+  }
+
+  cc.kune.core.shared.dto.StateAbstractDTO state;
+
+  public SocialNetworkChangedEvent(cc.kune.core.shared.dto.StateAbstractDTO state) {
+    this.state = state;
+  }
+
+  protected SocialNetworkChangedEvent() {
+    // Possibly for serialization.
+  }
+
+  @Override
+  public Type<SocialNetworkChangedHandler> getAssociatedType() {
+    return TYPE;
+  }
+
+  public cc.kune.core.shared.dto.StateAbstractDTO getState() {
+    return state;
+  }
+
+  @Override
+  protected void dispatch(SocialNetworkChangedHandler handler) {
+    handler.onSocialNetworkChanged(this);
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj)
+        return true;
+    if (obj == null)
+        return false;
+    if (getClass() != obj.getClass())
+        return false;
+    SocialNetworkChangedEvent other = (SocialNetworkChangedEvent) obj;
+    if (state == null) {
+      if (other.state != null)
+        return false;
+    } else if (!state.equals(other.state))
+      return false;
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int hashCode = 23;
+    hashCode = (hashCode * 37) + (state == null ? 1 : state.hashCode());
+    return hashCode;
+  }
+
+  @Override
+  public String toString() {
+    return "SocialNetworkChangedEvent["
+                 + state
+    + "]";
+  }
+}

Copied: trunk/src/main/java/cc/kune/core/client/events/StateChangedEvent.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/state/StateChangedEvent.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/events/StateChangedEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/events/StateChangedEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,101 @@
+/*
+ *
+ * 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.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class StateChangedEvent extends GwtEvent<StateChangedEvent.StateChangedHandler> { 
+
+  public interface HasStateChangedHandlers extends HasHandlers {
+    HandlerRegistration addStateChangedHandler(StateChangedHandler handler);
+  }
+
+  public interface StateChangedHandler extends EventHandler {
+    public void onStateChanged(StateChangedEvent event);
+  }
+
+  private static final Type<StateChangedHandler> TYPE = new Type<StateChangedHandler>();
+
+  public static void fire(HasHandlers source, cc.kune.core.shared.dto.StateAbstractDTO state) {
+    source.fireEvent(new StateChangedEvent(state));
+  }
+
+  public static Type<StateChangedHandler> getType() {
+    return TYPE;
+  }
+
+  cc.kune.core.shared.dto.StateAbstractDTO state;
+
+  public StateChangedEvent(cc.kune.core.shared.dto.StateAbstractDTO state) {
+    this.state = state;
+  }
+
+  protected StateChangedEvent() {
+    // Possibly for serialization.
+  }
+
+  @Override
+  public Type<StateChangedHandler> getAssociatedType() {
+    return TYPE;
+  }
+
+  public cc.kune.core.shared.dto.StateAbstractDTO getState() {
+    return state;
+  }
+
+  @Override
+  protected void dispatch(StateChangedHandler handler) {
+    handler.onStateChanged(this);
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    if (this == obj)
+        return true;
+    if (obj == null)
+        return false;
+    if (getClass() != obj.getClass())
+        return false;
+    StateChangedEvent other = (StateChangedEvent) obj;
+    if (state == null) {
+      if (other.state != null)
+        return false;
+    } else if (!state.equals(other.state))
+      return false;
+    return true;
+  }
+
+  @Override
+  public int hashCode() {
+    int hashCode = 23;
+    hashCode = (hashCode * 37) + (state == null ? 1 : state.hashCode());
+    return hashCode;
+  }
+
+  @Override
+  public String toString() {
+    return "StateChangedEvent["
+                 + state
+    + "]";
+  }
+}

Copied: trunk/src/main/java/cc/kune/core/client/events/ToolChangedEvent.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/state/ToolChangedEvent.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/events/ToolChangedEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/events/ToolChangedEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,130 @@
+/*
+ *
+ * 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.events;
+
+import cc.kune.core.shared.domain.utils.StateToken;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class ToolChangedEvent extends GwtEvent<ToolChangedEvent.ToolChangedHandler> {
+
+  public interface HasToolChangedHandlers extends HasHandlers {
+    HandlerRegistration addToolChangedHandler(ToolChangedHandler handler);
+  }
+
+  public interface ToolChangedHandler extends EventHandler {
+    public void onToolChanged(ToolChangedEvent event);
+  }
+
+  private static final Type<ToolChangedHandler> TYPE = new Type<ToolChangedHandler>();
+
+  public static void fire(final HasHandlers source, final StateToken previousToken,
+      final StateToken newToken) {
+    source.fireEvent(new ToolChangedEvent(previousToken, newToken));
+  }
+
+  public static Type<ToolChangedHandler> getType() {
+    return TYPE;
+  }
+
+  private StateToken newToken;
+  private StateToken previousToken;
+
+  protected ToolChangedEvent() {
+    // Possibly for serialization.
+  }
+
+  public ToolChangedEvent(final StateToken previousToken, final StateToken newToken) {
+    this.previousToken = previousToken;
+    this.newToken = newToken;
+  }
+
+  @Override
+  protected void dispatch(final ToolChangedHandler handler) {
+    handler.onToolChanged(this);
+  }
+
+  @Override
+  public boolean equals(final Object obj) {
+    if (this == obj) {
+      return true;
+    }
+    if (obj == null) {
+      return false;
+    }
+    if (getClass() != obj.getClass()) {
+      return false;
+    }
+    final ToolChangedEvent other = (ToolChangedEvent) obj;
+    if (newToken == null) {
+      if (other.newToken != null) {
+        return false;
+      }
+    } else if (!newToken.equals(other.newToken)) {
+      return false;
+    }
+    if (previousToken == null) {
+      if (other.previousToken != null) {
+        return false;
+      }
+    } else if (!previousToken.equals(other.previousToken)) {
+      return false;
+    }
+    return true;
+  }
+
+  @Override
+  public Type<ToolChangedHandler> getAssociatedType() {
+    return TYPE;
+  }
+
+  public StateToken getNewToken() {
+    return newToken;
+  }
+
+  public java.lang.String getNewTool() {
+    return newToken != null ? newToken.getTool() : null;
+  }
+
+  public StateToken getPreviousToken() {
+    return previousToken;
+  }
+
+  public java.lang.String getPreviousTool() {
+    return previousToken != null ? previousToken.getTool() : null;
+  }
+
+  @Override
+  public int hashCode() {
+    final int prime = 31;
+    int result = 1;
+    result = prime * result + ((newToken == null) ? 0 : newToken.hashCode());
+    result = prime * result + ((previousToken == null) ? 0 : previousToken.hashCode());
+    return result;
+  }
+
+  @Override
+  public String toString() {
+    return "ToolChangedEvent[" + getPreviousTool() + "," + getNewTool() + "]";
+  }
+}

Copied: trunk/src/main/java/cc/kune/core/client/events/UserSignInEvent.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/state/UserSignInEvent.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/events/UserSignInEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/events/UserSignInEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,85 @@
+/*
+ *
+ * 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.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class UserSignInEvent extends GwtEvent<UserSignInEvent.UserSignInHandler> {
+
+    public interface HasUserSignInHandlers extends HasHandlers {
+        HandlerRegistration addUserSignInHandler(UserSignInHandler handler);
+    }
+
+    public interface UserSignInHandler extends EventHandler {
+        public void onUserSignIn(UserSignInEvent event);
+    }
+
+    private static final Type<UserSignInHandler> TYPE = new Type<UserSignInHandler>();
+
+    public static Type<UserSignInHandler> getType() {
+        return TYPE;
+    }
+
+    private final cc.kune.core.shared.dto.UserInfoDTO userInfo;
+
+    public UserSignInEvent(final cc.kune.core.shared.dto.UserInfoDTO userInfo) {
+        this.userInfo = userInfo;
+    }
+
+    @Override
+    protected void dispatch(final UserSignInHandler handler) {
+        handler.onUserSignIn(this);
+    }
+
+    @Override
+    public boolean equals(final Object other) {
+        if (other != null && other.getClass().equals(this.getClass())) {
+            final UserSignInEvent o = (UserSignInEvent) other;
+            return true && ((o.userInfo == null && this.userInfo == null) || (o.userInfo != null && o.userInfo.equals(this.userInfo)));
+        }
+        return false;
+    }
+
+    @Override
+    public Type<UserSignInHandler> getAssociatedType() {
+        return TYPE;
+    }
+
+    public cc.kune.core.shared.dto.UserInfoDTO getUserInfo() {
+        return userInfo;
+    }
+
+    @Override
+    public int hashCode() {
+        int hashCode = 23;
+        hashCode = (hashCode * 37) + getClass().hashCode();
+        hashCode = (hashCode * 37) + (userInfo == null ? 1 : userInfo.hashCode());
+        return hashCode;
+    }
+
+    @Override
+    public String toString() {
+        return "UserSignInEvent[" + userInfo + "]";
+    }
+
+}

Copied: trunk/src/main/java/cc/kune/core/client/events/UserSignInOrSignOutEvent.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/state/UserSignInOrSignOutEvent.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/events/UserSignInOrSignOutEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/events/UserSignInOrSignOutEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,94 @@
+/*
+ *
+ * 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.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class UserSignInOrSignOutEvent extends GwtEvent<UserSignInOrSignOutEvent.UserSignInOrSignOutHandler> {
+
+    public interface HasUserSignInOrSignOutHandlers extends HasHandlers {
+        HandlerRegistration addUserSignInOrSignOutHandler(UserSignInOrSignOutHandler handler);
+    }
+
+    public interface UserSignInOrSignOutHandler extends EventHandler {
+        public void onUserSignInOrSignOut(UserSignInOrSignOutEvent event);
+    }
+
+    private static final Type<UserSignInOrSignOutHandler> TYPE = new Type<UserSignInOrSignOutHandler>();
+
+    public static Type<UserSignInOrSignOutHandler> getType() {
+        return TYPE;
+    }
+
+    private final boolean loggedin;
+
+    public UserSignInOrSignOutEvent(final boolean loggedin) {
+        this.loggedin = loggedin;
+    }
+
+    @Override
+    protected void dispatch(final UserSignInOrSignOutHandler handler) {
+        handler.onUserSignInOrSignOut(this);
+    }
+
+    @Override
+    public boolean equals(final Object obj) {
+        if (this == obj) {
+            return true;
+        }
+        if (obj == null) {
+            return false;
+        }
+        if (getClass() != obj.getClass()) {
+            return false;
+        }
+        final UserSignInOrSignOutEvent other = (UserSignInOrSignOutEvent) obj;
+        if (loggedin != other.loggedin) {
+            return false;
+        }
+        return true;
+    }
+
+    @Override
+    public Type<UserSignInOrSignOutHandler> getAssociatedType() {
+        return TYPE;
+    }
+
+    @Override
+    public int hashCode() {
+        final int prime = 31;
+        int result = 1;
+        result = prime * result + (loggedin ? 1231 : 1237);
+        return result;
+    }
+
+    public boolean isLogged() {
+        return loggedin;
+    }
+
+    @Override
+    public String toString() {
+        return "UserSignInOrSignOutEvent[" + loggedin + "]";
+    }
+
+}

Copied: trunk/src/main/java/cc/kune/core/client/events/UserSignOutEvent.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/state/UserSignOutEvent.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/events/UserSignOutEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/events/UserSignOutEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,81 @@
+/*
+ *
+ * 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.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+import com.gwtplatform.mvp.client.HasEventBus;
+
+public class UserSignOutEvent extends GwtEvent<UserSignOutEvent.UserSignOutHandler> {
+
+  public interface HasUserSignOutHandlers extends HasHandlers {
+    HandlerRegistration addUserSignOutHandler(UserSignOutHandler handler);
+  }
+
+  public interface UserSignOutHandler extends EventHandler {
+    public void onUserSignOut(UserSignOutEvent event);
+  }
+
+  private static final Type<UserSignOutHandler> TYPE = new Type<UserSignOutHandler>();
+
+  public static void fire(final HasEventBus source) {
+    source.fireEvent(new UserSignOutEvent());
+  }
+
+  public static Type<UserSignOutHandler> getType() {
+    return TYPE;
+  }
+
+  public UserSignOutEvent() {
+  }
+
+  @Override
+  protected void dispatch(final UserSignOutHandler handler) {
+    handler.onUserSignOut(this);
+  }
+
+  @Override
+  public boolean equals(final Object other) {
+    if (other != null && other.getClass().equals(this.getClass())) {
+      return true;
+    }
+    return false;
+  }
+
+  @Override
+  public Type<UserSignOutHandler> getAssociatedType() {
+    return TYPE;
+  }
+
+  @Override
+  public int hashCode() {
+    int hashCode = 23;
+    hashCode = (hashCode * 37) + getClass().hashCode();
+    return hashCode;
+  }
+
+  @Override
+  public String toString() {
+    return "UserSignOutEvent[" + "]";
+  }
+
+}

Modified: trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/i18n/I18nUITranslationService.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -35,10 +35,10 @@
 import cc.kune.common.client.utils.WindowUtils;
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.common.shared.utils.TextUtils;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
 import cc.kune.core.client.rpcservices.I18nServiceAsync;
 import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.UserSignInEvent;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
 import cc.kune.core.shared.dto.I18nLanguageDTO;
 
 import com.google.gwt.core.client.Scheduler;

Modified: trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants.properties	2012-01-08 23:06:53 UTC (rev 1656)
@@ -102,7 +102,7 @@
 andNExternalUser = and [%d] external user
 thisIsOnlyAPreviewOfHowThisPageWouldLookLikeToTheGeneralPublicOnTheInternet = This is only a preview of how this page would look like to the general public on the internet.
 preview = Preview
-paramUnderLicenseParam = © [%s], under license: [%s]
+paramUnderLicenseParam = © [%s], under license: [%s]
 clickToRename = Click to rename
 createANewDocumentIfYouChooseToPublishItThisDocumentWillAppearAsANewPageInThePublicWeb = Create a New Document. If you choose to publish it, this document will appear as a new 'Page' in the public web
 reloadCurrentPage = Reload current page
@@ -343,8 +343,8 @@
 error = Error
 toJoinAChatroomYouNeedToBeOnline = To join a chatroom you need to be 'online'
 licenseWizard = License wizard
-backUsedInButton = « Back
-nextUsedInButton = Next »
+backUsedInButton = « Back
+nextUsedInButton = Next »
 select = Select
 finishUsedInButton = Finish
 selectTheLicenseYouPreferUsingForSharingYourGroupContentsWithOtherPeople = Select the license you prefer using for sharing your group contents with other people:
@@ -433,7 +433,6 @@
 nowadaysTheGadgetsMapsPollsEtcAreExperimentalInSomeBrowsersYouMightExperienceProblemsWithCertainGadg = Nowadays the gadgets (maps, polls, etc) are experimental. In some browsers you might experience problems with certain gadgets
 errorConfiguringTheTool = Error configuring the tool
 youDoNotHaveRightsToPerformThatAction = You do not have rights to perform that action
-0 = 0
 signInOrRegisterToHelpWithTheTranslation = Sign in or register to help with the translation
 thisNameAlreadyExistsItIsUsedWhenAFileOrAFolderWithTheSameNameAlreadyExists = This name already exists
 doYouWantToAddParamAsAMemberOfParam = Do you want to add '[%s]' as a member of '[%s]'?

Modified: trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_fr.properties
===================================================================
--- trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_fr.properties	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/i18n/KuneConstants_fr.properties	2012-01-08 23:06:53 UTC (rev 1656)
@@ -431,7 +431,6 @@
 nowadaysTheGadgetsMapsPollsEtcAreExperimentalInSomeBrowsersYouMightExperienceProblemsWithCertainGadg = Les gadgets (cartes, sondages, etc) sont encore expérimentaux. Dans certains navigateurs, vous pourrez avoir des problèmes avec certains gadgets
 errorConfiguringTheTool = Erreur lors de la configuration de l'outil
 youDoNotHaveRightsToPerformThatAction = Vous n'avez pas les permissions suffisantes pour accomplir cette action
-0 = 0
 signInOrRegisterToHelpWithTheTranslation = Connectez-vous ou créez un compte pour aider à la traduction
 thisNameAlreadyExistsItIsUsedWhenAFileOrAFolderWithTheSameNameAlreadyExists = Ce nom existe déjà
 doYouWantToAddParamAsAMemberOfParam = Voulez-vous ajouter '[%s]' comme membre de '[%s]' ?

Deleted: trunk/src/main/java/cc/kune/core/client/init/AppStartEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/init/AppStartEvent.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/init/AppStartEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,94 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.init;
-
-import com.google.gwt.event.shared.EventHandler;
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.event.shared.HasHandlers;
-import com.gwtplatform.mvp.client.HasEventBus;
-
-public class AppStartEvent extends GwtEvent<AppStartEvent.AppStartHandler> { 
-
-  public interface HasAppStartHandlers extends HasHandlers {
-    HandlerRegistration addAppStartHandler(AppStartHandler handler);
-  }
-
-  public interface AppStartHandler extends EventHandler {
-    public void onAppStart(AppStartEvent event);
-  }
-
-  private static final Type<AppStartHandler> TYPE = new Type<AppStartHandler>();
-
-  public static void fire(HasEventBus source, cc.kune.core.shared.dto.InitDataDTO initData) {
-    source.fireEvent(new AppStartEvent(initData));
-  }
-
-  public static Type<AppStartHandler> getType() {
-    return TYPE;
-  }
-
-  private final cc.kune.core.shared.dto.InitDataDTO initData;
-
-  public AppStartEvent(cc.kune.core.shared.dto.InitDataDTO initData) {
-    this.initData = initData;
-  }
-
-  @Override
-  public Type<AppStartHandler> getAssociatedType() {
-    return TYPE;
-  }
-
-  public cc.kune.core.shared.dto.InitDataDTO getInitData() {
-    return initData;
-  }
-
-  @Override
-  protected void dispatch(AppStartHandler handler) {
-    handler.onAppStart(this);
-  }
-
-  @Override
-  public boolean equals(Object other) {
-    if (other != null && other.getClass().equals(this.getClass())) {
-          AppStartEvent o = (AppStartEvent) other;
-      return true
-          && ((o.initData == null && this.initData == null) || (o.initData != null && o.initData.equals(this.initData)))
-        ;
-    }
-    return false;
-  }
-
-  @Override
-  public int hashCode() {
-    int hashCode = 23;
-    hashCode = (hashCode * 37) + getClass().hashCode();
-    hashCode = (hashCode * 37) + (initData == null ? 1 : initData.hashCode());
-    return hashCode;
-  }
-
-  @Override
-  public String toString() {
-    return "AppStartEvent["
-                 + initData
-    + "]";
-  }
-
-}

Modified: trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/init/AppStarterDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -26,6 +26,8 @@
 import cc.kune.common.client.notify.UserNotifyEvent;
 import cc.kune.common.client.resources.CommonResources;
 import cc.kune.common.client.utils.SimpleResponseCallback;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.AppStopEvent;
 import cc.kune.core.client.rpcservices.SiteServiceAsync;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.shared.dto.InitDataDTO;

Deleted: trunk/src/main/java/cc/kune/core/client/init/AppStopEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/init/AppStopEvent.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/init/AppStopEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -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 cc.kune.core.client.init;
-
-import com.google.gwt.event.shared.EventHandler;
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.event.shared.HasHandlers;
-import com.gwtplatform.mvp.client.HasEventBus;
-
-public class AppStopEvent extends GwtEvent<AppStopEvent.AppStopHandler> { 
-
-  public interface HasAppStopHandlers extends HasHandlers {
-    HandlerRegistration addAppStopHandler(AppStopHandler handler);
-  }
-
-  public interface AppStopHandler extends EventHandler {
-    public void onAppStop(AppStopEvent event);
-  }
-
-  private static final Type<AppStopHandler> TYPE = new Type<AppStopHandler>();
-
-  public static void fire(HasEventBus source) {
-    source.fireEvent(new AppStopEvent());
-  }
-
-  public static Type<AppStopHandler> getType() {
-    return TYPE;
-  }
-
-
-  public AppStopEvent() {
-  }
-
-  @Override
-  public Type<AppStopHandler> getAssociatedType() {
-    return TYPE;
-  }
-
-  @Override
-  protected void dispatch(AppStopHandler handler) {
-    handler.onAppStop(this);
-  }
-
-  @Override
-  public boolean equals(Object other) {
-    if (other != null && other.getClass().equals(this.getClass())) {
-          AppStopEvent o = (AppStopEvent) other;
-      return true
-        ;
-    }
-    return false;
-  }
-
-  @Override
-  public int hashCode() {
-    int hashCode = 23;
-    hashCode = (hashCode * 37) + getClass().hashCode();
-    return hashCode;
-  }
-
-  @Override
-  public String toString() {
-    return "AppStopEvent["
-    + "]";
-  }
-
-}

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SiteUserOptionsPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -31,16 +31,16 @@
 import cc.kune.common.client.actions.ui.descrip.ToolbarSeparatorDescriptor;
 import cc.kune.common.client.actions.ui.descrip.ToolbarSeparatorDescriptor.Type;
 import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignOutEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.client.resources.CoreMessages;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.client.services.ClientFileDownloadUtils;
 import cc.kune.core.client.sn.actions.GotoGroupAction;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;
-import cc.kune.core.client.state.UserSignInEvent;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
-import cc.kune.core.client.state.UserSignOutEvent;
-import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.dto.UserInfoDTO;
 

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -24,7 +24,7 @@
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.core.client.sitebar.SitebarActionsPresenter.SitebarActionsView;
 import cc.kune.core.client.sitebar.logo.SiteLogo;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 
 import com.google.gwt.user.client.ui.Widget;
 import com.google.inject.Inject;

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarActionsPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -33,7 +33,7 @@
 import cc.kune.common.client.resources.CommonResources;
 import cc.kune.common.client.ui.KuneWindowUtils;
 import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.core.client.init.AppStartEvent;
+import cc.kune.core.client.events.AppStartEvent;
 import cc.kune.core.client.resources.CoreResources;
 
 import com.google.gwt.event.shared.EventBus;

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignInLink.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -23,14 +23,14 @@
 import cc.kune.common.client.actions.Action;
 import cc.kune.common.client.actions.ActionEvent;
 import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignOutEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 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.UserSignInEvent;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
-import cc.kune.core.client.state.UserSignOutEvent;
-import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
 
 import com.google.gwt.event.shared.EventBus;
 import com.google.inject.Inject;

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignOutLink.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignOutLink.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/SitebarSignOutLink.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -33,12 +33,12 @@
 import cc.kune.core.client.errors.ErrorHandler;
 import cc.kune.core.client.errors.SessionExpiredException;
 import cc.kune.core.client.errors.UserMustBeLoggedException;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignOutEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.client.rpcservices.UserServiceAsync;
 import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.UserSignInEvent;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
-import cc.kune.core.client.state.UserSignOutEvent;
-import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
 
 import com.google.gwt.event.shared.EventBus;
 import com.google.gwt.user.client.rpc.AsyncCallback;

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/logo/SiteLogo.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/logo/SiteLogo.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/logo/SiteLogo.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,9 +20,9 @@
 package cc.kune.core.client.sitebar.logo;
 
 import cc.kune.common.client.tooltip.Tooltip;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
-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.StateManager;

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/search/SitebarSearchPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -24,7 +24,7 @@
 import cc.kune.core.client.sitebar.search.SitebarSearchPresenter.SitebarSearchView;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 
 import com.google.gwt.event.dom.client.HasAllFocusHandlers;
 import com.google.gwt.event.dom.client.HasClickHandlers;

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -24,8 +24,8 @@
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.sitebar.spaces.SpaceSelectorPresenter.SpaceSelectorView;
 import cc.kune.core.client.state.Session;
-import cc.kune.gspace.client.GSpaceArmor;
-import cc.kune.gspace.client.resources.GSpaceArmorResources;
+import cc.kune.gspace.client.armor.GSpaceArmor;
+import cc.kune.gspace.client.armor.resources.GSpaceArmorResources;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.dom.client.HasClickHandlers;

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPanel.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPanel.ui.xml	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPanel.ui.xml	2012-01-08 23:06:53 UTC (rev 1656)
@@ -2,7 +2,7 @@
 <ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
   xmlns:g="urn:import:com.google.gwt.user.client.ui">
   <ui:with field='img'
-    type='cc.kune.gspace.client.resources.GSpaceArmorResources' />
+    type='cc.kune.gspace.client.armor.resources.GSpaceArmorResources' />
   <g:FlowPanel ui:field="panel" addStyleNames="k-space-sel k-10corners k-floatleft k-pointer" >
     <g:ToggleButton ui:field="homeButton" styleName="k-space-sel-btn">
       <g:upFace image='{img.homeSpaceDisabled}' />

Modified: trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sitebar/spaces/SpaceSelectorPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -24,14 +24,14 @@
 import cc.kune.common.client.ui.MaskWidgetView;
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.core.client.auth.SignIn;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.UserSignOutEvent;
 import cc.kune.core.client.events.WindowFocusEvent;
-import cc.kune.core.client.init.AppStartEvent;
 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.client.state.UserSignOutEvent;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 import cc.kune.gspace.client.style.GSpaceBackManager;
 
 import com.google.gwt.event.dom.client.ClickEvent;

Modified: trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/AbstractSNPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -33,7 +33,7 @@
 import cc.kune.core.client.dnd.KuneDragController;
 import cc.kune.core.client.dnd.NotImplementedDropManager;
 import cc.kune.core.client.ui.BasicDragableThumb;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.dom.client.ClickEvent;

Modified: trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupSNPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -30,7 +30,7 @@
 import cc.kune.core.client.sn.GroupSNPresenter.GroupSNView;
 import cc.kune.core.client.ui.BasicDragableThumb;
 import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 
 import com.google.gwt.user.client.ui.Widget;
 import com.google.inject.Inject;

Modified: trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/GroupSNPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -23,19 +23,19 @@
 
 import cc.kune.common.client.actions.ui.IsActionExtensible;
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.core.client.events.SocialNetworkChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignOutEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.client.services.ClientFileDownloadUtils;
 import cc.kune.core.client.sn.actions.registry.GroupSNAdminsMenuItemsRegistry;
 import cc.kune.core.client.sn.actions.registry.GroupSNCollabsMenuItemsRegistry;
 import cc.kune.core.client.sn.actions.registry.GroupSNConfActions;
 import cc.kune.core.client.sn.actions.registry.GroupSNPendingsMenuItemsRegistry;
 import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.SocialNetworkChangedEvent;
-import cc.kune.core.client.state.StateChangedEvent;
 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.client.state.UserSignOutEvent;
-import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.shared.domain.utils.AccessRights;
 import cc.kune.core.shared.dto.AccessListsDTO;
 import cc.kune.core.shared.dto.GroupDTO;

Deleted: trunk/src/main/java/cc/kune/core/client/sn/SimpleContactManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/SimpleContactManager.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/SimpleContactManager.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.sn;
-
-public interface SimpleContactManager {
-
-  void addNewBuddy(String shortName);
-
-  void chat(String shortName);
-
-  boolean isBuddy(String shortName);
-
-}

Modified: trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -31,7 +31,7 @@
 import cc.kune.core.client.ui.BasicDragableThumb;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.dto.UserSimpleDTO;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 
 import com.google.gwt.user.client.ui.Label;
 import com.google.gwt.user.client.ui.Widget;

Modified: trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -24,19 +24,19 @@
 import cc.kune.common.client.actions.ui.IsActionExtensible;
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
 import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.events.SocialNetworkChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignOutEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.client.services.ClientFileDownloadUtils;
 import cc.kune.core.client.sn.UserSNPresenter.UserSNProxy;
 import cc.kune.core.client.sn.UserSNPresenter.UserSNView;
 import cc.kune.core.client.sn.actions.registry.UserSNConfActions;
 import cc.kune.core.client.sn.actions.registry.UserSNMenuItemsRegistry;
 import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.SocialNetworkChangedEvent;
-import cc.kune.core.client.state.StateChangedEvent;
 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.client.state.UserSignOutEvent;
-import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.dto.ParticipationDataDTO;
 import cc.kune.core.shared.dto.StateAbstractDTO;

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/AddNewBuddiesAction.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -25,10 +25,10 @@
 import cc.kune.common.client.notify.NotifyUser;
 import cc.kune.common.client.utils.SimpleResponseCallback;
 import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.contacts.SimpleContactManager;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.client.sitebar.search.EntitySearchPanel;
 import cc.kune.core.client.sitebar.search.OnEntitySelectedInSearch;
-import cc.kune.core.client.sn.SimpleContactManager;
 
 import com.google.inject.Inject;
 

Added: trunk/src/main/java/cc/kune/core/client/sn/actions/GroupSNModerationSubMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/GroupSNModerationSubMenu.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/GroupSNModerationSubMenu.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,9 @@
+package cc.kune.core.client.sn.actions;
+
+import cc.kune.common.client.actions.ui.descrip.SubMenuDescriptor;
+
+import com.google.inject.Singleton;
+
+ at Singleton
+public class GroupSNModerationSubMenu extends SubMenuDescriptor {
+}

Added: trunk/src/main/java/cc/kune/core/client/sn/actions/GroupSNOptionsMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/GroupSNOptionsMenu.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/GroupSNOptionsMenu.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,9 @@
+package cc.kune.core.client.sn.actions;
+
+import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
+
+import com.google.inject.Singleton;
+
+ at Singleton
+public class GroupSNOptionsMenu extends MenuDescriptor {
+}

Added: trunk/src/main/java/cc/kune/core/client/sn/actions/GroupSNVisibilitySubMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/GroupSNVisibilitySubMenu.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/GroupSNVisibilitySubMenu.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,9 @@
+package cc.kune.core.client.sn.actions;
+
+import cc.kune.common.client.actions.ui.descrip.SubMenuDescriptor;
+
+import com.google.inject.Singleton;
+
+ at Singleton
+public class GroupSNVisibilitySubMenu extends SubMenuDescriptor {
+}

Deleted: trunk/src/main/java/cc/kune/core/client/sn/actions/RolComparator.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/RolComparator.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/RolComparator.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -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 cc.kune.core.client.sn.actions;
-
-import cc.kune.core.shared.domain.utils.AccessRights;
-import cc.kune.core.shared.dto.AccessRolDTO;
-
-public final class RolComparator {
-
-    public static boolean isEnabled(final AccessRolDTO rolRequired, final AccessRights rights) {
-        switch (rolRequired) {
-        case Administrator:
-            return rights.isAdministrable();
-        case Editor:
-            return rights.isEditable();
-        case Viewer:
-            return rights.isVisible();
-        }
-        return false;
-    }
-
-    public static boolean isMember(final AccessRights newRights) {
-        return newRights.isAdministrable() || newRights.isEditable();
-    }
-
-    private RolComparator() {
-    }
-}

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/SessionAction.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/SessionAction.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/SessionAction.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -21,9 +21,9 @@
 
 import cc.kune.common.client.actions.AbstractExtendedAction;
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
+import cc.kune.core.client.events.UserSignInOrSignOutEvent;
+import cc.kune.core.client.events.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
 import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.UserSignInOrSignOutEvent;
-import cc.kune.core.client.state.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
 
 import com.google.inject.Inject;
 

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAdmins.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAdmins.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToAdmins.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -21,18 +21,18 @@
 
 import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
 import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.core.client.sn.actions.registry.GroupSNConfActions;
 
 import com.google.inject.Inject;
 
 public class WriteToAdmins extends MenuItemDescriptor {
 
   @Inject
-  public WriteToAdmins(final WriteToAction action, final I18nTranslationService i18n) {
+  public WriteToAdmins(final WriteToAction action, final I18nTranslationService i18n,
+      final GroupSNOptionsMenu optionsMenu) {
     super(action);
     action.setOnlyToAdmin(true);
     withText(i18n.t("Write to the administrators of this group"));
-    setParent(GroupSNConfActions.OPTIONS_MENU);
+    setParent(optionsMenu);
     setPosition(0);
   }
 }

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToBuddyHeaderButton.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToBuddyHeaderButton.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToBuddyHeaderButton.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -23,10 +23,10 @@
 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.sn.SimpleContactManager;
+import cc.kune.core.client.contacts.SimpleContactManager;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
 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;

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToMembers.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToMembers.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/WriteToMembers.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -21,18 +21,18 @@
 
 import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
 import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.core.client.sn.actions.registry.GroupSNConfActions;
 
 import com.google.inject.Inject;
 
 public class WriteToMembers extends MenuItemDescriptor {
 
   @Inject
-  public WriteToMembers(final WriteToAction action, final I18nTranslationService i18n) {
+  public WriteToMembers(final WriteToAction action, final I18nTranslationService i18n,
+      final GroupSNOptionsMenu optionsMenu) {
     super(action);
     action.setOnlyToAdmin(false);
     withText(i18n.t("Write to the members of this group"));
-    setParent(GroupSNConfActions.OPTIONS_MENU);
+    setParent(optionsMenu);
     setPosition(0);
   }
 }

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsBuddieCondition.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsBuddieCondition.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsBuddieCondition.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -22,7 +22,7 @@
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
 import cc.kune.common.client.actions.ui.descrip.GuiAddCondition;
 import cc.kune.common.client.errors.UIException;
-import cc.kune.core.client.sn.SimpleContactManager;
+import cc.kune.core.client.contacts.SimpleContactManager;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.dto.UserSimpleDTO;

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotBuddieCondition.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotBuddieCondition.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/conditions/IsNotBuddieCondition.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,7 +20,7 @@
 package cc.kune.core.client.sn.actions.conditions;
 
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
-import cc.kune.core.client.sn.SimpleContactManager;
+import cc.kune.core.client.contacts.SimpleContactManager;
 import cc.kune.core.client.state.Session;
 
 import com.google.inject.Inject;

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	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/GroupSNConfActions.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -21,15 +21,18 @@
 
 import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
-import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
 import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
 import cc.kune.common.client.actions.ui.descrip.MenuRadioItemDescriptor;
 import cc.kune.common.client.actions.ui.descrip.MenuTitleItemDescriptor;
-import cc.kune.common.client.actions.ui.descrip.SubMenuDescriptor;
 import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.client.sn.GroupSNPresenter;
 import cc.kune.core.client.sn.actions.AddEntityToThisGroupAction;
+import cc.kune.core.client.sn.actions.GroupSNModerationSubMenu;
+import cc.kune.core.client.sn.actions.GroupSNOptionsMenu;
+import cc.kune.core.client.sn.actions.GroupSNVisibilitySubMenu;
 import cc.kune.core.client.sn.actions.JoinGroupAction;
 import cc.kune.core.client.sn.actions.MembersModerationMenuItem;
 import cc.kune.core.client.sn.actions.MembersVisibilityMenuItem;
@@ -39,8 +42,6 @@
 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;
-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.shared.domain.AdmissionType;
 import cc.kune.core.shared.domain.SocialNetworkVisibility;
@@ -60,10 +61,7 @@
 @SuppressWarnings("serial")
 public class GroupSNConfActions extends AbstractSNActionsRegistry {
 
-  public static final SubMenuDescriptor MODERATION_SUBMENU = new SubMenuDescriptor();
-  public static final MenuDescriptor OPTIONS_MENU = new MenuDescriptor();
   public static final String OPTIONS_STYLES = "k-sn-options-menu, k-noborder, k-nobackcolor, k-no-backimage, k-btn-min";
-  public static final SubMenuDescriptor VISIBILITY_SUBMENU = new SubMenuDescriptor();
 
   @Inject
   public GroupSNConfActions(final Session session, final StateManager stateManager,
@@ -72,8 +70,9 @@
       final IsLoggedCondition isLoggedCondition, final JoinGroupAction joinGroupAction,
       final WriteToMembers writeToMembers, final WriteToAdmins writeToAdmins,
       final IsGroupCondition isGroupCondition, final UnJoinFromCurrentGroupAction unJoinGroupAction,
-      final AddEntityToThisGroupAction addEntityToThisGroupAction) {
-    OPTIONS_MENU.withToolTip(i18n.t("Options")).withIcon(res.arrowdownsitebar()).withStyles(
+      final AddEntityToThisGroupAction addEntityToThisGroupAction, final GroupSNOptionsMenu optionsMenu,
+      final GroupSNModerationSubMenu moderationSubMenu, final GroupSNVisibilitySubMenu visibilitySubMenu) {
+    optionsMenu.withToolTip(i18n.t("Options")).withIcon(res.arrowdownsitebar()).withStyles(
         OPTIONS_STYLES);
     final MenuRadioItemDescriptor anyoneItem = membersVisibility.get().withVisibility(
         SocialNetworkVisibility.anyone);
@@ -87,19 +86,19 @@
         AdmissionType.Moderated);
     final MenuRadioItemDescriptor openItem = membersModeration.get().withModeration(AdmissionType.Open);
 
-    addImpl(OPTIONS_MENU);
-    new MenuTitleItemDescriptor(i18n.t("Options")).withParent(OPTIONS_MENU);
-    new MenuItemDescriptor(addEntityToThisGroupAction).withParent(OPTIONS_MENU).setPosition(0);
-    new MenuItemDescriptor(unJoinGroupAction).withParent(OPTIONS_MENU).setPosition(1);
+    addImpl(optionsMenu);
+    new MenuTitleItemDescriptor(i18n.t("Options")).withParent(optionsMenu);
+    new MenuItemDescriptor(addEntityToThisGroupAction).withParent(optionsMenu).setPosition(0);
+    new MenuItemDescriptor(unJoinGroupAction).withParent(optionsMenu).setPosition(1);
 
-    VISIBILITY_SUBMENU.withText(i18n.t("Users who can view this member list")).withParent(OPTIONS_MENU);
-    MODERATION_SUBMENU.withText(i18n.t("New members policy")).withParent(OPTIONS_MENU);
-    anyoneItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("anyone"));
-    onlyMembersItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("only members"));
-    onlyAdminsItem.withParent(VISIBILITY_SUBMENU).withText(i18n.t("only administrators"));
-    moderatedItem.withParent(MODERATION_SUBMENU).withText(i18n.t("moderate request to join"));
-    openItem.withParent(MODERATION_SUBMENU).withText(i18n.t("auto accept request to join"));
-    closedItem.withParent(MODERATION_SUBMENU).withText(i18n.t("closed for new members"));
+    visibilitySubMenu.withText(i18n.t("Users who can view this member list")).withParent(optionsMenu);
+    moderationSubMenu.withText(i18n.t("New members policy")).withParent(optionsMenu);
+    anyoneItem.withParent(visibilitySubMenu).withText(i18n.t("anyone"));
+    onlyMembersItem.withParent(visibilitySubMenu).withText(i18n.t("only members"));
+    onlyAdminsItem.withParent(visibilitySubMenu).withText(i18n.t("only administrators"));
+    moderatedItem.withParent(moderationSubMenu).withText(i18n.t("moderate request to join"));
+    openItem.withParent(moderationSubMenu).withText(i18n.t("auto accept request to join"));
+    closedItem.withParent(moderationSubMenu).withText(i18n.t("closed for new members"));
 
     final ButtonDescriptor joinBtn = new ButtonDescriptor(joinGroupAction);
     // final ButtonDescriptor unJoinBtn = new
@@ -116,8 +115,8 @@
       @Override
       public void onStateChanged(final StateChangedEvent event) {
         final boolean administrable = event.getState().getGroupRights().isAdministrable();
-        OPTIONS_MENU.setVisible(administrable);
-        OPTIONS_MENU.setEnabled(administrable);
+        optionsMenu.setVisible(administrable);
+        optionsMenu.setEnabled(administrable);
         final StateAbstractDTO state = event.getState();
         final GroupDTO currentGroup = state.getGroup();
         if (currentGroup.isNotPersonal()) {

Modified: trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/sn/actions/registry/UserSNConfActions.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -25,14 +25,14 @@
 import cc.kune.common.client.actions.ui.descrip.MenuRadioItemDescriptor;
 import cc.kune.common.client.actions.ui.descrip.SubMenuDescriptor;
 import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.client.sn.UserSNPresenter;
 import cc.kune.core.client.sn.actions.AddNewBuddiesAction;
 import cc.kune.core.client.sn.actions.UserSNVisibilityMenuItem;
 import cc.kune.core.client.sn.actions.conditions.IsGroupCondition;
 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.shared.domain.UserSNetVisibility;
 import cc.kune.core.shared.dto.StateAbstractDTO;

Deleted: trunk/src/main/java/cc/kune/core/client/state/AccessRightsChangedEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/AccessRightsChangedEvent.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/AccessRightsChangedEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,115 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.state;
-
-import com.google.gwt.event.shared.EventHandler;
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.event.shared.HasHandlers;
-
-public class AccessRightsChangedEvent extends GwtEvent<AccessRightsChangedEvent.AccessRightsChangedHandler> { 
-
-  public interface HasAccessRightsChangedHandlers extends HasHandlers {
-    HandlerRegistration addAccessRightsChangedHandler(AccessRightsChangedHandler handler);
-  }
-
-  public interface AccessRightsChangedHandler extends EventHandler {
-    public void onAccessRightsChanged(AccessRightsChangedEvent event);
-  }
-
-  private static final Type<AccessRightsChangedHandler> TYPE = new Type<AccessRightsChangedHandler>();
-
-  public static void fire(HasHandlers source, cc.kune.core.shared.domain.utils.AccessRights previousRights, cc.kune.core.shared.domain.utils.AccessRights currentRights) {
-    source.fireEvent(new AccessRightsChangedEvent(previousRights, currentRights));
-  }
-
-  public static Type<AccessRightsChangedHandler> getType() {
-    return TYPE;
-  }
-
-  cc.kune.core.shared.domain.utils.AccessRights previousRights;
-  cc.kune.core.shared.domain.utils.AccessRights currentRights;
-
-  public AccessRightsChangedEvent(cc.kune.core.shared.domain.utils.AccessRights previousRights, cc.kune.core.shared.domain.utils.AccessRights currentRights) {
-    this.previousRights = previousRights;
-    this.currentRights = currentRights;
-  }
-
-  protected AccessRightsChangedEvent() {
-    // Possibly for serialization.
-  }
-
-  @Override
-  public Type<AccessRightsChangedHandler> getAssociatedType() {
-    return TYPE;
-  }
-
-  public cc.kune.core.shared.domain.utils.AccessRights getPreviousRights() {
-    return previousRights;
-  }
-
-  public cc.kune.core.shared.domain.utils.AccessRights getCurrentRights() {
-    return currentRights;
-  }
-
-  @Override
-  protected void dispatch(AccessRightsChangedHandler handler) {
-    handler.onAccessRightsChanged(this);
-  }
-
-  @Override
-  public boolean equals(Object obj) {
-    if (this == obj)
-        return true;
-    if (obj == null)
-        return false;
-    if (getClass() != obj.getClass())
-        return false;
-    AccessRightsChangedEvent other = (AccessRightsChangedEvent) obj;
-    if (previousRights == null) {
-      if (other.previousRights != null)
-        return false;
-    } else if (!previousRights.equals(other.previousRights))
-      return false;
-    if (currentRights == null) {
-      if (other.currentRights != null)
-        return false;
-    } else if (!currentRights.equals(other.currentRights))
-      return false;
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    int hashCode = 23;
-    hashCode = (hashCode * 37) + (previousRights == null ? 1 : previousRights.hashCode());
-    hashCode = (hashCode * 37) + (currentRights == null ? 1 : currentRights.hashCode());
-    return hashCode;
-  }
-
-  @Override
-  public String toString() {
-    return "AccessRightsChangedEvent["
-                 + previousRights
-                 + ","
-                 + currentRights
-    + "]";
-  }
-}

Modified: trunk/src/main/java/cc/kune/core/client/state/AccessRightsClientManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/AccessRightsClientManager.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/AccessRightsClientManager.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -19,7 +19,9 @@
  */
 package cc.kune.core.client.state;
 
-import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
+import cc.kune.core.client.events.AccessRightsChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
 import cc.kune.core.shared.domain.utils.AccessRights;
 import cc.kune.core.shared.dto.StateAbstractDTO;
 

Deleted: trunk/src/main/java/cc/kune/core/client/state/ContentCacheDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/ContentCacheDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/ContentCacheDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -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 cc.kune.core.client.state;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import cc.kune.common.client.notify.ProgressShowEvent;
-import cc.kune.core.client.init.AppStartEvent;
-import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.client.state.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.StateAbstractDTO;
-
-import com.google.gwt.event.shared.EventBus;
-import com.google.gwt.user.client.rpc.AsyncCallback;
-import com.google.inject.Inject;
-
-public class ContentCacheDefault implements ContentCache {
-  private final Map<StateToken, StateAbstractDTO> cacheMap;
-  private final EventBus eventBus;
-  private final ContentServiceAsync server;
-  private boolean useCache = false;
-
-  @Inject
-  public ContentCacheDefault(final ContentServiceAsync server, final EventBus eventBus,
-      final Session session) {
-    this.server = server;
-    this.eventBus = eventBus;
-    this.cacheMap = new HashMap<StateToken, StateAbstractDTO>();
-    // Better, don't use while we don't check changes in the server (by others)
-    // and we do server pub/sub
-    session.onAppStart(true, new AppStartHandler() {
-      @Override
-      public void onAppStart(final AppStartEvent event) {
-        useCache = event.getInitData().useClientContentCache();
-      }
-    });
-    useCache = true;
-    session.onUserSignInOrSignOut(false, new UserSignInOrSignOutHandler() {
-      @Override
-      public void onUserSignInOrSignOut(final UserSignInOrSignOutEvent event) {
-        cacheMap.clear();
-      }
-    });
-  }
-
-  @Override
-  public void cache(final StateToken encodeState, final StateAbstractDTO content) {
-    assert encodeState != null;
-    if (useCache) {
-      cacheMap.put(encodeState, content);
-    }
-  }
-
-  private StateAbstractDTO getCached(final StateToken newState) {
-    assert newState != null;
-    return useCache ? cacheMap.get(newState) : null;
-  }
-
-  @Override
-  public void getContent(final String user, final StateToken newState,
-      final AsyncCallback<StateAbstractDTO> callback) {
-    assert newState != null;
-    eventBus.fireEvent(new ProgressShowEvent(""));
-    final StateAbstractDTO catched = getCached(newState);
-    if (catched != null) {
-      callback.onSuccess(catched);
-    } else {
-      // NotifyUser.info("Getting state of: " + newState, true);
-      server.getContent(user, newState, callback);
-    }
-  }
-
-  @Override
-  public void remove(final StateToken token) {
-    cacheMap.remove(token);
-  }
-
-  @Override
-  public void removeCacheOfGroup(final String group) {
-    for (final StateToken entry : cacheMap.keySet()) {
-      if (entry.getGroup().equals(group)) {
-        cacheMap.put(entry, null);
-      }
-    }
-  }
-
-}

Deleted: trunk/src/main/java/cc/kune/core/client/state/GroupChangedEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/GroupChangedEvent.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/GroupChangedEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,115 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.state;
-
-import com.google.gwt.event.shared.EventHandler;
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.event.shared.HasHandlers;
-
-public class GroupChangedEvent extends GwtEvent<GroupChangedEvent.GroupChangedHandler> { 
-
-  public interface HasGroupChangedHandlers extends HasHandlers {
-    HandlerRegistration addGroupChangedHandler(GroupChangedHandler handler);
-  }
-
-  public interface GroupChangedHandler extends EventHandler {
-    public void onGroupChanged(GroupChangedEvent event);
-  }
-
-  private static final Type<GroupChangedHandler> TYPE = new Type<GroupChangedHandler>();
-
-  public static void fire(HasHandlers source, java.lang.String previousGroup, java.lang.String newGroup) {
-    source.fireEvent(new GroupChangedEvent(previousGroup, newGroup));
-  }
-
-  public static Type<GroupChangedHandler> getType() {
-    return TYPE;
-  }
-
-  java.lang.String previousGroup;
-  java.lang.String newGroup;
-
-  public GroupChangedEvent(java.lang.String previousGroup, java.lang.String newGroup) {
-    this.previousGroup = previousGroup;
-    this.newGroup = newGroup;
-  }
-
-  protected GroupChangedEvent() {
-    // Possibly for serialization.
-  }
-
-  @Override
-  public Type<GroupChangedHandler> getAssociatedType() {
-    return TYPE;
-  }
-
-  public java.lang.String getPreviousGroup() {
-    return previousGroup;
-  }
-
-  public java.lang.String getNewGroup() {
-    return newGroup;
-  }
-
-  @Override
-  protected void dispatch(GroupChangedHandler handler) {
-    handler.onGroupChanged(this);
-  }
-
-  @Override
-  public boolean equals(Object obj) {
-    if (this == obj)
-        return true;
-    if (obj == null)
-        return false;
-    if (getClass() != obj.getClass())
-        return false;
-    GroupChangedEvent other = (GroupChangedEvent) obj;
-    if (previousGroup == null) {
-      if (other.previousGroup != null)
-        return false;
-    } else if (!previousGroup.equals(other.previousGroup))
-      return false;
-    if (newGroup == null) {
-      if (other.newGroup != null)
-        return false;
-    } else if (!newGroup.equals(other.newGroup))
-      return false;
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    int hashCode = 23;
-    hashCode = (hashCode * 37) + (previousGroup == null ? 1 : previousGroup.hashCode());
-    hashCode = (hashCode * 37) + (newGroup == null ? 1 : newGroup.hashCode());
-    return hashCode;
-  }
-
-  @Override
-  public String toString() {
-    return "GroupChangedEvent["
-                 + previousGroup
-                 + ","
-                 + newGroup
-    + "]";
-  }
-}

Deleted: trunk/src/main/java/cc/kune/core/client/state/HistoryWrapperDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/HistoryWrapperDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/HistoryWrapperDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.state;
-
-import com.google.gwt.user.client.History;
-
-public class HistoryWrapperDefault implements HistoryWrapper {
-
-    @Override
-    public String getToken() {
-        return History.getToken();
-    }
-
-    @Override
-    public void newItem(final String historyToken) {
-        History.newItem(historyToken);
-    }
-
-    @Override
-    public void newItem(final String historyToken, final boolean issueEvent) {
-        History.newItem(historyToken, issueEvent);
-    }
-
-}

Modified: trunk/src/main/java/cc/kune/core/client/state/Session.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/Session.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/Session.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -41,7 +41,10 @@
 import java.util.Collection;
 import java.util.List;
 
-import cc.kune.core.client.init.AppStartEvent;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignInOrSignOutEvent;
+import cc.kune.core.client.events.UserSignOutEvent;
 import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.I18nCountryDTO;

Deleted: trunk/src/main/java/cc/kune/core/client/state/SessionDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/SessionDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/SessionDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,373 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.state;
-
-import java.util.Collection;
-import java.util.List;
-
-import cc.kune.common.client.log.Log;
-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.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.UserServiceAsync;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
-import cc.kune.core.client.state.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
-import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
-import cc.kune.core.shared.domain.utils.StateToken;
-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.InitDataDTO;
-import cc.kune.core.shared.dto.LicenseDTO;
-import cc.kune.core.shared.dto.StateAbstractDTO;
-import cc.kune.core.shared.dto.StateContainerDTO;
-import cc.kune.core.shared.dto.StateContentDTO;
-import cc.kune.core.shared.dto.ToolSimpleDTO;
-import cc.kune.core.shared.dto.UserInfoDTO;
-import cc.kune.core.shared.dto.UserSimpleDTO;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.event.shared.EventBus;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class SessionDefault implements Session {
-  private final CookiesManager cookieManager;
-  private Object[][] countriesArray;
-  private I18nLanguageDTO currentLanguage;
-  private StateAbstractDTO currentState;
-  private UserInfoDTO currentUserInfo;
-  private final EventBus eventBus;
-  private InitDataDTO initData;
-  private Object[][] languagesArray;
-  private Object[][] timezonesArray;
-  private String userHash;
-  private final Provider<UserServiceAsync> userServiceProvider;
-
-  @Inject
-  public SessionDefault(final CookiesManager cookieManager,
-      final Provider<UserServiceAsync> userServiceProvider, final EventBus eventBus) {
-    this.cookieManager = cookieManager;
-    this.eventBus = eventBus;
-    this.userHash = cookieManager.getAuthCookie();
-    this.userHash = userHash == null || userHash.equals("null") ? null : userHash;
-    this.userServiceProvider = userServiceProvider;
-    languagesArray = null;
-    check(new AsyncCallbackSimple<Void>() {
-      @Override
-      public void onSuccess(final Void result) {
-      }
-    });
-  }
-
-  @Override
-  public void check(final AsyncCallbackSimple<Void> callback) {
-    Log.debug("Checking session (userhash: " + getUserHash() + ")");
-    userServiceProvider.get().onlyCheckSession(getUserHash(), callback);
-  }
-
-  @Override
-  public StateContainerDTO getContainerState() {
-    return (StateContainerDTO) currentState;
-  }
-
-  @Override
-  public StateContentDTO getContentState() {
-    return (StateContentDTO) currentState;
-  }
-
-  @Override
-  public List<I18nCountryDTO> getCountries() {
-    return initData.getCountries();
-  }
-
-  @Override
-  public Object[][] getCountriesArray() {
-    if (countriesArray == null) {
-      countriesArray = mapCountries();
-    }
-    return countriesArray.clone();
-  }
-
-  @Override
-  public String getCurrentCCversion() {
-    return initData.getCurrentCCversion();
-  }
-
-  @Override
-  public String getCurrentGroupShortName() {
-    return currentState == null ? null : currentState.getStateToken().getGroup();
-  }
-
-  @Override
-  public I18nLanguageDTO getCurrentLanguage() {
-    return currentLanguage;
-  }
-
-  @Override
-  public StateAbstractDTO getCurrentState() {
-    return currentState;
-  }
-
-  @Override
-  public StateToken getCurrentStateToken() {
-    return currentState == null ? null : currentState.getStateToken();
-  }
-
-  @Override
-  public UserSimpleDTO getCurrentUser() {
-    return currentUserInfo == null ? null : currentUserInfo.getUser();
-  }
-
-  @Override
-  public UserInfoDTO getCurrentUserInfo() {
-    return currentUserInfo;
-  }
-
-  @Override
-  public LicenseDTO getDefLicense() {
-    return initData.getDefaultLicense();
-  }
-
-  @Override
-  public String getGalleryPermittedExtensions() {
-    return initData.getGalleryPermittedExtensions();
-  }
-
-  @Override
-  public Collection<ToolSimpleDTO> getGroupTools() {
-    return initData.getGroupTools();
-  }
-
-  @Override
-  public int getImgCropsize() {
-    return initData.getImgCropsize();
-  }
-
-  @Override
-  public int getImgIconsize() {
-    return initData.getImgIconsize();
-  }
-
-  @Override
-  public int getImgResizewidth() {
-    return initData.getImgResizewidth();
-  }
-
-  @Override
-  public int getImgThumbsize() {
-    return initData.getImgThumbsize();
-  }
-
-  @Override
-  public InitDataDTO getInitData() {
-    return initData;
-  }
-
-  @Override
-  public List<I18nLanguageSimpleDTO> getLanguages() {
-    return initData.getLanguages();
-  }
-
-  @Override
-  public Object[][] getLanguagesArray() {
-    if (languagesArray == null) {
-      languagesArray = mapLangs();
-    }
-    return languagesArray.clone();
-  }
-
-  @Override
-  public List<LicenseDTO> getLicenses() {
-    return initData.getLicenses();
-  }
-
-  @Override
-  public boolean getShowDeletedContent() {
-    return currentUserInfo == null ? false : currentUserInfo.getShowDeletedContent();
-  }
-
-  @Override
-  public String getSiteUrl() {
-    final String baseURL = GWT.getModuleBaseURL();
-    return baseURL.substring(0, baseURL.lastIndexOf("/" + GWT.getModuleName()));
-  }
-
-  @Override
-  public Object[][] getTimezones() {
-    if (timezonesArray == null) {
-      mapTimezones();
-    }
-    return timezonesArray.clone();
-  }
-
-  @Override
-  public String getUserHash() {
-    return userHash;
-  }
-
-  @Override
-  public Collection<ToolSimpleDTO> getUserTools() {
-    return initData.getUserTools();
-  }
-
-  @Override
-  public boolean inSameToken(final StateToken token) {
-    return getCurrentStateToken().equals(token);
-  }
-
-  @Override
-  public boolean isCurrentStateAContent() {
-    return currentState instanceof StateContentDTO;
-  }
-
-  @Override
-  public boolean isCurrentStateAGroup() {
-    return currentState == null ? false : !currentState.getGroup().isPersonal();
-  }
-
-  @Override
-  public boolean isCurrentStateAPerson() {
-    return currentState == null ? false : currentState.getGroup().isPersonal();
-  }
-
-  @Override
-  public boolean isInCurrentUserSpace() {
-    if (!isLogged()) {
-      return false;
-    }
-    if (getCurrentStateToken().getGroup().equals(getCurrentUser().getShortName())) {
-      return true;
-    }
-    return false;
-  }
-
-  @Override
-  public boolean isLogged() {
-    return userHash != null;
-  }
-
-  @Override
-  public boolean isNotLogged() {
-    return !isLogged();
-  }
-
-  private Object[][] mapCountries() {
-    assert initData != null;
-    final Object[][] objs = new Object[initData.getCountries().size()][1];
-    int i = 0;
-    for (final I18nCountryDTO country : initData.getCountries()) {
-      final Object[] obj = new Object[] { country.getCode(), country.getEnglishName() };
-      objs[i++] = obj;
-    }
-    return objs;
-  }
-
-  private Object[][] mapLangs() {
-    assert initData != null;
-    final Object[][] objs = new Object[initData.getLanguages().size()][1];
-    int i = 0;
-    for (final I18nLanguageSimpleDTO language : initData.getLanguages()) {
-      final Object[] obj = new Object[] { language.getCode(), language.getEnglishName() };
-      objs[i++] = obj;
-    }
-    return objs;
-  }
-
-  private void mapTimezones() {
-    assert initData != null;
-    timezonesArray = new Object[initData.getTimezones().length][1];
-    for (int i = 0; i < getTimezones().length; i++) {
-      final Object[] obj = new Object[] { initData.getTimezones()[i] };
-      timezonesArray[i] = obj;
-    }
-  }
-
-  @Override
-  public void onAppStart(final boolean fireNow, final AppStartHandler handler) {
-    eventBus.addHandler(AppStartEvent.getType(), handler);
-    if (fireNow && initData != null) {
-      handler.onAppStart(new AppStartEvent(initData));
-    }
-  }
-
-  @Override
-  public void onUserSignIn(final boolean fireNow, final UserSignInHandler handler) {
-    eventBus.addHandler(UserSignInEvent.getType(), handler);
-    if (fireNow && isLogged() && currentUserInfo != null) {
-      handler.onUserSignIn(new UserSignInEvent(currentUserInfo));
-    }
-  }
-
-  @Override
-  public void onUserSignInOrSignOut(final boolean fireNow, final UserSignInOrSignOutHandler handler) {
-    eventBus.addHandler(UserSignInOrSignOutEvent.getType(), handler);
-    if (fireNow) {
-      handler.onUserSignInOrSignOut(new UserSignInOrSignOutEvent(isLogged()));
-    }
-  }
-
-  @Override
-  public void onUserSignOut(final boolean fireNow, final UserSignOutHandler handler) {
-    eventBus.addHandler(UserSignOutEvent.getType(), handler);
-    if (fireNow && isNotLogged()) {
-      handler.onUserSignOut(new UserSignOutEvent());
-    }
-  }
-
-  @Override
-  public void setCurrentLanguage(final I18nLanguageDTO currentLanguage) {
-    this.currentLanguage = currentLanguage;
-  }
-
-  @Override
-  public void setCurrentState(final StateAbstractDTO currentState) {
-    this.currentState = currentState;
-  }
-
-  @Override
-  public void setCurrentUserInfo(final UserInfoDTO currentUserInfo) {
-    this.currentUserInfo = currentUserInfo;
-    if (currentUserInfo != null) {
-      eventBus.fireEvent(new UserSignInEvent(this.currentUserInfo));
-    } else {
-      eventBus.fireEvent(new UserSignOutEvent());
-    }
-    eventBus.fireEvent(new UserSignInOrSignOutEvent(isLogged()));
-  }
-
-  @Override
-  public void setInitData(final InitDataDTO initData) {
-    this.initData = initData;
-  }
-
-  @Override
-  public void setUserHash(final String userHash) {
-    this.userHash = userHash;
-  }
-
-  @Override
-  public void signOut() {
-    cookieManager.removeAuthCookie();
-    setUserHash(null);
-    setCurrentUserInfo(null);
-  }
-}

Deleted: trunk/src/main/java/cc/kune/core/client/state/SocialNetworkChangedEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/SocialNetworkChangedEvent.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/SocialNetworkChangedEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,101 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.state;
-
-import com.google.gwt.event.shared.EventHandler;
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.event.shared.HasHandlers;
-
-public class SocialNetworkChangedEvent extends GwtEvent<SocialNetworkChangedEvent.SocialNetworkChangedHandler> { 
-
-  public interface HasSocialNetworkChangedHandlers extends HasHandlers {
-    HandlerRegistration addSocialNetworkChangedHandler(SocialNetworkChangedHandler handler);
-  }
-
-  public interface SocialNetworkChangedHandler extends EventHandler {
-    public void onSocialNetworkChanged(SocialNetworkChangedEvent event);
-  }
-
-  private static final Type<SocialNetworkChangedHandler> TYPE = new Type<SocialNetworkChangedHandler>();
-
-  public static void fire(HasHandlers source, cc.kune.core.shared.dto.StateAbstractDTO state) {
-    source.fireEvent(new SocialNetworkChangedEvent(state));
-  }
-
-  public static Type<SocialNetworkChangedHandler> getType() {
-    return TYPE;
-  }
-
-  cc.kune.core.shared.dto.StateAbstractDTO state;
-
-  public SocialNetworkChangedEvent(cc.kune.core.shared.dto.StateAbstractDTO state) {
-    this.state = state;
-  }
-
-  protected SocialNetworkChangedEvent() {
-    // Possibly for serialization.
-  }
-
-  @Override
-  public Type<SocialNetworkChangedHandler> getAssociatedType() {
-    return TYPE;
-  }
-
-  public cc.kune.core.shared.dto.StateAbstractDTO getState() {
-    return state;
-  }
-
-  @Override
-  protected void dispatch(SocialNetworkChangedHandler handler) {
-    handler.onSocialNetworkChanged(this);
-  }
-
-  @Override
-  public boolean equals(Object obj) {
-    if (this == obj)
-        return true;
-    if (obj == null)
-        return false;
-    if (getClass() != obj.getClass())
-        return false;
-    SocialNetworkChangedEvent other = (SocialNetworkChangedEvent) obj;
-    if (state == null) {
-      if (other.state != null)
-        return false;
-    } else if (!state.equals(other.state))
-      return false;
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    int hashCode = 23;
-    hashCode = (hashCode * 37) + (state == null ? 1 : state.hashCode());
-    return hashCode;
-  }
-
-  @Override
-  public String toString() {
-    return "SocialNetworkChangedEvent["
-                 + state
-    + "]";
-  }
-}

Deleted: trunk/src/main/java/cc/kune/core/client/state/StateChangedEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateChangedEvent.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/StateChangedEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,101 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.state;
-
-import com.google.gwt.event.shared.EventHandler;
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.event.shared.HasHandlers;
-
-public class StateChangedEvent extends GwtEvent<StateChangedEvent.StateChangedHandler> { 
-
-  public interface HasStateChangedHandlers extends HasHandlers {
-    HandlerRegistration addStateChangedHandler(StateChangedHandler handler);
-  }
-
-  public interface StateChangedHandler extends EventHandler {
-    public void onStateChanged(StateChangedEvent event);
-  }
-
-  private static final Type<StateChangedHandler> TYPE = new Type<StateChangedHandler>();
-
-  public static void fire(HasHandlers source, cc.kune.core.shared.dto.StateAbstractDTO state) {
-    source.fireEvent(new StateChangedEvent(state));
-  }
-
-  public static Type<StateChangedHandler> getType() {
-    return TYPE;
-  }
-
-  cc.kune.core.shared.dto.StateAbstractDTO state;
-
-  public StateChangedEvent(cc.kune.core.shared.dto.StateAbstractDTO state) {
-    this.state = state;
-  }
-
-  protected StateChangedEvent() {
-    // Possibly for serialization.
-  }
-
-  @Override
-  public Type<StateChangedHandler> getAssociatedType() {
-    return TYPE;
-  }
-
-  public cc.kune.core.shared.dto.StateAbstractDTO getState() {
-    return state;
-  }
-
-  @Override
-  protected void dispatch(StateChangedHandler handler) {
-    handler.onStateChanged(this);
-  }
-
-  @Override
-  public boolean equals(Object obj) {
-    if (this == obj)
-        return true;
-    if (obj == null)
-        return false;
-    if (getClass() != obj.getClass())
-        return false;
-    StateChangedEvent other = (StateChangedEvent) obj;
-    if (state == null) {
-      if (other.state != null)
-        return false;
-    } else if (!state.equals(other.state))
-      return false;
-    return true;
-  }
-
-  @Override
-  public int hashCode() {
-    int hashCode = 23;
-    hashCode = (hashCode * 37) + (state == null ? 1 : state.hashCode());
-    return hashCode;
-  }
-
-  @Override
-  public String toString() {
-    return "StateChangedEvent["
-                 + state
-    + "]";
-  }
-}

Modified: trunk/src/main/java/cc/kune/core/client/state/StateManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateManager.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/StateManager.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,6 +20,10 @@
 package cc.kune.core.client.state;
 
 import cc.kune.common.client.actions.BeforeActionListener;
+import cc.kune.core.client.events.GroupChangedEvent;
+import cc.kune.core.client.events.SocialNetworkChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.ToolChangedEvent;
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.SocialNetworkDataDTO;
 import cc.kune.core.shared.dto.StateAbstractDTO;

Deleted: trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,461 +0,0 @@
-/*
- *
-
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.state;
-
-import org.waveprotocol.box.webclient.client.ClientEvents;
-import org.waveprotocol.box.webclient.client.events.WaveSelectionEvent;
-import org.waveprotocol.wave.model.waveref.InvalidWaveRefException;
-import org.waveprotocol.wave.util.escapers.GwtWaverefEncoder;
-
-import cc.kune.common.client.actions.BeforeActionCollection;
-import cc.kune.common.client.actions.BeforeActionListener;
-import cc.kune.common.client.log.Log;
-import cc.kune.common.client.notify.ProgressHideEvent;
-import cc.kune.common.client.utils.Pair;
-import cc.kune.core.client.events.GoHomeEvent;
-import cc.kune.core.client.init.AppStartEvent;
-import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.sitebar.spaces.Space;
-import cc.kune.core.client.sitebar.spaces.SpaceConfEvent;
-import cc.kune.core.client.sitebar.spaces.SpaceSelectEvent;
-import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
-import cc.kune.core.client.state.SocialNetworkChangedEvent.SocialNetworkChangedHandler;
-import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
-import cc.kune.core.client.state.ToolChangedEvent.ToolChangedHandler;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.SocialNetworkDataDTO;
-import cc.kune.core.shared.dto.StateAbstractDTO;
-
-import com.google.gwt.event.logical.shared.ValueChangeEvent;
-import com.google.gwt.event.logical.shared.ValueChangeHandler;
-import com.google.gwt.event.shared.EventBus;
-import com.google.inject.Inject;
-
-public class StateManagerDefault implements StateManager, ValueChangeHandler<String> {
-  private final BeforeActionCollection beforeStateChangeCollection;
-  private final ContentCache contentCache;
-  private final EventBus eventBus;
-  private final HistoryWrapper history;
-  private StateToken previousGroupToken;
-  /**
-   * When a historyChanged is interrupted (for instance because you are editing
-   * something), the new history token is stored here
-   */
-  private String resumedHistoryToken;
-  private final Session session;
-  private final SiteTokenListeners siteTokens;
-  private final TokenMatcher tokenMatcher;
-
-  @Inject
-  public StateManagerDefault(final ContentCache contentProvider, final Session session,
-      final HistoryWrapper history, final TokenMatcher tokenMatcher, final EventBus eventBus,
-      final SiteTokenListeners siteTokens) {
-    this.tokenMatcher = tokenMatcher;
-    this.eventBus = eventBus;
-    this.contentCache = contentProvider;
-    this.session = session;
-    this.history = history;
-    this.previousGroupToken = null;
-    this.resumedHistoryToken = null;
-    tokenMatcher.init(GwtWaverefEncoder.INSTANCE);
-    this.siteTokens = siteTokens;
-    beforeStateChangeCollection = new BeforeActionCollection();
-    session.onAppStart(true, new AppStartHandler() {
-      @Override
-      public void onAppStart(final AppStartEvent event) {
-        session.onUserSignIn(false, new UserSignInEvent.UserSignInHandler() {
-          @Override
-          public void onUserSignIn(final UserSignInEvent event) {
-            // refreshCurrentGroupState();
-          }
-        });
-        session.onUserSignOut(false, new UserSignOutEvent.UserSignOutHandler() {
-          @Override
-          public void onUserSignOut(final UserSignOutEvent event) {
-            refreshCurrentStateWithoutCache();
-          }
-        });
-        processCurrentHistoryToken();
-      }
-    });
-    onSocialNetworkChanged(false, new SocialNetworkChangedHandler() {
-      @Override
-      public void onSocialNetworkChanged(final SocialNetworkChangedEvent event) {
-        contentCache.removeCacheOfGroup(event.getState().getStateToken().getGroup());
-      }
-    });
-    eventBus.addHandler(GoHomeEvent.getType(), new GoHomeEvent.GoHomeHandler() {
-      @Override
-      public void onGoHome(final GoHomeEvent event) {
-        gotoDefaultHomepage();
-      }
-    });
-  }
-
-  @Override
-  public void addBeforeStateChangeListener(final BeforeActionListener listener) {
-    beforeStateChangeCollection.add(listener);
-  }
-
-  @Override
-  public void addSiteToken(final String token, final HistoryTokenCallback callback) {
-    siteTokens.put(token.toLowerCase(), callback);
-  }
-
-  private void checkGroupAndToolChange(final StateAbstractDTO newState) {
-    final String newGroup = newState.getStateToken().getGroup();
-    final String previousGroup = getPreviousGroup();
-    if (startingUp() || !previousGroup.equals(newGroup)) {
-      GroupChangedEvent.fire(eventBus, previousGroup, newGroup);
-    }
-    final String previousToolName = getPreviousTool();
-    final String newTokenTool = newState.getStateToken().getTool();
-    final String newToolName = newTokenTool == null ? "" : newTokenTool;
-    if (startingUp() || previousToolName == null || !previousToolName.equals(newToolName)) {
-      ToolChangedEvent.fire(eventBus, previousGroupToken, newState.getStateToken());
-    }
-  }
-
-  private void getContent(final StateToken newState) {
-    getContent(newState, false);
-  }
-
-  private void getContent(final StateToken newState, final boolean setBrowserHistory) {
-    // NotifyUser.info("loading: " + newState + " because current:" +
-    // session.getCurrentStateToken());
-    contentCache.getContent(session.getUserHash(), newState,
-        new AsyncCallbackSimple<StateAbstractDTO>() {
-          @Override
-          public void onSuccess(final StateAbstractDTO newState) {
-            setState(newState);
-            final String currentToken = newState.getStateToken().toString();
-            SpaceConfEvent.fire(eventBus, Space.groupSpace, currentToken);
-            SpaceConfEvent.fire(eventBus, Space.publicSpace, TokenUtils.preview(currentToken));
-            if (setBrowserHistory) {
-              history.newItem(currentToken, false);
-              SpaceSelectEvent.fire(eventBus, Space.groupSpace);
-            }
-          }
-        });
-  }
-
-  @Override
-  public String getCurrentToken() {
-    return history.getToken();
-  }
-
-  private String getPreviousGroup() {
-    final String previousGroup = startingUp() ? "" : previousGroupToken.getGroup();
-    return previousGroup;
-  }
-
-  private String getPreviousTool() {
-    final String previousTool = startingUp() ? "" : previousGroupToken.getTool();
-    return previousTool;
-  }
-
-  @Override
-  public void gotoDefaultHomepage() {
-    getContent(new StateToken(SiteTokens.GROUP_HOME), true);
-  }
-
-  @Override
-  public void gotoHistoryToken(final String token) {
-    Log.debug("StateManager: history goto-string-token: " + token);
-    history.newItem(token);
-  }
-
-  @Override
-  public void gotoHistoryTokenButRedirectToCurrent(final String token) {
-    gotoHistoryToken(TokenUtils.addRedirect(token, history.getToken()));
-
-  }
-
-  @Override
-  public void gotoStateToken(final StateToken newToken) {
-    Log.debug("StateManager: history goto-token: " + newToken + ", previous: " + previousGroupToken);
-    history.newItem(newToken.getEncoded());
-  }
-
-  @Override
-  public void gotoStateToken(final StateToken token, final boolean useCache) {
-    if (!useCache) {
-      contentCache.remove(token);
-    }
-    gotoStateToken(token);
-  }
-
-  @Override
-  public void onGroupChanged(final boolean fireNow, final GroupChangedHandler handler) {
-    eventBus.addHandler(GroupChangedEvent.getType(), handler);
-    final StateAbstractDTO currentState = session.getCurrentState();
-    if (fireNow && currentState != null) {
-      handler.onGroupChanged(new GroupChangedEvent(getPreviousGroup(),
-          currentState.getStateToken().getGroup()));
-    }
-
-  }
-
-  @Override
-  public void onSocialNetworkChanged(final boolean fireNow, final SocialNetworkChangedHandler handler) {
-    eventBus.addHandler(SocialNetworkChangedEvent.getType(), handler);
-    final StateAbstractDTO currentState = session.getCurrentState();
-    if (fireNow && currentState != null) {
-      handler.onSocialNetworkChanged(new SocialNetworkChangedEvent(currentState));
-    }
-  }
-
-  @Override
-  public void onStateChanged(final boolean fireNow, final StateChangedHandler handler) {
-    eventBus.addHandler(StateChangedEvent.getType(), handler);
-    final StateAbstractDTO currentState = session.getCurrentState();
-    if (fireNow && currentState != null) {
-      handler.onStateChanged(new StateChangedEvent(currentState));
-    }
-  }
-
-  @Override
-  public void onToolChanged(final boolean fireNow, final ToolChangedHandler handler) {
-    eventBus.addHandler(ToolChangedEvent.getType(), handler);
-    final StateAbstractDTO currentState = session.getCurrentState();
-    if (fireNow && currentState != null) {
-      handler.onToolChanged(new ToolChangedEvent(previousGroupToken, currentState.getStateToken()));
-    }
-  }
-
-  @Override
-  public void onValueChange(final ValueChangeEvent<String> event) {
-    Log.info("History event value changed: " + event.getValue());
-    processHistoryToken(event.getValue());
-  }
-
-  private void processCurrentHistoryToken() {
-    processHistoryToken(history.getToken());
-  }
-
-  void processHistoryToken(final String newHistoryToken) {
-    // http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/DevGuideHistory
-    if (beforeStateChangeCollection.checkBeforeAction()) {
-      // There isn't a beforeStateChange listener that stops this history
-      // change
-      HistoryTokenCallback tokenListener = null;
-      if (newHistoryToken != null) {
-        final String nToken = newHistoryToken.toLowerCase();
-        tokenListener = siteTokens.get(nToken);
-      }
-      Log.debug("StateManager: on history changed (" + newHistoryToken + ")");
-      if (tokenListener == null) {
-        // Log.debug("Is not a special hash");
-        // token is not one of #newgroup #signin #translate ...
-        final String nToken = newHistoryToken != null ? newHistoryToken.toLowerCase() : null;
-        if (nToken != null && tokenMatcher.hasRedirect(nToken)) {
-          final Pair<String, String> redirect = tokenMatcher.getRedirect(nToken);
-          final String firstToken = redirect.getLeft();
-          final String sndToken = redirect.getRight();
-          if (firstToken.equals(SiteTokens.PREVIEW)) {
-            SpaceSelectEvent.fire(eventBus, Space.publicSpace);
-            SpaceConfEvent.fire(eventBus, Space.groupSpace, sndToken);
-            SpaceConfEvent.fire(eventBus, Space.publicSpace, TokenUtils.preview(sndToken));
-            getContent(new StateToken(sndToken));
-          } else if (firstToken.equals(SiteTokens.SUBTITLES)) {
-            siteTokens.get(SiteTokens.SUBTITLES).onHistoryToken(
-                tokenMatcher.getRedirect(newHistoryToken).getRight());
-          } else if (firstToken.equals(SiteTokens.NEWGROUP)) {
-            siteTokens.get(SiteTokens.NEWGROUP).onHistoryToken(newHistoryToken);
-          } else if (firstToken.equals(SiteTokens.SIGNIN)) {
-            if (session.isLogged()) {
-              // We are logged, then redirect:
-              history.newItem(sndToken, false);
-              processHistoryToken(sndToken);
-            } else {
-              // We have to loggin
-              siteTokens.get(SiteTokens.SIGNIN).onHistoryToken(newHistoryToken);
-            }
-          }
-        } else
-        // No redirection
-        if (tokenMatcher.isWaveToken(newHistoryToken)) {
-          if (session.isLogged()) {
-            SpaceConfEvent.fire(eventBus, Space.userSpace, newHistoryToken);
-            SpaceSelectEvent.fire(eventBus, Space.userSpace);
-            try {
-              ClientEvents.get().fireEvent(
-                  new WaveSelectionEvent(GwtWaverefEncoder.decodeWaveRefFromPath(newHistoryToken)));
-            } catch (final InvalidWaveRefException e) {
-              Log.error(nToken, e);
-            }
-          } else {
-            // Wave, but don't logged
-            history.newItem(TokenUtils.addRedirect(SiteTokens.SIGNIN, newHistoryToken));
-            if (startingUp()) {
-              // Starting application (with Wave)
-              getContent(new StateToken(SiteTokens.GROUP_HOME), false);
-            }
-          }
-        } else if (tokenMatcher.isGroupToken(newHistoryToken)) {
-          SpaceConfEvent.fire(eventBus, Space.groupSpace, newHistoryToken);
-          SpaceConfEvent.fire(eventBus, Space.publicSpace, TokenUtils.preview(newHistoryToken));
-          SpaceSelectEvent.fire(eventBus, Space.groupSpace);
-          getContent(new StateToken(newHistoryToken));
-        } else {
-          gotoDefaultHomepage();
-        }
-      } else {
-        // token is one of #newgroup #signin #translate ...
-        if (startingUp()) {
-          // Starting with some token like "signin": load defContent
-          // also
-          getContent(new StateToken(SiteTokens.GROUP_HOME), false);
-          // processHistoryToken(SiteTokens.GROUP_HOME);
-          // SpaceSelectEvent.fire(eventBus, Space.groupSpace);
-        }
-        // Fire the listener of this #hash token
-        tokenListener.onHistoryToken(newHistoryToken);
-      }
-    } else {
-      resumedHistoryToken = newHistoryToken;
-    }
-  }
-
-  @Override
-  public void redirectOrRestorePreviousToken() {
-    final String token = history.getToken();
-    if (tokenMatcher.hasRedirect(token)) {
-      // URL of the form signin(group.tool)
-      final String previousToken = tokenMatcher.getRedirect(token).getRight();
-      if (previousToken.equals(SiteTokens.WAVEINBOX) && session.isNotLogged()) {
-        // signin(inbox) && cancel
-        restorePreviousToken();
-      } else {
-        history.newItem(previousToken); // FIXMEKK
-      }
-    } else {
-      // No redirect then restore previous token
-      restorePreviousToken();
-    }
-  }
-
-  /**
-   * <p>
-   * Reload current state (using client cache if available)
-   * </p>
-   */
-  @Override
-  public void refreshCurrentState() {
-    processHistoryToken(history.getToken());
-  }
-
-  /**
-   * <p>
-   * Reload current state (not using client cache)
-   * </p>
-   */
-  @Override
-  public void refreshCurrentStateWithoutCache() {
-    final StateToken currentStateToken = session.getCurrentStateToken();
-    if (currentStateToken == null) {
-      processCurrentHistoryToken();
-    } else {
-      contentCache.remove(currentStateToken);
-      getContent(currentStateToken);
-    }
-  }
-
-  @Override
-  public void removeBeforeStateChangeListener(final BeforeActionListener listener) {
-    beforeStateChangeCollection.remove(listener);
-  }
-
-  @Override
-  public void removeCache(final StateToken parentToken) {
-    contentCache.remove(parentToken);
-  }
-
-  @Override
-  public void removeCacheOfGroup(final String group) {
-    contentCache.removeCacheOfGroup(group);
-  }
-
-  @Override
-  public void removeSiteToken(final String token) {
-    siteTokens.remove(token);
-  }
-
-  @Override
-  public void restorePreviousToken() {
-    if (previousGroupToken != null) {
-      gotoStateToken(previousGroupToken);
-    }
-  }
-
-  @Override
-  public void resumeTokenChange() {
-    if (resumedHistoryToken != null) {
-      // Is this reload redundant?
-      refreshCurrentState();
-      gotoHistoryToken(resumedHistoryToken);
-      resumedHistoryToken = null;
-    }
-  }
-
-  @Override
-  public void setRetrievedState(final StateAbstractDTO newState) {
-    contentCache.cache(newState.getStateToken(), newState);
-  }
-
-  @Override
-  public void setRetrievedStateAndGo(final StateAbstractDTO newState) {
-    setRetrievedState(newState);
-    final String token = newState.getStateToken().toString();
-    if (history.getToken().equals(token)) {
-      setState(newState);
-    }
-    history.newItem(token);
-  }
-
-  @Override
-  public void setSocialNetwork(final SocialNetworkDataDTO socialNet) {
-    StateAbstractDTO state;
-    if (session != null && (state = session.getCurrentState()) != null) {
-      // After a SN operation, usually returns a SocialNetworkResultDTO
-      // with new SN data and we refresh the state
-      // to avoid to reload() again the state
-      state.setSocialNetworkData(socialNet);
-      SocialNetworkChangedEvent.fire(eventBus, state);
-    }
-  }
-
-  void setState(final StateAbstractDTO newState) {
-    session.setCurrentState(newState);
-    final StateToken newToken = newState.getStateToken();
-    contentCache.cache(newToken, newState);
-    // history.newItem(newToken.toString(), false);
-    StateChangedEvent.fire(eventBus, newState);
-    checkGroupAndToolChange(newState);
-    previousGroupToken = newToken.copy();
-    eventBus.fireEvent(new ProgressHideEvent());
-  }
-
-  private boolean startingUp() {
-    return previousGroupToken == null;
-  }
-}

Deleted: trunk/src/main/java/cc/kune/core/client/state/ToolChangedEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/ToolChangedEvent.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/ToolChangedEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,130 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.state;
-
-import cc.kune.core.shared.domain.utils.StateToken;
-
-import com.google.gwt.event.shared.EventHandler;
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.event.shared.HasHandlers;
-
-public class ToolChangedEvent extends GwtEvent<ToolChangedEvent.ToolChangedHandler> {
-
-  public interface HasToolChangedHandlers extends HasHandlers {
-    HandlerRegistration addToolChangedHandler(ToolChangedHandler handler);
-  }
-
-  public interface ToolChangedHandler extends EventHandler {
-    public void onToolChanged(ToolChangedEvent event);
-  }
-
-  private static final Type<ToolChangedHandler> TYPE = new Type<ToolChangedHandler>();
-
-  public static void fire(final HasHandlers source, final StateToken previousToken,
-      final StateToken newToken) {
-    source.fireEvent(new ToolChangedEvent(previousToken, newToken));
-  }
-
-  public static Type<ToolChangedHandler> getType() {
-    return TYPE;
-  }
-
-  private StateToken newToken;
-  private StateToken previousToken;
-
-  protected ToolChangedEvent() {
-    // Possibly for serialization.
-  }
-
-  public ToolChangedEvent(final StateToken previousToken, final StateToken newToken) {
-    this.previousToken = previousToken;
-    this.newToken = newToken;
-  }
-
-  @Override
-  protected void dispatch(final ToolChangedHandler handler) {
-    handler.onToolChanged(this);
-  }
-
-  @Override
-  public boolean equals(final Object obj) {
-    if (this == obj) {
-      return true;
-    }
-    if (obj == null) {
-      return false;
-    }
-    if (getClass() != obj.getClass()) {
-      return false;
-    }
-    final ToolChangedEvent other = (ToolChangedEvent) obj;
-    if (newToken == null) {
-      if (other.newToken != null) {
-        return false;
-      }
-    } else if (!newToken.equals(other.newToken)) {
-      return false;
-    }
-    if (previousToken == null) {
-      if (other.previousToken != null) {
-        return false;
-      }
-    } else if (!previousToken.equals(other.previousToken)) {
-      return false;
-    }
-    return true;
-  }
-
-  @Override
-  public Type<ToolChangedHandler> getAssociatedType() {
-    return TYPE;
-  }
-
-  public StateToken getNewToken() {
-    return newToken;
-  }
-
-  public java.lang.String getNewTool() {
-    return newToken != null ? newToken.getTool() : null;
-  }
-
-  public StateToken getPreviousToken() {
-    return previousToken;
-  }
-
-  public java.lang.String getPreviousTool() {
-    return previousToken != null ? previousToken.getTool() : null;
-  }
-
-  @Override
-  public int hashCode() {
-    final int prime = 31;
-    int result = 1;
-    result = prime * result + ((newToken == null) ? 0 : newToken.hashCode());
-    result = prime * result + ((previousToken == null) ? 0 : previousToken.hashCode());
-    return result;
-  }
-
-  @Override
-  public String toString() {
-    return "ToolChangedEvent[" + getPreviousTool() + "," + getNewTool() + "]";
-  }
-}

Deleted: trunk/src/main/java/cc/kune/core/client/state/UserSignInEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/UserSignInEvent.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/UserSignInEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -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 cc.kune.core.client.state;
-
-import com.google.gwt.event.shared.EventHandler;
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.event.shared.HasHandlers;
-
-public class UserSignInEvent extends GwtEvent<UserSignInEvent.UserSignInHandler> {
-
-    public interface HasUserSignInHandlers extends HasHandlers {
-        HandlerRegistration addUserSignInHandler(UserSignInHandler handler);
-    }
-
-    public interface UserSignInHandler extends EventHandler {
-        public void onUserSignIn(UserSignInEvent event);
-    }
-
-    private static final Type<UserSignInHandler> TYPE = new Type<UserSignInHandler>();
-
-    public static Type<UserSignInHandler> getType() {
-        return TYPE;
-    }
-
-    private final cc.kune.core.shared.dto.UserInfoDTO userInfo;
-
-    public UserSignInEvent(final cc.kune.core.shared.dto.UserInfoDTO userInfo) {
-        this.userInfo = userInfo;
-    }
-
-    @Override
-    protected void dispatch(final UserSignInHandler handler) {
-        handler.onUserSignIn(this);
-    }
-
-    @Override
-    public boolean equals(final Object other) {
-        if (other != null && other.getClass().equals(this.getClass())) {
-            final UserSignInEvent o = (UserSignInEvent) other;
-            return true && ((o.userInfo == null && this.userInfo == null) || (o.userInfo != null && o.userInfo.equals(this.userInfo)));
-        }
-        return false;
-    }
-
-    @Override
-    public Type<UserSignInHandler> getAssociatedType() {
-        return TYPE;
-    }
-
-    public cc.kune.core.shared.dto.UserInfoDTO getUserInfo() {
-        return userInfo;
-    }
-
-    @Override
-    public int hashCode() {
-        int hashCode = 23;
-        hashCode = (hashCode * 37) + getClass().hashCode();
-        hashCode = (hashCode * 37) + (userInfo == null ? 1 : userInfo.hashCode());
-        return hashCode;
-    }
-
-    @Override
-    public String toString() {
-        return "UserSignInEvent[" + userInfo + "]";
-    }
-
-}

Deleted: trunk/src/main/java/cc/kune/core/client/state/UserSignInOrSignOutEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/UserSignInOrSignOutEvent.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/UserSignInOrSignOutEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,94 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.state;
-
-import com.google.gwt.event.shared.EventHandler;
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.event.shared.HasHandlers;
-
-public class UserSignInOrSignOutEvent extends GwtEvent<UserSignInOrSignOutEvent.UserSignInOrSignOutHandler> {
-
-    public interface HasUserSignInOrSignOutHandlers extends HasHandlers {
-        HandlerRegistration addUserSignInOrSignOutHandler(UserSignInOrSignOutHandler handler);
-    }
-
-    public interface UserSignInOrSignOutHandler extends EventHandler {
-        public void onUserSignInOrSignOut(UserSignInOrSignOutEvent event);
-    }
-
-    private static final Type<UserSignInOrSignOutHandler> TYPE = new Type<UserSignInOrSignOutHandler>();
-
-    public static Type<UserSignInOrSignOutHandler> getType() {
-        return TYPE;
-    }
-
-    private final boolean loggedin;
-
-    public UserSignInOrSignOutEvent(final boolean loggedin) {
-        this.loggedin = loggedin;
-    }
-
-    @Override
-    protected void dispatch(final UserSignInOrSignOutHandler handler) {
-        handler.onUserSignInOrSignOut(this);
-    }
-
-    @Override
-    public boolean equals(final Object obj) {
-        if (this == obj) {
-            return true;
-        }
-        if (obj == null) {
-            return false;
-        }
-        if (getClass() != obj.getClass()) {
-            return false;
-        }
-        final UserSignInOrSignOutEvent other = (UserSignInOrSignOutEvent) obj;
-        if (loggedin != other.loggedin) {
-            return false;
-        }
-        return true;
-    }
-
-    @Override
-    public Type<UserSignInOrSignOutHandler> getAssociatedType() {
-        return TYPE;
-    }
-
-    @Override
-    public int hashCode() {
-        final int prime = 31;
-        int result = 1;
-        result = prime * result + (loggedin ? 1231 : 1237);
-        return result;
-    }
-
-    public boolean isLogged() {
-        return loggedin;
-    }
-
-    @Override
-    public String toString() {
-        return "UserSignInOrSignOutEvent[" + loggedin + "]";
-    }
-
-}

Deleted: trunk/src/main/java/cc/kune/core/client/state/UserSignOutEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/UserSignOutEvent.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/state/UserSignOutEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,81 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.state;
-
-import com.google.gwt.event.shared.EventHandler;
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.event.shared.HasHandlers;
-import com.gwtplatform.mvp.client.HasEventBus;
-
-public class UserSignOutEvent extends GwtEvent<UserSignOutEvent.UserSignOutHandler> {
-
-  public interface HasUserSignOutHandlers extends HasHandlers {
-    HandlerRegistration addUserSignOutHandler(UserSignOutHandler handler);
-  }
-
-  public interface UserSignOutHandler extends EventHandler {
-    public void onUserSignOut(UserSignOutEvent event);
-  }
-
-  private static final Type<UserSignOutHandler> TYPE = new Type<UserSignOutHandler>();
-
-  public static void fire(final HasEventBus source) {
-    source.fireEvent(new UserSignOutEvent());
-  }
-
-  public static Type<UserSignOutHandler> getType() {
-    return TYPE;
-  }
-
-  public UserSignOutEvent() {
-  }
-
-  @Override
-  protected void dispatch(final UserSignOutHandler handler) {
-    handler.onUserSignOut(this);
-  }
-
-  @Override
-  public boolean equals(final Object other) {
-    if (other != null && other.getClass().equals(this.getClass())) {
-      return true;
-    }
-    return false;
-  }
-
-  @Override
-  public Type<UserSignOutHandler> getAssociatedType() {
-    return TYPE;
-  }
-
-  @Override
-  public int hashCode() {
-    int hashCode = 23;
-    hashCode = (hashCode * 37) + getClass().hashCode();
-    return hashCode;
-  }
-
-  @Override
-  public String toString() {
-    return "UserSignOutEvent[" + "]";
-  }
-
-}

Copied: trunk/src/main/java/cc/kune/core/client/state/impl/ContentCacheDefault.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/state/ContentCacheDefault.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/impl/ContentCacheDefault.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/state/impl/ContentCacheDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,110 @@
+/*
+ *
+ * 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.state.impl;
+
+import java.util.HashMap;
+import java.util.Map;
+
+import cc.kune.common.client.notify.ProgressShowEvent;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.UserSignInOrSignOutEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
+import cc.kune.core.client.rpcservices.ContentServiceAsync;
+import cc.kune.core.client.state.ContentCache;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.StateAbstractDTO;
+
+import com.google.gwt.event.shared.EventBus;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+import com.google.inject.Inject;
+
+public class ContentCacheDefault implements ContentCache {
+  private final Map<StateToken, StateAbstractDTO> cacheMap;
+  private final EventBus eventBus;
+  private final ContentServiceAsync server;
+  private boolean useCache = false;
+
+  @Inject
+  public ContentCacheDefault(final ContentServiceAsync server, final EventBus eventBus,
+      final Session session) {
+    this.server = server;
+    this.eventBus = eventBus;
+    this.cacheMap = new HashMap<StateToken, StateAbstractDTO>();
+    // Better, don't use while we don't check changes in the server (by others)
+    // and we do server pub/sub
+    session.onAppStart(true, new AppStartHandler() {
+      @Override
+      public void onAppStart(final AppStartEvent event) {
+        useCache = event.getInitData().useClientContentCache();
+      }
+    });
+    useCache = true;
+    session.onUserSignInOrSignOut(false, new UserSignInOrSignOutHandler() {
+      @Override
+      public void onUserSignInOrSignOut(final UserSignInOrSignOutEvent event) {
+        cacheMap.clear();
+      }
+    });
+  }
+
+  @Override
+  public void cache(final StateToken encodeState, final StateAbstractDTO content) {
+    assert encodeState != null;
+    if (useCache) {
+      cacheMap.put(encodeState, content);
+    }
+  }
+
+  private StateAbstractDTO getCached(final StateToken newState) {
+    assert newState != null;
+    return useCache ? cacheMap.get(newState) : null;
+  }
+
+  @Override
+  public void getContent(final String user, final StateToken newState,
+      final AsyncCallback<StateAbstractDTO> callback) {
+    assert newState != null;
+    eventBus.fireEvent(new ProgressShowEvent(""));
+    final StateAbstractDTO catched = getCached(newState);
+    if (catched != null) {
+      callback.onSuccess(catched);
+    } else {
+      // NotifyUser.info("Getting state of: " + newState, true);
+      server.getContent(user, newState, callback);
+    }
+  }
+
+  @Override
+  public void remove(final StateToken token) {
+    cacheMap.remove(token);
+  }
+
+  @Override
+  public void removeCacheOfGroup(final String group) {
+    for (final StateToken entry : cacheMap.keySet()) {
+      if (entry.getGroup().equals(group)) {
+        cacheMap.put(entry, null);
+      }
+    }
+  }
+
+}

Copied: trunk/src/main/java/cc/kune/core/client/state/impl/HistoryWrapperDefault.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/state/HistoryWrapperDefault.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/impl/HistoryWrapperDefault.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/state/impl/HistoryWrapperDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,43 @@
+/*
+ *
+ * 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.state.impl;
+
+import cc.kune.core.client.state.HistoryWrapper;
+
+import com.google.gwt.user.client.History;
+
+public class HistoryWrapperDefault implements HistoryWrapper {
+
+    @Override
+    public String getToken() {
+        return History.getToken();
+    }
+
+    @Override
+    public void newItem(final String historyToken) {
+        History.newItem(historyToken);
+    }
+
+    @Override
+    public void newItem(final String historyToken, final boolean issueEvent) {
+        History.newItem(historyToken, issueEvent);
+    }
+
+}

Copied: trunk/src/main/java/cc/kune/core/client/state/impl/SessionDefault.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/state/SessionDefault.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/impl/SessionDefault.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/state/impl/SessionDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,377 @@
+/*
+ *
+ * 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.state.impl;
+
+import java.util.Collection;
+import java.util.List;
+
+import cc.kune.common.client.log.Log;
+import cc.kune.core.client.cookies.CookiesManager;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.client.events.UserSignInOrSignOutEvent;
+import cc.kune.core.client.events.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
+import cc.kune.core.client.events.UserSignOutEvent;
+import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.rpcservices.UserServiceAsync;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.shared.domain.utils.StateToken;
+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.InitDataDTO;
+import cc.kune.core.shared.dto.LicenseDTO;
+import cc.kune.core.shared.dto.StateAbstractDTO;
+import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.core.shared.dto.StateContentDTO;
+import cc.kune.core.shared.dto.ToolSimpleDTO;
+import cc.kune.core.shared.dto.UserInfoDTO;
+import cc.kune.core.shared.dto.UserSimpleDTO;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class SessionDefault implements Session {
+  private final CookiesManager cookieManager;
+  private Object[][] countriesArray;
+  private I18nLanguageDTO currentLanguage;
+  private StateAbstractDTO currentState;
+  private UserInfoDTO currentUserInfo;
+  private final EventBus eventBus;
+  private InitDataDTO initData;
+  private Object[][] languagesArray;
+  private Object[][] timezonesArray;
+  private String userHash;
+  private final Provider<UserServiceAsync> userServiceProvider;
+
+  @Inject
+  public SessionDefault(final CookiesManager cookieManager,
+      final Provider<UserServiceAsync> userServiceProvider, final EventBus eventBus) {
+    this.cookieManager = cookieManager;
+    this.eventBus = eventBus;
+    this.userHash = cookieManager.getAuthCookie();
+    this.userHash = userHash == null || userHash.equals("null") ? null : userHash;
+    this.userServiceProvider = userServiceProvider;
+    languagesArray = null;
+    check(new AsyncCallbackSimple<Void>() {
+      @Override
+      public void onSuccess(final Void result) {
+      }
+    });
+  }
+
+  @Override
+  public void check(final AsyncCallbackSimple<Void> callback) {
+    Log.debug("Checking session (userhash: " + getUserHash() + ")");
+    userServiceProvider.get().onlyCheckSession(getUserHash(), callback);
+  }
+
+  @Override
+  public StateContainerDTO getContainerState() {
+    return (StateContainerDTO) currentState;
+  }
+
+  @Override
+  public StateContentDTO getContentState() {
+    return (StateContentDTO) currentState;
+  }
+
+  @Override
+  public List<I18nCountryDTO> getCountries() {
+    return initData.getCountries();
+  }
+
+  @Override
+  public Object[][] getCountriesArray() {
+    if (countriesArray == null) {
+      countriesArray = mapCountries();
+    }
+    return countriesArray;
+  }
+
+  @Override
+  public String getCurrentCCversion() {
+    return initData.getCurrentCCversion();
+  }
+
+  @Override
+  public String getCurrentGroupShortName() {
+    return currentState == null ? null : currentState.getStateToken().getGroup();
+  }
+
+  @Override
+  public I18nLanguageDTO getCurrentLanguage() {
+    return currentLanguage;
+  }
+
+  @Override
+  public StateAbstractDTO getCurrentState() {
+    return currentState;
+  }
+
+  @Override
+  public StateToken getCurrentStateToken() {
+    return currentState == null ? null : currentState.getStateToken();
+  }
+
+  @Override
+  public UserSimpleDTO getCurrentUser() {
+    return currentUserInfo == null ? null : currentUserInfo.getUser();
+  }
+
+  @Override
+  public UserInfoDTO getCurrentUserInfo() {
+    return currentUserInfo;
+  }
+
+  @Override
+  public LicenseDTO getDefLicense() {
+    return initData.getDefaultLicense();
+  }
+
+  @Override
+  public String getGalleryPermittedExtensions() {
+    return initData.getGalleryPermittedExtensions();
+  }
+
+  @Override
+  public Collection<ToolSimpleDTO> getGroupTools() {
+    return initData.getGroupTools();
+  }
+
+  @Override
+  public int getImgCropsize() {
+    return initData.getImgCropsize();
+  }
+
+  @Override
+  public int getImgIconsize() {
+    return initData.getImgIconsize();
+  }
+
+  @Override
+  public int getImgResizewidth() {
+    return initData.getImgResizewidth();
+  }
+
+  @Override
+  public int getImgThumbsize() {
+    return initData.getImgThumbsize();
+  }
+
+  @Override
+  public InitDataDTO getInitData() {
+    return initData;
+  }
+
+  @Override
+  public List<I18nLanguageSimpleDTO> getLanguages() {
+    return initData.getLanguages();
+  }
+
+  @Override
+  public Object[][] getLanguagesArray() {
+    if (languagesArray == null) {
+      languagesArray = mapLangs();
+    }
+    return languagesArray;
+  }
+
+  @Override
+  public List<LicenseDTO> getLicenses() {
+    return initData.getLicenses();
+  }
+
+  @Override
+  public boolean getShowDeletedContent() {
+    return currentUserInfo == null ? false : currentUserInfo.getShowDeletedContent();
+  }
+
+  @Override
+  public String getSiteUrl() {
+    final String baseURL = GWT.getModuleBaseURL();
+    return baseURL.substring(0, baseURL.lastIndexOf("/" + GWT.getModuleName()));
+  }
+
+  @Override
+  public Object[][] getTimezones() {
+    if (timezonesArray == null) {
+      mapTimezones();
+    }
+    return timezonesArray;
+  }
+
+  @Override
+  public String getUserHash() {
+    return userHash;
+  }
+
+  @Override
+  public Collection<ToolSimpleDTO> getUserTools() {
+    return initData.getUserTools();
+  }
+
+  @Override
+  public boolean inSameToken(final StateToken token) {
+    return getCurrentStateToken().equals(token);
+  }
+
+  @Override
+  public boolean isCurrentStateAContent() {
+    return currentState instanceof StateContentDTO;
+  }
+
+  @Override
+  public boolean isCurrentStateAGroup() {
+    return currentState == null ? false : !currentState.getGroup().isPersonal();
+  }
+
+  @Override
+  public boolean isCurrentStateAPerson() {
+    return currentState == null ? false : currentState.getGroup().isPersonal();
+  }
+
+  @Override
+  public boolean isInCurrentUserSpace() {
+    if (!isLogged()) {
+      return false;
+    }
+    if (getCurrentStateToken().getGroup().equals(getCurrentUser().getShortName())) {
+      return true;
+    }
+    return false;
+  }
+
+  @Override
+  public boolean isLogged() {
+    return userHash != null;
+  }
+
+  @Override
+  public boolean isNotLogged() {
+    return !isLogged();
+  }
+
+  private Object[][] mapCountries() {
+    assert initData != null;
+    final Object[][] objs = new Object[initData.getCountries().size()][1];
+    int i = 0;
+    for (final I18nCountryDTO country : initData.getCountries()) {
+      final Object[] obj = new Object[] { country.getCode(), country.getEnglishName() };
+      objs[i++] = obj;
+    }
+    return objs;
+  }
+
+  private Object[][] mapLangs() {
+    assert initData != null;
+    final Object[][] objs = new Object[initData.getLanguages().size()][1];
+    int i = 0;
+    for (final I18nLanguageSimpleDTO language : initData.getLanguages()) {
+      final Object[] obj = new Object[] { language.getCode(), language.getEnglishName() };
+      objs[i++] = obj;
+    }
+    return objs;
+  }
+
+  private void mapTimezones() {
+    assert initData != null;
+    timezonesArray = new Object[initData.getTimezones().length][1];
+    for (int i = 0; i < getTimezones().length; i++) {
+      final Object[] obj = new Object[] { initData.getTimezones()[i] };
+      timezonesArray[i] = obj;
+    }
+  }
+
+  @Override
+  public void onAppStart(final boolean fireNow, final AppStartHandler handler) {
+    eventBus.addHandler(AppStartEvent.getType(), handler);
+    if (fireNow && initData != null) {
+      handler.onAppStart(new AppStartEvent(initData));
+    }
+  }
+
+  @Override
+  public void onUserSignIn(final boolean fireNow, final UserSignInHandler handler) {
+    eventBus.addHandler(UserSignInEvent.getType(), handler);
+    if (fireNow && isLogged() && currentUserInfo != null) {
+      handler.onUserSignIn(new UserSignInEvent(currentUserInfo));
+    }
+  }
+
+  @Override
+  public void onUserSignInOrSignOut(final boolean fireNow, final UserSignInOrSignOutHandler handler) {
+    eventBus.addHandler(UserSignInOrSignOutEvent.getType(), handler);
+    if (fireNow) {
+      handler.onUserSignInOrSignOut(new UserSignInOrSignOutEvent(isLogged()));
+    }
+  }
+
+  @Override
+  public void onUserSignOut(final boolean fireNow, final UserSignOutHandler handler) {
+    eventBus.addHandler(UserSignOutEvent.getType(), handler);
+    if (fireNow && isNotLogged()) {
+      handler.onUserSignOut(new UserSignOutEvent());
+    }
+  }
+
+  @Override
+  public void setCurrentLanguage(final I18nLanguageDTO currentLanguage) {
+    this.currentLanguage = currentLanguage;
+  }
+
+  @Override
+  public void setCurrentState(final StateAbstractDTO currentState) {
+    this.currentState = currentState;
+  }
+
+  @Override
+  public void setCurrentUserInfo(final UserInfoDTO currentUserInfo) {
+    this.currentUserInfo = currentUserInfo;
+    if (currentUserInfo != null) {
+      eventBus.fireEvent(new UserSignInEvent(this.currentUserInfo));
+    } else {
+      eventBus.fireEvent(new UserSignOutEvent());
+    }
+    eventBus.fireEvent(new UserSignInOrSignOutEvent(isLogged()));
+  }
+
+  @Override
+  public void setInitData(final InitDataDTO initData) {
+    this.initData = initData;
+  }
+
+  @Override
+  public void setUserHash(final String userHash) {
+    this.userHash = userHash;
+  }
+
+  @Override
+  public void signOut() {
+    cookieManager.removeAuthCookie();
+    setUserHash(null);
+    setCurrentUserInfo(null);
+  }
+}

Copied: trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java (from rev 1655, trunk/src/main/java/cc/kune/core/client/state/StateManagerDefault.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/client/state/impl/StateManagerDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,476 @@
+/*
+ *
+
+ * 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.state.impl;
+
+import org.waveprotocol.box.webclient.client.ClientEvents;
+import org.waveprotocol.box.webclient.client.events.WaveSelectionEvent;
+import org.waveprotocol.wave.model.waveref.InvalidWaveRefException;
+import org.waveprotocol.wave.util.escapers.GwtWaverefEncoder;
+
+import cc.kune.common.client.actions.BeforeActionCollection;
+import cc.kune.common.client.actions.BeforeActionListener;
+import cc.kune.common.client.log.Log;
+import cc.kune.common.client.notify.ProgressHideEvent;
+import cc.kune.common.client.utils.Pair;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.GoHomeEvent;
+import cc.kune.core.client.events.GroupChangedEvent;
+import cc.kune.core.client.events.SocialNetworkChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.ToolChangedEvent;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignOutEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.GroupChangedEvent.GroupChangedHandler;
+import cc.kune.core.client.events.SocialNetworkChangedEvent.SocialNetworkChangedHandler;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
+import cc.kune.core.client.events.ToolChangedEvent.ToolChangedHandler;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.sitebar.spaces.Space;
+import cc.kune.core.client.sitebar.spaces.SpaceConfEvent;
+import cc.kune.core.client.sitebar.spaces.SpaceSelectEvent;
+import cc.kune.core.client.state.ContentCache;
+import cc.kune.core.client.state.HistoryTokenCallback;
+import cc.kune.core.client.state.HistoryWrapper;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.SiteTokenListeners;
+import cc.kune.core.client.state.SiteTokens;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.core.client.state.TokenMatcher;
+import cc.kune.core.client.state.TokenUtils;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.SocialNetworkDataDTO;
+import cc.kune.core.shared.dto.StateAbstractDTO;
+
+import com.google.gwt.event.logical.shared.ValueChangeEvent;
+import com.google.gwt.event.logical.shared.ValueChangeHandler;
+import com.google.gwt.event.shared.EventBus;
+import com.google.inject.Inject;
+
+public class StateManagerDefault implements StateManager, ValueChangeHandler<String> {
+  private final BeforeActionCollection beforeStateChangeCollection;
+  private final ContentCache contentCache;
+  private final EventBus eventBus;
+  private final HistoryWrapper history;
+  private StateToken previousGroupToken;
+  /**
+   * When a historyChanged is interrupted (for instance because you are editing
+   * something), the new history token is stored here
+   */
+  private String resumedHistoryToken;
+  private final Session session;
+  private final SiteTokenListeners siteTokens;
+  private final TokenMatcher tokenMatcher;
+
+  @Inject
+  public StateManagerDefault(final ContentCache contentProvider, final Session session,
+      final HistoryWrapper history, final TokenMatcher tokenMatcher, final EventBus eventBus,
+      final SiteTokenListeners siteTokens) {
+    this.tokenMatcher = tokenMatcher;
+    this.eventBus = eventBus;
+    this.contentCache = contentProvider;
+    this.session = session;
+    this.history = history;
+    this.previousGroupToken = null;
+    this.resumedHistoryToken = null;
+    tokenMatcher.init(GwtWaverefEncoder.INSTANCE);
+    this.siteTokens = siteTokens;
+    beforeStateChangeCollection = new BeforeActionCollection();
+    session.onAppStart(true, new AppStartHandler() {
+      @Override
+      public void onAppStart(final AppStartEvent event) {
+        session.onUserSignIn(false, new UserSignInEvent.UserSignInHandler() {
+          @Override
+          public void onUserSignIn(final UserSignInEvent event) {
+            // refreshCurrentGroupState();
+          }
+        });
+        session.onUserSignOut(false, new UserSignOutEvent.UserSignOutHandler() {
+          @Override
+          public void onUserSignOut(final UserSignOutEvent event) {
+            refreshCurrentStateWithoutCache();
+          }
+        });
+        processCurrentHistoryToken();
+      }
+    });
+    onSocialNetworkChanged(false, new SocialNetworkChangedHandler() {
+      @Override
+      public void onSocialNetworkChanged(final SocialNetworkChangedEvent event) {
+        contentCache.removeCacheOfGroup(event.getState().getStateToken().getGroup());
+      }
+    });
+    eventBus.addHandler(GoHomeEvent.getType(), new GoHomeEvent.GoHomeHandler() {
+      @Override
+      public void onGoHome(final GoHomeEvent event) {
+        gotoDefaultHomepage();
+      }
+    });
+  }
+
+  @Override
+  public void addBeforeStateChangeListener(final BeforeActionListener listener) {
+    beforeStateChangeCollection.add(listener);
+  }
+
+  @Override
+  public void addSiteToken(final String token, final HistoryTokenCallback callback) {
+    siteTokens.put(token.toLowerCase(), callback);
+  }
+
+  private void checkGroupAndToolChange(final StateAbstractDTO newState) {
+    final String newGroup = newState.getStateToken().getGroup();
+    final String previousGroup = getPreviousGroup();
+    if (startingUp() || !previousGroup.equals(newGroup)) {
+      GroupChangedEvent.fire(eventBus, previousGroup, newGroup);
+    }
+    final String previousToolName = getPreviousTool();
+    final String newTokenTool = newState.getStateToken().getTool();
+    final String newToolName = newTokenTool == null ? "" : newTokenTool;
+    if (startingUp() || previousToolName == null || !previousToolName.equals(newToolName)) {
+      ToolChangedEvent.fire(eventBus, previousGroupToken, newState.getStateToken());
+    }
+  }
+
+  private void getContent(final StateToken newState) {
+    getContent(newState, false);
+  }
+
+  private void getContent(final StateToken newState, final boolean setBrowserHistory) {
+    // NotifyUser.info("loading: " + newState + " because current:" +
+    // session.getCurrentStateToken());
+    contentCache.getContent(session.getUserHash(), newState,
+        new AsyncCallbackSimple<StateAbstractDTO>() {
+          @Override
+          public void onSuccess(final StateAbstractDTO newState) {
+            setState(newState);
+            final String currentToken = newState.getStateToken().toString();
+            SpaceConfEvent.fire(eventBus, Space.groupSpace, currentToken);
+            SpaceConfEvent.fire(eventBus, Space.publicSpace, TokenUtils.preview(currentToken));
+            if (setBrowserHistory) {
+              history.newItem(currentToken, false);
+              SpaceSelectEvent.fire(eventBus, Space.groupSpace);
+            }
+          }
+        });
+  }
+
+  @Override
+  public String getCurrentToken() {
+    return history.getToken();
+  }
+
+  private String getPreviousGroup() {
+    final String previousGroup = startingUp() ? "" : previousGroupToken.getGroup();
+    return previousGroup;
+  }
+
+  private String getPreviousTool() {
+    final String previousTool = startingUp() ? "" : previousGroupToken.getTool();
+    return previousTool;
+  }
+
+  @Override
+  public void gotoDefaultHomepage() {
+    getContent(new StateToken(SiteTokens.GROUP_HOME), true);
+  }
+
+  @Override
+  public void gotoHistoryToken(final String token) {
+    Log.debug("StateManager: history goto-string-token: " + token);
+    history.newItem(token);
+  }
+
+  @Override
+  public void gotoHistoryTokenButRedirectToCurrent(final String token) {
+    gotoHistoryToken(TokenUtils.addRedirect(token, history.getToken()));
+
+  }
+
+  @Override
+  public void gotoStateToken(final StateToken newToken) {
+    Log.debug("StateManager: history goto-token: " + newToken + ", previous: " + previousGroupToken);
+    history.newItem(newToken.getEncoded());
+  }
+
+  @Override
+  public void gotoStateToken(final StateToken token, final boolean useCache) {
+    if (!useCache) {
+      contentCache.remove(token);
+    }
+    gotoStateToken(token);
+  }
+
+  @Override
+  public void onGroupChanged(final boolean fireNow, final GroupChangedHandler handler) {
+    eventBus.addHandler(GroupChangedEvent.getType(), handler);
+    final StateAbstractDTO currentState = session.getCurrentState();
+    if (fireNow && currentState != null) {
+      handler.onGroupChanged(new GroupChangedEvent(getPreviousGroup(),
+          currentState.getStateToken().getGroup()));
+    }
+
+  }
+
+  @Override
+  public void onSocialNetworkChanged(final boolean fireNow, final SocialNetworkChangedHandler handler) {
+    eventBus.addHandler(SocialNetworkChangedEvent.getType(), handler);
+    final StateAbstractDTO currentState = session.getCurrentState();
+    if (fireNow && currentState != null) {
+      handler.onSocialNetworkChanged(new SocialNetworkChangedEvent(currentState));
+    }
+  }
+
+  @Override
+  public void onStateChanged(final boolean fireNow, final StateChangedHandler handler) {
+    eventBus.addHandler(StateChangedEvent.getType(), handler);
+    final StateAbstractDTO currentState = session.getCurrentState();
+    if (fireNow && currentState != null) {
+      handler.onStateChanged(new StateChangedEvent(currentState));
+    }
+  }
+
+  @Override
+  public void onToolChanged(final boolean fireNow, final ToolChangedHandler handler) {
+    eventBus.addHandler(ToolChangedEvent.getType(), handler);
+    final StateAbstractDTO currentState = session.getCurrentState();
+    if (fireNow && currentState != null) {
+      handler.onToolChanged(new ToolChangedEvent(previousGroupToken, currentState.getStateToken()));
+    }
+  }
+
+  @Override
+  public void onValueChange(final ValueChangeEvent<String> event) {
+    Log.info("History event value changed: " + event.getValue());
+    processHistoryToken(event.getValue());
+  }
+
+  private void processCurrentHistoryToken() {
+    processHistoryToken(history.getToken());
+  }
+
+  void processHistoryToken(final String newHistoryToken) {
+    // http://code.google.com/p/google-web-toolkit-doc-1-5/wiki/DevGuideHistory
+    if (beforeStateChangeCollection.checkBeforeAction()) {
+      // There isn't a beforeStateChange listener that stops this history
+      // change
+      HistoryTokenCallback tokenListener = null;
+      if (newHistoryToken != null) {
+        final String nToken = newHistoryToken.toLowerCase();
+        tokenListener = siteTokens.get(nToken);
+      }
+      Log.debug("StateManager: on history changed (" + newHistoryToken + ")");
+      if (tokenListener == null) {
+        // Log.debug("Is not a special hash");
+        // token is not one of #newgroup #signin #translate ...
+        final String nToken = newHistoryToken != null ? newHistoryToken.toLowerCase() : null;
+        if (nToken != null && tokenMatcher.hasRedirect(nToken)) {
+          final Pair<String, String> redirect = tokenMatcher.getRedirect(nToken);
+          final String firstToken = redirect.getLeft();
+          final String sndToken = redirect.getRight();
+          if (firstToken.equals(SiteTokens.PREVIEW)) {
+            SpaceSelectEvent.fire(eventBus, Space.publicSpace);
+            SpaceConfEvent.fire(eventBus, Space.groupSpace, sndToken);
+            SpaceConfEvent.fire(eventBus, Space.publicSpace, TokenUtils.preview(sndToken));
+            getContent(new StateToken(sndToken));
+          } else if (firstToken.equals(SiteTokens.SUBTITLES)) {
+            siteTokens.get(SiteTokens.SUBTITLES).onHistoryToken(
+                tokenMatcher.getRedirect(newHistoryToken).getRight());
+          } else if (firstToken.equals(SiteTokens.NEWGROUP)) {
+            siteTokens.get(SiteTokens.NEWGROUP).onHistoryToken(newHistoryToken);
+          } else if (firstToken.equals(SiteTokens.SIGNIN)) {
+            if (session.isLogged()) {
+              // We are logged, then redirect:
+              history.newItem(sndToken, false);
+              processHistoryToken(sndToken);
+            } else {
+              // We have to loggin
+              siteTokens.get(SiteTokens.SIGNIN).onHistoryToken(newHistoryToken);
+            }
+          }
+        } else
+        // No redirection
+        if (tokenMatcher.isWaveToken(newHistoryToken)) {
+          if (session.isLogged()) {
+            SpaceConfEvent.fire(eventBus, Space.userSpace, newHistoryToken);
+            SpaceSelectEvent.fire(eventBus, Space.userSpace);
+            try {
+              ClientEvents.get().fireEvent(
+                  new WaveSelectionEvent(GwtWaverefEncoder.decodeWaveRefFromPath(newHistoryToken)));
+            } catch (final InvalidWaveRefException e) {
+              Log.error(nToken, e);
+            }
+          } else {
+            // Wave, but don't logged
+            history.newItem(TokenUtils.addRedirect(SiteTokens.SIGNIN, newHistoryToken));
+            if (startingUp()) {
+              // Starting application (with Wave)
+              getContent(new StateToken(SiteTokens.GROUP_HOME), false);
+            }
+          }
+        } else if (tokenMatcher.isGroupToken(newHistoryToken)) {
+          SpaceConfEvent.fire(eventBus, Space.groupSpace, newHistoryToken);
+          SpaceConfEvent.fire(eventBus, Space.publicSpace, TokenUtils.preview(newHistoryToken));
+          SpaceSelectEvent.fire(eventBus, Space.groupSpace);
+          getContent(new StateToken(newHistoryToken));
+        } else {
+          gotoDefaultHomepage();
+        }
+      } else {
+        // token is one of #newgroup #signin #translate ...
+        if (startingUp()) {
+          // Starting with some token like "signin": load defContent
+          // also
+          getContent(new StateToken(SiteTokens.GROUP_HOME), false);
+          // processHistoryToken(SiteTokens.GROUP_HOME);
+          // SpaceSelectEvent.fire(eventBus, Space.groupSpace);
+        }
+        // Fire the listener of this #hash token
+        tokenListener.onHistoryToken(newHistoryToken);
+      }
+    } else {
+      resumedHistoryToken = newHistoryToken;
+    }
+  }
+
+  @Override
+  public void redirectOrRestorePreviousToken() {
+    final String token = history.getToken();
+    if (tokenMatcher.hasRedirect(token)) {
+      // URL of the form signin(group.tool)
+      final String previousToken = tokenMatcher.getRedirect(token).getRight();
+      if (previousToken.equals(SiteTokens.WAVEINBOX) && session.isNotLogged()) {
+        // signin(inbox) && cancel
+        restorePreviousToken();
+      } else {
+        history.newItem(previousToken); // FIXMEKK
+      }
+    } else {
+      // No redirect then restore previous token
+      restorePreviousToken();
+    }
+  }
+
+  /**
+   * <p>
+   * Reload current state (using client cache if available)
+   * </p>
+   */
+  @Override
+  public void refreshCurrentState() {
+    processHistoryToken(history.getToken());
+  }
+
+  /**
+   * <p>
+   * Reload current state (not using client cache)
+   * </p>
+   */
+  @Override
+  public void refreshCurrentStateWithoutCache() {
+    final StateToken currentStateToken = session.getCurrentStateToken();
+    if (currentStateToken == null) {
+      processCurrentHistoryToken();
+    } else {
+      contentCache.remove(currentStateToken);
+      getContent(currentStateToken);
+    }
+  }
+
+  @Override
+  public void removeBeforeStateChangeListener(final BeforeActionListener listener) {
+    beforeStateChangeCollection.remove(listener);
+  }
+
+  @Override
+  public void removeCache(final StateToken parentToken) {
+    contentCache.remove(parentToken);
+  }
+
+  @Override
+  public void removeCacheOfGroup(final String group) {
+    contentCache.removeCacheOfGroup(group);
+  }
+
+  @Override
+  public void removeSiteToken(final String token) {
+    siteTokens.remove(token);
+  }
+
+  @Override
+  public void restorePreviousToken() {
+    if (previousGroupToken != null) {
+      gotoStateToken(previousGroupToken);
+    }
+  }
+
+  @Override
+  public void resumeTokenChange() {
+    if (resumedHistoryToken != null) {
+      // Is this reload redundant?
+      refreshCurrentState();
+      gotoHistoryToken(resumedHistoryToken);
+      resumedHistoryToken = null;
+    }
+  }
+
+  @Override
+  public void setRetrievedState(final StateAbstractDTO newState) {
+    contentCache.cache(newState.getStateToken(), newState);
+  }
+
+  @Override
+  public void setRetrievedStateAndGo(final StateAbstractDTO newState) {
+    setRetrievedState(newState);
+    final String token = newState.getStateToken().toString();
+    if (history.getToken().equals(token)) {
+      setState(newState);
+    }
+    history.newItem(token);
+  }
+
+  @Override
+  public void setSocialNetwork(final SocialNetworkDataDTO socialNet) {
+    StateAbstractDTO state;
+    if (session != null && (state = session.getCurrentState()) != null) {
+      // After a SN operation, usually returns a SocialNetworkResultDTO
+      // with new SN data and we refresh the state
+      // to avoid to reload() again the state
+      state.setSocialNetworkData(socialNet);
+      SocialNetworkChangedEvent.fire(eventBus, state);
+    }
+  }
+
+  void setState(final StateAbstractDTO newState) {
+    session.setCurrentState(newState);
+    final StateToken newToken = newState.getStateToken();
+    contentCache.cache(newToken, newState);
+    // history.newItem(newToken.toString(), false);
+    StateChangedEvent.fire(eventBus, newState);
+    checkGroupAndToolChange(newState);
+    previousGroupToken = newToken.copy();
+    eventBus.fireEvent(new ProgressHideEvent());
+  }
+
+  private boolean startingUp() {
+    return previousGroupToken == null;
+  }
+}

Modified: trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/ws/CoreViewImpl.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,9 +20,9 @@
 package cc.kune.core.client.ws;
 
 import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.state.StateManagerDefault;
-import cc.kune.gspace.client.GSpaceArmorImpl;
-import cc.kune.gspace.client.resources.GSpaceArmorResources;
+import cc.kune.core.client.state.impl.StateManagerDefault;
+import cc.kune.gspace.client.armor.impl.GSpaceArmorImpl;
+import cc.kune.gspace.client.armor.resources.GSpaceArmorResources;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.user.client.History;

Modified: trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -30,7 +30,7 @@
 import cc.kune.core.shared.FileConstants;
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.GroupDTO;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 
 import com.google.gwt.user.client.ui.AbstractImagePrototype;
 import com.google.gwt.user.client.ui.HorizontalPanel;

Modified: trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/client/ws/entheader/EntityHeaderPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,13 +20,13 @@
 package cc.kune.core.client.ws.entheader;
 
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
-import cc.kune.core.client.state.GroupChangedEvent;
-import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
+import cc.kune.core.client.events.GroupChangedEvent;
+import cc.kune.core.client.events.GroupChangedEvent.GroupChangedHandler;
 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.options.logo.CurrentEntityChangedEvent;
-import cc.kune.gspace.client.options.logo.CurrentEntityChangedEvent.CurrentEntityChangedHandler;
+import cc.kune.gspace.client.events.CurrentEntityChangedEvent;
+import cc.kune.gspace.client.events.CurrentEntityChangedEvent.CurrentEntityChangedHandler;
 
 import com.google.gwt.event.shared.EventBus;
 import com.google.gwt.user.client.ui.IsWidget;

Modified: trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/PlatformServerModule.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -49,7 +49,8 @@
 import cc.kune.core.server.content.CreationService;
 import cc.kune.core.server.content.CreationServiceDefault;
 import cc.kune.core.server.content.XMLActionReader;
-import cc.kune.core.server.i18n.I18nTranslationServiceDefault;
+import cc.kune.core.server.i18n.I18nTranslationServiceMultiLang;
+import cc.kune.core.server.i18n.impl.I18nTranslationServiceDefault;
 import cc.kune.core.server.mail.MailService;
 import cc.kune.core.server.mail.MailServiceDefault;
 import cc.kune.core.server.manager.ExtMediaDescripManager;
@@ -64,7 +65,6 @@
 import cc.kune.core.server.manager.SocialNetworkManager;
 import cc.kune.core.server.manager.TagManager;
 import cc.kune.core.server.manager.TagUserContentManager;
-import cc.kune.core.server.manager.TagUserContentManagerDefault;
 import cc.kune.core.server.manager.ToolConfigurationManager;
 import cc.kune.core.server.manager.UserManager;
 import cc.kune.core.server.manager.file.EntityLogoDownloadManager;
@@ -82,6 +82,7 @@
 import cc.kune.core.server.manager.impl.RateManagerDefault;
 import cc.kune.core.server.manager.impl.SocialNetworkManagerDefault;
 import cc.kune.core.server.manager.impl.TagManagerDefault;
+import cc.kune.core.server.manager.impl.TagUserContentManagerDefault;
 import cc.kune.core.server.manager.impl.ToolConfigurationManagerDefault;
 import cc.kune.core.server.manager.impl.UserManagerDefault;
 import cc.kune.core.server.mapper.DozerMapper;
@@ -110,10 +111,10 @@
 import cc.kune.hspace.client.ClientStatsService;
 import cc.kune.lists.client.rpc.ListsService;
 import cc.kune.lists.server.rpc.ListsRPC;
-import cc.kune.wave.server.KuneWaveService;
-import cc.kune.wave.server.KuneWaveServiceDefault;
 import cc.kune.wave.server.ParticipantUtils;
-import cc.kune.wave.server.WaveEmailNotifier;
+import cc.kune.wave.server.kspecific.KuneWaveService;
+import cc.kune.wave.server.kspecific.KuneWaveServiceDefault;
+import cc.kune.wave.server.kspecific.WaveEmailNotifier;
 
 import com.google.inject.Singleton;
 import com.google.inject.matcher.Matchers;
@@ -168,6 +169,7 @@
     bind(FinderService.class).to(FinderServiceDefault.class);
     bind(StateService.class).to(StateServiceDefault.class);
     bind(I18nTranslationService.class).to(I18nTranslationServiceDefault.class);
+    bind(I18nTranslationServiceMultiLang.class).to(I18nTranslationServiceDefault.class);
     bind(KuneWaveService.class).to(KuneWaveServiceDefault.class);
     bind(MailService.class).to(MailServiceDefault.class);
     bind(XMLActionReader.class);

Modified: trunk/src/main/java/cc/kune/core/server/content/ContainerManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContainerManager.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/content/ContainerManager.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -21,7 +21,7 @@
 
 import cc.kune.core.client.errors.DefaultException;
 import cc.kune.core.server.manager.Manager;
-import cc.kune.core.server.manager.impl.SearchResult;
+import cc.kune.core.server.manager.SearchResult;
 import cc.kune.domain.AccessLists;
 import cc.kune.domain.Container;
 import cc.kune.domain.Group;

Modified: trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/content/ContainerManagerDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -30,9 +30,9 @@
 import cc.kune.core.client.errors.DefaultException;
 import cc.kune.core.client.errors.MoveOnSameContainerException;
 import cc.kune.core.client.errors.NameInUseException;
+import cc.kune.core.server.manager.SearchResult;
 import cc.kune.core.server.manager.file.FileUtils;
 import cc.kune.core.server.manager.impl.DefaultManager;
-import cc.kune.core.server.manager.impl.SearchResult;
 import cc.kune.core.server.manager.impl.ServerManagerException;
 import cc.kune.core.server.utils.FilenameUtils;
 import cc.kune.domain.AccessLists;

Modified: trunk/src/main/java/cc/kune/core/server/content/ContentManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContentManager.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/content/ContentManager.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -23,7 +23,7 @@
 
 import cc.kune.core.client.errors.DefaultException;
 import cc.kune.core.server.manager.Manager;
-import cc.kune.core.server.manager.impl.SearchResult;
+import cc.kune.core.server.manager.SearchResult;
 import cc.kune.core.shared.domain.ContentStatus;
 import cc.kune.core.shared.domain.RateResult;
 import cc.kune.domain.Container;

Modified: trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/content/ContentManagerDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -38,10 +38,10 @@
 import cc.kune.core.client.errors.NameInUseException;
 import cc.kune.core.client.errors.UserNotFoundException;
 import cc.kune.core.server.access.FinderService;
+import cc.kune.core.server.manager.SearchResult;
 import cc.kune.core.server.manager.TagUserContentManager;
 import cc.kune.core.server.manager.file.FileUtils;
 import cc.kune.core.server.manager.impl.DefaultManager;
-import cc.kune.core.server.manager.impl.SearchResult;
 import cc.kune.core.server.manager.impl.ServerManagerException;
 import cc.kune.core.server.utils.FilenameUtils;
 import cc.kune.core.shared.domain.ContentStatus;
@@ -56,9 +56,9 @@
 import cc.kune.domain.finders.ContentFinder;
 import cc.kune.domain.finders.I18nLanguageFinder;
 import cc.kune.domain.finders.UserFinder;
-import cc.kune.wave.server.KuneWaveService;
 import cc.kune.wave.server.KuneWaveUtils;
 import cc.kune.wave.server.ParticipantUtils;
+import cc.kune.wave.server.kspecific.KuneWaveService;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;

Modified: trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -35,7 +35,7 @@
 import cc.kune.domain.Group;
 import cc.kune.domain.I18nLanguage;
 import cc.kune.domain.User;
-import cc.kune.wave.server.KuneWaveService;
+import cc.kune.wave.server.kspecific.KuneWaveService;
 
 import com.google.inject.Inject;
 import com.google.inject.Singleton;

Deleted: trunk/src/main/java/cc/kune/core/server/i18n/I18nTranslationServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/i18n/I18nTranslationServiceDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/i18n/I18nTranslationServiceDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,99 +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.i18n;
-
-import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.common.shared.utils.TextUtils;
-import cc.kune.core.server.UserSessionManager;
-import cc.kune.core.server.manager.I18nTranslationManager;
-import cc.kune.domain.I18nTranslation;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-import com.google.inject.Singleton;
-
- at Singleton
-public class I18nTranslationServiceDefault extends I18nTranslationService {
-
-  private boolean initiliazied = false;
-  private final I18nTranslationManager translationManager;
-  private final Provider<UserSessionManager> userSessionManager;
-
-  @Inject
-  public I18nTranslationServiceDefault(final I18nTranslationManager translationManager,
-      final Provider<UserSessionManager> userSessionManager) {
-    this.translationManager = translationManager;
-    this.userSessionManager = userSessionManager;
-  }
-
-  public void init() {
-    initiliazied = true;
-  }
-
-  @Override
-  public boolean isRTL() {
-    return userSessionManager.get().isUserLoggedIn() ? userSessionManager.get().getUser().getLanguage().getDirection().equals(
-        RTL)
-        : false;
-  }
-
-  /**
-   * If the text is not in the db, it stores the text pending for translation.
-   * 
-   * Warning: text is escaped as html before insert in the db. Don't use html
-   * here (o user this method with params).
-   * 
-   * @param text
-   * @return text translated in the current language
-   */
-  @Override
-  public String t(final String text) {
-    return tWithNT(text, "");
-  }
-
-  /**
-   * If the text is not in the db, it stores the text pending for translation.
-   * 
-   * Warning: text is escaped as html before insert in the db. Don't use html
-   * here (o user this method with params).
-   * 
-   * @param text
-   * @param noteForTranslators
-   *          some note for facilitate the translation
-   * 
-   * @return text translated in the current language
-   */
-  @Override
-  public String tWithNT(final String text, final String noteForTranslators) {
-    String language;
-    if (initiliazied && userSessionManager.get().isUserLoggedIn()) {
-      language = userSessionManager.get().getUser().getLanguage().getCode();
-    } else {
-      language = I18nTranslation.DEFAULT_LANG;
-    }
-    final String encodeText = TextUtils.escapeHtmlLight(text);
-    String translation = translationManager.getTranslation(language, text, noteForTranslators);
-    if (translation == UNTRANSLATED_VALUE) {
-      // Not translated but in db, return text
-      translation = encodeText;
-    }
-    return decodeHtml(translation);
-  }
-}

Added: trunk/src/main/java/cc/kune/core/server/i18n/I18nTranslationServiceMultiLang.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/i18n/I18nTranslationServiceMultiLang.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/i18n/I18nTranslationServiceMultiLang.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,20 @@
+package cc.kune.core.server.i18n;
+
+import cc.kune.domain.I18nLanguage;
+
+public interface I18nTranslationServiceMultiLang {
+  /**
+   * If the text is not in the db, it stores the text pending for translation.
+   * 
+   * Warning: text is escaped as html before insert in the db. Don't use html
+   * here (o user this method with params).
+   * 
+   * @param text
+   * @param noteForTranslators
+   *          some note for facilitate the translation
+   * @param lang
+   *          translation for some specific language
+   * @return text translated in the specified language
+   */
+  public String tWithNT(I18nLanguage lang, final String text, final String noteForTranslators);
+}

Copied: trunk/src/main/java/cc/kune/core/server/i18n/impl/I18nTranslationServiceDefault.java (from rev 1655, trunk/src/main/java/cc/kune/core/server/i18n/I18nTranslationServiceDefault.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/i18n/impl/I18nTranslationServiceDefault.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/i18n/impl/I18nTranslationServiceDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,114 @@
+/*
+ *
+ * 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.i18n.impl;
+
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.common.shared.utils.TextUtils;
+import cc.kune.core.server.UserSessionManager;
+import cc.kune.core.server.i18n.I18nTranslationServiceMultiLang;
+import cc.kune.core.server.manager.I18nLanguageManager;
+import cc.kune.core.server.manager.I18nTranslationManager;
+import cc.kune.domain.I18nLanguage;
+import cc.kune.domain.I18nTranslation;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class I18nTranslationServiceDefault extends I18nTranslationService implements
+    I18nTranslationServiceMultiLang {
+
+  private boolean initiliazied = false;
+  private final I18nLanguageManager languageManager;
+  private final I18nTranslationManager translationManager;
+  private final Provider<UserSessionManager> userSessionManager;
+
+  @Inject
+  public I18nTranslationServiceDefault(final I18nTranslationManager translationManager,
+      final Provider<UserSessionManager> userSessionManager, final I18nLanguageManager languageManager) {
+    this.translationManager = translationManager;
+    this.userSessionManager = userSessionManager;
+    this.languageManager = languageManager;
+  }
+
+  private I18nLanguage defLang() {
+    return languageManager.findByCode(I18nTranslation.DEFAULT_LANG);
+  }
+
+  public void init() {
+    initiliazied = true;
+  }
+
+  @Override
+  public boolean isRTL() {
+    return userSessionManager.get().isUserLoggedIn() ? userSessionManager.get().getUser().getLanguage().getDirection().equals(
+        RTL)
+        : false;
+  }
+
+  /**
+   * If the text is not in the db, it stores the text pending for translation.
+   * 
+   * Warning: text is escaped as html before insert in the db. Don't use html
+   * here (o user this method with params).
+   * 
+   * @param text
+   * @return text translated in the current language
+   */
+  @Override
+  public String t(final String text) {
+    return tWithNT(text, "");
+  }
+
+  @Override
+  public String tWithNT(final I18nLanguage language, final String text, final String noteForTranslators) {
+    final String encodeText = TextUtils.escapeHtmlLight(text);
+    String translation = translationManager.getTranslation(language.getCode(), text, noteForTranslators);
+    if (translation == UNTRANSLATED_VALUE) {
+      // Not translated but in db, return text
+      translation = encodeText;
+    }
+    return decodeHtml(translation);
+  }
+
+  /**
+   * If the text is not in the db, it stores the text pending for translation.
+   * 
+   * Warning: text is escaped as html before insert in the db. Don't use html
+   * here (o user this method with params).
+   * 
+   * @param text
+   * @param noteForTranslators
+   *          some note for facilitate the translation
+   * 
+   * @return text translated in the current language
+   */
+  @Override
+  public String tWithNT(final String text, final String noteForTranslators) {
+    I18nLanguage language;
+    if (initiliazied && userSessionManager.get().isUserLoggedIn()) {
+      language = userSessionManager.get().getUser().getLanguage();
+    } else {
+      language = defLang();
+    }
+    return tWithNT(language, text, noteForTranslators);
+  }
+}

Modified: trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/init/DatabaseInitializer.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -29,7 +29,7 @@
 
 import cc.kune.core.client.errors.UserMustBeLoggedException;
 import cc.kune.core.server.content.ContentManager;
-import cc.kune.core.server.i18n.I18nTranslationServiceDefault;
+import cc.kune.core.server.i18n.impl.I18nTranslationServiceDefault;
 import cc.kune.core.server.manager.GroupManager;
 import cc.kune.core.server.manager.I18nCountryManager;
 import cc.kune.core.server.manager.I18nLanguageManager;

Modified: trunk/src/main/java/cc/kune/core/server/manager/GroupManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/GroupManager.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/manager/GroupManager.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -26,7 +26,6 @@
 import cc.kune.core.client.errors.EmailAddressInUseException;
 import cc.kune.core.client.errors.GroupShortNameInUseException;
 import cc.kune.core.client.errors.UserMustBeLoggedException;
-import cc.kune.core.server.manager.impl.SearchResult;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.domain.Content;
 import cc.kune.domain.Group;

Modified: trunk/src/main/java/cc/kune/core/server/manager/Manager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/Manager.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/manager/Manager.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -21,7 +21,6 @@
 
 import org.apache.lucene.search.BooleanClause;
 
-import cc.kune.core.server.manager.impl.SearchResult;
 
 public interface Manager<T, X> {
 

Copied: trunk/src/main/java/cc/kune/core/server/manager/SearchResult.java (from rev 1655, trunk/src/main/java/cc/kune/core/server/manager/impl/SearchResult.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/SearchResult.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/manager/SearchResult.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,62 @@
+/*
+ *
+ * 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.manager;
+
+import java.util.List;
+
+public class SearchResult<T> {
+    List<T> list;
+    int size;
+
+    public SearchResult() {
+        this(0, null);
+    }
+
+    public SearchResult(final int count, final List<T> list) {
+        this.list = list;
+        this.size = count;
+    }
+
+    public List<T> getList() {
+        return list;
+    }
+
+    /**
+     * Gets the size of total results (may differ from list size).
+     * 
+     * @return the size
+     */
+    public int getSize() {
+        return size;
+    }
+
+    public void setList(final List<T> list) {
+        this.list = list;
+    }
+
+    public void setSize(final int size) {
+        this.size = size;
+    }
+
+    @Override
+    public String toString() {
+        return "SearchResult[(" + getSize() + "): " + list + "]";
+    }
+}

Deleted: trunk/src/main/java/cc/kune/core/server/manager/TagUserContentManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/TagUserContentManagerDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/manager/TagUserContentManagerDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,127 +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.manager;
-
-import java.util.ArrayList;
-import java.util.List;
-
-import javax.persistence.EntityManager;
-import javax.persistence.NoResultException;
-
-
-import cc.kune.common.shared.utils.TextUtils;
-import cc.kune.core.server.manager.impl.DefaultManager;
-import cc.kune.core.shared.domain.TagCloudResult;
-import cc.kune.core.shared.domain.TagCount;
-import cc.kune.domain.Content;
-import cc.kune.domain.Group;
-import cc.kune.domain.Tag;
-import cc.kune.domain.TagUserContent;
-import cc.kune.domain.User;
-import cc.kune.domain.finders.TagUserContentFinder;
-
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-import com.google.inject.Singleton;
-
- at Singleton
-public class TagUserContentManagerDefault extends DefaultManager<TagUserContent, Long> implements TagUserContentManager {
-    private final TagUserContentFinder finder;
-    private final Provider<EntityManager> provider;
-    private final TagManager tagManager;
-
-    @Inject
-    public TagUserContentManagerDefault(final Provider<EntityManager> provider, final TagManager tagManager,
-            final TagUserContentFinder finder) {
-        super(provider, TagUserContent.class);
-        this.provider = provider;
-        this.tagManager = tagManager;
-        this.finder = finder;
-    }
-
-    List<Tag> find(final User user, final Content content) {
-        return finder.findTags(user, content);
-    }
-
-    private int getMaxCount(final Group group) {
-        return finder.getMaxGrouped(group).intValue();
-    }
-
-    private int getMinCount(final Group group) {
-        return finder.getMinGrouped(group).intValue();
-    }
-
-    private List<TagCount> getSummaryByGroup(final Group group) {
-        return finder.getTagsGroups(group);
-    }
-
-    @Override
-    public TagCloudResult getTagCloudResultByGroup(final Group group) {
-        try {
-            return new TagCloudResult(getSummaryByGroup(group), getMaxCount(group), getMinCount(group));
-        } catch (final NoResultException e) {
-            return new TagCloudResult();
-        }
-    }
-
-    @Override
-    public String getTagsAsString(final User user, final Content content) {
-        final StringBuffer tagConcatenated = new StringBuffer();
-        if (user.getId() != null) {
-            // FIXME: User must be persisted (this fails on tests)
-            final List<Tag> tags = find(user, content);
-            for (final Tag tag : tags) {
-                tagConcatenated.append(" ").append(tag.getName());
-            }
-        }
-        return tagConcatenated.toString().replaceFirst(" ", "");
-    }
-
-    @Override
-    public void remove(final User user, final Content content) {
-        for (final TagUserContent item : finder.find(user, content)) {
-            provider.get().remove(item);
-        }
-    }
-
-    @Override
-    public void setTags(final User user, final Content content, final String tags) {
-        final ArrayList<String> tagsStripped = TextUtils.splitTags(tags);
-        final ArrayList<Tag> tagList = new ArrayList<Tag>();
-
-        for (final String tagString : tagsStripped) {
-            Tag tag;
-            try {
-                tag = tagManager.findByTagName(tagString);
-            } catch (final NoResultException e) {
-                tag = new Tag(tagString);
-                tagManager.persist(tag);
-            }
-            if (!tagList.contains(tag)) {
-                tagList.add(tag);
-            }
-        }
-        remove(user, content);
-        for (final Tag tag : tagList) {
-            final TagUserContent tagUserContent = new TagUserContent(tag, user, content);
-            persist(tagUserContent);
-        }
-    }
-}

Modified: trunk/src/main/java/cc/kune/core/server/manager/UserManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/UserManager.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/manager/UserManager.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -22,7 +22,6 @@
 import org.waveprotocol.box.server.authentication.PasswordDigest;
 
 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;

Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/DefaultManager.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/DefaultManager.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/DefaultManager.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -34,6 +34,8 @@
 import org.hibernate.search.jpa.FullTextQuery;
 import org.hibernate.search.jpa.Search;
 
+import cc.kune.core.server.manager.SearchResult;
+
 import com.google.inject.Provider;
 
 public abstract class DefaultManager<T, K> {

Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/GroupManagerDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -42,6 +42,7 @@
 import cc.kune.core.server.manager.FileManager;
 import cc.kune.core.server.manager.GroupManager;
 import cc.kune.core.server.manager.LicenseManager;
+import cc.kune.core.server.manager.SearchResult;
 import cc.kune.core.server.manager.file.FileUtils;
 import cc.kune.core.server.properties.KuneBasicProperties;
 import cc.kune.core.server.properties.KuneProperties;

Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/KuneWaveManagerDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -36,9 +36,9 @@
 import cc.kune.domain.User;
 import cc.kune.domain.UserBuddiesData;
 import cc.kune.domain.finders.GroupFinder;
-import cc.kune.wave.server.KuneWaveService;
 import cc.kune.wave.server.KuneWaveUtils;
 import cc.kune.wave.server.ParticipantUtils;
+import cc.kune.wave.server.kspecific.KuneWaveService;
 
 import com.google.inject.Inject;
 import com.google.inject.Singleton;

Deleted: trunk/src/main/java/cc/kune/core/server/manager/impl/SearchResult.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/SearchResult.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/SearchResult.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,62 +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.manager.impl;
-
-import java.util.List;
-
-public class SearchResult<T> {
-    List<T> list;
-    int size;
-
-    public SearchResult() {
-        this(0, null);
-    }
-
-    public SearchResult(final int count, final List<T> list) {
-        this.list = list;
-        this.size = count;
-    }
-
-    public List<T> getList() {
-        return list;
-    }
-
-    /**
-     * Gets the size of total results (may differ from list size).
-     * 
-     * @return the size
-     */
-    public int getSize() {
-        return size;
-    }
-
-    public void setList(final List<T> list) {
-        this.list = list;
-    }
-
-    public void setSize(final int size) {
-        this.size = size;
-    }
-
-    @Override
-    public String toString() {
-        return "SearchResult[(" + getSize() + "): " + list + "]";
-    }
-}

Copied: trunk/src/main/java/cc/kune/core/server/manager/impl/TagUserContentManagerDefault.java (from rev 1655, trunk/src/main/java/cc/kune/core/server/manager/TagUserContentManagerDefault.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/TagUserContentManagerDefault.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/TagUserContentManagerDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,128 @@
+/*
+ *
+ * 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.manager.impl;
+
+import java.util.ArrayList;
+import java.util.List;
+
+import javax.persistence.EntityManager;
+import javax.persistence.NoResultException;
+
+import cc.kune.common.shared.utils.TextUtils;
+import cc.kune.core.server.manager.TagManager;
+import cc.kune.core.server.manager.TagUserContentManager;
+import cc.kune.core.shared.domain.TagCloudResult;
+import cc.kune.core.shared.domain.TagCount;
+import cc.kune.domain.Content;
+import cc.kune.domain.Group;
+import cc.kune.domain.Tag;
+import cc.kune.domain.TagUserContent;
+import cc.kune.domain.User;
+import cc.kune.domain.finders.TagUserContentFinder;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+import com.google.inject.Singleton;
+
+ at Singleton
+public class TagUserContentManagerDefault extends DefaultManager<TagUserContent, Long> implements
+    TagUserContentManager {
+  private final TagUserContentFinder finder;
+  private final Provider<EntityManager> provider;
+  private final TagManager tagManager;
+
+  @Inject
+  public TagUserContentManagerDefault(final Provider<EntityManager> provider,
+      final TagManager tagManager, final TagUserContentFinder finder) {
+    super(provider, TagUserContent.class);
+    this.provider = provider;
+    this.tagManager = tagManager;
+    this.finder = finder;
+  }
+
+  public List<Tag> find(final User user, final Content content) {
+    return finder.findTags(user, content);
+  }
+
+  private int getMaxCount(final Group group) {
+    return finder.getMaxGrouped(group).intValue();
+  }
+
+  private int getMinCount(final Group group) {
+    return finder.getMinGrouped(group).intValue();
+  }
+
+  private List<TagCount> getSummaryByGroup(final Group group) {
+    return finder.getTagsGroups(group);
+  }
+
+  @Override
+  public TagCloudResult getTagCloudResultByGroup(final Group group) {
+    try {
+      return new TagCloudResult(getSummaryByGroup(group), getMaxCount(group), getMinCount(group));
+    } catch (final NoResultException e) {
+      return new TagCloudResult();
+    }
+  }
+
+  @Override
+  public String getTagsAsString(final User user, final Content content) {
+    final StringBuffer tagConcatenated = new StringBuffer();
+    if (user.getId() != null) {
+      // FIXME: User must be persisted (this fails on tests)
+      final List<Tag> tags = find(user, content);
+      for (final Tag tag : tags) {
+        tagConcatenated.append(" ").append(tag.getName());
+      }
+    }
+    return tagConcatenated.toString().replaceFirst(" ", "");
+  }
+
+  @Override
+  public void remove(final User user, final Content content) {
+    for (final TagUserContent item : finder.find(user, content)) {
+      provider.get().remove(item);
+    }
+  }
+
+  @Override
+  public void setTags(final User user, final Content content, final String tags) {
+    final ArrayList<String> tagsStripped = TextUtils.splitTags(tags);
+    final ArrayList<Tag> tagList = new ArrayList<Tag>();
+
+    for (final String tagString : tagsStripped) {
+      Tag tag;
+      try {
+        tag = tagManager.findByTagName(tagString);
+      } catch (final NoResultException e) {
+        tag = new Tag(tagString);
+        tagManager.persist(tag);
+      }
+      if (!tagList.contains(tag)) {
+        tagList.add(tag);
+      }
+    }
+    remove(user, content);
+    for (final Tag tag : tagList) {
+      final TagUserContent tagUserContent = new TagUserContent(tag, user, content);
+      persist(tagUserContent);
+    }
+  }
+}

Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -55,6 +55,7 @@
 import cc.kune.core.server.manager.GroupManager;
 import cc.kune.core.server.manager.I18nCountryManager;
 import cc.kune.core.server.manager.I18nLanguageManager;
+import cc.kune.core.server.manager.SearchResult;
 import cc.kune.core.server.manager.UserManager;
 import cc.kune.core.server.notifier.NotifyService;
 import cc.kune.core.server.properties.ChatProperties;
@@ -72,8 +73,8 @@
 import cc.kune.domain.UserBuddiesData;
 import cc.kune.domain.finders.UserFinder;
 import cc.kune.wave.server.CustomUserRegistrationServlet;
-import cc.kune.wave.server.KuneWaveService;
 import cc.kune.wave.server.ParticipantUtils;
+import cc.kune.wave.server.kspecific.KuneWaveService;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;

Modified: trunk/src/main/java/cc/kune/core/server/mapper/DozerMapper.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/mapper/DozerMapper.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/mapper/DozerMapper.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -24,7 +24,7 @@
 
 import net.sf.dozer.util.mapping.DozerBeanMapperSingletonWrapper;
 import net.sf.dozer.util.mapping.MapperIF;
-import cc.kune.core.server.manager.impl.SearchResult;
+import cc.kune.core.server.manager.SearchResult;
 import cc.kune.core.shared.dto.SearchResultDTO;
 
 import com.google.inject.Singleton;

Modified: trunk/src/main/java/cc/kune/core/server/mapper/Mapper.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/mapper/Mapper.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/mapper/Mapper.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -22,7 +22,7 @@
 import java.util.List;
 
 
-import cc.kune.core.server.manager.impl.SearchResult;
+import cc.kune.core.server.manager.SearchResult;
 import cc.kune.core.shared.dto.SearchResultDTO;
 
 public interface Mapper {

Modified: trunk/src/main/java/cc/kune/core/server/notifier/NotifySenderDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/notifier/NotifySenderDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/notifier/NotifySenderDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -8,14 +8,14 @@
 import org.apache.commons.logging.LogFactory;
 
 import cc.kune.common.shared.utils.TextUtils;
+import cc.kune.core.server.i18n.I18nTranslationServiceMultiLang;
 import cc.kune.core.server.mail.FormatedString;
 import cc.kune.core.server.mail.MailService;
-import cc.kune.core.server.manager.I18nTranslationManager;
 import cc.kune.core.server.properties.KuneProperties;
 import cc.kune.core.server.xmpp.XmppManager;
 import cc.kune.core.shared.domain.dto.EmailNotificationFrequency;
 import cc.kune.domain.User;
-import cc.kune.wave.server.KuneWaveService;
+import cc.kune.wave.server.kspecific.KuneWaveService;
 
 import com.google.common.base.Preconditions;
 import com.google.inject.Inject;
@@ -25,14 +25,14 @@
 public class NotifySenderDefault implements NotifySender {
   public static final Log LOG = LogFactory.getLog(NotifySenderDefault.class);
   private final String emailTemplate;
-  private final I18nTranslationManager i18n;
+  private final I18nTranslationServiceMultiLang i18n;
   private final MailService mailService;
   private final KuneWaveService waveService;
   private final XmppManager xmppManager;
 
   @Inject
   public NotifySenderDefault(final MailService mailService, final KuneWaveService waveService,
-      final XmppManager xmppManager, final I18nTranslationManager i18n,
+      final XmppManager xmppManager, final I18nTranslationServiceMultiLang i18n,
       final KuneProperties kuneProperties) throws IOException {
     this.mailService = mailService;
     this.waveService = waveService;
@@ -51,20 +51,20 @@
       final String username = user.getShortName();
       if (subject.shouldBeTranslated()) {
         // Translate per recipient language
-        final String subjectTranslation = i18n.getTranslation(user.getLanguage().getCode(),
-            subject.getTemplate(), "");
-        if (subjectTranslation != null) {
-          // Right now commented because we are only testing
-          // subject.setTemplate(subjectTranslation);
-        }
+        // final String subjectTranslation = i18n.tWithNT(user.getLanguage(),
+        // subject.getTemplate(), "");
+        // if (subjectTranslation != null) {
+        // Right now commented because we are only testing
+        // subject.setTemplate(subjectTranslation);
+        // }
       }
       if (body.shouldBeTranslated()) {
-        final String bodyTranslation = i18n.getTranslation(user.getLanguage().getCode(),
-            body.getTemplate(), "");
-        if (bodyTranslation != null) {
-          // Right now commented because we are only testing
-          // body.setTemplate(bodyTranslation);
-        }
+        // final String bodyTranslation = i18n.tWithNT(user.getLanguage(),
+        // body.getTemplate(), "");
+        // if (bodyTranslation != null) {
+        // Right now commented because we are only testing
+        // body.setTemplate(bodyTranslation);
+        // }
       }
       switch (notifyType) {
       case chat:

Modified: trunk/src/main/java/cc/kune/core/server/notifier/NotifyService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/notifier/NotifyService.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/notifier/NotifyService.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -33,6 +33,7 @@
     this.userFinder = userFinder;
   }
 
+  @SuppressWarnings("unchecked")
   private void getAllUserMembers(final Set<User> users, final Group groupToNotify,
       final boolean onlyAdmins) {
     final Collection<Group> members;
@@ -60,7 +61,6 @@
 
   }
 
-  @SuppressWarnings("unchecked")
   public void notifyGroup(final Group groupToNotify, final Group groupSender, final String subject,
       final String message) {
     final Set<User> members = new HashSet<User>();

Deleted: trunk/src/main/java/cc/kune/core/server/rack/RackHelper.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rack/RackHelper.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/rack/RackHelper.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,57 +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.rack;
-
-import javax.servlet.ServletRequest;
-import javax.servlet.http.HttpServletRequest;
-
-public final class RackHelper {
-    public static String buildForwardString(final ServletRequest request, final String forward) {
-        String parameters = RackHelper.extractParameters(request);
-        return new StringBuilder(forward).append(parameters).toString();
-    }
-
-    public static String extractParameters(final ServletRequest request) {
-        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
-        String uri = httpServletRequest.getRequestURI();
-        int index = uri.indexOf('?');
-        if (index > 0) {
-            return uri.substring(index);
-        } else {
-            return "";
-        }
-    }
-
-    public static String getRelativeURL(final ServletRequest request) {
-        HttpServletRequest req = (HttpServletRequest) request;
-        String contextPath = req.getContextPath();
-        String uri = req.getRequestURI();
-        return uri.substring(contextPath.length());
-    }
-
-    public static String getURI(final ServletRequest request) {
-        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
-        return httpServletRequest.getRequestURI();
-    }
-
-    private RackHelper() {
-    }
-
-}

Deleted: trunk/src/main/java/cc/kune/core/server/rack/RackServletFilter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rack/RackServletFilter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/rack/RackServletFilter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,192 +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.rack;
-
-import java.io.IOException;
-import java.util.Iterator;
-import java.util.List;
-
-import javax.servlet.Filter;
-import javax.servlet.FilterChain;
-import javax.servlet.FilterConfig;
-import javax.servlet.ServletException;
-import javax.servlet.ServletRequest;
-import javax.servlet.ServletResponse;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.quartz.SchedulerException;
-import org.waveprotocol.box.server.rpc.ServerRpcProvider;
-
-import cc.kune.core.server.error.ServerException;
-import cc.kune.core.server.rack.dock.Dock;
-import cc.kune.core.server.rack.dock.RequestMatcher;
-import cc.kune.core.server.scheduler.CronServerTasksManager;
-import cc.kune.wave.server.WaveEmailNotifier;
-
-import com.google.inject.Injector;
-
-public class RackServletFilter implements Filter {
-  public static class DockChain implements FilterChain {
-    private final Iterator<Dock> iterator;
-
-    public DockChain(final Iterator<Dock> iterator) {
-      this.iterator = iterator;
-    }
-
-    @Override
-    public void doFilter(final ServletRequest request, final ServletResponse response)
-        throws IOException, ServletException {
-      Dock dock = null;
-      boolean matched = false;
-
-      final String relative = RackHelper.getRelativeURL(request);
-      while (!matched && iterator.hasNext()) {
-        dock = iterator.next();
-        matched = dock.matches(relative);
-      }
-      if (matched) {
-        execute(dock.getFilter(), request, response);
-      }
-    }
-
-    private void execute(final Filter filter, final ServletRequest request,
-        final ServletResponse response) throws IOException, ServletException {
-      // log.debug("RACK FILTER: " + filter.getClass().getSimpleName());
-      filter.doFilter(request, response, this);
-    }
-  }
-
-  public static final String INJECTOR_ATTRIBUTE = Injector.class.getName() + "Child";
-  public static final String INJECTOR_PARENT_ATTRIBUTE = ServerRpcProvider.INJECTOR_ATTRIBUTE;
-  private static final Log LOG = LogFactory.getLog(RackServletFilter.class);
-  private static final String MODULE_PARAMETER = RackModule.class.getName();
-  private List<Dock> docks;
-
-  private List<RequestMatcher> excludes;
-  private Injector injector;
-  private Rack rack;
-
-  @Override
-  public void destroy() {
-    for (final Dock dock : docks) {
-      dock.getFilter().destroy();
-    }
-  }
-
-  @Override
-  public void doFilter(final ServletRequest request, final ServletResponse response,
-      final FilterChain chain) throws IOException, ServletException {
-
-    final String relative = RackHelper.getRelativeURL(request);
-    for (final RequestMatcher matcher : excludes) {
-      if (matcher.matches(relative)) {
-        LOG.info("Excluded (from Guice): " + relative);
-        chain.doFilter(request, response);
-        return;
-      }
-    }
-    LOG.debug("REQUEST: " + relative);
-    final FilterChain newChain = new DockChain(docks.iterator());
-    newChain.doFilter(request, response);
-  }
-
-  @Override
-  protected void finalize() throws Throwable {
-    super.finalize();
-    stopContainerListeners(rack.getListeners(), injector);
-  }
-
-  private RackModule getModule(final FilterConfig filterConfig) {
-    final String moduleName = getModuleName(filterConfig);
-    try {
-      final Class<?> clazz = Class.forName(moduleName);
-      final RackModule module = (RackModule) clazz.newInstance();
-      return module;
-    } catch (final Exception e) {
-      throw new ServerException("couldn't instantiate the rack module", e);
-    }
-  }
-
-  private String getModuleName(final FilterConfig filterConfig) {
-    final String moduleName = filterConfig.getInitParameter(MODULE_PARAMETER);
-    if (moduleName == null) {
-      throw new ServerException("Rack module name can't be null!");
-    }
-    return moduleName;
-  }
-
-  @Override
-  public void init(final FilterConfig filterConfig) throws ServletException {
-    LOG.debug("INITIALIZING RackServletFilter...");
-    final RackModule module = getModule(filterConfig);
-    final RackBuilder builder = new RackBuilder();
-    module.configure(builder);
-    rack = builder.getRack();
-    injector = (Injector) filterConfig.getServletContext().getAttribute(INJECTOR_PARENT_ATTRIBUTE);
-    final Injector kuneChildInjector = installInjector(filterConfig, rack, injector);
-    startContainerListeners(rack.getListeners(), kuneChildInjector);
-    docks = rack.getDocks();
-    excludes = rack.getExcludes();
-    initFilters(filterConfig);
-    kuneChildInjector.getInstance(WaveEmailNotifier.class);
-    try {
-      kuneChildInjector.getInstance(CronServerTasksManager.class).start();
-    } catch (final SchedulerException e) {
-      LOG.error("Error starting cron scheduler", e);
-    }
-    LOG.debug("INITIALIZATION DONE!");
-  }
-
-  private void initFilters(final FilterConfig filterConfig) throws ServletException {
-    for (final Dock dock : docks) {
-      dock.getFilter().init(filterConfig);
-    }
-  }
-
-  private Injector installInjector(final FilterConfig filterConfig, final Rack rack,
-      final Injector waveChildInjector) {
-    // final Injector injector = Guice.createInjector();
-    final Injector childInjector = waveChildInjector.createChildInjector(rack.getGuiceModules());
-    filterConfig.getServletContext().setAttribute(INJECTOR_ATTRIBUTE, childInjector);
-    return childInjector;
-  }
-
-  private void startContainerListeners(final List<Class<? extends ContainerListener>> listenerClasses,
-      final Injector injector) {
-    LOG.debug("STARTING CONTAINER LISTENERS...");
-    for (final Class<? extends ContainerListener> listenerClass : listenerClasses) {
-      final ContainerListener listener = injector.getInstance(listenerClass);
-      listener.start();
-    }
-  }
-
-  // FIXME: Dani, never used this:
-  @SuppressWarnings("unused")
-  private void stopContainerListeners(final List<Class<? extends ContainerListener>> listenerClasses,
-      final Injector injector) {
-    LOG.debug("STOPING CONTAINER LISTENERS...");
-    for (final Class<? extends ContainerListener> listenerClass : listenerClasses) {
-      final ContainerListener listener = injector.getInstance(listenerClass);
-      listener.stop();
-    }
-  }
-
-}

Added: trunk/src/main/java/cc/kune/core/server/rack/RackServletFilter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rack/RackServletFilter.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/rack/RackServletFilter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,191 @@
+/*
+ *
+ * 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.rack;
+
+import java.io.IOException;
+import java.util.Iterator;
+import java.util.List;
+
+import javax.servlet.Filter;
+import javax.servlet.FilterChain;
+import javax.servlet.FilterConfig;
+import javax.servlet.ServletException;
+import javax.servlet.ServletRequest;
+import javax.servlet.ServletResponse;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.quartz.SchedulerException;
+import org.waveprotocol.box.server.rpc.ServerRpcProvider;
+
+import cc.kune.core.server.error.ServerException;
+import cc.kune.core.server.rack.dock.Dock;
+import cc.kune.core.server.rack.dock.RequestMatcher;
+import cc.kune.core.server.rack.utils.RackHelper;
+import cc.kune.core.server.scheduler.CronServerTasksManager;
+import cc.kune.wave.server.kspecific.WaveEmailNotifier;
+
+import com.google.inject.Injector;
+
+public class RackServletFilter implements Filter {
+  public static class DockChain implements FilterChain {
+    private final Iterator<Dock> iterator;
+
+    public DockChain(final Iterator<Dock> iterator) {
+      this.iterator = iterator;
+    }
+
+    @Override
+    public void doFilter(final ServletRequest request, final ServletResponse response)
+        throws IOException, ServletException {
+      Dock dock = null;
+      boolean matched = false;
+
+      final String relative = RackHelper.getRelativeURL(request);
+      while (!matched && iterator.hasNext()) {
+        dock = iterator.next();
+        matched = dock.matches(relative);
+      }
+      if (matched) {
+        execute(dock.getFilter(), request, response);
+      }
+    }
+
+    private void execute(final Filter filter, final ServletRequest request,
+        final ServletResponse response) throws IOException, ServletException {
+      // log.debug("RACK FILTER: " + filter.getClass().getSimpleName());
+      filter.doFilter(request, response, this);
+    }
+  }
+
+  public static final String INJECTOR_ATTRIBUTE = Injector.class.getName() + "Child";
+  public static final String INJECTOR_PARENT_ATTRIBUTE = ServerRpcProvider.INJECTOR_ATTRIBUTE;
+  private static final Log LOG = LogFactory.getLog(RackServletFilter.class);
+  private static final String MODULE_PARAMETER = RackModule.class.getName();
+  private List<Dock> docks;
+
+  private List<RequestMatcher> excludes;
+  private Injector injector;
+  private Rack rack;
+
+  @Override
+  public void destroy() {
+    for (final Dock dock : docks) {
+      dock.getFilter().destroy();
+    }
+  }
+
+  @Override
+  public void doFilter(final ServletRequest request, final ServletResponse response,
+      final FilterChain chain) throws IOException, ServletException {
+
+    final String relative = RackHelper.getRelativeURL(request);
+    for (final RequestMatcher matcher : excludes) {
+      if (matcher.matches(relative)) {
+        LOG.info("Excluded (from Guice): " + relative);
+        chain.doFilter(request, response);
+        return;
+      }
+    }
+    LOG.debug("REQUEST: " + relative);
+    final FilterChain newChain = new DockChain(docks.iterator());
+    newChain.doFilter(request, response);
+  }
+
+  @Override
+  protected void finalize() throws Throwable {
+    super.finalize();
+    stopContainerListeners(rack.getListeners(), injector);
+  }
+
+  private RackModule getModule(final FilterConfig filterConfig) {
+    final String moduleName = getModuleName(filterConfig);
+    try {
+      final Class<?> clazz = Class.forName(moduleName);
+      final RackModule module = (RackModule) clazz.newInstance();
+      return module;
+    } catch (final Exception e) {
+      throw new ServerException("couldn't instantiate the rack module", e);
+    }
+  }
+
+  private String getModuleName(final FilterConfig filterConfig) {
+    final String moduleName = filterConfig.getInitParameter(MODULE_PARAMETER);
+    if (moduleName == null) {
+      throw new ServerException("Rack module name can't be null!");
+    }
+    return moduleName;
+  }
+
+  @Override
+  public void init(final FilterConfig filterConfig) throws ServletException {
+    LOG.debug("INITIALIZING RackServletFilter...");
+    final RackModule module = getModule(filterConfig);
+    final RackBuilder builder = new RackBuilder();
+    module.configure(builder);
+    rack = builder.getRack();
+    injector = (Injector) filterConfig.getServletContext().getAttribute(INJECTOR_PARENT_ATTRIBUTE);
+    final Injector kuneChildInjector = installInjector(filterConfig, rack, injector);
+    startContainerListeners(rack.getListeners(), kuneChildInjector);
+    docks = rack.getDocks();
+    excludes = rack.getExcludes();
+    initFilters(filterConfig);
+    kuneChildInjector.getInstance(WaveEmailNotifier.class);
+    try {
+      kuneChildInjector.getInstance(CronServerTasksManager.class).start();
+    } catch (final SchedulerException e) {
+      LOG.error("Error starting cron scheduler", e);
+    }
+    LOG.debug("INITIALIZATION DONE!");
+  }
+
+  private void initFilters(final FilterConfig filterConfig) throws ServletException {
+    for (final Dock dock : docks) {
+      dock.getFilter().init(filterConfig);
+    }
+  }
+
+  private Injector installInjector(final FilterConfig filterConfig, final Rack rack,
+      final Injector waveChildInjector) {
+    // final Injector injector = Guice.createInjector();
+    final Injector childInjector = waveChildInjector.createChildInjector(rack.getGuiceModules());
+    filterConfig.getServletContext().setAttribute(INJECTOR_ATTRIBUTE, childInjector);
+    return childInjector;
+  }
+
+  private void startContainerListeners(final List<Class<? extends ContainerListener>> listenerClasses,
+      final Injector injector) {
+    LOG.debug("STARTING CONTAINER LISTENERS...");
+    for (final Class<? extends ContainerListener> listenerClass : listenerClasses) {
+      final ContainerListener listener = injector.getInstance(listenerClass);
+      listener.start();
+    }
+  }
+
+  private void stopContainerListeners(final List<Class<? extends ContainerListener>> listenerClasses,
+      final Injector injector) {
+    LOG.debug("STOPING CONTAINER LISTENERS...");
+    for (final Class<? extends ContainerListener> listenerClass : listenerClasses) {
+      final ContainerListener listener = injector.getInstance(listenerClass);
+      listener.stop();
+    }
+  }
+
+}

Modified: trunk/src/main/java/cc/kune/core/server/rack/filters/AbstractInjectedFilter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rack/filters/AbstractInjectedFilter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/rack/filters/AbstractInjectedFilter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -31,23 +31,23 @@
 
 public abstract class AbstractInjectedFilter implements Filter {
 
-    protected ServletContext ctx;
+  protected ServletContext ctx;
 
-    @Override
-    public abstract void destroy();
+  @Override
+  public abstract void destroy();
 
-    public <T> T getInstance(final Class<T> type) {
-        return getInjector().getInstance(type);
-    }
+  private Injector getInjector() {
+    return (Injector) ctx.getAttribute(RackServletFilter.INJECTOR_ATTRIBUTE);
+  }
 
-    @Override
-    public void init(final FilterConfig filterConfig) throws ServletException {
-        this.ctx = filterConfig.getServletContext();
-        getInjector().injectMembers(this);
-    }
+  public <T> T getInstance(final Class<T> type) {
+    return getInjector().getInstance(type);
+  }
 
-    private Injector getInjector() {
-        return (Injector) ctx.getAttribute(RackServletFilter.INJECTOR_ATTRIBUTE);
-    }
+  @Override
+  public void init(final FilterConfig filterConfig) throws ServletException {
+    this.ctx = filterConfig.getServletContext();
+    getInjector().injectMembers(this);
+  }
 
 }

Modified: trunk/src/main/java/cc/kune/core/server/rack/filters/ForwardFilter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rack/filters/ForwardFilter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/rack/filters/ForwardFilter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -29,7 +29,7 @@
 import javax.servlet.ServletResponse;
 import javax.servlet.http.HttpServletRequest;
 
-import cc.kune.core.server.rack.RackHelper;
+import cc.kune.core.server.rack.utils.RackHelper;
 
 public class ForwardFilter extends AbstractInjectedFilter {
     // private static final Log log = LogFactory.getLog(ForwardFilter.class);

Modified: trunk/src/main/java/cc/kune/core/server/rack/filters/LogFilter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rack/filters/LogFilter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/rack/filters/LogFilter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -31,7 +31,7 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import cc.kune.core.server.rack.RackHelper;
+import cc.kune.core.server.rack.utils.RackHelper;
 
 public class LogFilter implements Filter {
   public static final Log LOG = LogFactory.getLog(LogFilter.class);

Modified: trunk/src/main/java/cc/kune/core/server/rack/filters/gwts/GWTServiceFilter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rack/filters/gwts/GWTServiceFilter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/rack/filters/gwts/GWTServiceFilter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -32,8 +32,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import cc.kune.core.server.rack.RackHelper;
 import cc.kune.core.server.rack.filters.AbstractInjectedFilter;
+import cc.kune.core.server.rack.utils.RackHelper;
 
 import com.google.gwt.user.client.rpc.RemoteService;
 

Modified: trunk/src/main/java/cc/kune/core/server/rack/filters/rest/RESTServiceFilter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rack/filters/rest/RESTServiceFilter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/rack/filters/rest/RESTServiceFilter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -32,8 +32,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import cc.kune.core.server.rack.RackHelper;
 import cc.kune.core.server.rack.filters.AbstractInjectedFilter;
+import cc.kune.core.server.rack.utils.RackHelper;
 
 import com.google.inject.Inject;
 

Modified: trunk/src/main/java/cc/kune/core/server/rack/filters/servlet/ServletServiceFilter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rack/filters/servlet/ServletServiceFilter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/rack/filters/servlet/ServletServiceFilter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -31,8 +31,8 @@
 import org.apache.commons.logging.Log;
 import org.apache.commons.logging.LogFactory;
 
-import cc.kune.core.server.rack.RackHelper;
 import cc.kune.core.server.rack.filters.AbstractInjectedFilter;
+import cc.kune.core.server.rack.utils.RackHelper;
 
 public class ServletServiceFilter extends AbstractInjectedFilter {
     Log log = LogFactory.getLog(ServletServiceFilter.class);

Copied: trunk/src/main/java/cc/kune/core/server/rack/utils/RackHelper.java (from rev 1655, trunk/src/main/java/cc/kune/core/server/rack/RackHelper.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rack/utils/RackHelper.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/rack/utils/RackHelper.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,57 @@
+/*
+ *
+ * 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.rack.utils;
+
+import javax.servlet.ServletRequest;
+import javax.servlet.http.HttpServletRequest;
+
+public final class RackHelper {
+    public static String buildForwardString(final ServletRequest request, final String forward) {
+        String parameters = RackHelper.extractParameters(request);
+        return new StringBuilder(forward).append(parameters).toString();
+    }
+
+    public static String extractParameters(final ServletRequest request) {
+        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
+        String uri = httpServletRequest.getRequestURI();
+        int index = uri.indexOf('?');
+        if (index > 0) {
+            return uri.substring(index);
+        } else {
+            return "";
+        }
+    }
+
+    public static String getRelativeURL(final ServletRequest request) {
+        HttpServletRequest req = (HttpServletRequest) request;
+        String contextPath = req.getContextPath();
+        String uri = req.getRequestURI();
+        return uri.substring(contextPath.length());
+    }
+
+    public static String getURI(final ServletRequest request) {
+        HttpServletRequest httpServletRequest = (HttpServletRequest) request;
+        return httpServletRequest.getRequestURI();
+    }
+
+    private RackHelper() {
+    }
+
+}

Modified: trunk/src/main/java/cc/kune/core/server/rest/ContentJSONService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rest/ContentJSONService.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/rest/ContentJSONService.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -22,7 +22,7 @@
 
 import cc.kune.core.server.content.ContainerManager;
 import cc.kune.core.server.content.ContentManager;
-import cc.kune.core.server.manager.impl.SearchResult;
+import cc.kune.core.server.manager.SearchResult;
 import cc.kune.core.server.mapper.Mapper;
 import cc.kune.core.server.rack.filters.rest.REST;
 import cc.kune.core.shared.SearcherConstants;

Modified: trunk/src/main/java/cc/kune/core/server/rest/GroupJSONService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rest/GroupJSONService.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/rest/GroupJSONService.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -21,7 +21,7 @@
 
 
 import cc.kune.core.server.manager.GroupManager;
-import cc.kune.core.server.manager.impl.SearchResult;
+import cc.kune.core.server.manager.SearchResult;
 import cc.kune.core.server.mapper.Mapper;
 import cc.kune.core.server.rack.filters.rest.REST;
 import cc.kune.core.shared.SearcherConstants;

Modified: trunk/src/main/java/cc/kune/core/server/rest/UserJSONService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rest/UserJSONService.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/rest/UserJSONService.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,8 +20,8 @@
 package cc.kune.core.server.rest;
 
 
+import cc.kune.core.server.manager.SearchResult;
 import cc.kune.core.server.manager.UserManager;
-import cc.kune.core.server.manager.impl.SearchResult;
 import cc.kune.core.server.mapper.Mapper;
 import cc.kune.core.server.rack.filters.rest.REST;
 import cc.kune.core.shared.SearcherConstants;

Modified: trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/core/server/state/StateServiceDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -35,7 +35,7 @@
 import cc.kune.domain.License;
 import cc.kune.domain.Revision;
 import cc.kune.domain.User;
-import cc.kune.wave.server.KuneWaveService;
+import cc.kune.wave.server.kspecific.KuneWaveService;
 
 import com.google.inject.Inject;
 import com.google.inject.Singleton;

Modified: trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/events/client/viewer/CalendarViewerPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -10,9 +10,9 @@
 import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.events.client.viewer.CalendarViewerPresenter.CalendarViewerView;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 import cc.kune.gspace.client.viewers.AbstractFolderViewerPanel;
-import cc.kune.gspace.client.viewers.FolderItemDescriptor;
+import cc.kune.gspace.client.viewers.items.FolderItemDescriptor;
 
 import com.bradrydzewski.gwt.calendar.client.Appointment;
 import com.bradrydzewski.gwt.calendar.client.AppointmentStyle;

Deleted: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -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 cc.kune.gspace.client;
-
-import cc.kune.common.client.actions.ui.IsActionExtensible;
-
-import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
-import com.google.gwt.user.client.ui.IsWidget;
-import com.google.gwt.user.client.ui.SimplePanel;
-
-public interface GSpaceArmor {
-
-  void clearBackImage();
-
-  void enableCenterScroll(boolean enable);
-
-  ForIsWidget getDocContainer();
-
-  ForIsWidget getDocFooter();
-
-  IsActionExtensible getDocFooterToolbar();
-
-  ForIsWidget getDocHeader();
-
-  ForIsWidget getDocSubheader();
-
-  ForIsWidget getEntityFooter();
-
-  IsActionExtensible getEntityFooterToolbar();
-
-  ForIsWidget getEntityHeader();
-
-  ForIsWidget getEntityToolsCenter();
-
-  ForIsWidget getEntityToolsNorth();
-
-  ForIsWidget getEntityToolsSouth();
-
-  IsActionExtensible getHeaderToolbar();
-
-  SimplePanel getHomeSpace();
-
-  IsWidget getMainpanel();
-
-  SimplePanel getPublicSpace();
-
-  ForIsWidget getSitebar();
-
-  IsActionExtensible getSubheaderToolbar();
-
-  IsActionExtensible getToolsSouthToolbar();
-
-  ForIsWidget getUserSpace();
-
-  void selectGroupSpace();
-
-  void selectHomeSpace();
-
-  void selectPublicSpace();
-
-  void selectUserSpace();
-
-  void setBackImage(String url);
-
-  void setContentVisible(boolean visible);
-}
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorEntryPoint.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorEntryPoint.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorEntryPoint.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -19,7 +19,8 @@
  */
 package cc.kune.gspace.client;
 
-import cc.kune.gspace.client.resources.GSpaceArmorResources;
+import cc.kune.gspace.client.armor.impl.GSpaceArmorImpl;
+import cc.kune.gspace.client.armor.resources.GSpaceArmorResources;
 
 import com.google.gwt.core.client.EntryPoint;
 import com.google.gwt.core.client.GWT;

Deleted: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,277 +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.gspace.client;
-
-import org.cobogw.gwt.user.client.CSS;
-
-import cc.kune.common.client.actions.ui.ActionFlowPanel;
-import cc.kune.common.client.actions.ui.IsActionExtensible;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.dom.client.Style.Overflow;
-import com.google.gwt.dom.client.Style.Position;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.user.client.DOM;
-import com.google.gwt.user.client.Element;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.DockLayoutPanel;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
-import com.google.gwt.user.client.ui.IsWidget;
-import com.google.gwt.user.client.ui.ScrollPanel;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.SplitLayoutPanel;
-import com.google.gwt.user.client.ui.TabLayoutPanel;
-import com.google.gwt.user.client.ui.Widget;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
-public class GSpaceArmorImpl extends Composite implements GSpaceArmor {
-
-  interface WsArmorImplUiBinder extends UiBinder<Widget, GSpaceArmorImpl> {
-  }
-
-  private static WsArmorImplUiBinder uiBinder = GWT.create(WsArmorImplUiBinder.class);
-
-  @UiField
-  ScrollPanel centerScroll;
-  @UiField
-  FlowPanel docContainer;
-  @UiField
-  DockLayoutPanel docContainerParent;
-  @UiField
-  FlowPanel docFooter;
-  private final ActionFlowPanel docFooterToolbar;
-  @UiField
-  FlowPanel docHeader;
-  @UiField
-  FlowPanel docSubheader;
-  @UiField
-  FlowPanel entityFooter;
-  private final ActionFlowPanel entityFooterToolbar;
-  @UiField
-  FlowPanel entityHeader;
-  @UiField
-  FlowPanel entityToolsCenter;
-  @UiField
-  FlowPanel entityToolsContainer;
-  @UiField
-  FlowPanel entityToolsNorth;
-  @UiField
-  FlowPanel entityToolsSouth;
-  @UiField
-  SplitLayoutPanel groupSpace;
-  @UiField
-  SimplePanel groupSpaceWrapper;
-  private final ActionFlowPanel headerToolbar;
-  @UiField
-  SimplePanel homeSpace;
-  @UiField
-  DockLayoutPanel mainpanel;
-  @UiField
-  SimplePanel publicSpace;
-  @UiField
-  FlowPanel sitebar;
-  @UiField
-  DockLayoutPanel splitCenter;
-  @UiField
-  DockLayoutPanel splitEast;
-  private final ActionFlowPanel subheaderToolbar;
-  @UiField
-  TabLayoutPanel tabs;
-  private final ActionFlowPanel toolsSouthToolbar;
-  @UiField
-  FlowPanel userSpace;
-
-  @Inject
-  public GSpaceArmorImpl(final Provider<ActionFlowPanel> toolbarProv) {
-    initWidget(uiBinder.createAndBindUi(this));
-    groupSpace.setWidgetMinSize(splitEast, 150);
-    DOM.setStyleAttribute((Element) groupSpace.getWidgetContainerElement(splitEast), "overflow",
-        "visible");
-    DOM.setStyleAttribute((Element) splitEast.getWidgetContainerElement(entityToolsContainer),
-        "overflow", "visible");
-    docFooterToolbar = toolbarProv.get();
-    headerToolbar = toolbarProv.get();
-    subheaderToolbar = toolbarProv.get();
-    toolsSouthToolbar = toolbarProv.get();
-    entityFooterToolbar = toolbarProv.get();
-    getDocHeader().add(headerToolbar);
-    getDocSubheader().add(subheaderToolbar);
-    getDocFooter().add(docFooterToolbar);
-    getEntityToolsSouth().add(toolsSouthToolbar);
-    getEntityFooter().add(entityFooterToolbar);
-    entityToolsNorth.getElement().getStyle().setPosition(Position.RELATIVE);
-    // entityToolsSouth.setVisible(false);
-    mainpanel.getWidgetContainerElement(tabs).addClassName("k-spaces");
-    enableCenterScroll(true);
-  }
-
-  @Override
-  public void clearBackImage() {
-    final String bodyProp = "#FFFFFF";
-    DOM.setStyleAttribute(groupSpaceWrapper.getElement(), CSS.A.BACKGROUND, bodyProp);
-  }
-
-  @Override
-  public void enableCenterScroll(final boolean enable) {
-    // TODO use here Element.getStyle()...
-    if (enable) {
-      centerScroll.setAlwaysShowScrollBars(false);
-      DOM.setStyleAttribute(centerScroll.getElement(), "position", "absolute");
-      DOM.setStyleAttribute((Element) centerScroll.getElement().getFirstChildElement(), "position",
-          "relative");
-    } else {
-      centerScroll.getElement().getStyle().setOverflow(Overflow.HIDDEN);
-      DOM.setStyleAttribute(centerScroll.getElement(), "position", "");
-      DOM.setStyleAttribute((Element) centerScroll.getElement().getFirstChildElement(), "position", "");
-    }
-  }
-
-  @Override
-  public ForIsWidget getDocContainer() {
-    return docContainer;
-  }
-
-  @Override
-  public ForIsWidget getDocFooter() {
-    return docFooter;
-  }
-
-  @Override
-  public IsActionExtensible getDocFooterToolbar() {
-    return docFooterToolbar;
-  }
-
-  @Override
-  public ForIsWidget getDocHeader() {
-    return docHeader;
-  }
-
-  @Override
-  public ForIsWidget getDocSubheader() {
-    return docSubheader;
-  }
-
-  @Override
-  public ForIsWidget getEntityFooter() {
-    return entityFooter;
-  }
-
-  @Override
-  public IsActionExtensible getEntityFooterToolbar() {
-    return entityFooterToolbar;
-  }
-
-  @Override
-  public ForIsWidget getEntityHeader() {
-    return entityHeader;
-  }
-
-  @Override
-  public ForIsWidget getEntityToolsCenter() {
-    return entityToolsCenter;
-  }
-
-  @Override
-  public ForIsWidget getEntityToolsNorth() {
-    return entityToolsNorth;
-  }
-
-  @Override
-  public ForIsWidget getEntityToolsSouth() {
-    return entityToolsSouth;
-  }
-
-  @Override
-  public IsActionExtensible getHeaderToolbar() {
-    return headerToolbar;
-  }
-
-  @Override
-  public SimplePanel getHomeSpace() {
-    return homeSpace;
-  }
-
-  @Override
-  public IsWidget getMainpanel() {
-    return mainpanel;
-  }
-
-  @Override
-  public SimplePanel getPublicSpace() {
-    return publicSpace;
-  }
-
-  @Override
-  public ForIsWidget getSitebar() {
-    return sitebar;
-  }
-
-  @Override
-  public IsActionExtensible getSubheaderToolbar() {
-    return subheaderToolbar;
-  }
-
-  @Override
-  public IsActionExtensible getToolsSouthToolbar() {
-    return toolsSouthToolbar;
-  }
-
-  @Override
-  public ForIsWidget getUserSpace() {
-    return userSpace;
-  }
-
-  @Override
-  public void selectGroupSpace() {
-    tabs.selectTab(groupSpaceWrapper);
-  }
-
-  @Override
-  public void selectHomeSpace() {
-    tabs.selectTab(homeSpace);
-  }
-
-  @Override
-  public void selectPublicSpace() {
-    tabs.selectTab(publicSpace);
-  }
-
-  @Override
-  public void selectUserSpace() {
-    tabs.selectTab(userSpace);
-  }
-
-  @Override
-  public void setBackImage(final String url) {
-    final String bodyProp = "#FFFFFF url('" + url + "') fixed top left";
-    DOM.setStyleAttribute(groupSpaceWrapper.getElement(), CSS.A.BACKGROUND, bodyProp);
-  }
-
-  @Override
-  public void setContentVisible(final boolean visible) {
-    // FIXME: remove this?
-    // NotifyUser.info("Visible: " + visible);
-    // docContainer.getElement().getStyle().setOpacity(visible ? 1d : .0d);
-    // docFooter.getElement().getStyle().setOpacity(visible ? 1d : .0d);
-  }
-}

Deleted: trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,126 +0,0 @@
-<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
-<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
-  xmlns:co="urn:import:cc.kune.core.client" xmlns:kp="urn:import:cc.kune.pspace.client"
-  xmlns:g="urn:import:com.google.gwt.user.client.ui">
-  <ui:with field='res'
-    type='cc.kune.gspace.client.resources.GSpaceArmorResources'/>
-  <ui:style>
-    .frame {
-      border: 0px;
-      margin: 0px;
-    }
-  </ui:style>
-  <g:DockLayoutPanel ui:field="mainpanel" styleName='{res.style.mainPanel}'
-    unit="PX">
-    <g:north size="23">
-      <g:FlowPanel ui:field="sitebar" height="23px"
-        styleName='{res.style.siteBar}'>
-      </g:FlowPanel>
-    </g:north>
-    <g:center>
-      <g:TabLayoutPanel width="100%" height="100%"
-        barUnit='PX' barHeight='0' ui:field="tabs">
-        <g:tab>
-          <g:header size='0'/>
-          <g:SimplePanel styleName="k-space" ui:field="homeSpace"
-            width="100%" height="100%"></g:SimplePanel>
-        </g:tab>
-        <g:tab>
-          <g:header size='0'/>
-          <g:FlowPanel ui:field="userSpace" styleName="k-space"
-            width="100%" height="100%">
-            <!-- <g:Frame url="/" styleName="{style.frame}" -->
-            <!-- ui:field="frame" width="100%" height="100%" /> -->
-          </g:FlowPanel>
-        </g:tab>
-        <g:tab>
-          <g:header size='0'/>
-          <g:SimplePanel ui:field="groupSpaceWrapper"
-            styleName="k-group-space">
-            <g:SplitLayoutPanel width="100%" height="100%"
-              styleName="k-space" ui:field="groupSpace">
-              <g:center size="1.0">
-                <g:DockLayoutPanel unit="PX" ui:field="splitCenter"
-                  styleName="{res.style.entityCentralContainer}">
-                  <g:north size="153">
-                    <g:VerticalPanel width="100%"
-                      height="153px">
-                      <g:FlowPanel height="70px" width="100%"
-                        styleName="{res.style.entityHeader}" ui:field="entityHeader">
-                        <!--<g:RichTextArea width="100%" height="70px" /> -->
-                      </g:FlowPanel>
-                      <g:FlowPanel width="100%" height="38px"
-                        styleName="{res.style.docHeader}" ui:field="docHeader">
-                      </g:FlowPanel>
-                      <g:HTMLPanel ui:field="arrow"
-                        styleName="{res.style.docSubheaderArrow}"/>
-                      <g:FlowPanel width="100%" height="45px"
-                        styleName="{res.style.docSubheader}" ui:field="docSubheader">
-                      </g:FlowPanel>
-                    </g:VerticalPanel>
-                  </g:north>
-                  <g:center>
-                    <g:DockLayoutPanel unit="PX"
-                      styleName="{res.style.docEditorMargin}" ui:field="docContainerParent">
-                      <g:west size="10">
-                        <g:SimplePanel/>
-                      </g:west>
-                      <g:east size="10">
-                        <g:SimplePanel/>
-                      </g:east>
-                      <g:center>
-                        <g:ScrollPanel ui:field="centerScroll"
-                          styleName="{res.style.docEditor}">
-                          <g:FlowPanel width="auto" height="auto"
-                            styleName="{res.style.docEditorContainer}"
-                            ui:field="docContainer"/>
-                        </g:ScrollPanel>
-                      </g:center>
-                      <g:south size="33.0">
-                        <g:VerticalPanel height="33px"
-                          width="100%" styleName="{res.style.docFooter}">
-                          <g:FlowPanel width="100%" height="33"
-                            ui:field="docFooter">
-                          </g:FlowPanel>
-                        </g:VerticalPanel>
-                      </g:south>
-                    </g:DockLayoutPanel>
-                  </g:center>
-                  <g:south size="36">
-                    <g:FlowPanel height="36px" width="100%"
-                      styleName="{res.style.entityFooter}" ui:field="entityFooter">
-                    </g:FlowPanel>
-                  </g:south>
-                </g:DockLayoutPanel>
-              </g:center>
-              <!-- east to RTL (plus css changes in corners and menus) -->
-              <g:west size="200.0">
-                <g:DockLayoutPanel unit="PX"
-                  styleName="{res.style.entityTools}" ui:field="splitEast">
-                  <g:center>
-                    <g:FlowPanel ui:field="entityToolsContainer">
-                      <g:FlowPanel width="100%" ui:field="entityToolsNorth"
-                        styleName="{res.style.entityToolsNorth}"></g:FlowPanel>
-                      <g:FlowPanel width="100%" ui:field="entityToolsCenter"
-                        styleName="{res.style.entityToolsCenter}">
-                      </g:FlowPanel>
-                    </g:FlowPanel>
-                  </g:center>
-                  <g:south size="98">
-                    <g:FlowPanel styleName="{res.style.entityToolsSouth}"
-                      ui:field="entityToolsSouth" width="100%"/>
-                  </g:south>
-                </g:DockLayoutPanel>
-              </g:west>
-            </g:SplitLayoutPanel>
-          </g:SimplePanel>
-        </g:tab>
-        <g:tab>
-          <g:header size='0'/>
-          <g:SimplePanel ui:field="publicSpace" width="100%"
-            styleName="k-space" height="100%"></g:SimplePanel>
-        </g:tab>
-      </g:TabLayoutPanel>
-    </g:center>
-  </g:DockLayoutPanel>
-</ui:UiBinder>
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -26,6 +26,8 @@
 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.armor.GSpaceArmor;
+import cc.kune.gspace.client.armor.impl.GSpaceArmorImpl;
 import cc.kune.gspace.client.i18n.I18nTranslator;
 import cc.kune.gspace.client.i18n.I18nTranslatorPanel;
 import cc.kune.gspace.client.i18n.I18nTranslatorPresenter;

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -19,8 +19,8 @@
  */
 package cc.kune.gspace.client;
 
-import cc.kune.core.client.init.AppStartEvent;
-import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.sitebar.search.SitebarSearchPresenter;
 import cc.kune.core.client.sn.actions.WriteToBuddyHeaderButton;
 import cc.kune.core.client.state.HistoryTokenCallback;

Modified: trunk/src/main/java/cc/kune/gspace/client/actions/AbstractEditorsMenu.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AbstractEditorsMenu.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AbstractEditorsMenu.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,8 +20,8 @@
 package cc.kune.gspace.client.actions;
 
 import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
-import cc.kune.core.client.state.AccessRightsChangedEvent;
-import cc.kune.core.client.state.AccessRightsChangedEvent.AccessRightsChangedHandler;
+import cc.kune.core.client.events.AccessRightsChangedEvent;
+import cc.kune.core.client.events.AccessRightsChangedEvent.AccessRightsChangedHandler;
 import cc.kune.core.client.state.AccessRightsClientManager;
 
 public class AbstractEditorsMenu extends MenuDescriptor {

Modified: trunk/src/main/java/cc/kune/gspace/client/actions/AbstractFoldableToolActions.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/AbstractFoldableToolActions.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/AbstractFoldableToolActions.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,9 +20,9 @@
 package cc.kune.gspace.client.actions;
 
 import cc.kune.core.client.actions.ActionRegistryByType;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
-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.StateManager;
 

Modified: trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackBtn.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackBtn.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/GiveUsFeedbackBtn.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -22,7 +22,7 @@
 import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.resources.nav.NavResources;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 
 import com.google.inject.Inject;
 

Modified: trunk/src/main/java/cc/kune/gspace/client/actions/GotoTokenAction.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/GotoTokenAction.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/GotoTokenAction.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -23,8 +23,8 @@
 import cc.kune.common.client.actions.Action;
 import cc.kune.common.client.actions.ActionEvent;
 import cc.kune.core.client.events.RenameContentEvent;
-import cc.kune.core.client.state.SocialNetworkChangedEvent;
-import cc.kune.core.client.state.SocialNetworkChangedEvent.SocialNetworkChangedHandler;
+import cc.kune.core.client.events.SocialNetworkChangedEvent;
+import cc.kune.core.client.events.SocialNetworkChangedEvent.SocialNetworkChangedHandler;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.domain.utils.StateToken;
 

Copied: trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmor.java (from rev 1655, trunk/src/main/java/cc/kune/gspace/client/GSpaceArmor.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmor.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/armor/GSpaceArmor.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,83 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.armor;
+
+import cc.kune.common.client.actions.ui.IsActionExtensible;
+
+import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.gwt.user.client.ui.SimplePanel;
+
+public interface GSpaceArmor {
+
+  void clearBackImage();
+
+  void enableCenterScroll(boolean enable);
+
+  ForIsWidget getDocContainer();
+
+  ForIsWidget getDocFooter();
+
+  IsActionExtensible getDocFooterToolbar();
+
+  ForIsWidget getDocHeader();
+
+  ForIsWidget getDocSubheader();
+
+  ForIsWidget getEntityFooter();
+
+  IsActionExtensible getEntityFooterToolbar();
+
+  ForIsWidget getEntityHeader();
+
+  ForIsWidget getEntityToolsCenter();
+
+  ForIsWidget getEntityToolsNorth();
+
+  ForIsWidget getEntityToolsSouth();
+
+  IsActionExtensible getHeaderToolbar();
+
+  SimplePanel getHomeSpace();
+
+  IsWidget getMainpanel();
+
+  SimplePanel getPublicSpace();
+
+  ForIsWidget getSitebar();
+
+  IsActionExtensible getSubheaderToolbar();
+
+  IsActionExtensible getToolsSouthToolbar();
+
+  ForIsWidget getUserSpace();
+
+  void selectGroupSpace();
+
+  void selectHomeSpace();
+
+  void selectPublicSpace();
+
+  void selectUserSpace();
+
+  void setBackImage(String url);
+
+  void setContentVisible(boolean visible);
+}
\ No newline at end of file

Copied: trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.java (from rev 1655, trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,278 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.armor.impl;
+
+import org.cobogw.gwt.user.client.CSS;
+
+import cc.kune.common.client.actions.ui.ActionFlowPanel;
+import cc.kune.common.client.actions.ui.IsActionExtensible;
+import cc.kune.gspace.client.armor.GSpaceArmor;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.dom.client.Style.Overflow;
+import com.google.gwt.dom.client.Style.Position;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.user.client.DOM;
+import com.google.gwt.user.client.Element;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.DockLayoutPanel;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.InsertPanel.ForIsWidget;
+import com.google.gwt.user.client.ui.IsWidget;
+import com.google.gwt.user.client.ui.ScrollPanel;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.SplitLayoutPanel;
+import com.google.gwt.user.client.ui.TabLayoutPanel;
+import com.google.gwt.user.client.ui.Widget;
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class GSpaceArmorImpl extends Composite implements GSpaceArmor {
+
+  interface WsArmorImplUiBinder extends UiBinder<Widget, GSpaceArmorImpl> {
+  }
+
+  private static WsArmorImplUiBinder uiBinder = GWT.create(WsArmorImplUiBinder.class);
+
+  @UiField
+  ScrollPanel centerScroll;
+  @UiField
+  FlowPanel docContainer;
+  @UiField
+  DockLayoutPanel docContainerParent;
+  @UiField
+  FlowPanel docFooter;
+  private final ActionFlowPanel docFooterToolbar;
+  @UiField
+  FlowPanel docHeader;
+  @UiField
+  FlowPanel docSubheader;
+  @UiField
+  FlowPanel entityFooter;
+  private final ActionFlowPanel entityFooterToolbar;
+  @UiField
+  FlowPanel entityHeader;
+  @UiField
+  FlowPanel entityToolsCenter;
+  @UiField
+  FlowPanel entityToolsContainer;
+  @UiField
+  FlowPanel entityToolsNorth;
+  @UiField
+  FlowPanel entityToolsSouth;
+  @UiField
+  SplitLayoutPanel groupSpace;
+  @UiField
+  SimplePanel groupSpaceWrapper;
+  private final ActionFlowPanel headerToolbar;
+  @UiField
+  SimplePanel homeSpace;
+  @UiField
+  DockLayoutPanel mainpanel;
+  @UiField
+  SimplePanel publicSpace;
+  @UiField
+  FlowPanel sitebar;
+  @UiField
+  DockLayoutPanel splitCenter;
+  @UiField
+  DockLayoutPanel splitEast;
+  private final ActionFlowPanel subheaderToolbar;
+  @UiField
+  TabLayoutPanel tabs;
+  private final ActionFlowPanel toolsSouthToolbar;
+  @UiField
+  FlowPanel userSpace;
+
+  @Inject
+  public GSpaceArmorImpl(final Provider<ActionFlowPanel> toolbarProv) {
+    initWidget(uiBinder.createAndBindUi(this));
+    groupSpace.setWidgetMinSize(splitEast, 150);
+    DOM.setStyleAttribute((Element) groupSpace.getWidgetContainerElement(splitEast), "overflow",
+        "visible");
+    DOM.setStyleAttribute((Element) splitEast.getWidgetContainerElement(entityToolsContainer),
+        "overflow", "visible");
+    docFooterToolbar = toolbarProv.get();
+    headerToolbar = toolbarProv.get();
+    subheaderToolbar = toolbarProv.get();
+    toolsSouthToolbar = toolbarProv.get();
+    entityFooterToolbar = toolbarProv.get();
+    getDocHeader().add(headerToolbar);
+    getDocSubheader().add(subheaderToolbar);
+    getDocFooter().add(docFooterToolbar);
+    getEntityToolsSouth().add(toolsSouthToolbar);
+    getEntityFooter().add(entityFooterToolbar);
+    entityToolsNorth.getElement().getStyle().setPosition(Position.RELATIVE);
+    // entityToolsSouth.setVisible(false);
+    mainpanel.getWidgetContainerElement(tabs).addClassName("k-spaces");
+    enableCenterScroll(true);
+  }
+
+  @Override
+  public void clearBackImage() {
+    final String bodyProp = "#FFFFFF";
+    DOM.setStyleAttribute(groupSpaceWrapper.getElement(), CSS.A.BACKGROUND, bodyProp);
+  }
+
+  @Override
+  public void enableCenterScroll(final boolean enable) {
+    // TODO use here Element.getStyle()...
+    if (enable) {
+      centerScroll.setAlwaysShowScrollBars(false);
+      DOM.setStyleAttribute(centerScroll.getElement(), "position", "absolute");
+      DOM.setStyleAttribute((Element) centerScroll.getElement().getFirstChildElement(), "position",
+          "relative");
+    } else {
+      centerScroll.getElement().getStyle().setOverflow(Overflow.HIDDEN);
+      DOM.setStyleAttribute(centerScroll.getElement(), "position", "");
+      DOM.setStyleAttribute((Element) centerScroll.getElement().getFirstChildElement(), "position", "");
+    }
+  }
+
+  @Override
+  public ForIsWidget getDocContainer() {
+    return docContainer;
+  }
+
+  @Override
+  public ForIsWidget getDocFooter() {
+    return docFooter;
+  }
+
+  @Override
+  public IsActionExtensible getDocFooterToolbar() {
+    return docFooterToolbar;
+  }
+
+  @Override
+  public ForIsWidget getDocHeader() {
+    return docHeader;
+  }
+
+  @Override
+  public ForIsWidget getDocSubheader() {
+    return docSubheader;
+  }
+
+  @Override
+  public ForIsWidget getEntityFooter() {
+    return entityFooter;
+  }
+
+  @Override
+  public IsActionExtensible getEntityFooterToolbar() {
+    return entityFooterToolbar;
+  }
+
+  @Override
+  public ForIsWidget getEntityHeader() {
+    return entityHeader;
+  }
+
+  @Override
+  public ForIsWidget getEntityToolsCenter() {
+    return entityToolsCenter;
+  }
+
+  @Override
+  public ForIsWidget getEntityToolsNorth() {
+    return entityToolsNorth;
+  }
+
+  @Override
+  public ForIsWidget getEntityToolsSouth() {
+    return entityToolsSouth;
+  }
+
+  @Override
+  public IsActionExtensible getHeaderToolbar() {
+    return headerToolbar;
+  }
+
+  @Override
+  public SimplePanel getHomeSpace() {
+    return homeSpace;
+  }
+
+  @Override
+  public IsWidget getMainpanel() {
+    return mainpanel;
+  }
+
+  @Override
+  public SimplePanel getPublicSpace() {
+    return publicSpace;
+  }
+
+  @Override
+  public ForIsWidget getSitebar() {
+    return sitebar;
+  }
+
+  @Override
+  public IsActionExtensible getSubheaderToolbar() {
+    return subheaderToolbar;
+  }
+
+  @Override
+  public IsActionExtensible getToolsSouthToolbar() {
+    return toolsSouthToolbar;
+  }
+
+  @Override
+  public ForIsWidget getUserSpace() {
+    return userSpace;
+  }
+
+  @Override
+  public void selectGroupSpace() {
+    tabs.selectTab(groupSpaceWrapper);
+  }
+
+  @Override
+  public void selectHomeSpace() {
+    tabs.selectTab(homeSpace);
+  }
+
+  @Override
+  public void selectPublicSpace() {
+    tabs.selectTab(publicSpace);
+  }
+
+  @Override
+  public void selectUserSpace() {
+    tabs.selectTab(userSpace);
+  }
+
+  @Override
+  public void setBackImage(final String url) {
+    final String bodyProp = "#FFFFFF url('" + url + "') fixed top left";
+    DOM.setStyleAttribute(groupSpaceWrapper.getElement(), CSS.A.BACKGROUND, bodyProp);
+  }
+
+  @Override
+  public void setContentVisible(final boolean visible) {
+    // FIXME: remove this?
+    // NotifyUser.info("Visible: " + visible);
+    // docContainer.getElement().getStyle().setOpacity(visible ? 1d : .0d);
+    // docFooter.getElement().getStyle().setOpacity(visible ? 1d : .0d);
+  }
+}

Copied: trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.ui.xml (from rev 1655, trunk/src/main/java/cc/kune/gspace/client/GSpaceArmorImpl.ui.xml)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.ui.xml	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/armor/impl/GSpaceArmorImpl.ui.xml	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,126 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+  xmlns:co="urn:import:cc.kune.core.client" xmlns:kp="urn:import:cc.kune.pspace.client"
+  xmlns:g="urn:import:com.google.gwt.user.client.ui">
+  <ui:with field='res'
+    type='cc.kune.gspace.client.armor.resources.GSpaceArmorResources'/>
+  <ui:style>
+    .frame {
+      border: 0px;
+      margin: 0px;
+    }
+  </ui:style>
+  <g:DockLayoutPanel ui:field="mainpanel" styleName='{res.style.mainPanel}'
+    unit="PX">
+    <g:north size="23">
+      <g:FlowPanel ui:field="sitebar" height="23px"
+        styleName='{res.style.siteBar}'>
+      </g:FlowPanel>
+    </g:north>
+    <g:center>
+      <g:TabLayoutPanel width="100%" height="100%"
+        barUnit='PX' barHeight='0' ui:field="tabs">
+        <g:tab>
+          <g:header size='0'/>
+          <g:SimplePanel styleName="k-space" ui:field="homeSpace"
+            width="100%" height="100%"></g:SimplePanel>
+        </g:tab>
+        <g:tab>
+          <g:header size='0'/>
+          <g:FlowPanel ui:field="userSpace" styleName="k-space"
+            width="100%" height="100%">
+            <!-- <g:Frame url="/" styleName="{style.frame}" -->
+            <!-- ui:field="frame" width="100%" height="100%" /> -->
+          </g:FlowPanel>
+        </g:tab>
+        <g:tab>
+          <g:header size='0'/>
+          <g:SimplePanel ui:field="groupSpaceWrapper"
+            styleName="k-group-space">
+            <g:SplitLayoutPanel width="100%" height="100%"
+              styleName="k-space" ui:field="groupSpace">
+              <g:center size="1.0">
+                <g:DockLayoutPanel unit="PX" ui:field="splitCenter"
+                  styleName="{res.style.entityCentralContainer}">
+                  <g:north size="153">
+                    <g:VerticalPanel width="100%"
+                      height="153px">
+                      <g:FlowPanel height="70px" width="100%"
+                        styleName="{res.style.entityHeader}" ui:field="entityHeader">
+                        <!--<g:RichTextArea width="100%" height="70px" /> -->
+                      </g:FlowPanel>
+                      <g:FlowPanel width="100%" height="38px"
+                        styleName="{res.style.docHeader}" ui:field="docHeader">
+                      </g:FlowPanel>
+                      <g:HTMLPanel ui:field="arrow"
+                        styleName="{res.style.docSubheaderArrow}"/>
+                      <g:FlowPanel width="100%" height="45px"
+                        styleName="{res.style.docSubheader}" ui:field="docSubheader">
+                      </g:FlowPanel>
+                    </g:VerticalPanel>
+                  </g:north>
+                  <g:center>
+                    <g:DockLayoutPanel unit="PX"
+                      styleName="{res.style.docEditorMargin}" ui:field="docContainerParent">
+                      <g:west size="10">
+                        <g:SimplePanel/>
+                      </g:west>
+                      <g:east size="10">
+                        <g:SimplePanel/>
+                      </g:east>
+                      <g:center>
+                        <g:ScrollPanel ui:field="centerScroll"
+                          styleName="{res.style.docEditor}">
+                          <g:FlowPanel width="auto" height="auto"
+                            styleName="{res.style.docEditorContainer}"
+                            ui:field="docContainer"/>
+                        </g:ScrollPanel>
+                      </g:center>
+                      <g:south size="33.0">
+                        <g:VerticalPanel height="33px"
+                          width="100%" styleName="{res.style.docFooter}">
+                          <g:FlowPanel width="100%" height="33"
+                            ui:field="docFooter">
+                          </g:FlowPanel>
+                        </g:VerticalPanel>
+                      </g:south>
+                    </g:DockLayoutPanel>
+                  </g:center>
+                  <g:south size="36">
+                    <g:FlowPanel height="36px" width="100%"
+                      styleName="{res.style.entityFooter}" ui:field="entityFooter">
+                    </g:FlowPanel>
+                  </g:south>
+                </g:DockLayoutPanel>
+              </g:center>
+              <!-- east to RTL (plus css changes in corners and menus) -->
+              <g:west size="200.0">
+                <g:DockLayoutPanel unit="PX"
+                  styleName="{res.style.entityTools}" ui:field="splitEast">
+                  <g:center>
+                    <g:FlowPanel ui:field="entityToolsContainer">
+                      <g:FlowPanel width="100%" ui:field="entityToolsNorth"
+                        styleName="{res.style.entityToolsNorth}"></g:FlowPanel>
+                      <g:FlowPanel width="100%" ui:field="entityToolsCenter"
+                        styleName="{res.style.entityToolsCenter}">
+                      </g:FlowPanel>
+                    </g:FlowPanel>
+                  </g:center>
+                  <g:south size="98">
+                    <g:FlowPanel styleName="{res.style.entityToolsSouth}"
+                      ui:field="entityToolsSouth" width="100%"/>
+                  </g:south>
+                </g:DockLayoutPanel>
+              </g:west>
+            </g:SplitLayoutPanel>
+          </g:SimplePanel>
+        </g:tab>
+        <g:tab>
+          <g:header size='0'/>
+          <g:SimplePanel ui:field="publicSpace" width="100%"
+            styleName="k-space" height="100%"></g:SimplePanel>
+        </g:tab>
+      </g:TabLayoutPanel>
+    </g:center>
+  </g:DockLayoutPanel>
+</ui:UiBinder>
\ No newline at end of file

Copied: trunk/src/main/java/cc/kune/gspace/client/armor/resources (from rev 1655, trunk/src/main/java/cc/kune/gspace/client/resources)

Modified: trunk/src/main/java/cc/kune/gspace/client/armor/resources/GSpaceArmorResources.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/resources/GSpaceArmorResources.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/armor/resources/GSpaceArmorResources.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -17,7 +17,7 @@
  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
  *
  */
-package cc.kune.gspace.client.resources;
+package cc.kune.gspace.client.armor.resources;
 
 import com.google.gwt.resources.client.ClientBundle;
 import com.google.gwt.resources.client.CssResource;

Copied: trunk/src/main/java/cc/kune/gspace/client/events/CurrentEntityChangedEvent.java (from rev 1655, trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentEntityChangedEvent.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/events/CurrentEntityChangedEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/events/CurrentEntityChangedEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,74 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.events;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+import com.google.gwt.event.shared.HasHandlers;
+
+public class CurrentEntityChangedEvent extends GwtEvent<CurrentEntityChangedEvent.CurrentEntityChangedHandler> {
+
+  public interface CurrentEntityChangedHandler extends EventHandler {
+    public void onCurrentLogoChanged(CurrentEntityChangedEvent event);
+  }
+
+  public interface HasCurrentLogoChangedHandlers extends HasHandlers {
+    HandlerRegistration addCurrentLogoChangedHandler(CurrentEntityChangedHandler handler);
+  }
+
+  private static final Type<CurrentEntityChangedHandler> TYPE = new Type<CurrentEntityChangedHandler>();
+
+  public static void fire(final HasHandlers source) {
+    source.fireEvent(new CurrentEntityChangedEvent());
+  }
+
+  public static Type<CurrentEntityChangedHandler> getType() {
+    return TYPE;
+  }
+
+  public CurrentEntityChangedEvent() {
+  }
+
+  @Override
+  protected void dispatch(final CurrentEntityChangedHandler handler) {
+    handler.onCurrentLogoChanged(this);
+  }
+
+  @Override
+  public boolean equals(final Object obj) {
+    return super.equals(obj);
+  }
+
+  @Override
+  public Type<CurrentEntityChangedHandler> getAssociatedType() {
+    return TYPE;
+  }
+
+  @Override
+  public int hashCode() {
+    return super.hashCode();
+  }
+
+  @Override
+  public String toString() {
+    return "CurrentLogoChangedEvent[" + "]";
+  }
+}

Modified: trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/options/GroupOptionsPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -25,13 +25,13 @@
 import cc.kune.common.client.actions.ui.descrip.ButtonDescriptor;
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescrip;
 import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.UserSignOutEvent;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
+import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.client.resources.CoreResources;
 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.state.UserSignOutEvent;
-import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.client.ui.dialogs.tabbed.AbstractTabbedDialogPresenter;
 import cc.kune.core.shared.dto.StateAbstractDTO;
 import cc.kune.gspace.client.options.GroupOptionsPresenter.GroupOptionsView;

Modified: trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/options/UserOptionsPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -24,14 +24,14 @@
 import cc.kune.common.client.actions.ActionEvent;
 import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
 import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignOutEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.client.sitebar.SiteUserOptions;
 import cc.kune.core.client.state.Session;
 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.client.state.UserSignOutEvent;
-import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.client.ui.dialogs.tabbed.AbstractTabbedDialogPresenter;
 import cc.kune.gspace.client.options.UserOptionsPresenter.UserOptionsView;
 

Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/EntityOptGeneralPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -22,8 +22,8 @@
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;
+import cc.kune.gspace.client.events.CurrentEntityChangedEvent;
 import cc.kune.gspace.client.options.EntityOptions;
-import cc.kune.gspace.client.options.logo.CurrentEntityChangedEvent;
 
 import com.google.gwt.event.dom.client.ChangeEvent;
 import com.google.gwt.event.dom.client.ChangeHandler;

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	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/GroupOptGeneralPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,11 +20,11 @@
 package cc.kune.gspace.client.options.general;
 
 import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.events.GroupChangedEvent;
+import cc.kune.core.client.events.GroupChangedEvent.GroupChangedHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
 import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.state.GroupChangedEvent;
-import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.domain.utils.StateToken;

Modified: trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/options/general/UserOptGeneralPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,14 +20,14 @@
 package cc.kune.gspace.client.options.general;
 
 import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
 import cc.kune.core.client.i18n.I18nUITranslationService;
 import cc.kune.core.client.i18n.I18nUITranslationService.I18nLanguageChangeNeeded;
 import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
 import cc.kune.core.client.rpcservices.UserServiceAsync;
 import cc.kune.core.client.state.Session;
 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.domain.dto.EmailNotificationFrequency;
 import cc.kune.core.shared.dto.I18nLanguageSimpleDTO;
 import cc.kune.core.shared.dto.StateAbstractDTO;

Modified: trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicensePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicensePresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/GroupOptDefLicensePresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -19,10 +19,10 @@
  */
 package cc.kune.gspace.client.options.license;
 
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
 import cc.kune.core.client.state.Session;
 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.domain.utils.StateToken;
 import cc.kune.core.shared.dto.LicenseDTO;
 import cc.kune.gspace.client.licensewizard.LicenseChangeAction;

Modified: trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicensePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicensePresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/options/license/UserOptDefLicensePresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -19,9 +19,9 @@
  */
 package cc.kune.gspace.client.options.license;
 
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
 import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.UserSignInEvent;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.LicenseDTO;
 import cc.kune.gspace.client.licensewizard.LicenseChangeAction;

Deleted: trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentEntityChangedEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentEntityChangedEvent.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/CurrentEntityChangedEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,74 +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.gspace.client.options.logo;
-
-import com.google.gwt.event.shared.EventHandler;
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.HandlerRegistration;
-import com.google.gwt.event.shared.HasHandlers;
-
-public class CurrentEntityChangedEvent extends GwtEvent<CurrentEntityChangedEvent.CurrentEntityChangedHandler> {
-
-  public interface CurrentEntityChangedHandler extends EventHandler {
-    public void onCurrentLogoChanged(CurrentEntityChangedEvent event);
-  }
-
-  public interface HasCurrentLogoChangedHandlers extends HasHandlers {
-    HandlerRegistration addCurrentLogoChangedHandler(CurrentEntityChangedHandler handler);
-  }
-
-  private static final Type<CurrentEntityChangedHandler> TYPE = new Type<CurrentEntityChangedHandler>();
-
-  public static void fire(final HasHandlers source) {
-    source.fireEvent(new CurrentEntityChangedEvent());
-  }
-
-  public static Type<CurrentEntityChangedHandler> getType() {
-    return TYPE;
-  }
-
-  public CurrentEntityChangedEvent() {
-  }
-
-  @Override
-  protected void dispatch(final CurrentEntityChangedHandler handler) {
-    handler.onCurrentLogoChanged(this);
-  }
-
-  @Override
-  public boolean equals(final Object obj) {
-    return super.equals(obj);
-  }
-
-  @Override
-  public Type<CurrentEntityChangedHandler> getAssociatedType() {
-    return TYPE;
-  }
-
-  @Override
-  public int hashCode() {
-    return super.hashCode();
-  }
-
-  @Override
-  public String toString() {
-    return "CurrentLogoChangedEvent[" + "]";
-  }
-}

Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/EntityOptLogoPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -27,6 +27,7 @@
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.core.client.rpcservices.UserServiceAsync;
 import cc.kune.core.client.state.Session;
+import cc.kune.gspace.client.events.CurrentEntityChangedEvent;
 import cc.kune.gspace.client.options.EntityOptions;
 
 import com.google.gwt.event.shared.EventBus;

Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/GroupOptLogoPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,9 +20,9 @@
 package cc.kune.gspace.client.options.logo;
 
 import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.events.GroupChangedEvent;
+import cc.kune.core.client.events.GroupChangedEvent.GroupChangedHandler;
 import cc.kune.core.client.rpcservices.UserServiceAsync;
-import cc.kune.core.client.state.GroupChangedEvent;
-import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.gspace.client.options.GroupOptions;

Modified: trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/options/logo/UserOptLogoPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -22,12 +22,12 @@
 import gwtupload.client.IUploader;
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.core.client.events.AvatarChangedEvent;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
 import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
 import cc.kune.core.client.rpcservices.UserServiceAsync;
 import cc.kune.core.client.state.Session;
 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.GroupDTO;
 import cc.kune.gspace.client.options.UserOptions;
 

Modified: trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/options/style/EntityOptStylePresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -26,13 +26,13 @@
 import cc.kune.common.client.notify.NotifyUser;
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.common.shared.utils.TextUtils;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
 import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
 import cc.kune.core.client.rpcservices.GroupServiceAsync;
 import cc.kune.core.client.services.ClientFileDownloadUtils;
 import cc.kune.core.client.services.ImageSize;
 import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateChangedEvent;
-import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.GroupDTO;

Modified: trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/GroupOptToolsPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -23,9 +23,9 @@
 import java.util.List;
 
 import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.events.GroupChangedEvent;
+import cc.kune.core.client.events.GroupChangedEvent.GroupChangedHandler;
 import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.state.GroupChangedEvent;
-import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.domain.utils.StateToken;

Modified: trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/options/tools/UserOptToolsPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -23,11 +23,11 @@
 import java.util.List;
 
 import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
 import cc.kune.core.client.rpcservices.GroupServiceAsync;
 import cc.kune.core.client.state.Session;
 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.domain.utils.StateToken;
 import cc.kune.core.shared.dto.ToolSimpleDTO;
 import cc.kune.gspace.client.options.UserOptions;

Modified: trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/style/GSpaceBackManagerImpl.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -22,9 +22,8 @@
 import javax.annotation.Nonnull;
 
 import cc.kune.core.client.services.ClientFileDownloadUtils;
-import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 
 import com.google.inject.Inject;
 
@@ -34,14 +33,11 @@
   private final ClientFileDownloadUtils downloadUtils;
   private final GSpaceArmor gSpaceArmor;
   private StateToken lastToken;
-  private final StateManager stateManager;
 
   @Inject
-  public GSpaceBackManagerImpl(final ClientFileDownloadUtils downloadUtils, final GSpaceArmor gSpaceArmor,
-      final StateManager stateManager) {
+  public GSpaceBackManagerImpl(final ClientFileDownloadUtils downloadUtils, final GSpaceArmor gSpaceArmor) {
     this.downloadUtils = downloadUtils;
     this.gSpaceArmor = gSpaceArmor;
-    this.stateManager = stateManager;
     lastToken = NO_TOKEN;
   }
 

Modified: trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,7 +20,7 @@
 package cc.kune.gspace.client.tags;
 
 import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 import cc.kune.gspace.client.tags.TagsSummaryPresenter.TagsSummaryView;
 
 import com.google.gwt.event.dom.client.ClickHandler;

Modified: trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/tags/TagsSummaryPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -21,9 +21,9 @@
 
 import cc.kune.common.client.log.Log;
 import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
 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.shared.domain.TagCloudResult;
 import cc.kune.core.shared.domain.TagCount;

Modified: trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeManager.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeManager.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeManager.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -23,12 +23,12 @@
 
 import cc.kune.common.client.notify.NotifyUser;
 import cc.kune.common.client.utils.CSSUtils;
-import cc.kune.core.client.init.AppStartEvent;
-import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.GroupChangedEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.GroupChangedEvent.GroupChangedHandler;
 import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
 import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.state.GroupChangedEvent;
-import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.domain.utils.StateToken;
@@ -36,7 +36,7 @@
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.dto.InitDataDTO;
 import cc.kune.core.shared.dto.StateAbstractDTO;
-import cc.kune.gspace.client.resources.GSpaceArmorResources;
+import cc.kune.gspace.client.armor.resources.GSpaceArmorResources;
 import cc.kune.gspace.client.style.GSpaceBackManager;
 
 import com.google.gwt.dom.client.StyleElement;

Modified: trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/themes/GSpaceThemeSelectorPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -28,8 +28,8 @@
 import cc.kune.common.client.actions.ui.descrip.MenuDescriptor;
 import cc.kune.common.client.actions.ui.descrip.MenuRadioItemDescriptor;
 import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.core.client.init.AppStartEvent;
-import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.shared.dto.GSpaceTheme;

Modified: trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -27,11 +27,11 @@
 
 import cc.kune.common.client.log.Log;
 import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.core.client.init.AppStartEvent;
-import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
 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.shared.dto.HasContent;
 import cc.kune.core.shared.dto.StateAbstractDTO;

Modified: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,7 +20,7 @@
 package cc.kune.gspace.client.tool.selector;
 
 import cc.kune.core.client.dnd.FolderViewerDropController;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 import cc.kune.gspace.client.tool.selector.ToolSelectorItemPresenter.ToolSelectorItemView;
 import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter.ToolSelectorView;
 

Modified: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -25,13 +25,13 @@
 import cc.kune.common.client.errors.UIException;
 import cc.kune.common.client.log.Log;
 import cc.kune.common.shared.utils.TextUtils;
-import cc.kune.core.client.state.GroupChangedEvent;
-import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
-import cc.kune.core.client.state.StateChangedEvent;
-import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
+import cc.kune.core.client.events.GroupChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.ToolChangedEvent;
+import cc.kune.core.client.events.GroupChangedEvent.GroupChangedHandler;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
+import cc.kune.core.client.events.ToolChangedEvent.ToolChangedHandler;
 import cc.kune.core.client.state.StateManager;
-import cc.kune.core.client.state.ToolChangedEvent;
-import cc.kune.core.client.state.ToolChangedEvent.ToolChangedHandler;
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.gspace.client.tool.selector.ToolSelectorItemPresenter.ToolSelectorItemView;
 

Modified: trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -23,7 +23,7 @@
 import cc.kune.common.client.ui.KuneWindowUtils;
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.core.shared.dto.LicenseDTO;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 import cc.kune.gspace.client.ui.footer.license.EntityLicensePresenter.EntityLicenseView;
 
 import com.google.gwt.core.client.GWT;

Modified: trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/ui/footer/license/EntityLicensePresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -19,9 +19,9 @@
  */
 package cc.kune.gspace.client.ui.footer.license;
 
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
 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.shared.dto.HasContent;
 import cc.kune.core.shared.dto.LicenseDTO;

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -28,7 +28,7 @@
 import cc.kune.core.client.dnd.KuneDragController;
 import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
 import cc.kune.core.shared.dto.StateContainerDTO;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 import cc.kune.gspace.client.viewers.FolderViewerPresenter.FolderViewerView;
 
 import com.google.gwt.user.client.Window;

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerView.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerView.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/AbstractFolderViewerView.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -3,6 +3,7 @@
 import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
 import cc.kune.common.client.ui.HasEditHandler;
 import cc.kune.core.shared.dto.StateContainerDTO;
+import cc.kune.gspace.client.viewers.items.FolderItemDescriptor;
 
 import com.google.gwt.event.dom.client.ClickHandler;
 import com.google.gwt.event.dom.client.DoubleClickHandler;

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentTitleWidget.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentTitleWidget.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentTitleWidget.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -25,7 +25,7 @@
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.core.client.registry.IconsRegistry;
 import cc.kune.core.shared.dto.BasicMimeTypeDTO;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 
 import com.google.gwt.resources.client.ImageResource;
 import com.google.gwt.user.client.ui.Composite;

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -39,7 +39,7 @@
 import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.shared.dto.StateContentDTO;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 import cc.kune.gspace.client.viewers.ContentViewerPresenter.ContentViewerView;
 import cc.kune.wave.client.KuneStagesProvider;
 import cc.kune.wave.client.WaveClientClearEvent;

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/ContentViewerPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -29,12 +29,12 @@
 import cc.kune.common.client.ui.EditEvent.EditHandler;
 import cc.kune.common.client.ui.HasEditHandler;
 import cc.kune.core.client.actions.ActionRegistryByType;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignOutEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.client.state.Session;
 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.client.state.UserSignOutEvent;
-import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.shared.domain.utils.AccessRights;
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.core.shared.dto.HasContent;

Deleted: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemDescriptor.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemDescriptor.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemDescriptor.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -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 cc.kune.gspace.client.viewers;
-
-import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
-import cc.kune.core.shared.domain.ContentStatus;
-import cc.kune.core.shared.domain.utils.StateToken;
-
-public class FolderItemDescriptor {
-  private final GuiActionDescCollection actionCollection;
-  private final boolean allowDrag;
-  private final boolean allowDrop;
-  private final ContentStatus contentStatus;
-  private final Object icon;
-  private final String id;
-  private final long modififiedOn;
-  private final String parentId;
-  private final String text;
-  private final StateToken token;
-  private final String tooltip;
-
-  public FolderItemDescriptor(final String id, final String parentId, final Object icon,
-      final String text, final String tooltip, final ContentStatus contentStatus,
-      final StateToken token, final long modififiedOn, final boolean allowDrag, final boolean allowDrop,
-      final GuiActionDescCollection actionCollection) {
-    this.id = id;
-    this.parentId = parentId;
-    this.icon = icon;
-    this.text = text;
-    this.tooltip = tooltip;
-    this.contentStatus = contentStatus;
-    this.token = token;
-    this.modififiedOn = modififiedOn;
-    this.allowDrag = allowDrag;
-    this.allowDrop = allowDrop;
-    this.actionCollection = actionCollection;
-  }
-
-  public GuiActionDescCollection getActionCollection() {
-    return actionCollection;
-  }
-
-  public ContentStatus getContentStatus() {
-    return contentStatus;
-  }
-
-  public Object getIcon() {
-    return icon;
-  }
-
-  public String getId() {
-    return id;
-  }
-
-  public long getModififiedOn() {
-    return modififiedOn;
-  }
-
-  public String getParentId() {
-    return parentId;
-  }
-
-  public StateToken getStateToken() {
-    return token;
-  }
-
-  public String getText() {
-    return text;
-  }
-
-  public String getTooltip() {
-    return tooltip;
-  }
-
-  public boolean isDraggable() {
-    return allowDrag;
-  }
-
-  public boolean isDroppable() {
-    return allowDrop;
-  }
-
-}

Deleted: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -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 cc.kune.gspace.client.viewers;
-
-import cc.kune.common.client.actions.ui.ActionSimplePanel;
-import cc.kune.core.shared.domain.utils.StateToken;
-
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.event.dom.client.BlurEvent;
-import com.google.gwt.event.dom.client.FocusEvent;
-import com.google.gwt.event.dom.client.HasAllFocusHandlers;
-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.MouseOutEvent;
-import com.google.gwt.event.dom.client.MouseOverEvent;
-import com.google.gwt.resources.client.ImageResource;
-import com.google.gwt.uibinder.client.UiBinder;
-import com.google.gwt.uibinder.client.UiField;
-import com.google.gwt.uibinder.client.UiHandler;
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.FocusPanel;
-import com.google.gwt.user.client.ui.HasText;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.InlineLabel;
-import com.google.gwt.user.client.ui.SimplePanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class FolderItemWidget extends Composite implements HasText {
-
-  interface FolderItemWidgetUiBinder extends UiBinder<Widget, FolderItemWidget> {
-  }
-
-  private static FolderItemWidgetUiBinder uiBinder = GWT.create(FolderItemWidgetUiBinder.class);
-
-  @UiField
-  FlowPanel flow;
-  @UiField
-  FocusPanel focusPanel;
-  @UiField
-  Image icon;
-  @UiField
-  SimplePanel menu;
-  @UiField
-  InlineLabel modified;
-  @UiField
-  InlineLabel title;
-
-  private final StateToken token;
-
-  public FolderItemWidget(final ImageResource iconResource, final String title, final StateToken token) {
-    this.token = token;
-    initWidget(uiBinder.createAndBindUi(this));
-    this.title.setText(title);
-    icon.setResource(iconResource);
-  }
-
-  private void clearFocusStyles() {
-    focusPanel.removeStyleDependentName("nofocused");
-    focusPanel.removeStyleDependentName("focused");
-  }
-
-  FlowPanel getFlow() {
-    return flow;
-  }
-
-  Widget getIcon() {
-    return icon;
-  }
-
-  HasClickHandlers getRowClick() {
-    return focusPanel;
-  }
-
-  HasDoubleClickHandlers getRowDoubleClick() {
-    return focusPanel;
-  }
-
-  HasAllFocusHandlers getRowFocus() {
-    return focusPanel;
-  }
-
-  HasAllMouseHandlers getRowMouse() {
-    return focusPanel;
-  }
-
-  @Override
-  public String getText() {
-    return title.getText();
-  }
-
-  Widget getTitleWidget() {
-    return title;
-  }
-
-  public StateToken getToken() {
-    return token;
-  }
-
-  @UiHandler("focusPanel")
-  public void onBlur(final BlurEvent event) {
-    clearFocusStyles();
-    focusPanel.addStyleDependentName("nofocused");
-  }
-
-  @UiHandler("focusPanel")
-  public void onFocus(final FocusEvent event) {
-    clearFocusStyles();
-    focusPanel.addStyleDependentName("focused");
-  }
-
-  @UiHandler("focusPanel")
-  public void onOut(final MouseOutEvent event) {
-    clearFocusStyles();
-    focusPanel.addStyleDependentName("nofocused");
-  }
-
-  @UiHandler("focusPanel")
-  public void onOver(final MouseOverEvent event) {
-    clearFocusStyles();
-    focusPanel.addStyleDependentName("focused");
-  }
-
-  public void setMenu(final ActionSimplePanel toolbar) {
-    menu.add(toolbar);
-  }
-
-  public void setMenuVisible(final boolean visible) {
-    menu.getElement().getStyle().setOpacity(visible ? 1d : 0.2d);
-  }
-
-  public void setModifiedText(final String text) {
-    modified.setText(text);
-  }
-
-  public void setSelect(final boolean selected) {
-    clearFocusStyles();
-    focusPanel.removeStyleDependentName(selected ? "noselected" : "selected");
-    focusPanel.addStyleDependentName(selected ? "selected" : "noselected");
-  }
-
-  @Override
-  public void setText(final String text) {
-    title.setText(text);
-  }
-
-}

Deleted: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,79 +0,0 @@
-<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
-<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
-  xmlns:co="urn:ui:cc.kune.core.client" xmlns:g="urn:import:com.google.gwt.user.client.ui">
-  <ui:style>
-    @external .k-folderitem-focus;
-    @external .k-folderitem-focus-focused;
-    @external .k-folderitem-focus-selected;
-    @external .k-folderitem-focus-noselected;
-    @external .k-folderitem-focus-nofocused;
-    .k-folderitem-focus {
-      background-color: none;
-      border: solid 2px transparent;
-      -moz-border-radius: 4px;
-      -webkit-border-radius: 4px;
-      border-radius: 4px;
-    }
-
-    .k-folderitem-focus-focused {
-      background-color: #F2F5FD;
-    }
-
-    .k-folderitem-focus-selected {
-      background-color: #E3E9FF;
-    }
-
-    .k-folderitem-focus-noselected {
-
-    }
-
-    .k-folderitem-focus-nofocused {
-
-    }
-
-    .flow {
-      cursor: pointer;
-      border-bottom: 1px solid #F3F3F3;
-      line-height: 1.3em;
-      height: 28px;
-      outline: 0;
-    }
-
-    .modified {
-      margin-right: 5px;
-      color: #A05A2C;
-      font-size: 17px;
-      line-height: 1.3em;
-      -moz-user-select: none;
-      -khtml-user-select: none;
-      float: right;
-      font-style: italic;
-    }
-
-    .title {
-      margin-left: 5px;
-      color: #A05A2C;
-      font-size: 19px;
-      line-height: 1.3em;
-      -moz-user-select: none;
-      -khtml-user-select: none;
-    }
-
-    .icon {
-      margin: 5px;
-    }
-
-    .menu {
-      float: right;
-    }
-  </ui:style>
-  <g:FocusPanel ui:field="focusPanel" styleName="{style.k-folderitem-focus}">
-    <g:FlowPanel styleName="{style.flow}" ui:field="flow">
-      <g:Image styleName="{style.icon}" ui:field="icon"/>
-      <g:InlineLabel styleName="{style.title}" ui:field="title"/>
-      <g:SimplePanel styleName="{style.menu}" ui:field="menu"/>
-      <g:InlineLabel styleName="{style.modified}"
-        ui:field="modified"/>
-    </g:FlowPanel>
-  </g:FocusPanel>
-</ui:UiBinder>
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsFlowPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsFlowPanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsFlowPanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -29,7 +29,8 @@
 import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
 import cc.kune.core.client.ui.BasicDragableThumb;
 import cc.kune.core.shared.dto.StateContainerDTO;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
+import cc.kune.gspace.client.viewers.items.FolderItemDescriptor;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.dom.client.ClickEvent;

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerAsTablePanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -34,8 +34,10 @@
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.shared.domain.ContentStatus;
 import cc.kune.core.shared.dto.StateContainerDTO;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 import cc.kune.gspace.client.viewers.FolderViewerPresenter.FolderViewerView;
+import cc.kune.gspace.client.viewers.items.FolderItemDescriptor;
+import cc.kune.gspace.client.viewers.items.FolderItemWidget;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.dom.client.ClickEvent;

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -24,6 +24,7 @@
 import cc.kune.core.shared.dto.StateContainerDTO;
 import cc.kune.gspace.client.actions.ActionGroups;
 import cc.kune.gspace.client.viewers.FolderViewerPresenter.FolderViewerView;
+import cc.kune.gspace.client.viewers.items.FolderItemDescriptor;
 
 import com.google.gwt.event.dom.client.ClickEvent;
 import com.google.gwt.event.dom.client.ClickHandler;

Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -24,7 +24,7 @@
 import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
 import cc.kune.core.client.resources.CoreMessages;
 import cc.kune.core.shared.dto.HasContent;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 import cc.kune.gspace.client.tool.ContentViewer;
 
 import com.google.inject.Inject;

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers/items/FolderItemDescriptor.java (from rev 1655, trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemDescriptor.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/items/FolderItemDescriptor.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/items/FolderItemDescriptor.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,100 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ \*/
+package cc.kune.gspace.client.viewers.items;
+
+import cc.kune.common.client.actions.ui.descrip.GuiActionDescCollection;
+import cc.kune.core.shared.domain.ContentStatus;
+import cc.kune.core.shared.domain.utils.StateToken;
+
+public class FolderItemDescriptor {
+  private final GuiActionDescCollection actionCollection;
+  private final boolean allowDrag;
+  private final boolean allowDrop;
+  private final ContentStatus contentStatus;
+  private final Object icon;
+  private final String id;
+  private final long modififiedOn;
+  private final String parentId;
+  private final String text;
+  private final StateToken token;
+  private final String tooltip;
+
+  public FolderItemDescriptor(final String id, final String parentId, final Object icon,
+      final String text, final String tooltip, final ContentStatus contentStatus,
+      final StateToken token, final long modififiedOn, final boolean allowDrag, final boolean allowDrop,
+      final GuiActionDescCollection actionCollection) {
+    this.id = id;
+    this.parentId = parentId;
+    this.icon = icon;
+    this.text = text;
+    this.tooltip = tooltip;
+    this.contentStatus = contentStatus;
+    this.token = token;
+    this.modififiedOn = modififiedOn;
+    this.allowDrag = allowDrag;
+    this.allowDrop = allowDrop;
+    this.actionCollection = actionCollection;
+  }
+
+  public GuiActionDescCollection getActionCollection() {
+    return actionCollection;
+  }
+
+  public ContentStatus getContentStatus() {
+    return contentStatus;
+  }
+
+  public Object getIcon() {
+    return icon;
+  }
+
+  public String getId() {
+    return id;
+  }
+
+  public long getModififiedOn() {
+    return modififiedOn;
+  }
+
+  public String getParentId() {
+    return parentId;
+  }
+
+  public StateToken getStateToken() {
+    return token;
+  }
+
+  public String getText() {
+    return text;
+  }
+
+  public String getTooltip() {
+    return tooltip;
+  }
+
+  public boolean isDraggable() {
+    return allowDrag;
+  }
+
+  public boolean isDroppable() {
+    return allowDrop;
+  }
+
+}

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers/items/FolderItemWidget.java (from rev 1655, trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.java)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/items/FolderItemWidget.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/items/FolderItemWidget.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,165 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.gspace.client.viewers.items;
+
+import cc.kune.common.client.actions.ui.ActionSimplePanel;
+import cc.kune.core.shared.domain.utils.StateToken;
+
+import com.google.gwt.core.client.GWT;
+import com.google.gwt.event.dom.client.BlurEvent;
+import com.google.gwt.event.dom.client.FocusEvent;
+import com.google.gwt.event.dom.client.HasAllFocusHandlers;
+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.MouseOutEvent;
+import com.google.gwt.event.dom.client.MouseOverEvent;
+import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.uibinder.client.UiBinder;
+import com.google.gwt.uibinder.client.UiField;
+import com.google.gwt.uibinder.client.UiHandler;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.FlowPanel;
+import com.google.gwt.user.client.ui.FocusPanel;
+import com.google.gwt.user.client.ui.HasText;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.InlineLabel;
+import com.google.gwt.user.client.ui.SimplePanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class FolderItemWidget extends Composite implements HasText {
+
+  interface FolderItemWidgetUiBinder extends UiBinder<Widget, FolderItemWidget> {
+  }
+
+  private static FolderItemWidgetUiBinder uiBinder = GWT.create(FolderItemWidgetUiBinder.class);
+
+  @UiField
+  FlowPanel flow;
+  @UiField
+  FocusPanel focusPanel;
+  @UiField
+  Image icon;
+  @UiField
+  SimplePanel menu;
+  @UiField
+  InlineLabel modified;
+  @UiField
+  InlineLabel title;
+
+  private final StateToken token;
+
+  public FolderItemWidget(final ImageResource iconResource, final String title, final StateToken token) {
+    this.token = token;
+    initWidget(uiBinder.createAndBindUi(this));
+    this.title.setText(title);
+    icon.setResource(iconResource);
+  }
+
+  private void clearFocusStyles() {
+    focusPanel.removeStyleDependentName("nofocused");
+    focusPanel.removeStyleDependentName("focused");
+  }
+
+  public FlowPanel getFlow() {
+    return flow;
+  }
+
+  public Widget getIcon() {
+    return icon;
+  }
+
+  public HasClickHandlers getRowClick() {
+    return focusPanel;
+  }
+
+  public HasDoubleClickHandlers getRowDoubleClick() {
+    return focusPanel;
+  }
+
+  public HasAllFocusHandlers getRowFocus() {
+    return focusPanel;
+  }
+
+  public HasAllMouseHandlers getRowMouse() {
+    return focusPanel;
+  }
+
+  @Override
+  public String getText() {
+    return title.getText();
+  }
+
+  public Widget getTitleWidget() {
+    return title;
+  }
+
+  public StateToken getToken() {
+    return token;
+  }
+
+  @UiHandler("focusPanel")
+  public void onBlur(final BlurEvent event) {
+    clearFocusStyles();
+    focusPanel.addStyleDependentName("nofocused");
+  }
+
+  @UiHandler("focusPanel")
+  public void onFocus(final FocusEvent event) {
+    clearFocusStyles();
+    focusPanel.addStyleDependentName("focused");
+  }
+
+  @UiHandler("focusPanel")
+  public void onOut(final MouseOutEvent event) {
+    clearFocusStyles();
+    focusPanel.addStyleDependentName("nofocused");
+  }
+
+  @UiHandler("focusPanel")
+  public void onOver(final MouseOverEvent event) {
+    clearFocusStyles();
+    focusPanel.addStyleDependentName("focused");
+  }
+
+  public void setMenu(final ActionSimplePanel toolbar) {
+    menu.add(toolbar);
+  }
+
+  public void setMenuVisible(final boolean visible) {
+    menu.getElement().getStyle().setOpacity(visible ? 1d : 0.2d);
+  }
+
+  public void setModifiedText(final String text) {
+    modified.setText(text);
+  }
+
+  public void setSelect(final boolean selected) {
+    clearFocusStyles();
+    focusPanel.removeStyleDependentName(selected ? "noselected" : "selected");
+    focusPanel.addStyleDependentName(selected ? "selected" : "noselected");
+  }
+
+  @Override
+  public void setText(final String text) {
+    title.setText(text);
+  }
+
+}

Copied: trunk/src/main/java/cc/kune/gspace/client/viewers/items/FolderItemWidget.ui.xml (from rev 1655, trunk/src/main/java/cc/kune/gspace/client/viewers/FolderItemWidget.ui.xml)
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/items/FolderItemWidget.ui.xml	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/items/FolderItemWidget.ui.xml	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,79 @@
+<!DOCTYPE ui:UiBinder SYSTEM "http://dl.google.com/gwt/DTD/xhtml.ent">
+<ui:UiBinder xmlns:ui="urn:ui:com.google.gwt.uibinder"
+  xmlns:co="urn:ui:cc.kune.core.client" xmlns:g="urn:import:com.google.gwt.user.client.ui">
+  <ui:style>
+    @external .k-folderitem-focus;
+    @external .k-folderitem-focus-focused;
+    @external .k-folderitem-focus-selected;
+    @external .k-folderitem-focus-noselected;
+    @external .k-folderitem-focus-nofocused;
+    .k-folderitem-focus {
+      background-color: none;
+      border: solid 2px transparent;
+      -moz-border-radius: 4px;
+      -webkit-border-radius: 4px;
+      border-radius: 4px;
+    }
+
+    .k-folderitem-focus-focused {
+      background-color: #F2F5FD;
+    }
+
+    .k-folderitem-focus-selected {
+      background-color: #E3E9FF;
+    }
+
+    .k-folderitem-focus-noselected {
+
+    }
+
+    .k-folderitem-focus-nofocused {
+
+    }
+
+    .flow {
+      cursor: pointer;
+      border-bottom: 1px solid #F3F3F3;
+      line-height: 1.3em;
+      height: 28px;
+      outline: 0;
+    }
+
+    .modified {
+      margin-right: 5px;
+      color: #A05A2C;
+      font-size: 17px;
+      line-height: 1.3em;
+      -moz-user-select: none;
+      -khtml-user-select: none;
+      float: right;
+      font-style: italic;
+    }
+
+    .title {
+      margin-left: 5px;
+      color: #A05A2C;
+      font-size: 19px;
+      line-height: 1.3em;
+      -moz-user-select: none;
+      -khtml-user-select: none;
+    }
+
+    .icon {
+      margin: 5px;
+    }
+
+    .menu {
+      float: right;
+    }
+  </ui:style>
+  <g:FocusPanel ui:field="focusPanel" styleName="{style.k-folderitem-focus}">
+    <g:FlowPanel styleName="{style.flow}" ui:field="flow">
+      <g:Image styleName="{style.icon}" ui:field="icon"/>
+      <g:InlineLabel styleName="{style.title}" ui:field="title"/>
+      <g:SimplePanel styleName="{style.menu}" ui:field="menu"/>
+      <g:InlineLabel styleName="{style.modified}"
+        ui:field="modified"/>
+    </g:FlowPanel>
+  </g:FocusPanel>
+</ui:UiBinder>
\ No newline at end of file

Modified: trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/hspace/client/HSpacePanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -30,7 +30,7 @@
 import cc.kune.core.shared.dto.ContentSimpleDTO;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.utils.SharedFileDownloadUtils;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 import cc.kune.hspace.client.HSpacePresenter.HSpaceView;
 
 import com.calclab.emite.core.client.packet.TextUtils;

Modified: trunk/src/main/java/cc/kune/hspace/client/HSpaceParts.java
===================================================================
--- trunk/src/main/java/cc/kune/hspace/client/HSpaceParts.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/hspace/client/HSpaceParts.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -19,8 +19,8 @@
  */
 package cc.kune.hspace.client;
 
-import cc.kune.core.client.init.AppStartEvent;
-import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.state.Session;
 
 import com.google.inject.Inject;

Modified: trunk/src/main/java/cc/kune/hspace/client/HSpacePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/hspace/client/HSpacePresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/hspace/client/HSpacePresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -23,10 +23,10 @@
 
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.core.client.events.InboxUnreadUpdatedEvent;
+import cc.kune.core.client.events.UserSignInOrSignOutEvent;
+import cc.kune.core.client.events.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
 import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
 import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.UserSignInOrSignOutEvent;
-import cc.kune.core.client.state.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
 import cc.kune.core.shared.dto.ContentSimpleDTO;
 import cc.kune.core.shared.dto.GroupDTO;
 import cc.kune.core.shared.dto.HomeStatsDTO;

Modified: trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/lists/server/ListsServerTool.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -44,8 +44,8 @@
 import cc.kune.domain.Content;
 import cc.kune.domain.Group;
 import cc.kune.domain.User;
-import cc.kune.wave.server.KuneWaveService;
 import cc.kune.wave.server.KuneWaveUtils;
+import cc.kune.wave.server.kspecific.KuneWaveService;
 
 import com.google.inject.Inject;
 

Modified: trunk/src/main/java/cc/kune/pspace/client/PSpaceInDevelopment.java
===================================================================
--- trunk/src/main/java/cc/kune/pspace/client/PSpaceInDevelopment.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/pspace/client/PSpaceInDevelopment.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -22,16 +22,16 @@
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.common.shared.utils.TextUtils;
 import cc.kune.common.shared.utils.UrlParam;
+import cc.kune.core.client.events.GroupChangedEvent;
+import cc.kune.core.client.events.GroupChangedEvent.GroupChangedHandler;
 import cc.kune.core.client.resources.CoreResources;
 import cc.kune.core.client.services.ClientFileDownloadUtils;
-import cc.kune.core.client.state.GroupChangedEvent;
-import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
 import cc.kune.core.client.state.Session;
 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.gspace.client.options.logo.CurrentEntityChangedEvent;
-import cc.kune.gspace.client.options.logo.CurrentEntityChangedEvent.CurrentEntityChangedHandler;
+import cc.kune.gspace.client.events.CurrentEntityChangedEvent;
+import cc.kune.gspace.client.events.CurrentEntityChangedEvent.CurrentEntityChangedHandler;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.event.shared.EventBus;

Modified: trunk/src/main/java/cc/kune/pspace/client/PSpacePanel.java
===================================================================
--- trunk/src/main/java/cc/kune/pspace/client/PSpacePanel.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/pspace/client/PSpacePanel.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -24,7 +24,7 @@
 import cc.kune.common.client.actions.ui.IsActionExtensible;
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.core.client.resources.CoreResources;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 import cc.kune.pspace.client.PSpacePresenter.PSpaceView;
 
 import com.google.gwt.core.client.GWT;

Modified: trunk/src/main/java/cc/kune/pspace/client/PSpaceParts.java
===================================================================
--- trunk/src/main/java/cc/kune/pspace/client/PSpaceParts.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/pspace/client/PSpaceParts.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -19,8 +19,8 @@
  */
 package cc.kune.pspace.client;
 
-import cc.kune.core.client.init.AppStartEvent;
-import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.state.Session;
 
 import com.google.inject.Inject;

Modified: trunk/src/main/java/cc/kune/pspace/client/PSpacePresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/pspace/client/PSpacePresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/pspace/client/PSpacePresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -22,10 +22,10 @@
 import cc.kune.common.client.actions.ui.IsActionExtensible;
 import cc.kune.common.shared.i18n.I18nTranslationService;
 import cc.kune.common.shared.utils.TextUtils;
-import cc.kune.core.client.init.AppStartEvent;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
 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.state.StateTokenUtils;
 import cc.kune.core.shared.domain.ContentStatus;

Deleted: trunk/src/main/java/cc/kune/wave/client/KuneConversation.css
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneConversation.css	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/wave/client/KuneConversation.css	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,31 +0,0 @@
-/*
- * CSS for conversations.
- *
- * Author: reuben at google.com (Reuben Kan)
- */
-.fixedSelf {
-  position: absolute;
-  top: 0;
-  bottom: 0;
-  left: 0;
-  right: 0;
-  z-index: 0;
-}
-
-.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.
-   */
-  overflow-y: scroll;
-  /* position: absolute; */ /*   position: relative; */
-  /*   top: 24px; */
-  top: 0;
-  /*   left: 0; */ /*   right: 0; */ /*   bottom: 0; */
-  /* Layout under siblings (participant panel etc). */
-  z-index: -1;
-}
-
- at sprite .toolbar {
-  gwt-image: 'emptyToolbar';
-}

Modified: trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -49,12 +49,14 @@
 import org.waveprotocol.wave.client.wavepanel.view.dom.full.DomRenderer;
 import org.waveprotocol.wave.client.widget.popup.PopupChromeFactory;
 import org.waveprotocol.wave.client.widget.popup.PopupFactory;
+import org.waveprotocol.wave.model.conversation.Conversation;
+import org.waveprotocol.wave.model.conversation.ConversationBlip;
 import org.waveprotocol.wave.model.conversation.ConversationView;
 import org.waveprotocol.wave.model.id.IdGenerator;
+import org.waveprotocol.wave.model.id.ModernIdSerialiser;
 import org.waveprotocol.wave.model.wave.ParticipantId;
 import org.waveprotocol.wave.model.waveref.WaveRef;
 
-import cc.kune.common.client.log.Log;
 import cc.kune.common.shared.i18n.I18nTranslationService;
 
 import com.google.gwt.dom.client.Element;
@@ -68,30 +70,29 @@
 
   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 I18nTranslationService i18n;
   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 boolean closed;
+  private StageOne one;
+  private StageTwo two;
   private StageThree three;
-  private StageTwo two;
   private WaveContext wave;
-  private final Element wavePanelElement;
-  private final WaveRef waveRef;
 
-  private final WaveStore waveStore;
-
   /**
    * @param wavePanelElement The dom element to become the wave panel
    * @param rootPanel A panel that this an ancestor of wavePanelElement. This is
@@ -102,9 +103,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, final I18nTranslationService i18n) {
+  public KuneStagesProvider(Element wavePanelElement, LogicalPanel rootPanel, WaveRef waveRef,
+      RemoteViewServiceMultiplexer channel, IdGenerator idGenerator, ProfileManager profiles,
+      WaveStore store, boolean isNewWave, String localDomain, boolean showParticipantsPanel, I18nTranslationService i18n) {
     this.wavePanelElement = wavePanelElement;
     this.rootPanel = rootPanel;
     this.waveRef = waveRef;
@@ -119,17 +120,43 @@
   }
 
   @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 Element createWaveHolder() {
+        return wavePanelElement;
+      }
+
+      @Override
       protected LogicalPanel createWaveContainer() {
         return rootPanel;
       }
+    });
+  }
 
+  @Override
+  protected AsyncHolder<StageTwo> createStageTwoLoader(StageOne one) {
+    return haltIfClosed(new StageTwoProvider(
+        this.one = one, waveRef.getWaveId(), channel, isNewWave, idGenerator, profiles) {
+      // Kune patch
       @Override
-      protected Element createWaveHolder() {
-        return wavePanelElement;
+      protected DomRenderer createRenderer() {
+        return KuneFullDomWaveRendererImpl.create(getConversations(), getProfileManager(),
+            getBlipDetailer(), getViewIdMapper(), getBlipQueue(), getThreadReadStateMonitor(),
+            createViewFactories(), showParticipantsPanel);
       }
+
+      // Warning: this run into issue #73
+      //      @Override
+      //      protected void installFeatures() {
+      //        WavePanelResourceLoader.loadCss();
+      //        // KuneWavePanelResourceLoader.loadCss();
+      //      }
     });
   }
 
@@ -141,7 +168,7 @@
         // Prepend an init wave flow onto the stage continuation.
         super.create(new Accessor<StageThree>() {
           @Override
-          public void use(final StageThree x) {
+          public void use(StageThree x) {
             onStageThreeLoaded(x, whenReady);
           }
         });
@@ -178,31 +205,64 @@
     });
   }
 
-  @Override
-  protected AsyncHolder<StageTwo> createStageTwoLoader(final StageOne one) {
-    return haltIfClosed(new StageTwoProvider(
-        this.one = one, waveRef, channel, isNewWave, idGenerator, profiles) {
-      // Kune patch
-      @Override
-      protected DomRenderer createRenderer() {
-        return KuneFullDomWaveRendererImpl.create(getConversations(), getProfileManager(),
-            getBlipDetailer(), getViewIdMapper(), getBlipQueue(), getThreadReadStateMonitor(),
-            createViewFactories(), showParticipantsPanel);
-      }
+  private void onStageThreeLoaded(StageThree x, Accessor<StageThree> whenReady) {
+    if (closed) {
+      // Stop the loading process.
+      return;
+    }
+    three = x;
+    if (isNewWave) {
+      initNewWave(x);
+    } else {
+      handleExistingWave(x);
+    }
+    wave = new WaveContext(
+        two.getWave(), two.getConversations(), two.getSupplement(), two.getReadMonitor());
+    waveStore.add(wave);
+    whenReady.use(x);
+  }
 
-      // Warning: this run into issue #73
-      //      @Override
-      //      protected void installFeatures() {
-      //        WavePanelResourceLoader.loadCss();
-      //        // KuneWavePanelResourceLoader.loadCss();
-      //      }
-    });
+  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);
   }
 
-  @Override
-  protected AsyncHolder<StageZero> createStageZeroLoader() {
-    return haltIfClosed(super.createStageZeroLoader());
+  private void handleExistingWave(StageThree three) {
+    // If there's blip reference then focus on that blip.
+    String documentId = waveRef.getDocumentId();
+    if (documentId != null) {
+      ModelAsViewProvider views = two.getModelAsViewProvider();
+      BlipQueueRenderer blipQueue = two.getBlipQueue();
+      ConversationView wave = two.getConversations();
+      blipQueue.flush();
+      // Find conversation
+      Conversation conversation;
+      if (waveRef.hasWaveletId()) {
+        String id = ModernIdSerialiser.INSTANCE.serialiseWaveletId(waveRef.getWaveletId());
+        conversation = wave.getConversation(id);
+      } else {
+        // Unspecified wavelet means root.
+        conversation = wave.getRoot();
+      }
+      if (conversation != null) {
+        // Find selected blip.
+        ConversationBlip blip = wave.getRoot().getBlip(documentId);
+        if (blip != null) {
+          BlipView blipUi = views.getBlipView(blip);
+          if (blipUi != null) {
+            two.getStageOne().getFocusFrame().focus(blipUi);
   }
+        }
+      }
+    }
+  }
 
   public void destroy() {
     if (wave != null) {
@@ -210,27 +270,15 @@
       wave = null;
     }
     if (three != null) {
-      try {
         three.getEditActions().stopEditing();
-      } catch (final Exception e) {
-        Log.info("Some exception stoping editing", e);
-      }
       three = null;
     }
     if (two != null) {
-      try {
       two.getConnector().close();
-      } catch (final Exception e) {
-        Log.info("Some exception closing connector", e);
-      }
       two = null;
     }
     if (one != null) {
-      try {
       one.getWavePanel().destroy();
-      } catch (final Exception e) {
-        Log.info("Some exception destroying panel", e);
-      }
       one = null;
     }
     closed = true;
@@ -241,41 +289,7 @@
    *         given provider.
    */
   @SuppressWarnings("unchecked") // HALT is safe as a holder for any type
-  private <T> AsyncHolder<T> haltIfClosed(final AsyncHolder<T> provider) {
+  private <T> AsyncHolder<T> haltIfClosed(AsyncHolder<T> provider) {
     return closed ? (AsyncHolder<T>) HALT : provider;
   }
-
-  private void handleExistingWave(final StageThree three) {
-      final BlipQueueRenderer blipQueue = two.getBlipQueue();
-      blipQueue.flush();
-  }
-
-  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;
-    }
-    three = x;
-    if (isNewWave) {
-      initNewWave(x);
-    } else {
-      handleExistingWave(x);
-    }
-    wave = new WaveContext(
-        two.getWave(), two.getConversations(), two.getSupplement(), two.getReadMonitor());
-    waveStore.add(wave);
-    whenReady.use(x);
-  }
 }

Added: trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java.seg
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java.seg	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/client/KuneStagesProvider.java.seg	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,295 @@
+// @formatter:off
+/**
+ * Copyright 2010 Google Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ */
+
+
+package cc.kune.wave.client;
+
+import org.waveprotocol.box.webclient.client.RemoteViewServiceMultiplexer;
+import org.waveprotocol.box.webclient.client.StageTwoProvider;
+import org.waveprotocol.box.webclient.search.WaveContext;
+import org.waveprotocol.box.webclient.search.WaveStore;
+import org.waveprotocol.wave.client.StageOne;
+import org.waveprotocol.wave.client.StageThree;
+import org.waveprotocol.wave.client.StageTwo;
+import org.waveprotocol.wave.client.StageZero;
+import org.waveprotocol.wave.client.Stages;
+import org.waveprotocol.wave.client.account.ProfileManager;
+import org.waveprotocol.wave.client.common.util.AsyncHolder;
+import org.waveprotocol.wave.client.common.util.AsyncHolder.Accessor;
+import org.waveprotocol.wave.client.common.util.LogicalPanel;
+import org.waveprotocol.wave.client.editor.EditorStaticDeps;
+import org.waveprotocol.wave.client.wavepanel.impl.WavePanelImpl;
+import org.waveprotocol.wave.client.wavepanel.impl.edit.Actions;
+import org.waveprotocol.wave.client.wavepanel.impl.edit.EditController;
+import org.waveprotocol.wave.client.wavepanel.impl.edit.EditSession;
+import org.waveprotocol.wave.client.wavepanel.impl.edit.KeepFocusInView;
+import org.waveprotocol.wave.client.wavepanel.impl.focus.FocusFramePresenter;
+import org.waveprotocol.wave.client.wavepanel.impl.indicator.ReplyIndicatorController;
+import org.waveprotocol.wave.client.wavepanel.impl.menu.MenuController;
+import org.waveprotocol.wave.client.wavepanel.impl.title.WaveTitleHandler;
+import org.waveprotocol.wave.client.wavepanel.impl.toolbar.ToolbarSwitcher;
+import org.waveprotocol.wave.client.wavepanel.view.BlipView;
+import org.waveprotocol.wave.client.wavepanel.view.dom.ModelAsViewProvider;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.BlipQueueRenderer;
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.DomRenderer;
+import org.waveprotocol.wave.client.widget.popup.PopupChromeFactory;
+import org.waveprotocol.wave.client.widget.popup.PopupFactory;
+import org.waveprotocol.wave.model.conversation.Conversation;
+import org.waveprotocol.wave.model.conversation.ConversationBlip;
+import org.waveprotocol.wave.model.conversation.ConversationView;
+import org.waveprotocol.wave.model.id.IdGenerator;
+import org.waveprotocol.wave.model.id.ModernIdSerialiser;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+import org.waveprotocol.wave.model.waveref.WaveRef;
+
+import cc.kune.common.shared.i18n.I18nTranslationService;
+
+import com.google.gwt.dom.client.Element;
+
+/**
+ * Stages for loading the undercurrent Wave Panel
+ *
+ * @author zdwang at google.com (David Wang)
+ */
+public class KuneStagesProvider extends Stages {
+
+  private final static AsyncHolder<Object> HALT = new AsyncHolder<Object>() {
+    @Override
+    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 final I18nTranslationService i18n;
+  private final IdGenerator idGenerator;
+  private final ProfileManager profiles;
+  private final WaveStore waveStore;
+  private final boolean isNewWave;
+  private final String localDomain;
+
+  private final boolean showParticipantsPanel;
+  private boolean closed;
+  private StageOne one;
+  private StageTwo two;
+  private StageThree three;
+  private WaveContext wave;
+
+  /**
+   * @param wavePanelElement The dom element to become the wave panel
+   * @param rootPanel A panel that this an ancestor of wavePanelElement. This is
+   *        used for adopting to the GWT widget tree.
+   * @param waveRef the id of the wave to open. If null, it means, create a new
+   *        wave.
+   * @param channel communication channel.
+   * @param isNewWave true if the wave is a new client-created wave
+   * @param idGenerator
+   */
+  public KuneStagesProvider(Element wavePanelElement, LogicalPanel rootPanel, WaveRef waveRef,
+      RemoteViewServiceMultiplexer channel, IdGenerator idGenerator, ProfileManager profiles,
+      WaveStore store, boolean isNewWave, String localDomain, boolean showParticipantsPanel, I18nTranslationService i18n) {
+    this.wavePanelElement = wavePanelElement;
+    this.rootPanel = rootPanel;
+    this.waveRef = waveRef;
+    this.channel = channel;
+    this.idGenerator = idGenerator;
+    this.profiles = profiles;
+    this.waveStore = store;
+    this.isNewWave = isNewWave;
+    this.localDomain = localDomain;
+    this.showParticipantsPanel = showParticipantsPanel;
+    this.i18n = i18n;
+  }
+
+  @Override
+  protected AsyncHolder<StageZero> createStageZeroLoader() {
+    return haltIfClosed(super.createStageZeroLoader());
+  }
+
+  @Override
+  protected AsyncHolder<StageOne> createStageOneLoader(StageZero zero) {
+    return haltIfClosed(new StageOne.DefaultProvider(zero) {
+      @Override
+      protected Element createWaveHolder() {
+        return wavePanelElement;
+      }
+
+      @Override
+      protected LogicalPanel createWaveContainer() {
+        return rootPanel;
+      }
+    });
+  }
+
+  @Override
+  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(),
+            getBlipDetailer(), getViewIdMapper(), getBlipQueue(), getThreadReadStateMonitor(),
+            createViewFactories(), showParticipantsPanel);
+      }
+
+      // Warning: this run into issue #73
+      //      @Override
+      //      protected void installFeatures() {
+      //        WavePanelResourceLoader.loadCss();
+      //        // KuneWavePanelResourceLoader.loadCss();
+      //      }
+    });
+  }
+
+  @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(StageThree x) {
+            onStageThreeLoaded(x, whenReady);
+          }
+        });
+      }
+
+      @Override
+      protected String getLocalDomain() {
+        return localDomain;
+      }
+      @Override
+      protected void install() {
+        EditorStaticDeps.setPopupProvider(PopupFactory.getProvider());
+        EditorStaticDeps.setPopupChromeProvider(PopupChromeFactory.getProvider());
+
+        // Eagerly install some features.
+        final WavePanelImpl panel = stageTwo.getStageOne().getWavePanel();
+        final FocusFramePresenter focus = stageTwo.getStageOne().getFocusFrame();
+        final ParticipantId user = stageTwo.getSignedInUser();
+        final ModelAsViewProvider models = stageTwo.getModelAsViewProvider();
+        final ProfileManager profiles = stageTwo.getProfileManager();
+
+        final Actions actions = getEditActions();
+        final EditSession edit = getEditSession();
+        MenuController.install(actions, panel);
+        ToolbarSwitcher.install(stageTwo.getStageOne().getWavePanel(), getEditSession(),
+            getViewToolbar(), getEditToolbar());
+        WaveTitleHandler.install(edit, models);
+        ReplyIndicatorController.install(actions, edit, panel);
+        EditController.install(focus, actions, panel);
+       KuneParticipantController.install(panel, models, profiles, getLocalDomain(), i18n);
+        KeepFocusInView.install(edit, panel);
+        stageTwo.getDiffController().upgrade(edit);
+      }
+    });
+  }
+
+  private void onStageThreeLoaded(StageThree x, Accessor<StageThree> whenReady) {
+    if (closed) {
+      // Stop the loading process.
+      return;
+    }
+    three = x;
+    if (isNewWave) {
+      initNewWave(x);
+    } else {
+      handleExistingWave(x);
+    }
+    wave = new WaveContext(
+        two.getWave(), two.getConversations(), two.getSupplement(), two.getReadMonitor());
+    waveStore.add(wave);
+    whenReady.use(x);
+  }
+
+  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(StageThree three) {
+    // If there's blip reference then focus on that blip.
+    String documentId = waveRef.getDocumentId();
+    if (documentId != null) {
+      ModelAsViewProvider views = two.getModelAsViewProvider();
+      BlipQueueRenderer blipQueue = two.getBlipQueue();
+      ConversationView wave = two.getConversations();
+      blipQueue.flush();
+      // Find conversation
+      Conversation conversation;
+      if (waveRef.hasWaveletId()) {
+        String id = ModernIdSerialiser.INSTANCE.serialiseWaveletId(waveRef.getWaveletId());
+        conversation = wave.getConversation(id);
+      } else {
+        // Unspecified wavelet means root.
+        conversation = wave.getRoot();
+      }
+      if (conversation != null) {
+        // Find selected blip.
+        ConversationBlip blip = wave.getRoot().getBlip(documentId);
+        if (blip != null) {
+          BlipView blipUi = views.getBlipView(blip);
+          if (blipUi != null) {
+            two.getStageOne().getFocusFrame().focus(blipUi);
+  }
+        }
+      }
+    }
+  }
+
+  public void destroy() {
+    if (wave != null) {
+      waveStore.remove(wave);
+      wave = null;
+    }
+    if (three != null) {
+        three.getEditActions().stopEditing();
+      three = null;
+    }
+    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;
+  }
+}

Deleted: trunk/src/main/java/cc/kune/wave/client/KuneWaveResources.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/KuneWaveResources.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/wave/client/KuneWaveResources.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.wave.client;
-
-import org.waveprotocol.wave.client.wavepanel.view.dom.full.TopConversationViewBuilder;
-
-import com.google.gwt.resources.client.ClientBundle;
-import com.google.gwt.resources.client.ImageResource;
-import com.google.gwt.resources.client.ImageResource.ImageOptions;
-import com.google.gwt.resources.client.ImageResource.RepeatStyle;
-
-public class KuneWaveResources {
-  // Not used now
-  public interface Conversation extends ClientBundle {
-    // Note: the CSS file contains a gwt-image reference, so must be defined
-    // after the referenced images in this interface.
-    @Source("KuneConversation.css")
-    TopConversationViewBuilder.Css css();
-
-    @ImageOptions(repeatStyle = RepeatStyle.Horizontal)
-    @Source("toolbar_empty.png")
-    ImageResource emptyToolbar();
-  }
-}

Deleted: trunk/src/main/java/cc/kune/wave/client/WaveClientClearEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveClientClearEvent.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/wave/client/WaveClientClearEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,77 +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.client;
-
-import com.google.gwt.event.shared.EventHandler;
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.HandlerRegistration;
-
-import com.google.gwt.event.shared.HasHandlers;
-
-public class WaveClientClearEvent extends GwtEvent<WaveClientClearEvent.WaveClientClearHandler> { 
-
-  public interface HasWaveClientClearHandlers extends HasHandlers {
-    HandlerRegistration addWaveClientClearHandler(WaveClientClearHandler handler);
-  }
-
-  public interface WaveClientClearHandler extends EventHandler {
-    public void onWaveClientClear(WaveClientClearEvent event);
-  }
-
-  private static final Type<WaveClientClearHandler> TYPE = new Type<WaveClientClearHandler>();
-
-  public static void fire(HasHandlers source) {
-    source.fireEvent(new WaveClientClearEvent());
-  }
-
-  public static Type<WaveClientClearHandler> getType() {
-    return TYPE;
-  }
-
-
-  public WaveClientClearEvent() {
-  }
-
-  @Override
-  public Type<WaveClientClearHandler> getAssociatedType() {
-    return TYPE;
-  }
-
-  @Override
-  protected void dispatch(WaveClientClearHandler handler) {
-    handler.onWaveClientClear(this);
-  }
-
-  @Override
-  public boolean equals(Object obj) {
-    return super.equals(obj);
-  }
-
-  @Override
-  public int hashCode() {
-    return super.hashCode();
-  }
-
-  @Override
-  public String toString() {
-    return "WaveClientClearEvent["
-    + "]";
-  }
-}

Added: trunk/src/main/java/cc/kune/wave/client/WaveClientClearEvent.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveClientClearEvent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/client/WaveClientClearEvent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,77 @@
+/*
+ *
+ * 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.client;
+
+import com.google.gwt.event.shared.EventHandler;
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.HandlerRegistration;
+
+import com.google.gwt.event.shared.HasHandlers;
+
+public class WaveClientClearEvent extends GwtEvent<WaveClientClearEvent.WaveClientClearHandler> { 
+
+  public interface HasWaveClientClearHandlers extends HasHandlers {
+    HandlerRegistration addWaveClientClearHandler(WaveClientClearHandler handler);
+  }
+
+  public interface WaveClientClearHandler extends EventHandler {
+    public void onWaveClientClear(WaveClientClearEvent event);
+  }
+
+  private static final Type<WaveClientClearHandler> TYPE = new Type<WaveClientClearHandler>();
+
+  public static void fire(HasHandlers source) {
+    source.fireEvent(new WaveClientClearEvent());
+  }
+
+  public static Type<WaveClientClearHandler> getType() {
+    return TYPE;
+  }
+
+
+  public WaveClientClearEvent() {
+  }
+
+  @Override
+  public Type<WaveClientClearHandler> getAssociatedType() {
+    return TYPE;
+  }
+
+  @Override
+  protected void dispatch(WaveClientClearHandler handler) {
+    handler.onWaveClientClear(this);
+  }
+
+  @Override
+  public boolean equals(Object obj) {
+    return super.equals(obj);
+  }
+
+  @Override
+  public int hashCode() {
+    return super.hashCode();
+  }
+
+  @Override
+  public String toString() {
+    return "WaveClientClearEvent["
+    + "]";
+  }
+}

Modified: trunk/src/main/java/cc/kune/wave/client/WaveClientManager.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveClientManager.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/wave/client/WaveClientManager.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -20,17 +20,17 @@
 package cc.kune.wave.client;
 
 import cc.kune.common.client.log.Log;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignOutEvent;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
 import cc.kune.core.client.rpcservices.UserServiceAsync;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;
 import cc.kune.core.client.state.TokenMatcher;
-import cc.kune.core.client.state.UserSignInEvent;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
-import cc.kune.core.client.state.UserSignOutEvent;
-import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
 import cc.kune.core.shared.dto.WaveClientParams;
-import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.armor.GSpaceArmor;
 import cc.kune.wave.client.inboxcount.InboxCountPresenter;
 
 import com.google.gwt.core.client.JavaScriptObject;

Modified: trunk/src/main/java/cc/kune/wave/client/WaveParts.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveParts.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/wave/client/WaveParts.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -19,8 +19,8 @@
  */
 package cc.kune.wave.client;
 
-import cc.kune.core.client.init.AppStartEvent;
-import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
 import cc.kune.core.client.state.Session;
 import cc.kune.wave.client.inboxcount.InboxCountPresenter;
 

Deleted: trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,92 +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.client;
-
-import org.waveprotocol.box.webclient.client.ClientEvents;
-import org.waveprotocol.box.webclient.client.events.NetworkStatusEvent;
-import org.waveprotocol.box.webclient.client.events.NetworkStatusEventHandler;
-
-import cc.kune.common.client.actions.AbstractAction;
-import cc.kune.common.client.actions.Action;
-import cc.kune.common.client.actions.ActionEvent;
-import cc.kune.common.client.actions.ui.descrip.IconLabelDescriptor;
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.sitebar.SitebarActionsPresenter;
-import cc.kune.core.client.sn.actions.SessionAction;
-import cc.kune.core.client.state.Session;
-
-import com.google.inject.Inject;
-
-public class WaveStatusIndicator {
-
-  public static class WaveStatusAction extends SessionAction {
-
-    @Inject
-    public WaveStatusAction(final Session session, final I18nTranslationService i18n) {
-      super(session, true);
-      setVisible(false);
-      ClientEvents.get().addNetworkStatusEventHandler(new NetworkStatusEventHandler() {
-        private void goOnline() {
-          putValue(Action.NAME, ""); // i18n.t("Online"));
-          putValue(AbstractAction.STYLES, "k-sitebar-wave-status, k-sitebar-wave-status-online");
-          setVisible(false);
-          NotifyUser.hideProgress();
-        }
-
-        @Override
-        public void onNetworkStatus(final NetworkStatusEvent event) {
-          switch (event.getStatus()) {
-          case CONNECTED:
-          case RECONNECTED:
-            session.check(new AsyncCallbackSimple<Void>() {
-              @Override
-              public void onSuccess(final Void result) {
-                goOnline();
-              }
-            });
-            break;
-          case DISCONNECTED:
-            NotifyUser.showProgress(i18n.t("Connecting"));
-          case RECONNECTING:
-            putValue(Action.NAME, i18n.t("Offline"));
-            putValue(AbstractAction.STYLES, "k-sitebar-wave-status, k-sitebar-wave-status-offline");
-            setVisible(true);
-            break;
-          }
-        }
-      });
-    }
-
-    @Override
-    public void actionPerformed(final ActionEvent event) {
-      // Do nothing
-    }
-
-  }
-
-  @Inject
-  public WaveStatusIndicator(final SitebarActionsPresenter sitebar, final WaveStatusAction action) {
-    final IconLabelDescriptor status = new IconLabelDescriptor(action);
-    status.setPosition(1);
-    sitebar.getRightToolbar().add(status);
-  }
-}

Added: trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/client/WaveStatusIndicator.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,92 @@
+/*
+ *
+ * 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.client;
+
+import org.waveprotocol.box.webclient.client.ClientEvents;
+import org.waveprotocol.box.webclient.client.events.NetworkStatusEvent;
+import org.waveprotocol.box.webclient.client.events.NetworkStatusEventHandler;
+
+import cc.kune.common.client.actions.AbstractAction;
+import cc.kune.common.client.actions.Action;
+import cc.kune.common.client.actions.ActionEvent;
+import cc.kune.common.client.actions.ui.descrip.IconLabelDescriptor;
+import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
+import cc.kune.core.client.sitebar.SitebarActionsPresenter;
+import cc.kune.core.client.sn.actions.SessionAction;
+import cc.kune.core.client.state.Session;
+
+import com.google.inject.Inject;
+
+public class WaveStatusIndicator {
+
+  public static class WaveStatusAction extends SessionAction {
+
+    @Inject
+    public WaveStatusAction(final Session session, final I18nTranslationService i18n) {
+      super(session, true);
+      setVisible(false);
+      ClientEvents.get().addNetworkStatusEventHandler(new NetworkStatusEventHandler() {
+        private void goOnline() {
+          putValue(Action.NAME, ""); // i18n.t("Online"));
+          putValue(AbstractAction.STYLES, "k-sitebar-wave-status, k-sitebar-wave-status-online");
+          setVisible(false);
+          NotifyUser.hideProgress();
+        }
+
+        @Override
+        public void onNetworkStatus(final NetworkStatusEvent event) {
+          switch (event.getStatus()) {
+          case CONNECTED:
+          case RECONNECTED:
+            session.check(new AsyncCallbackSimple<Void>() {
+              @Override
+              public void onSuccess(final Void result) {
+                goOnline();
+              }
+            });
+            break;
+          case DISCONNECTED:
+            NotifyUser.showProgress(i18n.t("Connecting"));
+          case RECONNECTING:
+            putValue(Action.NAME, i18n.t("Offline"));
+            putValue(AbstractAction.STYLES, "k-sitebar-wave-status, k-sitebar-wave-status-offline");
+            setVisible(true);
+            break;
+          }
+        }
+      });
+    }
+
+    @Override
+    public void actionPerformed(final ActionEvent event) {
+      // Do nothing
+    }
+
+  }
+
+  @Inject
+  public WaveStatusIndicator(final SitebarActionsPresenter sitebar, final WaveStatusAction action) {
+    final IconLabelDescriptor status = new IconLabelDescriptor(action);
+    status.setPosition(1);
+    sitebar.getRightToolbar().add(status);
+  }
+}

Modified: trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPresenter.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/wave/client/inboxcount/InboxCountPresenter.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -29,9 +29,9 @@
 import cc.kune.core.client.events.InboxUnreadUpdatedEvent;
 import cc.kune.core.client.events.NewUserRegisteredEvent;
 import cc.kune.core.client.events.SndClickEvent;
+import cc.kune.core.client.events.UserSignInOrSignOutEvent;
+import cc.kune.core.client.events.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
 import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.UserSignInOrSignOutEvent;
-import cc.kune.core.client.state.UserSignInOrSignOutEvent.UserSignInOrSignOutHandler;
 
 import com.google.gwt.event.shared.EventBus;
 import com.google.gwt.user.client.Timer;

Copied: trunk/src/main/java/cc/kune/wave/client/resources/KuneConversation.css (from rev 1655, trunk/src/main/java/cc/kune/wave/client/KuneConversation.css)
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/resources/KuneConversation.css	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/client/resources/KuneConversation.css	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,31 @@
+/*
+ * CSS for conversations.
+ *
+ * Author: reuben at google.com (Reuben Kan)
+ */
+.fixedSelf {
+  position: absolute;
+  top: 0;
+  bottom: 0;
+  left: 0;
+  right: 0;
+  z-index: 0;
+}
+
+.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.
+   */
+  overflow-y: scroll;
+  /* position: absolute; */ /*   position: relative; */
+  /*   top: 24px; */
+  top: 0;
+  /*   left: 0; */ /*   right: 0; */ /*   bottom: 0; */
+  /* Layout under siblings (participant panel etc). */
+  z-index: -1;
+}
+
+ at sprite .toolbar {
+  gwt-image: 'emptyToolbar';
+}

Copied: trunk/src/main/java/cc/kune/wave/client/resources/KuneWaveResources.java (from rev 1655, trunk/src/main/java/cc/kune/wave/client/KuneWaveResources.java)
===================================================================
--- trunk/src/main/java/cc/kune/wave/client/resources/KuneWaveResources.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/client/resources/KuneWaveResources.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,41 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.wave.client.resources;
+
+import org.waveprotocol.wave.client.wavepanel.view.dom.full.TopConversationViewBuilder;
+
+import com.google.gwt.resources.client.ClientBundle;
+import com.google.gwt.resources.client.ImageResource;
+import com.google.gwt.resources.client.ImageResource.ImageOptions;
+import com.google.gwt.resources.client.ImageResource.RepeatStyle;
+
+public class KuneWaveResources {
+  // Not used now
+  public interface Conversation extends ClientBundle {
+    // Note: the CSS file contains a gwt-image reference, so must be defined
+    // after the referenced images in this interface.
+    @Source("KuneConversation.css")
+    TopConversationViewBuilder.Css css();
+
+    @ImageOptions(repeatStyle = RepeatStyle.Horizontal)
+    @Source("toolbar_empty.png")
+    ImageResource emptyToolbar();
+  }
+}

Copied: trunk/src/main/java/cc/kune/wave/client/resources/toolbar_empty.png (from rev 1655, trunk/src/main/java/cc/kune/wave/client/toolbar_empty.png)
===================================================================
(Binary files differ)

Deleted: trunk/src/main/java/cc/kune/wave/client/toolbar_empty.png
===================================================================
(Binary files differ)

Modified: trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/wave/server/CustomUserRegistrationServlet.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -44,7 +44,7 @@
 
 /**
  * The user registration servlet allows new users to register accounts.
- * 
+ *
  * @author josephg at gmail.com (Joseph Gentle)
  */
 @SuppressWarnings("serial")
@@ -53,17 +53,18 @@
 
   private final AccountStore accountStore;
   private final String domain;
- // private final WelcomeRobot welcomeBot;
+  private final boolean registrationDisabled;
 
   private final Log LOG = Log.get(CustomUserRegistrationServlet.class);
 
   @Inject
   public CustomUserRegistrationServlet(AccountStore accountStore,
-      @Named(CoreSettings.WAVE_SERVER_DOMAIN) String domain) {
-      //, WelcomeRobot welcomeBot) {
+      @Named(CoreSettings.WAVE_SERVER_DOMAIN) String domain,
+      @Named(CoreSettings.DISABLE_REGISTRATION) boolean registrationDisabled) {
     this.accountStore = accountStore;
     this.domain = domain;
   //  this.welcomeBot = welcomeBot;
+    this.registrationDisabled = registrationDisabled;
   }
 
   @Override
@@ -71,26 +72,29 @@
     writeRegistrationPage("", AuthenticationServlet.RESPONSE_STATUS_NONE, req.getLocale(), resp);
   }
 
-  @SuppressWarnings("unchecked")
   @Override
   protected void doPost(HttpServletRequest req, HttpServletResponse resp) throws IOException {
     req.setCharacterEncoding("UTF-8");
+    String message = null;
+    String responseType;
     String password = req.getParameter(HttpRequestBasedCallbackHandler.PASSWORD_FIELD);
     if (password == null) {
       // Register the user with an empty password.
       password = "";
     }
+    if (!registrationDisabled) {
     final PasswordDigest passwordDigest = new PasswordDigest(password.toCharArray());
-    String message =
+    message =
         tryCreateUser(req.getParameter(HttpRequestBasedCallbackHandler.ADDRESS_FIELD), passwordDigest);
-    String responseType = AuthenticationServlet.RESPONSE_STATUS_SUCCESS;
+    }
 
-    if (message != null) {
+    if (message != null || registrationDisabled) {
       resp.setStatus(HttpServletResponse.SC_FORBIDDEN);
       responseType = AuthenticationServlet.RESPONSE_STATUS_FAILED;
     } else {
       message = "Registration complete.";
       resp.setStatus(HttpServletResponse.SC_OK);
+      responseType = AuthenticationServlet.RESPONSE_STATUS_SUCCESS;
     }
 
     writeRegistrationPage(message, responseType, req.getLocale(), resp);
@@ -101,7 +105,6 @@
    * returns a string containing an error message. On success, returns null.
    */
   public String tryCreateUser(String username, final PasswordDigest passwordDigest) { // NOPMD by vjrj on 27/04/11 8:36
-    final String message = null;
     ParticipantId id = null;
 
     try {
@@ -159,6 +162,6 @@
     dest.setCharacterEncoding("UTF-8");
     dest.setContentType("text/html;charset=utf-8");
     UserRegistrationPage.write(dest.getWriter(), new GxpContext(locale), domain, message,
-        responseType);
+        responseType, registrationDisabled);
   }
 }

Deleted: trunk/src/main/java/cc/kune/wave/server/KuneAgent.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneAgent.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/wave/server/KuneAgent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,193 +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.HashSet;
-import java.util.logging.Logger;
-
-import javax.annotation.Nonnull;
-
-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;
-import org.waveprotocol.wave.model.waveref.WaveRef;
-
-import com.google.inject.Inject;
-import com.google.inject.Injector;
-import com.google.inject.Singleton;
-import com.google.wave.api.Wavelet;
-
- at SuppressWarnings("serial")
- at Singleton
-public class KuneAgent extends AbstractBaseRobotAgent implements KuneWaveService {
-
-  private static final Logger LOG = Logger.getLogger(KuneAgent.class.getName());
-
-  private static final String NO_TITLE = "";
-  public static final String ROBOT_URI = AGENT_PREFIX_URI + "/kune-agent";
-
-  @Inject
-  public KuneAgent(final Injector injector) {
-    super(injector);
-  }
-
-  // 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 URL gadgetUrl) {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override
-  public void addParticipants(final WaveRef waveName, final String author, final String userWhoAdd,
-      final String... newParticipants) {
-    // TODO Auto-generated method stub
-
-  }
-
-  @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(final String title, final String message, final String... participantsArray) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public WaveRef createWave(final String title, final String message, final String waveIdToCopy,
-      final URL gadgetUrl, final ParticipantId... participantsArray) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public WaveRef createWave(final String title, final String message, final URL gadgetUrl,
-      final ParticipantId... participantsArray) {
-    // super.newWave(getWaveDomain(), participantsArray);
-    final HashSet<String> parts = new HashSet<String>();
-    for (final ParticipantId part : participantsArray) {
-      parts.add(part.getAddress());
-    }
-    final Wavelet wave = newWave(getWaveDomain(), parts);
-    return WaveRef.of(wave.getWaveId(), wave.getWaveletId());
-  }
-
-  @Override
-  public void delParticipants(final WaveRef waveName, final String whoDel, final String... participants) {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override
-  public Wavelet fetchWave(final WaveId waveId, final WaveletId waveletId, final String author) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public Wavelet fetchWave(final WaveRef waveRef, final String author) {
-    // // Preconditions.checkNotNull(author);
-    // RobotAccountData account = null;
-    // final String rpcUrl = "http://" + getFrontEndAddress() + "/robot/rpc";
-    // try {
-    // account = getAccountStore().getAccount(
-    // ParticipantId.ofUnsafe(getRobotId() + "@" + getWaveDomain())).asRobot();
-    // } catch (final PersistenceException e) {
-    // LOG.log(Level.WARNING, "Cannot fetch account data for robot id: " +
-    // getRobotId(), e);
-    // }
-    // if (account != null) {
-    // setupOAuth(account.getId().getAddress(), account.getConsumerSecret(),
-    // rpcUrl);
-    // try {
-    // return super.fetchWavelet(waveRef.getWaveId(), waveRef.getWaveletId(),
-    // "http://"
-    // + getFrontEndAddress() + "/robot/rpc");
-    // } catch (final IOException e) {
-    // e.printStackTrace();
-    // return null;
-    // }
-    // }
-    return null;
-  }
-
-  @Override
-  public String getRobotId() {
-    return "kune-agent";
-  }
-
-  @Override
-  protected String getRobotName() {
-    return "Kune Agent";
-  }
-
-  @Override
-  public String getRobotUri() {
-    return ROBOT_URI;
-  }
-
-  @Override
-  public boolean isParticipant(final Wavelet wavelet, final String user) {
-    // TODO Auto-generated method stub
-    return false;
-  }
-
-  @Override
-  public String render(final Wavelet wavelet) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public String render(final WaveRef waveRef, final String author) {
-    // TODO Auto-generated method stub
-    return null;
-  }
-
-  @Override
-  public void setGadgetProperty(final WaveRef waveletName, final String author, final URL gadgetUrl,
-      final String someProperty, final String someValue) {
-    // TODO Auto-generated method stub
-
-  }
-
-  @Override
-  public void setTitle(final WaveRef waveName, final String title, final String author) {
-    // TODO Auto-generated method stub
-
-  }
-
-}

Deleted: trunk/src/main/java/cc/kune/wave/server/KuneWaveService.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveService.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveService.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,68 +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 KuneWaveService {
-  public static final String NO_MESSAGE = "";
-  public static final String NO_TITLE = "";
-  public static final URL WITHOUT_GADGET = null;
-
-  void addGadget(WaveRef waveName, String author, URL 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... 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 setGadgetProperty(WaveRef waveletName, String author, URL gadgetUrl, String someProperty,
-      String someValue);
-
-  void setTitle(WaveRef waveName, String title, String author);
-
-}

Deleted: trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,491 +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.Arrays;
-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 java.util.TreeSet;
-
-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.shared.utils.TextUtils;
-import cc.kune.core.client.errors.DefaultException;
-
-import com.google.common.collect.ImmutableMap;
-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.Participants;
-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.DocumentModifyQuery;
-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 List<String> NO_VALUES = Collections.<String> emptyList();
-  private static final String NO_WAVE_TO_COPY = null;
-
-  /**
-   * 
-   * Copy blips
-   * 
-   * @param fromBlip
-   * @param toBlip
-   * 
-   * @author yurize at 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 URL gadgetUrl) {
-    // See DocumentModifyServiceTest
-    final List<Element> elementsIn = Lists.newArrayListWithCapacity(1);
-    final Map<String, String> properties = Maps.newHashMap();
-    properties.put(Gadget.URL, gadgetUrl.toString());
-    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();
-
-    final OperationRequest operationRequest = opQueue.modifyDocument(rootBlip);
-    operationRequest.addParameter(Parameter.of(ParamsProperty.MODIFY_ACTION, new DocumentModifyAction(
-        ModifyHow.INSERT, NO_VALUES, NO_ANNOTATION_KEY, elementsIn, NO_BUNDLED_ANNOTATIONS, false)));
-    operationRequest.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 Participants currentParticipants = wavelet.getParticipants();
-    // Removing duplicates
-    for (final String participant : toSet(newLocalParticipants)) {
-      final String newPartWithDomain = participantUtils.of(participant).toString();
-      if (!currentParticipants.contains(newPartWithDomain)) {
-        // FIXME This is very costly. Seems like only one participant per
-        // opQueue is added (try to
-        // fix this in WAVE)
-        final OperationQueue opQueue = new OperationQueue();
-        LOG.debug("Adding as participant: " + newPartWithDomain);
-        opQueue.addParticipantToWavelet(wavelet, newPartWithDomain);
-        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(final String title, final String message, final String... participantsArray) {
-    return createWave(title, message, participantUtils.listFrom(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 && TextUtils.notEmpty(waveIdToCopy)) {
-      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... participantsToDel) {
-    final Wavelet wavelet = fetchWave(waveName, whoDel);
-    final Participants currentParticipants = wavelet.getParticipants();
-    final Set<String> set = toSet(participantsToDel);
-    LOG.debug("Removing participants: " + set.toString());
-    for (final String participant : set) {
-      // FIXME Seems like only one participant per opQueue is added (try to fix
-      // this in WAVE)
-      final String partWithDomain = participantUtils.of(participant).toString();
-      if (currentParticipants.contains(partWithDomain)) {
-        final OperationQueue opQueue = new OperationQueue();
-        LOG.debug("Removing as participant: " + partWithDomain);
-        opQueue.removeParticipantFromWavelet(wavelet, partWithDomain);
-        doOperation(whoDel, opQueue, "del participant");
-      }
-    }
-  }
-
-  private void doOperation(final String author, final OperationQueue opQueue, final String logComment) {
-    // FIXME: do here a callback!!!
-    final OperationContextImpl context = new OperationContextImpl(waveletProvider,
-        converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
-    for (final OperationRequest request : opQueue.getPendingOperations()) {
-      // 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
-      assert response != null;
-      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 setGadgetProperty(final WaveRef waveletName, final String author, final URL gadgetUrl,
-      final String someProperty, final String someValue) {
-    // See BlipContentRefs DocumentModifyService
-    final Wavelet wavelet = fetchWave(waveletName, author);
-    // FIXME
-    final OperationQueue opQueue = new OperationQueue();
-    final Blip rootBlip = wavelet.getRootBlip();
-    for (final Element elem : rootBlip.getElements().values()) {
-      if (elem.isGadget()) {
-        final Map<String, String> properties = elem.getProperties();
-        if (properties.get(Gadget.URL).equals(gadgetUrl.toString())) {
-          // This is the gadget we want to modify (the first of that type)
-          final List<Element> updatedElementsIn = Lists.newArrayListWithCapacity(1);
-          properties.put(someProperty, someValue);
-          // properties.put(propertyNameToDelete, null);
-          final Gadget gadget = (Gadget) elem;
-          gadget.setProperty(someProperty, someValue);
-          // updatedElementsIn.add(new Gadget(properties));
-          updatedElementsIn.add(gadget);
-          final OperationRequest operationRequest = opQueue.modifyDocument(rootBlip);
-          operationRequest.addParameter(Parameter.of(ParamsProperty.MODIFY_ACTION,
-              new DocumentModifyAction(ModifyHow.UPDATE_ELEMENT, NO_VALUES, NO_ANNOTATION_KEY,
-                  updatedElementsIn, NO_BUNDLED_ANNOTATIONS, false)));
-          operationRequest.addParameter(Parameter.of(
-              ParamsProperty.MODIFY_QUERY,
-              new DocumentModifyQuery(ElementType.GADGET, ImmutableMap.of(Gadget.URL,
-                  gadgetUrl.toString()), 1)));
-          doOperation(author, opQueue, "set gadget property");
-          break;
-        }
-      }
-    }
-  }
-
-  @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");
-  }
-
-  private Set<String> toSet(final String[] array) {
-    final Set<String> set = new TreeSet<String>(Collections.reverseOrder());
-    set.addAll(Arrays.asList(array));
-    return set;
-  }
-}

Deleted: trunk/src/main/java/cc/kune/wave/server/WaveEmailNotifier.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/WaveEmailNotifier.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/cc/kune/wave/server/WaveEmailNotifier.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,84 +0,0 @@
-package cc.kune.wave.server;
-
-import javax.persistence.NoResultException;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.waveprotocol.box.common.DeltaSequence;
-import org.waveprotocol.box.server.waveserver.WaveBus;
-import org.waveprotocol.box.server.waveserver.WaveBus.Subscriber;
-import org.waveprotocol.wave.model.id.IdUtil;
-import org.waveprotocol.wave.model.id.WaveletId;
-import org.waveprotocol.wave.model.id.WaveletName;
-import org.waveprotocol.wave.model.operation.wave.AddParticipant;
-import org.waveprotocol.wave.model.operation.wave.TransformedWaveletDelta;
-import org.waveprotocol.wave.model.operation.wave.WaveletBlipOperation;
-import org.waveprotocol.wave.model.operation.wave.WaveletOperation;
-import org.waveprotocol.wave.model.version.HashedVersion;
-import org.waveprotocol.wave.model.wave.ParticipantId;
-import org.waveprotocol.wave.model.wave.data.ReadableWaveletData;
-import org.waveprotocol.wave.model.waveref.WaveRef;
-
-import cc.kune.core.server.LogThis;
-import cc.kune.core.server.mail.FormatedString;
-import cc.kune.core.server.notifier.NotifySender;
-import cc.kune.core.server.notifier.NotifyType;
-import cc.kune.core.server.notifier.UsersOnline;
-import cc.kune.core.server.properties.KuneBasicProperties;
-import cc.kune.domain.User;
-import cc.kune.domain.finders.UserFinder;
-
-import com.google.inject.Inject;
-
- at LogThis
-public class WaveEmailNotifier {
-  public static final Log LOG = LogFactory.getLog(WaveEmailNotifier.class);
-
-  @Inject
-  public WaveEmailNotifier(final WaveBus waveBus, final NotifySender notifyService,
-      final UsersOnline usersOnline, final KuneBasicProperties basicProperties,
-      final ParticipantUtils partUtils, final UserFinder userFinder) {
-    waveBus.subscribe(new Subscriber() {
-      @Override
-      public void waveletCommitted(final WaveletName waveletName, final HashedVersion version) {
-      }
-
-      @Override
-      public void waveletUpdate(final ReadableWaveletData wavelet, final DeltaSequence deltas) {
-        final WaveletId waveletId = wavelet.getWaveletId();
-        if (IdUtil.isUserDataWavelet(waveletId)) {
-          return;
-        }
-        for (final TransformedWaveletDelta delta : deltas) {
-          for (final WaveletOperation op : delta) {
-            if (op instanceof AddParticipant) {
-              final ParticipantId participant = ((AddParticipant) op).getParticipantId();
-              final String url = KuneWaveUtils.getUrl(WaveRef.of(wavelet.getWaveId(), waveletId));
-              final FormatedString body = FormatedString.build(
-                  "Hi there,<br><br>You have a new message in %s. <a href=\"%s#%s\">Read more</a>.<br>",
-                  basicProperties.getSiteCommonName(), basicProperties.getSiteUrl(), url);
-              final String address = participant.getAddress();
-              if (partUtils.isLocal(address)) {
-                final String userName = partUtils.getAddressName(address);
-                // FIXME only for testing
-                try {
-                  final User user = userFinder.findByShortName(userName);
-                  if (true || !usersOnline.isLogged(userName)) {
-                    notifyService.send(NotifyType.email, FormatedString.build("You have a new message"),
-                        body, true, user);
-                    notifyService.send(NotifyType.chat, FormatedString.build("New message"), body, true,
-                        user);
-                  }
-                } catch (final NoResultException e) {
-                  // Seems is not a local user
-                }
-              }
-            } else if (op instanceof WaveletBlipOperation) {
-
-            }
-          }
-        }
-      }
-    });
-  }
-}

Copied: trunk/src/main/java/cc/kune/wave/server/kspecific/KuneAgent.java (from rev 1655, trunk/src/main/java/cc/kune/wave/server/KuneAgent.java)
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/kspecific/KuneAgent.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/server/kspecific/KuneAgent.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,193 @@
+/*
+ *
+ * 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.kspecific;
+
+import java.net.URL;
+import java.util.HashSet;
+import java.util.logging.Logger;
+
+import javax.annotation.Nonnull;
+
+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;
+import org.waveprotocol.wave.model.waveref.WaveRef;
+
+import com.google.inject.Inject;
+import com.google.inject.Injector;
+import com.google.inject.Singleton;
+import com.google.wave.api.Wavelet;
+
+ at SuppressWarnings("serial")
+ at Singleton
+public class KuneAgent extends AbstractBaseRobotAgent implements KuneWaveService {
+
+  private static final Logger LOG = Logger.getLogger(KuneAgent.class.getName());
+
+  private static final String NO_TITLE = "";
+  public static final String ROBOT_URI = AGENT_PREFIX_URI + "/kune-agent";
+
+  @Inject
+  public KuneAgent(final Injector injector) {
+    super(injector);
+  }
+
+  // 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 URL gadgetUrl) {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public void addParticipants(final WaveRef waveName, final String author, final String userWhoAdd,
+      final String... newParticipants) {
+    // TODO Auto-generated method stub
+
+  }
+
+  @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(final String title, final String message, final String... participantsArray) {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public WaveRef createWave(final String title, final String message, final String waveIdToCopy,
+      final URL gadgetUrl, final ParticipantId... participantsArray) {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public WaveRef createWave(final String title, final String message, final URL gadgetUrl,
+      final ParticipantId... participantsArray) {
+    // super.newWave(getWaveDomain(), participantsArray);
+    final HashSet<String> parts = new HashSet<String>();
+    for (final ParticipantId part : participantsArray) {
+      parts.add(part.getAddress());
+    }
+    final Wavelet wave = newWave(getWaveDomain(), parts);
+    return WaveRef.of(wave.getWaveId(), wave.getWaveletId());
+  }
+
+  @Override
+  public void delParticipants(final WaveRef waveName, final String whoDel, final String... participants) {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public Wavelet fetchWave(final WaveId waveId, final WaveletId waveletId, final String author) {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public Wavelet fetchWave(final WaveRef waveRef, final String author) {
+    // // Preconditions.checkNotNull(author);
+    // RobotAccountData account = null;
+    // final String rpcUrl = "http://" + getFrontEndAddress() + "/robot/rpc";
+    // try {
+    // account = getAccountStore().getAccount(
+    // ParticipantId.ofUnsafe(getRobotId() + "@" + getWaveDomain())).asRobot();
+    // } catch (final PersistenceException e) {
+    // LOG.log(Level.WARNING, "Cannot fetch account data for robot id: " +
+    // getRobotId(), e);
+    // }
+    // if (account != null) {
+    // setupOAuth(account.getId().getAddress(), account.getConsumerSecret(),
+    // rpcUrl);
+    // try {
+    // return super.fetchWavelet(waveRef.getWaveId(), waveRef.getWaveletId(),
+    // "http://"
+    // + getFrontEndAddress() + "/robot/rpc");
+    // } catch (final IOException e) {
+    // e.printStackTrace();
+    // return null;
+    // }
+    // }
+    return null;
+  }
+
+  @Override
+  public String getRobotId() {
+    return "kune-agent";
+  }
+
+  @Override
+  protected String getRobotName() {
+    return "Kune Agent";
+  }
+
+  @Override
+  public String getRobotUri() {
+    return ROBOT_URI;
+  }
+
+  @Override
+  public boolean isParticipant(final Wavelet wavelet, final String user) {
+    // TODO Auto-generated method stub
+    return false;
+  }
+
+  @Override
+  public String render(final Wavelet wavelet) {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public String render(final WaveRef waveRef, final String author) {
+    // TODO Auto-generated method stub
+    return null;
+  }
+
+  @Override
+  public void setGadgetProperty(final WaveRef waveletName, final String author, final URL gadgetUrl,
+      final String someProperty, final String someValue) {
+    // TODO Auto-generated method stub
+
+  }
+
+  @Override
+  public void setTitle(final WaveRef waveName, final String title, final String author) {
+    // TODO Auto-generated method stub
+
+  }
+
+}

Copied: trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveService.java (from rev 1655, trunk/src/main/java/cc/kune/wave/server/KuneWaveService.java)
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveService.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveService.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -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.wave.server.kspecific;
+
+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 String NO_MESSAGE = "";
+  public static final String NO_TITLE = "";
+  public static final URL WITHOUT_GADGET = null;
+
+  void addGadget(WaveRef waveName, String author, URL 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... 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 setGadgetProperty(WaveRef waveletName, String author, URL gadgetUrl, String someProperty,
+      String someValue);
+
+  void setTitle(WaveRef waveName, String title, String author);
+
+}

Copied: trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveServiceDefault.java (from rev 1655, trunk/src/main/java/cc/kune/wave/server/KuneWaveServiceDefault.java)
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveServiceDefault.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveServiceDefault.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,492 @@
+/*
+ *
+ * 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.kspecific;
+
+import java.net.URL;
+import java.util.Arrays;
+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 java.util.TreeSet;
+
+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.shared.utils.TextUtils;
+import cc.kune.core.client.errors.DefaultException;
+import cc.kune.wave.server.ParticipantUtils;
+
+import com.google.common.collect.ImmutableMap;
+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.Participants;
+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.DocumentModifyQuery;
+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 List<String> NO_VALUES = Collections.<String> emptyList();
+  private static final String NO_WAVE_TO_COPY = null;
+
+  /**
+   * 
+   * Copy blips
+   * 
+   * @param fromBlip
+   * @param toBlip
+   * 
+   * @author yurize at 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 URL gadgetUrl) {
+    // See DocumentModifyServiceTest
+    final List<Element> elementsIn = Lists.newArrayListWithCapacity(1);
+    final Map<String, String> properties = Maps.newHashMap();
+    properties.put(Gadget.URL, gadgetUrl.toString());
+    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();
+
+    final OperationRequest operationRequest = opQueue.modifyDocument(rootBlip);
+    operationRequest.addParameter(Parameter.of(ParamsProperty.MODIFY_ACTION, new DocumentModifyAction(
+        ModifyHow.INSERT, NO_VALUES, NO_ANNOTATION_KEY, elementsIn, NO_BUNDLED_ANNOTATIONS, false)));
+    operationRequest.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 Participants currentParticipants = wavelet.getParticipants();
+    // Removing duplicates
+    for (final String participant : toSet(newLocalParticipants)) {
+      final String newPartWithDomain = participantUtils.of(participant).toString();
+      if (!currentParticipants.contains(newPartWithDomain)) {
+        // FIXME This is very costly. Seems like only one participant per
+        // opQueue is added (try to
+        // fix this in WAVE)
+        final OperationQueue opQueue = new OperationQueue();
+        LOG.debug("Adding as participant: " + newPartWithDomain);
+        opQueue.addParticipantToWavelet(wavelet, newPartWithDomain);
+        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(final String title, final String message, final String... participantsArray) {
+    return createWave(title, message, participantUtils.listFrom(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 && TextUtils.notEmpty(waveIdToCopy)) {
+      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... participantsToDel) {
+    final Wavelet wavelet = fetchWave(waveName, whoDel);
+    final Participants currentParticipants = wavelet.getParticipants();
+    final Set<String> set = toSet(participantsToDel);
+    LOG.debug("Removing participants: " + set.toString());
+    for (final String participant : set) {
+      // FIXME Seems like only one participant per opQueue is added (try to fix
+      // this in WAVE)
+      final String partWithDomain = participantUtils.of(participant).toString();
+      if (currentParticipants.contains(partWithDomain)) {
+        final OperationQueue opQueue = new OperationQueue();
+        LOG.debug("Removing as participant: " + partWithDomain);
+        opQueue.removeParticipantFromWavelet(wavelet, partWithDomain);
+        doOperation(whoDel, opQueue, "del participant");
+      }
+    }
+  }
+
+  private void doOperation(final String author, final OperationQueue opQueue, final String logComment) {
+    // FIXME: do here a callback!!!
+    final OperationContextImpl context = new OperationContextImpl(waveletProvider,
+        converterManager.getEventDataConverter(ProtocolVersion.DEFAULT), conversationUtil);
+    for (final OperationRequest request : opQueue.getPendingOperations()) {
+      // 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
+      assert response != null;
+      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 setGadgetProperty(final WaveRef waveletName, final String author, final URL gadgetUrl,
+      final String someProperty, final String someValue) {
+    // See BlipContentRefs DocumentModifyService
+    final Wavelet wavelet = fetchWave(waveletName, author);
+    // FIXME
+    final OperationQueue opQueue = new OperationQueue();
+    final Blip rootBlip = wavelet.getRootBlip();
+    for (final Element elem : rootBlip.getElements().values()) {
+      if (elem.isGadget()) {
+        final Map<String, String> properties = elem.getProperties();
+        if (properties.get(Gadget.URL).equals(gadgetUrl.toString())) {
+          // This is the gadget we want to modify (the first of that type)
+          final List<Element> updatedElementsIn = Lists.newArrayListWithCapacity(1);
+          properties.put(someProperty, someValue);
+          // properties.put(propertyNameToDelete, null);
+          final Gadget gadget = (Gadget) elem;
+          gadget.setProperty(someProperty, someValue);
+          // updatedElementsIn.add(new Gadget(properties));
+          updatedElementsIn.add(gadget);
+          final OperationRequest operationRequest = opQueue.modifyDocument(rootBlip);
+          operationRequest.addParameter(Parameter.of(ParamsProperty.MODIFY_ACTION,
+              new DocumentModifyAction(ModifyHow.UPDATE_ELEMENT, NO_VALUES, NO_ANNOTATION_KEY,
+                  updatedElementsIn, NO_BUNDLED_ANNOTATIONS, false)));
+          operationRequest.addParameter(Parameter.of(
+              ParamsProperty.MODIFY_QUERY,
+              new DocumentModifyQuery(ElementType.GADGET, ImmutableMap.of(Gadget.URL,
+                  gadgetUrl.toString()), 1)));
+          doOperation(author, opQueue, "set gadget property");
+          break;
+        }
+      }
+    }
+  }
+
+  @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");
+  }
+
+  private Set<String> toSet(final String[] array) {
+    final Set<String> set = new TreeSet<String>(Collections.reverseOrder());
+    set.addAll(Arrays.asList(array));
+    return set;
+  }
+}

Copied: trunk/src/main/java/cc/kune/wave/server/kspecific/WaveEmailNotifier.java (from rev 1655, trunk/src/main/java/cc/kune/wave/server/WaveEmailNotifier.java)
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/kspecific/WaveEmailNotifier.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/wave/server/kspecific/WaveEmailNotifier.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,86 @@
+package cc.kune.wave.server.kspecific;
+
+import javax.persistence.NoResultException;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.waveprotocol.box.common.DeltaSequence;
+import org.waveprotocol.box.server.waveserver.WaveBus;
+import org.waveprotocol.box.server.waveserver.WaveBus.Subscriber;
+import org.waveprotocol.wave.model.id.IdUtil;
+import org.waveprotocol.wave.model.id.WaveletId;
+import org.waveprotocol.wave.model.id.WaveletName;
+import org.waveprotocol.wave.model.operation.wave.AddParticipant;
+import org.waveprotocol.wave.model.operation.wave.TransformedWaveletDelta;
+import org.waveprotocol.wave.model.operation.wave.WaveletBlipOperation;
+import org.waveprotocol.wave.model.operation.wave.WaveletOperation;
+import org.waveprotocol.wave.model.version.HashedVersion;
+import org.waveprotocol.wave.model.wave.ParticipantId;
+import org.waveprotocol.wave.model.wave.data.ReadableWaveletData;
+import org.waveprotocol.wave.model.waveref.WaveRef;
+
+import cc.kune.core.server.LogThis;
+import cc.kune.core.server.mail.FormatedString;
+import cc.kune.core.server.notifier.NotifySender;
+import cc.kune.core.server.notifier.NotifyType;
+import cc.kune.core.server.notifier.UsersOnline;
+import cc.kune.core.server.properties.KuneBasicProperties;
+import cc.kune.domain.User;
+import cc.kune.domain.finders.UserFinder;
+import cc.kune.wave.server.KuneWaveUtils;
+import cc.kune.wave.server.ParticipantUtils;
+
+import com.google.inject.Inject;
+
+ at LogThis
+public class WaveEmailNotifier {
+  public static final Log LOG = LogFactory.getLog(WaveEmailNotifier.class);
+
+  @Inject
+  public WaveEmailNotifier(final WaveBus waveBus, final NotifySender notifyService,
+      final UsersOnline usersOnline, final KuneBasicProperties basicProperties,
+      final ParticipantUtils partUtils, final UserFinder userFinder) {
+    waveBus.subscribe(new Subscriber() {
+      @Override
+      public void waveletCommitted(final WaveletName waveletName, final HashedVersion version) {
+      }
+
+      @Override
+      public void waveletUpdate(final ReadableWaveletData wavelet, final DeltaSequence deltas) {
+        final WaveletId waveletId = wavelet.getWaveletId();
+        if (IdUtil.isUserDataWavelet(waveletId)) {
+          return;
+        }
+        for (final TransformedWaveletDelta delta : deltas) {
+          for (final WaveletOperation op : delta) {
+            if (op instanceof AddParticipant) {
+              final ParticipantId participant = ((AddParticipant) op).getParticipantId();
+              final String url = KuneWaveUtils.getUrl(WaveRef.of(wavelet.getWaveId(), waveletId));
+              final FormatedString body = FormatedString.build(
+                  "Hi there,<br><br>You have a new message in %s. <a href=\"%s#%s\">Read more</a>.<br>",
+                  basicProperties.getSiteCommonName(), basicProperties.getSiteUrl(), url);
+              final String address = participant.getAddress();
+              if (partUtils.isLocal(address)) {
+                final String userName = partUtils.getAddressName(address);
+                // FIXME only for testing
+                try {
+                  final User user = userFinder.findByShortName(userName);
+                  if (!usersOnline.isLogged(userName)) {
+                    notifyService.send(NotifyType.email, FormatedString.build("You have a new message"),
+                        body, true, user);
+                    notifyService.send(NotifyType.chat, FormatedString.build("New message"), body, true,
+                        user);
+                  }
+                } catch (final NoResultException e) {
+                  // Seems is not a local user
+                }
+              }
+            } else if (op instanceof WaveletBlipOperation) {
+
+            }
+          }
+        }
+      }
+    });
+  }
+}

Modified: trunk/src/main/java/org/waveprotocol/wave/client/wavepanel/view/dom/full/KuneWavePanelResourceLoader.java
===================================================================
--- trunk/src/main/java/org/waveprotocol/wave/client/wavepanel/view/dom/full/KuneWavePanelResourceLoader.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/main/java/org/waveprotocol/wave/client/wavepanel/view/dom/full/KuneWavePanelResourceLoader.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -18,7 +18,7 @@
 
 import org.waveprotocol.wave.client.editor.EditorImpl;
 
-import cc.kune.wave.client.KuneWaveResources;
+import cc.kune.wave.client.resources.KuneWaveResources;
 
 import com.google.gwt.core.client.GWT;
 import com.google.gwt.dom.client.StyleInjector;

Deleted: trunk/src/test/java/cc/kune/core/client/state/EventBusTester.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/state/EventBusTester.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/test/java/cc/kune/core/client/state/EventBusTester.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -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 cc.kune.core.client.state;
-
-import java.util.ArrayList;
-
-import com.google.gwt.event.shared.GwtEvent;
-import com.google.gwt.event.shared.SimpleEventBus;
-
-public class EventBusTester extends SimpleEventBus {
-    private final ArrayList<GwtEvent<?>> all;
-    private GwtEvent<?> lastEvent;
-
-    public EventBusTester() {
-        all = new ArrayList<GwtEvent<?>>();
-    }
-
-    @Override
-    public void fireEvent(final GwtEvent<?> event) {
-        all.add(event);
-        this.lastEvent = event;
-        super.fireEvent(event);
-    }
-
-    public GwtEvent<?> getLastEvent() {
-        return lastEvent;
-    }
-
-    @SuppressWarnings("unchecked")
-    public <T extends GwtEvent<?>> Class<T> getLastEventClass() {
-        return (Class<T>) lastEvent.getClass();
-    }
-
-    public boolean receivedEventOfClass(final Class<? extends GwtEvent<?>> eventClass) {
-        for (final GwtEvent<?> event : all) {
-            if (eventClass.equals(event.getClass())) {
-                return true;
-            }
-        }
-        return false;
-    }
-}

Deleted: trunk/src/test/java/cc/kune/core/client/state/StateManagerDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/state/StateManagerDefaultTest.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/test/java/cc/kune/core/client/state/StateManagerDefaultTest.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,329 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.state;
-
-import static org.mockito.Matchers.anyBoolean;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.mockito.Mockito;
-import org.mockito.invocation.InvocationOnMock;
-import org.mockito.stubbing.Answer;
-
-import cc.kune.common.client.actions.BeforeActionListener;
-import cc.kune.core.client.init.AppStartEvent;
-import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
-import cc.kune.core.client.state.GroupChangedEvent.GroupChangedHandler;
-import cc.kune.core.client.state.StateChangedEvent.StateChangedHandler;
-import cc.kune.core.client.state.ToolChangedEvent.ToolChangedHandler;
-import cc.kune.core.client.state.UserSignInEvent.UserSignInHandler;
-import cc.kune.core.client.state.UserSignOutEvent.UserSignOutHandler;
-import cc.kune.core.shared.domain.utils.StateToken;
-import cc.kune.core.shared.dto.InitDataDTO;
-import cc.kune.core.shared.dto.StateAbstractDTO;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public class StateManagerDefaultTest {
-
-  private static final StateToken EMPTY_TOKEN = null;
-  private static final StateToken GROUP1_TOOL1 = new StateToken("group1.tool1");
-  private static final StateToken GROUP1_TOOL2 = new StateToken("group1.tool2");
-  private static final StateToken GROUP2_TOOL1 = new StateToken("group2.tool1");
-  private static final String HASH = "someUserHash";
-  private BeforeActionListener beforeChangeListener1;
-  private BeforeActionListener beforeChangeListener2;
-  private ContentCache contentProvider;
-  private EventBusTester eventBus;
-  private GroupChangedHandler groupChangeHandler;
-  private HistoryWrapper history;
-  private Session session;
-  private SiteTokenListeners siteTokens;
-  private StateAbstractDTO state;
-  private StateChangedHandler stateChangeHandler;
-  private StateManagerDefault stateManager;
-  private TokenMatcher tokenMatcher;
-  private ToolChangedHandler toolChangeHandler;
-
-  @Before
-  public void before() {
-    contentProvider = Mockito.mock(ContentCache.class);
-    session = Mockito.mock(Session.class);
-    history = Mockito.mock(HistoryWrapper.class);
-    tokenMatcher = Mockito.mock(TokenMatcher.class);
-    siteTokens = Mockito.mock(SiteTokenListeners.class);
-    eventBus = new EventBusTester();
-    Mockito.when(session.getUserHash()).thenReturn(HASH);
-    Mockito.doAnswer(new Answer<Object>() {
-      @Override
-      public Object answer(final InvocationOnMock invocation) throws Throwable {
-        eventBus.addHandler(UserSignInEvent.getType(), (UserSignInHandler) invocation.getArguments()[1]);
-        return null;
-      }
-    }).when(session).onUserSignIn(anyBoolean(), (UserSignInHandler) Mockito.anyObject());
-    Mockito.doAnswer(new Answer<Object>() {
-      @Override
-      public Object answer(final InvocationOnMock invocation) throws Throwable {
-        eventBus.addHandler(UserSignOutEvent.getType(),
-            (UserSignOutHandler) invocation.getArguments()[1]);
-        return null;
-      }
-    }).when(session).onUserSignOut(anyBoolean(), (UserSignOutHandler) Mockito.anyObject());
-    Mockito.doAnswer(new Answer<Object>() {
-      @Override
-      public Object answer(final InvocationOnMock invocation) throws Throwable {
-        eventBus.addHandler(AppStartEvent.getType(), (AppStartHandler) invocation.getArguments()[1]);
-        return null;
-      }
-    }).when(session).onAppStart(anyBoolean(), (AppStartHandler) Mockito.anyObject());
-    state = Mockito.mock(StateAbstractDTO.class);
-    stateManager = new StateManagerDefault(contentProvider, session, history, tokenMatcher, eventBus,
-        siteTokens);
-    stateChangeHandler = Mockito.mock(StateChangedHandler.class);
-    groupChangeHandler = Mockito.mock(GroupChangedHandler.class);
-    toolChangeHandler = Mockito.mock(ToolChangedHandler.class);
-    beforeChangeListener1 = Mockito.mock(BeforeActionListener.class);
-    beforeChangeListener2 = Mockito.mock(BeforeActionListener.class);
-    eventBus.addHandler(StateChangedEvent.getType(), stateChangeHandler);
-    eventBus.addHandler(GroupChangedEvent.getType(), groupChangeHandler);
-    eventBus.addHandler(ToolChangedEvent.getType(), toolChangeHandler);
-    // new NotifyUser(null, null);
-  }
-
-  @Test
-  public void changeGroupWithNoTool() {
-    changeState("group1", "group2");
-    Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
-        (StateChangedEvent) Mockito.anyObject());
-    Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged(
-        (GroupChangedEvent) Mockito.anyObject());
-    Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged(
-        (GroupChangedEvent) Mockito.anyObject());
-  }
-
-  private void changeState(final String... tokens) {
-    for (final String token : tokens) {
-      Mockito.when(state.getStateToken()).thenReturn(new StateToken(token));
-      stateManager.setState(state);
-    }
-  }
-
-  @Test
-  public void changeStateWithDifferentAndGroupsToolsMustFireListener() {
-    changeState("group2.tool1", "group1.tool2");
-    Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
-        (StateChangedEvent) Mockito.anyObject());
-    Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged(
-        (GroupChangedEvent) Mockito.anyObject());
-    Mockito.verify(toolChangeHandler, Mockito.times(2)).onToolChanged(
-        (ToolChangedEvent) Mockito.anyObject());
-    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
-        new GroupChangedEvent("", "group2"));
-    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
-        new GroupChangedEvent("group2", "group1"));
-    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
-        new ToolChangedEvent(EMPTY_TOKEN, GROUP2_TOOL1));
-    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
-        new ToolChangedEvent(GROUP2_TOOL1, GROUP1_TOOL2));
-  }
-
-  @Test
-  public void changeStateWithDifferentGroupsMustFireListener() {
-    changeState("group1.tool1", "group2.tool1");
-    // assertTrue(stateChangeListener.isCalled(2));
-    // assertTrue(groupChangeListener.isCalledWithEquals("", "group1",
-    // "group1", "group2"));
-    // assertTrue(toolChangeListener.isCalledWithEquals("", "tool1"));
-    Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
-        (StateChangedEvent) Mockito.anyObject());
-    Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged(
-        (GroupChangedEvent) Mockito.anyObject());
-    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
-        (ToolChangedEvent) Mockito.anyObject());
-    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
-        new GroupChangedEvent("", "group1"));
-    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
-        new GroupChangedEvent("group1", "group2"));
-    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
-        new ToolChangedEvent(null, GROUP1_TOOL1));
-
-  }
-
-  @Test
-  public void changeStateWithDifferentToolsMustFireListener() {
-    changeState("group1.tool1", "group1.tool2");
-    Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
-        (StateChangedEvent) Mockito.anyObject());
-    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
-        (GroupChangedEvent) Mockito.anyObject());
-    Mockito.verify(toolChangeHandler, Mockito.times(2)).onToolChanged(
-        (ToolChangedEvent) Mockito.anyObject());
-    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
-        new GroupChangedEvent("", "group1"));
-    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
-        new ToolChangedEvent(EMPTY_TOKEN, GROUP1_TOOL1));
-    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
-        new ToolChangedEvent(GROUP1_TOOL1, GROUP1_TOOL2));
-  }
-
-  @Test
-  public void changeToNoTool() {
-    changeState("group1.tool1", "group1");
-    Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
-        (StateChangedEvent) Mockito.anyObject());
-    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
-        (GroupChangedEvent) Mockito.anyObject());
-    Mockito.verify(toolChangeHandler, Mockito.times(2)).onToolChanged(
-        (ToolChangedEvent) Mockito.anyObject());
-    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
-        new GroupChangedEvent("", "group1"));
-    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
-        new ToolChangedEvent(EMPTY_TOKEN, GROUP1_TOOL1));
-    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
-        new ToolChangedEvent(GROUP1_TOOL1, new StateToken("group1")));
-  }
-
-  @Test
-  public void changeToSameToken() {
-    changeState("group1.tool1", "group1.tool1");
-    Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
-        (StateChangedEvent) Mockito.anyObject());
-    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
-        (GroupChangedEvent) Mockito.anyObject());
-    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
-        (ToolChangedEvent) Mockito.anyObject());
-    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
-        new GroupChangedEvent("", "group1"));
-    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
-        new ToolChangedEvent(EMPTY_TOKEN, GROUP1_TOOL1));
-  }
-
-  private String confBeforeStateChangeListeners(final boolean value, final boolean value2) {
-    stateManager.addBeforeStateChangeListener(beforeChangeListener1);
-    stateManager.addBeforeStateChangeListener(beforeChangeListener2);
-    final String newToken = "something";
-    Mockito.when(beforeChangeListener1.beforeAction()).thenReturn(value);
-    Mockito.when(beforeChangeListener2.beforeAction()).thenReturn(value2);
-    return newToken;
-  }
-
-  @SuppressWarnings("unchecked")
-  @Test
-  public void getDefGroup() {
-    stateManager.processHistoryToken("site.docs");
-    verifyGetServerContent();
-  }
-
-  public void getWaveToken() {
-    stateManager.processHistoryToken("example.com/w+abcd/~/conv+root/b+45kg");
-  }
-
-  @SuppressWarnings("unchecked")
-  @Test
-  public void normalStartLoggedUser() {
-    // When a user enter reload state, also if the application is starting
-    // (and the user was logged)
-    Mockito.when(history.getToken()).thenReturn("");
-    stateManager.refreshCurrentState();
-    verifyGetServerContent();
-  }
-
-  @SuppressWarnings("unchecked")
-  @Test
-  public void oneBeforeStateChangeListenerAddAndRemove() {
-    final String newToken = confBeforeStateChangeListeners(false, false);
-    stateManager.processHistoryToken(newToken);
-    removeBeforeStateChangeListener();
-    stateManager.processHistoryToken(newToken);
-    verifyGetServerContent();
-  }
-
-  @Test
-  public void oneBeforeStateChangeListenerFalseAndResume() {
-    final String token = confBeforeStateChangeListeners(false, true);
-    stateManager.processHistoryToken(token);
-    Mockito.verify(history, Mockito.never()).newItem(token);
-    removeBeforeStateChangeListener();
-    stateManager.resumeTokenChange();
-    Mockito.verify(history, Mockito.times(1)).newItem(token);
-  }
-
-  @SuppressWarnings("unchecked")
-  @Test
-  public void oneBeforeStateChangeListenerReturnFalse() {
-    stateManager.processHistoryToken(confBeforeStateChangeListeners(true, false));
-    Mockito.verify(contentProvider, Mockito.never()).getContent(Mockito.anyString(),
-        (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
-  }
-
-  @SuppressWarnings("unchecked")
-  @Test
-  public void oneBeforeStateChangeListenerReturnFalseWithTwo() {
-    stateManager.processHistoryToken(confBeforeStateChangeListeners(false, false));
-    Mockito.verify(contentProvider, Mockito.never()).getContent(Mockito.anyString(),
-        (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
-  }
-
-  @SuppressWarnings("unchecked")
-  @Test
-  public void oneBeforeStateChangeListenerReturnTrue() {
-    stateManager.processHistoryToken(confBeforeStateChangeListeners(true, true));
-    verifyGetServerContent();
-  }
-
-  private void removeBeforeStateChangeListener() {
-    stateManager.removeBeforeStateChangeListener(beforeChangeListener1);
-    stateManager.removeBeforeStateChangeListener(beforeChangeListener2);
-  }
-
-  @SuppressWarnings("unchecked")
-  @Test
-  public void siteTokenFirstLoadDefContentAndFireListener() {
-    final HistoryTokenCallback listener = Mockito.mock(HistoryTokenCallback.class);
-    final String token = SiteTokens.SIGNIN;
-    stateManager.addSiteToken(token, listener);
-    Mockito.when(siteTokens.get(SiteTokens.SIGNIN)).thenReturn(listener);
-    stateManager.processHistoryToken(token);
-    Mockito.verify(listener, Mockito.times(1)).onHistoryToken(Mockito.anyString());
-    verifyGetServerContent();
-  }
-
-  @Test
-  public void siteTokenTest() {
-    final HistoryTokenCallback listener = Mockito.mock(HistoryTokenCallback.class);
-    stateManager.addSiteToken(SiteTokens.SIGNIN, listener);
-    Mockito.when(siteTokens.get(SiteTokens.SIGNIN)).thenReturn(listener);
-    stateManager.processHistoryToken("signIn");
-    Mockito.verify(listener, Mockito.times(1)).onHistoryToken(Mockito.anyString());
-  }
-
-  @Test
-  public void startMustLoadContent() {
-    final InitDataDTO initData = Mockito.mock(InitDataDTO.class);
-    Mockito.when(history.getToken()).thenReturn("");
-    eventBus.fireEvent(new AppStartEvent(initData));
-    verifyGetServerContent();
-  }
-
-  private void verifyGetServerContent() {
-    Mockito.verify(contentProvider, Mockito.times(1)).getContent(Mockito.anyString(),
-        (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
-  }
-}

Deleted: trunk/src/test/java/cc/kune/core/client/state/StateTokenTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/state/StateTokenTest.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/test/java/cc/kune/core/client/state/StateTokenTest.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -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 cc.kune.core.client.state;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertNull;
-
-import org.junit.Test;
-
-import cc.kune.core.shared.domain.utils.StateToken;
-
-public class StateTokenTest {
-
-    @Test
-    public void checkAllEmpty() {
-        final StateToken token = new StateToken("");
-        assertNull(token.getGroup());
-        assertNull(token.getTool());
-        assertNull(token.getFolder());
-        assertNull(token.getDocument());
-    }
-
-    @Test
-    public void checkEquals() {
-        final StateToken token1 = new StateToken("abc", "da", "1", "1");
-        final StateToken token2 = new StateToken("abc", "da", "1", "1");
-        assertEquals(token1, token2);
-    }
-
-    @Test
-    public void checkEqualsEncoded() {
-        final StateToken token1 = new StateToken("abc.da.1.1");
-        final StateToken token2 = new StateToken("abc.da.1.1");
-        assertEquals(token1, token2);
-    }
-
-    @Test
-    public void checkNoEquals() {
-        final StateToken token1 = new StateToken("abc", "da", "1", "1");
-        final StateToken token2 = new StateToken("abc", "da", 1L);
-        assertFalse(token1.equals(token2));
-    }
-
-    @Test
-    public void parseEncodedNotCatched() {
-        final StateToken token1 = new StateToken();
-        final StateToken token2 = new StateToken();
-        token1.getEncoded();
-        token2.getEncoded();
-        token1.setEncoded("abc.da.1.1");
-        token2.setEncoded("abc.da.1.2");
-        assertFalse(token1.equals(token2));
-    }
-}

Deleted: trunk/src/test/java/cc/kune/core/client/state/TokenMatcherTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/client/state/TokenMatcherTest.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/test/java/cc/kune/core/client/state/TokenMatcherTest.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -1,152 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.client.state;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertTrue;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.waveprotocol.wave.util.escapers.jvm.JavaWaverefEncoder;
-
-import cc.kune.core.shared.dto.ReservedWordsRegistryDTO;
-
-public class TokenMatcherTest {
-
-    private static final String DEF_SITE_TOKEN = "";
-    private static final String GROUP_TOKEN = "site.docs.1";
-    private static final String GROUP_TOKEN_ONLY_PROJECT = "site";
-    private static final String GROUP_TOKEN_ONLY_PROJECT_AND_TOOL = "site.docs";
-    private static final String REDIRECT_LINK = "example.com/w+jsdKixyHhZA";
-    private static final String SIGNIN_TOKEN = "signin";
-    private static final String SIGNIN_TOKEN_WITH_REDIRECT = SIGNIN_TOKEN + "(" + REDIRECT_LINK + ")";
-    private static final String SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW = SIGNIN_TOKEN + "(" + SiteTokens.PREVIEW + "("
-            + REDIRECT_LINK + "))";
-    private static final String WAVE_TOKEN_SAMPLE1 = "example.com/w+abcd";
-    private static final String WAVE_TOKEN_SAMPLE2 = "example.com/w+abcd/~/conv+root";
-    private static final String WAVE_TOKEN_SAMPLE3 = "example.com/w+abcd/~/conv+root/b+45kg";
-    private TokenMatcher tokenMatcher;
-
-    @Before
-    public void before() {
-        final ReservedWordsRegistryDTO reservedWords = new ReservedWordsRegistryDTO();
-        reservedWords.add(SIGNIN_TOKEN);
-        tokenMatcher = new TokenMatcher(reservedWords);
-        tokenMatcher.init(JavaWaverefEncoder.INSTANCE);
-    }
-
-    private void dontMatchGroupToken(final String token) {
-        assertFalse("Expected '" + token + "' dont match isGroup", tokenMatcher.isGroupToken(token));
-    }
-
-    @Test
-    public void dontMatchRedirect() {
-        dontMatchWaveToken(SIGNIN_TOKEN_WITH_REDIRECT);
-        dontMatchGroupToken(SIGNIN_TOKEN_WITH_REDIRECT);
-        assertFalse(tokenMatcher.hasRedirect(SIGNIN_TOKEN));
-    }
-
-    private void dontMatchWaveToken(final String token) {
-        assertFalse("Expected '" + token + "' dont match isWaveToken", tokenMatcher.isWaveToken(token));
-    }
-
-    private void matchGroupToken(final String token) {
-        assertTrue("Expected '" + token + "' match isGroup", tokenMatcher.isGroupToken(token));
-    }
-
-    private void matchWaveToken(final String token) {
-        assertTrue("Expected '" + token + "' match isWaveToken", tokenMatcher.isWaveToken(token));
-    }
-
-    @Test
-    public void matchWaveToken2() {
-        matchWaveToken(WAVE_TOKEN_SAMPLE2);
-        dontMatchGroupToken(WAVE_TOKEN_SAMPLE2);
-    }
-
-    @Test
-    public void matchWaveToken3() {
-        matchWaveToken(WAVE_TOKEN_SAMPLE3);
-        dontMatchGroupToken(WAVE_TOKEN_SAMPLE3);
-    }
-
-    @Test
-    public void shouldDontMatchNull() {
-        dontMatchWaveToken(null);
-        dontMatchWaveToken("");
-        dontMatchGroupToken(null);
-        dontMatchGroupToken("");
-    }
-
-    @Test
-    public void shouldExtractRedirect() {
-        assertTrue(tokenMatcher.hasRedirect(SIGNIN_TOKEN_WITH_REDIRECT));
-        assertEquals(SIGNIN_TOKEN, tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT).getLeft());
-        assertEquals(REDIRECT_LINK, tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT).getRight());
-    }
-
-    @Test
-    public void shouldExtractRedirectInSignPreview() {
-        assertTrue(tokenMatcher.hasRedirect(SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW));
-        assertEquals(
-                "Expected " + SIGNIN_TOKEN + " but: "
-                        + tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW).getLeft(), SIGNIN_TOKEN,
-                tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW).getLeft());
-        // assertEquals(REDIRECT_LINK,
-        // tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT).getRight());
-    }
-
-    @Test
-    public void shoulMatchCompleteToken() {
-        matchGroupToken(GROUP_TOKEN);
-        dontMatchWaveToken(GROUP_TOKEN);
-    }
-
-    @Test
-    public void shoulMatchGroupToken() {
-        matchGroupToken(GROUP_TOKEN_ONLY_PROJECT);
-        dontMatchWaveToken(GROUP_TOKEN_ONLY_PROJECT);
-    }
-
-    @Test
-    public void shoulMatchGroupToolToken() {
-        matchGroupToken(GROUP_TOKEN_ONLY_PROJECT_AND_TOOL);
-        dontMatchWaveToken(GROUP_TOKEN_ONLY_PROJECT_AND_TOOL);
-    }
-
-    @Test
-    public void testDefSiteTokenDontMatch() {
-        dontMatchWaveToken(DEF_SITE_TOKEN);
-        dontMatchGroupToken(DEF_SITE_TOKEN);
-    }
-
-    @Test
-    public void testMatchWaveToken1() {
-        matchWaveToken(WAVE_TOKEN_SAMPLE1);
-        dontMatchGroupToken(WAVE_TOKEN_SAMPLE1);
-    }
-
-    @Test
-    public void testOtherSiteTokensDontMatch() {
-        dontMatchWaveToken(SIGNIN_TOKEN);
-        dontMatchGroupToken(SIGNIN_TOKEN);
-    }
-}

Copied: trunk/src/test/java/cc/kune/core/client/state/impl/EventBusTester.java (from rev 1655, trunk/src/test/java/cc/kune/core/client/state/EventBusTester.java)
===================================================================
--- trunk/src/test/java/cc/kune/core/client/state/impl/EventBusTester.java	                        (rev 0)
+++ trunk/src/test/java/cc/kune/core/client/state/impl/EventBusTester.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,59 @@
+/*
+ *
+ * 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.state.impl;
+
+import java.util.ArrayList;
+
+import com.google.gwt.event.shared.GwtEvent;
+import com.google.gwt.event.shared.SimpleEventBus;
+
+public class EventBusTester extends SimpleEventBus {
+    private final ArrayList<GwtEvent<?>> all;
+    private GwtEvent<?> lastEvent;
+
+    public EventBusTester() {
+        all = new ArrayList<GwtEvent<?>>();
+    }
+
+    @Override
+    public void fireEvent(final GwtEvent<?> event) {
+        all.add(event);
+        this.lastEvent = event;
+        super.fireEvent(event);
+    }
+
+    public GwtEvent<?> getLastEvent() {
+        return lastEvent;
+    }
+
+    @SuppressWarnings("unchecked")
+    public <T extends GwtEvent<?>> Class<T> getLastEventClass() {
+        return (Class<T>) lastEvent.getClass();
+    }
+
+    public boolean receivedEventOfClass(final Class<? extends GwtEvent<?>> eventClass) {
+        for (final GwtEvent<?> event : all) {
+            if (eventClass.equals(event.getClass())) {
+                return true;
+            }
+        }
+        return false;
+    }
+}

Copied: trunk/src/test/java/cc/kune/core/client/state/impl/StateManagerDefaultTest.java (from rev 1655, trunk/src/test/java/cc/kune/core/client/state/StateManagerDefaultTest.java)
===================================================================
--- trunk/src/test/java/cc/kune/core/client/state/impl/StateManagerDefaultTest.java	                        (rev 0)
+++ trunk/src/test/java/cc/kune/core/client/state/impl/StateManagerDefaultTest.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,342 @@
+/*
+ *
+ * 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.state.impl;
+
+import static org.mockito.Matchers.anyBoolean;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.mockito.invocation.InvocationOnMock;
+import org.mockito.stubbing.Answer;
+
+import cc.kune.common.client.actions.BeforeActionListener;
+import cc.kune.core.client.events.AppStartEvent;
+import cc.kune.core.client.events.GroupChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.ToolChangedEvent;
+import cc.kune.core.client.events.UserSignInEvent;
+import cc.kune.core.client.events.UserSignOutEvent;
+import cc.kune.core.client.events.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.events.GroupChangedEvent.GroupChangedHandler;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
+import cc.kune.core.client.events.ToolChangedEvent.ToolChangedHandler;
+import cc.kune.core.client.events.UserSignInEvent.UserSignInHandler;
+import cc.kune.core.client.events.UserSignOutEvent.UserSignOutHandler;
+import cc.kune.core.client.state.ContentCache;
+import cc.kune.core.client.state.HistoryTokenCallback;
+import cc.kune.core.client.state.HistoryWrapper;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.SiteTokenListeners;
+import cc.kune.core.client.state.SiteTokens;
+import cc.kune.core.client.state.TokenMatcher;
+import cc.kune.core.client.state.impl.StateManagerDefault;
+import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.InitDataDTO;
+import cc.kune.core.shared.dto.StateAbstractDTO;
+
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public class StateManagerDefaultTest {
+
+  private static final StateToken EMPTY_TOKEN = null;
+  private static final StateToken GROUP1_TOOL1 = new StateToken("group1.tool1");
+  private static final StateToken GROUP1_TOOL2 = new StateToken("group1.tool2");
+  private static final StateToken GROUP2_TOOL1 = new StateToken("group2.tool1");
+  private static final String HASH = "someUserHash";
+  private BeforeActionListener beforeChangeListener1;
+  private BeforeActionListener beforeChangeListener2;
+  private ContentCache contentProvider;
+  private EventBusTester eventBus;
+  private GroupChangedHandler groupChangeHandler;
+  private HistoryWrapper history;
+  private Session session;
+  private SiteTokenListeners siteTokens;
+  private StateAbstractDTO state;
+  private StateChangedHandler stateChangeHandler;
+  private StateManagerDefault stateManager;
+  private TokenMatcher tokenMatcher;
+  private ToolChangedHandler toolChangeHandler;
+
+  @Before
+  public void before() {
+    contentProvider = Mockito.mock(ContentCache.class);
+    session = Mockito.mock(Session.class);
+    history = Mockito.mock(HistoryWrapper.class);
+    tokenMatcher = Mockito.mock(TokenMatcher.class);
+    siteTokens = Mockito.mock(SiteTokenListeners.class);
+    eventBus = new EventBusTester();
+    Mockito.when(session.getUserHash()).thenReturn(HASH);
+    Mockito.doAnswer(new Answer<Object>() {
+      @Override
+      public Object answer(final InvocationOnMock invocation) throws Throwable {
+        eventBus.addHandler(UserSignInEvent.getType(), (UserSignInHandler) invocation.getArguments()[1]);
+        return null;
+      }
+    }).when(session).onUserSignIn(anyBoolean(), (UserSignInHandler) Mockito.anyObject());
+    Mockito.doAnswer(new Answer<Object>() {
+      @Override
+      public Object answer(final InvocationOnMock invocation) throws Throwable {
+        eventBus.addHandler(UserSignOutEvent.getType(),
+            (UserSignOutHandler) invocation.getArguments()[1]);
+        return null;
+      }
+    }).when(session).onUserSignOut(anyBoolean(), (UserSignOutHandler) Mockito.anyObject());
+    Mockito.doAnswer(new Answer<Object>() {
+      @Override
+      public Object answer(final InvocationOnMock invocation) throws Throwable {
+        eventBus.addHandler(AppStartEvent.getType(), (AppStartHandler) invocation.getArguments()[1]);
+        return null;
+      }
+    }).when(session).onAppStart(anyBoolean(), (AppStartHandler) Mockito.anyObject());
+    state = Mockito.mock(StateAbstractDTO.class);
+    stateManager = new StateManagerDefault(contentProvider, session, history, tokenMatcher, eventBus,
+        siteTokens);
+    stateChangeHandler = Mockito.mock(StateChangedHandler.class);
+    groupChangeHandler = Mockito.mock(GroupChangedHandler.class);
+    toolChangeHandler = Mockito.mock(ToolChangedHandler.class);
+    beforeChangeListener1 = Mockito.mock(BeforeActionListener.class);
+    beforeChangeListener2 = Mockito.mock(BeforeActionListener.class);
+    eventBus.addHandler(StateChangedEvent.getType(), stateChangeHandler);
+    eventBus.addHandler(GroupChangedEvent.getType(), groupChangeHandler);
+    eventBus.addHandler(ToolChangedEvent.getType(), toolChangeHandler);
+    // new NotifyUser(null, null);
+  }
+
+  @Test
+  public void changeGroupWithNoTool() {
+    changeState("group1", "group2");
+    Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
+        (StateChangedEvent) Mockito.anyObject());
+    Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged(
+        (GroupChangedEvent) Mockito.anyObject());
+    Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged(
+        (GroupChangedEvent) Mockito.anyObject());
+  }
+
+  private void changeState(final String... tokens) {
+    for (final String token : tokens) {
+      Mockito.when(state.getStateToken()).thenReturn(new StateToken(token));
+      stateManager.setState(state);
+    }
+  }
+
+  @Test
+  public void changeStateWithDifferentAndGroupsToolsMustFireListener() {
+    changeState("group2.tool1", "group1.tool2");
+    Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
+        (StateChangedEvent) Mockito.anyObject());
+    Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged(
+        (GroupChangedEvent) Mockito.anyObject());
+    Mockito.verify(toolChangeHandler, Mockito.times(2)).onToolChanged(
+        (ToolChangedEvent) Mockito.anyObject());
+    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+        new GroupChangedEvent("", "group2"));
+    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+        new GroupChangedEvent("group2", "group1"));
+    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+        new ToolChangedEvent(EMPTY_TOKEN, GROUP2_TOOL1));
+    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+        new ToolChangedEvent(GROUP2_TOOL1, GROUP1_TOOL2));
+  }
+
+  @Test
+  public void changeStateWithDifferentGroupsMustFireListener() {
+    changeState("group1.tool1", "group2.tool1");
+    // assertTrue(stateChangeListener.isCalled(2));
+    // assertTrue(groupChangeListener.isCalledWithEquals("", "group1",
+    // "group1", "group2"));
+    // assertTrue(toolChangeListener.isCalledWithEquals("", "tool1"));
+    Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
+        (StateChangedEvent) Mockito.anyObject());
+    Mockito.verify(groupChangeHandler, Mockito.times(2)).onGroupChanged(
+        (GroupChangedEvent) Mockito.anyObject());
+    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+        (ToolChangedEvent) Mockito.anyObject());
+    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+        new GroupChangedEvent("", "group1"));
+    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+        new GroupChangedEvent("group1", "group2"));
+    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+        new ToolChangedEvent(null, GROUP1_TOOL1));
+
+  }
+
+  @Test
+  public void changeStateWithDifferentToolsMustFireListener() {
+    changeState("group1.tool1", "group1.tool2");
+    Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
+        (StateChangedEvent) Mockito.anyObject());
+    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+        (GroupChangedEvent) Mockito.anyObject());
+    Mockito.verify(toolChangeHandler, Mockito.times(2)).onToolChanged(
+        (ToolChangedEvent) Mockito.anyObject());
+    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+        new GroupChangedEvent("", "group1"));
+    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+        new ToolChangedEvent(EMPTY_TOKEN, GROUP1_TOOL1));
+    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+        new ToolChangedEvent(GROUP1_TOOL1, GROUP1_TOOL2));
+  }
+
+  @Test
+  public void changeToNoTool() {
+    changeState("group1.tool1", "group1");
+    Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
+        (StateChangedEvent) Mockito.anyObject());
+    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+        (GroupChangedEvent) Mockito.anyObject());
+    Mockito.verify(toolChangeHandler, Mockito.times(2)).onToolChanged(
+        (ToolChangedEvent) Mockito.anyObject());
+    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+        new GroupChangedEvent("", "group1"));
+    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+        new ToolChangedEvent(EMPTY_TOKEN, GROUP1_TOOL1));
+    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+        new ToolChangedEvent(GROUP1_TOOL1, new StateToken("group1")));
+  }
+
+  @Test
+  public void changeToSameToken() {
+    changeState("group1.tool1", "group1.tool1");
+    Mockito.verify(stateChangeHandler, Mockito.times(2)).onStateChanged(
+        (StateChangedEvent) Mockito.anyObject());
+    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+        (GroupChangedEvent) Mockito.anyObject());
+    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+        (ToolChangedEvent) Mockito.anyObject());
+    Mockito.verify(groupChangeHandler, Mockito.times(1)).onGroupChanged(
+        new GroupChangedEvent("", "group1"));
+    Mockito.verify(toolChangeHandler, Mockito.times(1)).onToolChanged(
+        new ToolChangedEvent(EMPTY_TOKEN, GROUP1_TOOL1));
+  }
+
+  private String confBeforeStateChangeListeners(final boolean value, final boolean value2) {
+    stateManager.addBeforeStateChangeListener(beforeChangeListener1);
+    stateManager.addBeforeStateChangeListener(beforeChangeListener2);
+    final String newToken = "something";
+    Mockito.when(beforeChangeListener1.beforeAction()).thenReturn(value);
+    Mockito.when(beforeChangeListener2.beforeAction()).thenReturn(value2);
+    return newToken;
+  }
+
+  @SuppressWarnings("unchecked")
+  @Test
+  public void getDefGroup() {
+    stateManager.processHistoryToken("site.docs");
+    verifyGetServerContent();
+  }
+
+  public void getWaveToken() {
+    stateManager.processHistoryToken("example.com/w+abcd/~/conv+root/b+45kg");
+  }
+
+  @SuppressWarnings("unchecked")
+  @Test
+  public void normalStartLoggedUser() {
+    // When a user enter reload state, also if the application is starting
+    // (and the user was logged)
+    Mockito.when(history.getToken()).thenReturn("");
+    stateManager.refreshCurrentState();
+    verifyGetServerContent();
+  }
+
+  @SuppressWarnings("unchecked")
+  @Test
+  public void oneBeforeStateChangeListenerAddAndRemove() {
+    final String newToken = confBeforeStateChangeListeners(false, false);
+    stateManager.processHistoryToken(newToken);
+    removeBeforeStateChangeListener();
+    stateManager.processHistoryToken(newToken);
+    verifyGetServerContent();
+  }
+
+  @Test
+  public void oneBeforeStateChangeListenerFalseAndResume() {
+    final String token = confBeforeStateChangeListeners(false, true);
+    stateManager.processHistoryToken(token);
+    Mockito.verify(history, Mockito.never()).newItem(token);
+    removeBeforeStateChangeListener();
+    stateManager.resumeTokenChange();
+    Mockito.verify(history, Mockito.times(1)).newItem(token);
+  }
+
+  @SuppressWarnings("unchecked")
+  @Test
+  public void oneBeforeStateChangeListenerReturnFalse() {
+    stateManager.processHistoryToken(confBeforeStateChangeListeners(true, false));
+    Mockito.verify(contentProvider, Mockito.never()).getContent(Mockito.anyString(),
+        (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
+  }
+
+  @SuppressWarnings("unchecked")
+  @Test
+  public void oneBeforeStateChangeListenerReturnFalseWithTwo() {
+    stateManager.processHistoryToken(confBeforeStateChangeListeners(false, false));
+    Mockito.verify(contentProvider, Mockito.never()).getContent(Mockito.anyString(),
+        (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
+  }
+
+  @SuppressWarnings("unchecked")
+  @Test
+  public void oneBeforeStateChangeListenerReturnTrue() {
+    stateManager.processHistoryToken(confBeforeStateChangeListeners(true, true));
+    verifyGetServerContent();
+  }
+
+  private void removeBeforeStateChangeListener() {
+    stateManager.removeBeforeStateChangeListener(beforeChangeListener1);
+    stateManager.removeBeforeStateChangeListener(beforeChangeListener2);
+  }
+
+  @SuppressWarnings("unchecked")
+  @Test
+  public void siteTokenFirstLoadDefContentAndFireListener() {
+    final HistoryTokenCallback listener = Mockito.mock(HistoryTokenCallback.class);
+    final String token = SiteTokens.SIGNIN;
+    stateManager.addSiteToken(token, listener);
+    Mockito.when(siteTokens.get(SiteTokens.SIGNIN)).thenReturn(listener);
+    stateManager.processHistoryToken(token);
+    Mockito.verify(listener, Mockito.times(1)).onHistoryToken(Mockito.anyString());
+    verifyGetServerContent();
+  }
+
+  @Test
+  public void siteTokenTest() {
+    final HistoryTokenCallback listener = Mockito.mock(HistoryTokenCallback.class);
+    stateManager.addSiteToken(SiteTokens.SIGNIN, listener);
+    Mockito.when(siteTokens.get(SiteTokens.SIGNIN)).thenReturn(listener);
+    stateManager.processHistoryToken("signIn");
+    Mockito.verify(listener, Mockito.times(1)).onHistoryToken(Mockito.anyString());
+  }
+
+  @Test
+  public void startMustLoadContent() {
+    final InitDataDTO initData = Mockito.mock(InitDataDTO.class);
+    Mockito.when(history.getToken()).thenReturn("");
+    eventBus.fireEvent(new AppStartEvent(initData));
+    verifyGetServerContent();
+  }
+
+  private void verifyGetServerContent() {
+    Mockito.verify(contentProvider, Mockito.times(1)).getContent(Mockito.anyString(),
+        (StateToken) Mockito.anyObject(), (AsyncCallback<StateAbstractDTO>) Mockito.anyObject());
+  }
+}

Copied: trunk/src/test/java/cc/kune/core/client/state/impl/StateTokenTest.java (from rev 1655, trunk/src/test/java/cc/kune/core/client/state/StateTokenTest.java)
===================================================================
--- trunk/src/test/java/cc/kune/core/client/state/impl/StateTokenTest.java	                        (rev 0)
+++ trunk/src/test/java/cc/kune/core/client/state/impl/StateTokenTest.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,72 @@
+/*
+ *
+ * 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.state.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertNull;
+
+import org.junit.Test;
+
+import cc.kune.core.shared.domain.utils.StateToken;
+
+public class StateTokenTest {
+
+    @Test
+    public void checkAllEmpty() {
+        final StateToken token = new StateToken("");
+        assertNull(token.getGroup());
+        assertNull(token.getTool());
+        assertNull(token.getFolder());
+        assertNull(token.getDocument());
+    }
+
+    @Test
+    public void checkEquals() {
+        final StateToken token1 = new StateToken("abc", "da", "1", "1");
+        final StateToken token2 = new StateToken("abc", "da", "1", "1");
+        assertEquals(token1, token2);
+    }
+
+    @Test
+    public void checkEqualsEncoded() {
+        final StateToken token1 = new StateToken("abc.da.1.1");
+        final StateToken token2 = new StateToken("abc.da.1.1");
+        assertEquals(token1, token2);
+    }
+
+    @Test
+    public void checkNoEquals() {
+        final StateToken token1 = new StateToken("abc", "da", "1", "1");
+        final StateToken token2 = new StateToken("abc", "da", 1L);
+        assertFalse(token1.equals(token2));
+    }
+
+    @Test
+    public void parseEncodedNotCatched() {
+        final StateToken token1 = new StateToken();
+        final StateToken token2 = new StateToken();
+        token1.getEncoded();
+        token2.getEncoded();
+        token1.setEncoded("abc.da.1.1");
+        token2.setEncoded("abc.da.1.2");
+        assertFalse(token1.equals(token2));
+    }
+}

Copied: trunk/src/test/java/cc/kune/core/client/state/impl/TokenMatcherTest.java (from rev 1655, trunk/src/test/java/cc/kune/core/client/state/TokenMatcherTest.java)
===================================================================
--- trunk/src/test/java/cc/kune/core/client/state/impl/TokenMatcherTest.java	                        (rev 0)
+++ trunk/src/test/java/cc/kune/core/client/state/impl/TokenMatcherTest.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -0,0 +1,154 @@
+/*
+ *
+ * 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.state.impl;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.waveprotocol.wave.util.escapers.jvm.JavaWaverefEncoder;
+
+import cc.kune.core.client.state.SiteTokens;
+import cc.kune.core.client.state.TokenMatcher;
+import cc.kune.core.shared.dto.ReservedWordsRegistryDTO;
+
+public class TokenMatcherTest {
+
+    private static final String DEF_SITE_TOKEN = "";
+    private static final String GROUP_TOKEN = "site.docs.1";
+    private static final String GROUP_TOKEN_ONLY_PROJECT = "site";
+    private static final String GROUP_TOKEN_ONLY_PROJECT_AND_TOOL = "site.docs";
+    private static final String REDIRECT_LINK = "example.com/w+jsdKixyHhZA";
+    private static final String SIGNIN_TOKEN = "signin";
+    private static final String SIGNIN_TOKEN_WITH_REDIRECT = SIGNIN_TOKEN + "(" + REDIRECT_LINK + ")";
+    private static final String SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW = SIGNIN_TOKEN + "(" + SiteTokens.PREVIEW + "("
+            + REDIRECT_LINK + "))";
+    private static final String WAVE_TOKEN_SAMPLE1 = "example.com/w+abcd";
+    private static final String WAVE_TOKEN_SAMPLE2 = "example.com/w+abcd/~/conv+root";
+    private static final String WAVE_TOKEN_SAMPLE3 = "example.com/w+abcd/~/conv+root/b+45kg";
+    private TokenMatcher tokenMatcher;
+
+    @Before
+    public void before() {
+        final ReservedWordsRegistryDTO reservedWords = new ReservedWordsRegistryDTO();
+        reservedWords.add(SIGNIN_TOKEN);
+        tokenMatcher = new TokenMatcher(reservedWords);
+        tokenMatcher.init(JavaWaverefEncoder.INSTANCE);
+    }
+
+    private void dontMatchGroupToken(final String token) {
+        assertFalse("Expected '" + token + "' dont match isGroup", tokenMatcher.isGroupToken(token));
+    }
+
+    @Test
+    public void dontMatchRedirect() {
+        dontMatchWaveToken(SIGNIN_TOKEN_WITH_REDIRECT);
+        dontMatchGroupToken(SIGNIN_TOKEN_WITH_REDIRECT);
+        assertFalse(tokenMatcher.hasRedirect(SIGNIN_TOKEN));
+    }
+
+    private void dontMatchWaveToken(final String token) {
+        assertFalse("Expected '" + token + "' dont match isWaveToken", tokenMatcher.isWaveToken(token));
+    }
+
+    private void matchGroupToken(final String token) {
+        assertTrue("Expected '" + token + "' match isGroup", tokenMatcher.isGroupToken(token));
+    }
+
+    private void matchWaveToken(final String token) {
+        assertTrue("Expected '" + token + "' match isWaveToken", tokenMatcher.isWaveToken(token));
+    }
+
+    @Test
+    public void matchWaveToken2() {
+        matchWaveToken(WAVE_TOKEN_SAMPLE2);
+        dontMatchGroupToken(WAVE_TOKEN_SAMPLE2);
+    }
+
+    @Test
+    public void matchWaveToken3() {
+        matchWaveToken(WAVE_TOKEN_SAMPLE3);
+        dontMatchGroupToken(WAVE_TOKEN_SAMPLE3);
+    }
+
+    @Test
+    public void shouldDontMatchNull() {
+        dontMatchWaveToken(null);
+        dontMatchWaveToken("");
+        dontMatchGroupToken(null);
+        dontMatchGroupToken("");
+    }
+
+    @Test
+    public void shouldExtractRedirect() {
+        assertTrue(tokenMatcher.hasRedirect(SIGNIN_TOKEN_WITH_REDIRECT));
+        assertEquals(SIGNIN_TOKEN, tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT).getLeft());
+        assertEquals(REDIRECT_LINK, tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT).getRight());
+    }
+
+    @Test
+    public void shouldExtractRedirectInSignPreview() {
+        assertTrue(tokenMatcher.hasRedirect(SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW));
+        assertEquals(
+                "Expected " + SIGNIN_TOKEN + " but: "
+                        + tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW).getLeft(), SIGNIN_TOKEN,
+                tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT_TO_PREVIEW).getLeft());
+        // assertEquals(REDIRECT_LINK,
+        // tokenMatcher.getRedirect(SIGNIN_TOKEN_WITH_REDIRECT).getRight());
+    }
+
+    @Test
+    public void shoulMatchCompleteToken() {
+        matchGroupToken(GROUP_TOKEN);
+        dontMatchWaveToken(GROUP_TOKEN);
+    }
+
+    @Test
+    public void shoulMatchGroupToken() {
+        matchGroupToken(GROUP_TOKEN_ONLY_PROJECT);
+        dontMatchWaveToken(GROUP_TOKEN_ONLY_PROJECT);
+    }
+
+    @Test
+    public void shoulMatchGroupToolToken() {
+        matchGroupToken(GROUP_TOKEN_ONLY_PROJECT_AND_TOOL);
+        dontMatchWaveToken(GROUP_TOKEN_ONLY_PROJECT_AND_TOOL);
+    }
+
+    @Test
+    public void testDefSiteTokenDontMatch() {
+        dontMatchWaveToken(DEF_SITE_TOKEN);
+        dontMatchGroupToken(DEF_SITE_TOKEN);
+    }
+
+    @Test
+    public void testMatchWaveToken1() {
+        matchWaveToken(WAVE_TOKEN_SAMPLE1);
+        dontMatchGroupToken(WAVE_TOKEN_SAMPLE1);
+    }
+
+    @Test
+    public void testOtherSiteTokensDontMatch() {
+        dontMatchWaveToken(SIGNIN_TOKEN);
+        dontMatchGroupToken(SIGNIN_TOKEN);
+    }
+}

Modified: trunk/src/test/java/cc/kune/core/server/manager/ContentManagerDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/manager/ContentManagerDefaultTest.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/test/java/cc/kune/core/server/manager/ContentManagerDefaultTest.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -30,7 +30,6 @@
 import cc.kune.core.client.errors.MoveOnSameContainerException;
 import cc.kune.core.client.errors.NameInUseException;
 import cc.kune.core.server.PersistencePreLoadedDataTest;
-import cc.kune.core.server.manager.impl.SearchResult;
 import cc.kune.domain.BasicMimeType;
 import cc.kune.domain.Content;
 

Modified: trunk/src/test/java/cc/kune/core/server/manager/GroupManagerDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/manager/GroupManagerDefaultTest.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/test/java/cc/kune/core/server/manager/GroupManagerDefaultTest.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -34,7 +34,6 @@
 import cc.kune.core.client.errors.I18nNotFoundException;
 import cc.kune.core.client.errors.UserRegistrationException;
 import cc.kune.core.server.PersistencePreLoadedDataTest;
-import cc.kune.core.server.manager.impl.SearchResult;
 import cc.kune.core.shared.dto.GroupType;
 import cc.kune.domain.AccessLists;
 import cc.kune.domain.Group;

Modified: trunk/src/test/java/cc/kune/core/server/manager/TagUserContentTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/manager/TagUserContentTest.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/test/java/cc/kune/core/server/manager/TagUserContentTest.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -29,7 +29,7 @@
 
 import cc.kune.core.server.PersistencePreLoadedDataTest;
 import cc.kune.core.server.manager.TagManager;
-import cc.kune.core.server.manager.TagUserContentManagerDefault;
+import cc.kune.core.server.manager.impl.TagUserContentManagerDefault;
 import cc.kune.domain.Tag;
 import cc.kune.domain.TagUserContent;
 import cc.kune.domain.finders.TagUserContentFinder;

Modified: trunk/src/test/java/cc/kune/core/server/manager/UserManagerDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/core/server/manager/UserManagerDefaultTest.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/test/java/cc/kune/core/server/manager/UserManagerDefaultTest.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -34,7 +34,6 @@
 import cc.kune.core.client.errors.GroupShortNameInUseException;
 import cc.kune.core.client.errors.I18nNotFoundException;
 import cc.kune.core.server.PersistencePreLoadedDataTest;
-import cc.kune.core.server.manager.impl.SearchResult;
 import cc.kune.core.shared.domain.UserSNetVisibility;
 import cc.kune.domain.Group;
 import cc.kune.domain.User;

Modified: trunk/src/test/java/cc/kune/gspace/client/tags/TagsSummaryPresenterTest.java
===================================================================
--- trunk/src/test/java/cc/kune/gspace/client/tags/TagsSummaryPresenterTest.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/test/java/cc/kune/gspace/client/tags/TagsSummaryPresenterTest.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -25,9 +25,9 @@
 import org.junit.Test;
 import org.mockito.Mockito;
 
-import cc.kune.core.client.state.EventBusTester;
 import cc.kune.core.client.state.Session;
 import cc.kune.core.client.state.StateManager;
+import cc.kune.core.client.state.impl.EventBusTester;
 import cc.kune.core.shared.domain.TagCloudResult;
 import cc.kune.core.shared.domain.TagCount;
 import cc.kune.core.shared.dto.StateContainerDTO;

Modified: trunk/src/test/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenterTest.java
===================================================================
--- trunk/src/test/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenterTest.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/test/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenterTest.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -23,8 +23,8 @@
 import org.junit.Test;
 import org.mockito.Mockito;
 
-import cc.kune.core.client.state.EventBusTester;
 import cc.kune.core.client.state.StateManager;
+import cc.kune.core.client.state.impl.EventBusTester;
 import cc.kune.core.shared.domain.utils.StateToken;
 import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter.ToolSelectorProxy;
 import cc.kune.gspace.client.tool.selector.ToolSelectorPresenter.ToolSelectorView;

Modified: trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java
===================================================================
--- trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/test/java/cc/kune/wave/server/KuneAgentTest.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -37,6 +37,8 @@
 import org.waveprotocol.wave.model.wave.ParticipantId;
 import org.waveprotocol.wave.model.waveref.WaveRef;
 
+import cc.kune.wave.server.kspecific.KuneAgent;
+
 import com.google.common.collect.Lists;
 import com.google.wave.api.Wavelet;
 

Modified: trunk/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java
===================================================================
--- trunk/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java	2012-01-06 20:54:28 UTC (rev 1655)
+++ trunk/src/test/java/cc/kune/wave/server/KuneWaveServiceDefaultTest.java	2012-01-08 23:06:53 UTC (rev 1656)
@@ -40,6 +40,7 @@
 import cc.kune.core.client.errors.DefaultException;
 import cc.kune.core.server.integration.IntegrationTest;
 import cc.kune.core.server.integration.IntegrationTestHelper;
+import cc.kune.wave.server.kspecific.KuneWaveService;
 
 import com.google.inject.Inject;
 import com.google.wave.api.Element;




More information about the kune-commits mailing list