kune-commits
Threads by month
- ----- 2026 -----
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2008 -----
- December
- November
- October
- September
- August
- July
- June
- May
- 1587 discussions
Author: vjrj
Date: 2008-11-11 14:33:36 +0100 (Tue, 11 Nov 2008)
New Revision: 949
Added:
branches/
Removed:
old/
rev080110/
Modified:
sandbox4/pom.xml
trunk/dev-utils/
Log:
some cleanup of repo
Modified: sandbox4/pom.xml
===================================================================
--- sandbox4/pom.xml 2008-11-11 13:29:29 UTC (rev 948)
+++ sandbox4/pom.xml 2008-11-11 13:33:36 UTC (rev 949)
@@ -133,7 +133,7 @@
<dependency>
<groupId>com.gwtext</groupId>
<artifactId>gwtext</artifactId>
- <version>2.0.4-beta1</version>
+ <version>2.0.4-beta2</version>
</dependency>
<!--
Property changes on: trunk/dev-utils
___________________________________________________________________
Name: svn:ignore
+ gwt.importorder
gwt-checkstyle-tests.xml
gwt-checkstyle.xml
1
0
Author: vjrj
Date: 2008-11-11 14:29:29 +0100 (Tue, 11 Nov 2008)
New Revision: 948
Modified:
trunk/
Log:
0.5.0
Property changes on: trunk
___________________________________________________________________
Name: subclipse:tags
+ 946,0.5.0,/tags/0.5.0,tag
1
0
Author: vjrj
Date: 2008-11-11 14:27:39 +0100 (Tue, 11 Nov 2008)
New Revision: 947
Added:
tags/
tags/0.5.0/
Log:
0.5.0
Copied: tags/0.5.0 (from rev 946, trunk)
1
0
Author: vjrj
Date: 2008-11-11 14:12:39 +0100 (Tue, 11 Nov 2008)
New Revision: 946
Added:
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContent.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentView.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewer.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerView.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextPropEditor.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextPropEditorPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextPropEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextPropEditorView.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/ContextPropertyPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPanel.java
Removed:
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditor.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/
Modified:
trunk/TODO
trunk/pom.xml
trunk/script/copy_deploy.sh
trunk/script/css-update.sh
trunk/script/deploy_gwt.cmd
trunk/script/deploy_gwt.sh
trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
Log:
Incomplete - task Context properties editor
Incomplete - task UI tools & workspace refactorization
Modified: trunk/TODO
===================================================================
--- trunk/TODO 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/TODO 2008-11-11 13:12:39 UTC (rev 946)
@@ -6,10 +6,6 @@
SHORT-TERM (URGENT):
--------------------------------------------------------------------------------
<vjrj> IconHyperlink.java and IconLabel.java to gwt1.5
-<vjrj> chat add new room name validation (do a form with validation)
---> vjrj
-<vjrj> Double click issue:
-http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/147f09153c4752d2/4caf0ac41c4625d3?lnk=gst&q=timer+double+click&rnum=1#4caf0ac41c4625d3
<vjrj> Injection problem [2]
<vjrj> BUG: Duplicate Keys in group/user creation different exception [1]
---> vjrj
@@ -351,7 +347,7 @@
Selecciona una licencia para compartir los contenidos de este grupo con el resto de gente:
[X] Usar la licencia <href>copyleft recomendada
-[ ] Quiero elegir otra licencia (uso avanzado)
+[ ] Quiero elegir otra licencia (uso avanzado)
Notas:
* <href>¿Porqué necesito una licencia?
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/pom.xml 2008-11-11 13:12:39 UTC (rev 946)
@@ -5,7 +5,7 @@
<groupId>org.ourproject</groupId>
<artifactId>kune</artifactId>
<packaging>jar</packaging>
- <version>0.0.4</version>
+ <version>0.0.5</version>
<description>
kune free/open/libre collaboration platform
</description>
Modified: trunk/script/copy_deploy.sh
===================================================================
--- trunk/script/copy_deploy.sh 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/script/copy_deploy.sh 2008-11-11 13:12:39 UTC (rev 946)
@@ -5,4 +5,4 @@
rm src/main/webapp/gwt/org.ourproject.kune.app.Kune/ -R
mkdir src/main/webapp/gwt/org.ourproject.kune.app.Kune/
-cp target/kune-0.0.4/org.ourproject.kune.app.Kune/ src/main/webapp/gwt/ -R
+cp target/kune-0.0.5/org.ourproject.kune.app.Kune/ src/main/webapp/gwt/ -R
Modified: trunk/script/css-update.sh
===================================================================
--- trunk/script/css-update.sh 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/script/css-update.sh 2008-11-11 13:12:39 UTC (rev 946)
@@ -1,7 +1,7 @@
#!/bin/bash
APPPUB=src/main/java/org/ourproject/kune/app/public
WEBAPP=src/main/webapp/gwt/org.ourproject.kune.app.Kune
-TARGET=target/kune-0.0.4/org.ourproject.kune.app.Kune
+TARGET=target/kune-0.0.5/org.ourproject.kune.app.Kune
#$PWD/script/css-compact-and-tidy.css
Modified: trunk/script/deploy_gwt.cmd
===================================================================
--- trunk/script/deploy_gwt.cmd 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/script/deploy_gwt.cmd 2008-11-11 13:12:39 UTC (rev 946)
@@ -1 +1 @@
-copy target\kune-0.0.4\org.ourproject.kune.Main\* src\main\webapp\gwt\org.ourproject.kune
+copy target\kune-0.0.5\org.ourproject.kune.Main\* src\main\webapp\gwt\org.ourproject.kune
Modified: trunk/script/deploy_gwt.sh
===================================================================
--- trunk/script/deploy_gwt.sh 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/script/deploy_gwt.sh 2008-11-11 13:12:39 UTC (rev 946)
@@ -2,11 +2,11 @@
mkdir -p src/main/webapp/gwt/org.ourproject.kune.app.Kune
-find target/kune-0.0.4/org.ourproject.kune.app.Kune/ -name .DS_Store -exec rm {} \;
+find target/kune-0.0.5/org.ourproject.kune.app.Kune/ -name .DS_Store -exec rm {} \;
script/css-compact-and-tidy.css
script/css-update.sh
-cp target/kune-0.0.4/org.ourproject.kune.app.Kune/js/ext/ext-all-debug.js target/kune-0.0.4/org.ourproject.kune.app.Kune/js/ext/ext-all.js
-rsync --delete -C -r -p target/kune-0.0.4/org.ourproject.kune.app.Kune/ src/main/webapp/gwt/org.ourproject.kune.app.Kune/
+cp target/kune-0.0.5/org.ourproject.kune.app.Kune/js/ext/ext-all-debug.js target/kune-0.0.5/org.ourproject.kune.app.Kune/js/ext/ext-all.js
+rsync --delete -C -r -p target/kune-0.0.5/org.ourproject.kune.app.Kune/ src/main/webapp/gwt/org.ourproject.kune.app.Kune/
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/all.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css 2008-11-11 13:12:39 UTC (rev 946)
@@ -41,4 +41,4 @@
padding: 1px 0px 1px 1px;
text-decoration:none;
}
-*/.k-textlinethrough{text-decoration:line-through;color:red;}.k-textnormal{text-decoration:inherit;color:green;}.k-textunderline{text-decoration:underline;color:gray;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}
\ No newline at end of file
+*/.k-textlinethrough{text-decoration:line-through;color:red;}.k-textnormal{text-decoration:inherit;color:green;}.k-textunderline{text-decoration:underline;color:gray;}.x-tool-kmenu{background-position:0 -75px;}.x-tool-kmenu-over{background-position:-15px -75px;}.k-border-openbox{border-bottom:1px #D0D0D0 solid;border-right:1px #D0D0D0 solid;border-left:1px #D0D0D0 solid;}/* SiteToastMessages */.k-stm-info-icon{background-image:url(img/info.gif)!important;}.k-stm-imp-icon{background-image:url(img/alert.gif)!important;}.k-stm-verimp-icon{background-image:url(img/important.gif)!important;}.k-stm-error-icon{background-image:url(img/error.gif)!important;}.k-error-tb{background:#FFB380 none repeat scroll 0 50%;color:#250;}.k-infod-head{font-size:108%;margin-bottom:10px;}.gwt-DisclosurePanel{}.gwt-DisclosurePanel-open{}.gwt-DisclosurePanel-closed{}.gwt-DisclosurePanel .header,.gwt-DisclosurePanel .header a,.gwt-DisclosurePanel .header td{text-decoration:none;/* Remove underline from header */color:#000;cursor:pointer;cursor:hand;}.gwt-DisclosurePanel .content{border-left:3px solid #e8eef7;padding:4px 0 4px 8px;margin-left:6px;}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-11-11 13:12:39 UTC (rev 946)
@@ -750,11 +750,36 @@
}
.k-error-tb {
- background: #FFB380 none repeat scroll 0% 50%;
- color: #250;
+ background: #FFB380 none repeat scroll 0% 50%;
+ color: #250;
}
.k-infod-head {
- font-size: 108%;
- margin-bottom: 10px;
-}
\ No newline at end of file
+ font-size: 108%;
+ margin-bottom: 10px;
+}
+
+.gwt-DisclosurePanel {
+}
+
+.gwt-DisclosurePanel-open {
+}
+
+.gwt-DisclosurePanel-closed {
+}
+
+.gwt-DisclosurePanel .header,
+.gwt-DisclosurePanel .header a,
+.gwt-DisclosurePanel .header td {
+ text-decoration: none; /* Remove underline from header */
+ color: black;
+ cursor: pointer;
+ cursor: hand;
+}
+
+.gwt-DisclosurePanel .content {
+ border-left: 3px solid #e8eef7;
+ padding: 4px 0px 4px 8px;
+ margin-left: 6px;
+}
+
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -28,8 +28,8 @@
import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_WIKI;
import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_WIKIPAGE;
-import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewer;
-import org.ourproject.kune.docs.client.ctx.admin.DocContextEditor;
+import org.ourproject.kune.docs.client.cnt.DocumentViewer;
+import org.ourproject.kune.docs.client.ctx.admin.DocContextPropEditor;
import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
import org.ourproject.kune.platf.client.actions.ActionMenuItemDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonAndItemDescriptor;
@@ -87,7 +87,7 @@
private final Provider<TextEditor> textEditorProvider;
private final KuneErrorHandler errorHandler;
private final DocumentViewer documentViewer;
- private final Provider<DocContextEditor> adminContextProvider;
+ private final Provider<DocContextPropEditor> contextPropEditorProvider;
public DocumentClientActions(final I18nUITranslationService i18n, final ContextNavigator contextNavigator,
final Session session, final StateManager stateManager,
@@ -96,7 +96,7 @@
final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
final Provider<FileDownloadUtils> fileDownloadProvider, final EntityLogo entityLogo,
final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler,
- final DocumentViewer documentViewer, final Provider<DocContextEditor> adminContextProvider) {
+ final DocumentViewer documentViewer, final Provider<DocContextPropEditor> contextProvEditorProvider) {
this.i18n = i18n;
this.contextNavigator = contextNavigator;
this.session = session;
@@ -111,7 +111,7 @@
this.textEditorProvider = textEditorProvider;
this.errorHandler = errorHandler;
this.documentViewer = documentViewer;
- this.adminContextProvider = adminContextProvider;
+ this.contextPropEditorProvider = contextProvEditorProvider;
createActions();
}
@@ -339,7 +339,7 @@
final TextEditor editor = textEditorProvider.get();
documentViewer.detach();
contextNavigator.detach();
- adminContextProvider.get().attach();
+ contextPropEditorProvider.get().attach();
editor.editContent(session.getContentState().getContent(), new Listener<String>() {
public void onEvent(final String html) {
Site.showProgressSaving();
@@ -371,7 +371,7 @@
DeferredCommand.addCommand(new Command() {
public void execute() {
documentViewer.attach();
- adminContextProvider.get().detach();
+ contextPropEditorProvider.get().detach();
contextNavigator.attach();
if (session.getCurrentStateToken().equals(stateToken)) {
documentViewer.refreshState();
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -18,20 +18,20 @@
*
*/package org.ourproject.kune.docs.client;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.DocFolderContent;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.DocFolderContentPanel;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.DocFolderContentPresenter;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.DocFolderContentView;
-import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewer;
-import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewerPanel;
-import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewerPresenter;
-import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewerView;
+import org.ourproject.kune.docs.client.cnt.DocFolderContent;
+import org.ourproject.kune.docs.client.cnt.DocFolderContentPanel;
+import org.ourproject.kune.docs.client.cnt.DocFolderContentPresenter;
+import org.ourproject.kune.docs.client.cnt.DocFolderContentView;
+import org.ourproject.kune.docs.client.cnt.DocumentViewer;
+import org.ourproject.kune.docs.client.cnt.DocumentViewerPanel;
+import org.ourproject.kune.docs.client.cnt.DocumentViewerPresenter;
+import org.ourproject.kune.docs.client.cnt.DocumentViewerView;
import org.ourproject.kune.docs.client.ctx.DocumentContext;
import org.ourproject.kune.docs.client.ctx.DocumentContextPresenter;
-import org.ourproject.kune.docs.client.ctx.admin.DocContextEditor;
-import org.ourproject.kune.docs.client.ctx.admin.DocContextEditorPanel;
-import org.ourproject.kune.docs.client.ctx.admin.DocContextEditorPresenter;
-import org.ourproject.kune.docs.client.ctx.admin.DocContextEditorView;
+import org.ourproject.kune.docs.client.ctx.admin.DocContextPropEditor;
+import org.ourproject.kune.docs.client.ctx.admin.DocContextPropEditorPanel;
+import org.ourproject.kune.docs.client.ctx.admin.DocContextPropEditorPresenter;
+import org.ourproject.kune.docs.client.ctx.admin.DocContextPropEditorView;
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
@@ -52,6 +52,7 @@
import org.ourproject.kune.workspace.client.editor.TextEditor;
import org.ourproject.kune.workspace.client.entitylogo.EntityLogo;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelector;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.tags.TagsSummary;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
@@ -85,18 +86,18 @@
$$(GroupServiceAsync.class), $$(FileUploader.class), $(ContentActionRegistry.class),
$(ContextActionRegistry.class), $$(FileDownloadUtils.class), $(EntityLogo.class),
$$(TextEditor.class), $(KuneErrorHandler.class), $(DocumentViewer.class),
- $$(DocContextEditor.class));
+ $$(DocContextPropEditor.class));
}
});
- register(Singleton.class, new Factory<DocContextEditor>(DocContextEditor.class) {
+ register(Singleton.class, new Factory<DocContextPropEditor>(DocContextPropEditor.class) {
@Override
- public DocContextEditor create() {
- final DocContextEditorPresenter presenter = new DocContextEditorPresenter($(Session.class),
+ public DocContextPropEditor create() {
+ final DocContextPropEditorPresenter presenter = new DocContextPropEditorPresenter($(Session.class),
$(StateManager.class), $$(TagsSummary.class), $$(ContentServiceAsync.class),
$(EntityTitle.class), $(EntitySubTitle.class));
- final DocContextEditorView view = new DocContextEditorPanel(presenter,
- $(I18nUITranslationService.class), $(WorkspaceSkeleton.class));
+ final DocContextPropEditorView view = new DocContextPropEditorPanel(presenter,
+ $(I18nUITranslationService.class), $(WorkspaceSkeleton.class), $$(LanguageSelector.class));
presenter.init(view);
return presenter;
}
@@ -106,7 +107,7 @@
@Override
public DocumentContext create() {
final DocumentContextPresenter presenter = new DocumentContextPresenter($(StateManager.class),
- $$(ContextNavigator.class), $$(DocContextEditor.class));
+ $$(ContextNavigator.class), $$(DocContextPropEditor.class));
return presenter;
}
});
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContent.java (from rev 942, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContent.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContent.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContent.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,23 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt;
+
+public interface DocFolderContent {
+}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPanel.java (from rev 943, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPanel.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPanel.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,33 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
+import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+public class DocFolderContentPanel extends FoldableContentPanel implements DocFolderContentView {
+
+ public DocFolderContentPanel(WorkspaceSkeleton ws, I18nTranslationService i18n) {
+ super(ws, i18n);
+ super.setLabel("Folder properties, translations ..." + Site.IN_DEVELOPMENT);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java (from rev 942, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPresenter.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentPresenter.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,40 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt;
+
+import org.ourproject.kune.docs.client.DocumentClientTool;
+import org.ourproject.kune.platf.client.actions.ActionRegistry;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
+
+public class DocFolderContentPresenter extends FoldableContentPresenter implements DocFolderContent {
+
+ public DocFolderContentPresenter(StateManager stateManager, Session session, ActionContentToolbar toolbar,
+ final ActionRegistry<StateToken> actionRegistry) {
+ super(DocumentClientTool.NAME, stateManager, session, toolbar, actionRegistry);
+ }
+
+ public void init(final DocFolderContentView view) {
+ super.init(view);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentView.java (from rev 942, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentView.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocFolderContentView.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,25 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt;
+
+import org.ourproject.kune.workspace.client.cnt.AbstractContentView;
+
+public interface DocFolderContentView extends AbstractContentView {
+}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewer.java (from rev 943, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewer.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewer.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewer.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,30 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt;
+
+public interface DocumentViewer {
+
+ void attach();
+
+ void detach();
+
+ void refreshState();
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPanel.java (from rev 943, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPanel.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPanel.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,30 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+public class DocumentViewerPanel extends FoldableContentPanel implements DocumentViewerView {
+ public DocumentViewerPanel(final WorkspaceSkeleton ws, I18nTranslationService i18n) {
+ super(ws, i18n);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java (from rev 943, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPresenter.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerPresenter.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,81 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt;
+
+import org.ourproject.kune.docs.client.DocumentClientTool;
+import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
+import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
+import org.ourproject.kune.platf.client.dto.StateContentDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.download.ImageSize;
+import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+
+import com.calclab.suco.client.ioc.Provider;
+
+public class DocumentViewerPresenter extends FoldableContentPresenter implements DocumentViewer {
+ private DocumentViewerView view;
+ private final Provider<FileDownloadUtils> downloadProvider;
+
+ public DocumentViewerPresenter(StateManager stateManager, Session session, I18nUITranslationService i18n,
+ ActionContentToolbar toolbar, ContentActionRegistry actionRegistry,
+ Provider<FileDownloadUtils> downloadProvider) {
+ super(DocumentClientTool.NAME, stateManager, session, toolbar, actionRegistry);
+ this.downloadProvider = downloadProvider;
+ }
+
+ public void init(DocumentViewerView view) {
+ super.init(view);
+ this.view = view;
+ }
+
+ public void refreshState() {
+ setState(session.getContentState());
+ }
+
+ @Override
+ protected void setState(StateContentDTO state) {
+ super.setState(state);
+ String typeId = state.getTypeId();
+ String text = state.getContent();
+ StateToken token = state.getStateToken();
+ BasicMimeTypeDTO mimeType = state.getMimeType();
+ if (typeId.equals(DocumentClientTool.TYPE_UPLOADEDFILE)) {
+ if (mimeType != null) {
+ FileDownloadUtils fileDownloadUtils = downloadProvider.get();
+ if (mimeType.getType().equals("image")) {
+ view.showImage(fileDownloadUtils.getImageUrl(token), fileDownloadUtils.getImageResizedUrl(token,
+ ImageSize.sized));
+ } else if (mimeType.toString().equals("text/plain") || mimeType.toString().equals("application/pdf")) {
+ view.setContent(text);
+ } else {
+ view.setContent("");
+ }
+ }
+ } else {
+ view.setContent(text);
+ }
+ view.attach();
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerView.java (from rev 943, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerView.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentViewerView.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,30 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt;
+
+import org.ourproject.kune.workspace.client.cnt.AbstractContentView;
+
+public interface DocumentViewerView extends AbstractContentView {
+
+ void setContent(String content);
+
+ void showImage(String imageUrl, String imageResizedUrl);
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -20,7 +20,7 @@
package org.ourproject.kune.docs.client.ctx;
import org.ourproject.kune.docs.client.DocumentClientTool;
-import org.ourproject.kune.docs.client.ctx.admin.DocContextEditor;
+import org.ourproject.kune.docs.client.ctx.admin.DocContextPropEditor;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.state.StateManager;
@@ -30,11 +30,11 @@
import com.calclab.suco.client.ioc.Provider;
public class DocumentContextPresenter extends FoldableContextPresenter implements DocumentContext {
- private final Provider<DocContextEditor> adminContextProvider;
+ private final Provider<DocContextPropEditor> adminContextProvider;
public DocumentContextPresenter(final StateManager stateManager,
final Provider<ContextNavigator> contextNavigatorProvider,
- final Provider<DocContextEditor> adminContextProvider) {
+ final Provider<DocContextPropEditor> adminContextProvider) {
super(DocumentClientTool.NAME, stateManager, contextNavigatorProvider);
this.adminContextProvider = adminContextProvider;
}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditor.java 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditor.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -1,32 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.docs.client.ctx.admin;
-
-import org.ourproject.kune.platf.client.dto.StateContentDTO;
-
-public interface DocContextEditor {
- void attach();
-
- void clear();
-
- void detach();
-
- void setState(StateContentDTO content);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPanel.java 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPanel.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -1,277 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.docs.client.ctx.admin;
-
-import java.util.Date;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.dto.AccessListsDTO;
-import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-
-public class DocContextEditorPanel extends VerticalPanel implements DocContextEditorView {
- // private static final Images IMG = Images.App.getInstance();
-
- // private static final int FORMS_WIDTH = 145;
-
- // private final IndexedStackPanelWithSubItems options;
- // private final AdminContextPresenter presenter;
- //
- // private AccessListsPanel accessListsPanel;
- // private DateField publishedOnField;
- // private TextArea tagsField;
- // private VerticalPanel tagsComponent;
- // private VerticalPanel publishedOnComponent;
- // private LanguageSelectorComponent langPresenter;
- // private VerticalPanel authorsComponent;
- // private VerticalPanel langComponent;
- // private IconLabel addAuthorLabel;
- // private final I18nTranslationService i18n;
- // private final String authors_item;
- // private final String publication_item;
- // private final String perms_item;
- // private final String language_item;
- // private final String tags_item;
-
- private final WorkspaceSkeleton ws;
- private final Label testLabel;
-
- public DocContextEditorPanel(final DocContextEditorPresenter presenter, final I18nTranslationService i18n,
- WorkspaceSkeleton ws) {
- this.ws = ws;
- testLabel = new Label("Admin ctx");
- // this.presenter = presenter;
- // this.i18n = i18n;
- // options = new IndexedStackPanelWithSubItems();
- // //options.addStyleName("kune-AdminContextPanel");
- //
- // //add(options);
- // //setCellWidth(options, "100%");
- // setWidth("100%");
- // authors_item = i18n.t("Authors");
- // publication_item = i18n.t("Publication");
- // perms_item = i18n.t("Permissions");
- // language_item = i18n.t("Language");
- // tags_item = i18n.t("Tags");
- }
-
- public void attach() {
- if (!testLabel.isAttached()) {
- ws.getEntityWorkspace().setContext(testLabel);
- }
- }
-
- public void detach() {
- if (testLabel.isAttached()) {
- testLabel.removeFromParent();
- }
- }
-
- public void removeAccessListComponent() {
- // if (options.containsItem(perms_item)) {
- // removeComponent(perms_item);
- // }
- }
-
- public void removeAuthorsComponent() {
- // if (options.containsItem(authors_item)) {
- // removeComponent(authors_item);
- // }
- }
-
- public void removeLangComponent() {
- // if (options.containsItem(language_item)) {
- // removeComponent(language_item);
- // }
- }
-
- public void removePublishedOnComponent() {
- // if (options.containsItem(publication_item)) {
- // removeComponent(publication_item);
- // }
- }
-
- public void removeTagsComponent() {
- // if (options.containsItem(tags_item)) {
- // removeComponent(tags_item);
- // }
- }
-
- public void reset() {
- // options.clear();
- }
-
- public void setAccessLists(final AccessListsDTO accessLists) {
- // if (accessListsPanel == null) {
- // accessListsPanel = new AccessListsPanel(i18n);
- // }
- // if (!options.containsItem(perms_item)) {
- // addComponent(perms_item, i18n.t("Who can admin/edit/view this work"),
- // accessListsPanel);
- // }
- // accessListsPanel.setAccessLists(accessLists);
- }
-
- public void setAuthors(final List<UserSimpleDTO> authors) {
- // if (authorsComponent == null) {
- // authorsComponent = new VerticalPanel();
- // addAuthorLabel = new IconLabel(IMG.addGreen(), i18n.t("Add author"));
- // addAuthorLabel.addClickListener(new ClickListener() {
- // public void onClick(final Widget sender) {
- // presenter.doAction(DocsEvents.ADD_AUTHOR, null);
- // }
- // });
- // } else {
- // if (options.containsItem(authors_item)) {
- // options.removeStackItem(authors_item);
- // }
- // authorsComponent.clear();
- // }
- // if (!options.containsItem(authors_item)) {
- // addComponent(authors_item, i18n.t("Authors of this work"),
- // authorsComponent);
- // }
- // for (final Iterator<UserSimpleDTO> iterator = authors.iterator();
- // iterator.hasNext();) {
- // final UserSimpleDTO author = iterator.next();
- // final StackSubItemAction[] authorActions = { new
- // StackSubItemAction(IMG.del(), i18n.t("Remove author"),
- // DocsEvents.REMOVE_AUTHOR) };
- // options.addStackSubItem(authors_item, IMG.personDef(),
- // author.getShortName(), author.getName(),
- // authorActions, presenter);
- // }
- // authorsComponent.add(addAuthorLabel);
- }
-
- public void setLanguage(final I18nLanguageDTO language) {
- // if (langComponent == null) {
- // langPresenter = WorkspaceFactory.createLanguageSelectorComponent();
- // langComponent = new VerticalPanel();
- // final LanguageSelectorPanel view = (LanguageSelectorPanel)
- // langPresenter.getView();
- // view.setWidth("" + FORMS_WIDTH);
- // langComponent.add(view);
- // view.addChangeListener(new ComboBoxListenerAdapter() {
- // public void onSelect(final ComboBox comboBox, final Record record,
- // final int index) {
- // presenter.doChangeLanguage(record.getAsString(LanguageSelectorPanel.LANG_ID));
- // }
- // });
- // }
- // if (!options.containsItem(language_item)) {
- // addComponent(language_item, i18n.t("The language of this work"),
- // langComponent);
- // }
- // langPresenter.setLanguage(language);
- }
-
- public void setPublishedOn(final Date publishedOn) {
- // if (publishedOnField == null) {
- // publishedOnComponent = createPublicationComponent();
- // }
- // if (!options.containsItem(publication_item)) {
- // addComponent(publication_item, i18n.t("Date of publication of this
- // work"), publishedOnComponent);
- // }
- // // publishedOnField.setValue(publishedOn);
- }
-
- public void setTags(final String tags) {
- // if (tagsComponent == null) {
- // tagsComponent = createTagsComponent();
- // }
- // if (!options.containsItem(tags_item)) {
- // addComponent(tags_item,
- // i18n.t("Keywords or terms associated with this work"),
- // tagsComponent);
- // }
- // tagsField.setValue(tags);
- // }
- //
- // private void addComponent(final String header, final String
- // headerTitle,
- // final VerticalPanel panel) {
- // panel.addStyleName("kune-AdminContextPanel-inner-wrap");
- // final VerticalPanel vp = options.addStackItem(header, headerTitle,
- // false);
- // vp.setStyleName("kune-AdminContextPanel-inner");
- // vp.add(panel);
- // vp.setCellWidth(panel, "100%");
- // vp.setWidth("100%");
- }
-
- // private FormPanel createDefaultForm() {
- // final FormPanel form = new FormPanel();
- // form.setHideLabels(true);
- // form.setWidth(FORMS_WIDTH);
- // form.setBorder(false);
- // return form;
- // }
-
- // private VerticalPanel createPublicationComponent() {
- // // final FormPanel form = createDefaultForm();
- // //
- // // publishedOnField = new DateField();
- // // publishedOnField.setWidth("140");
- // // publishedOnField.setFormat("Y-m-d");
- // //
- // // publishedOnField.addListener(new FieldListenerAdapter() {
- // // public void onChange(final Field field, final Object newVal, final
- // // Object oldVal) {
- // // presenter.setPublishedOn((Date) newVal);
- // // }
- // // });
- // //
- // // form.add(publishedOnField);
- // //
- // // final VerticalPanel vp = new VerticalPanel();
- // // vp.add(form);
- // // return vp;
- // //// }
- //
- // private VerticalPanel createTagsComponent() {
- // final FormPanel form = createDefaultForm();
- // tagsField = new TextArea();
- // tagsField.setWidth("" + FORMS_WIDTH);
- // tagsField.setHeight("3em");
- // tagsField.addListener(new FieldListenerAdapter() {
- // public void onChange(final Field field, final Object newVal, final
- // Object oldVal) {
- // presenter.setTags((String) newVal);
- // }
- // });
- //
- // form.add(tagsField);
- // final VerticalPanel vp = new VerticalPanel();
- // vp.add(form);
- // return vp;
- // }
-
- // private void removeComponent(final String header) {
- // options.removeStackItem(header);
- // }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPresenter.java 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPresenter.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -1,176 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.docs.client.ctx.admin;
-
-import java.util.Date;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.dto.AccessListsDTO;
-import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.dto.StateContainerDTO;
-import org.ourproject.kune.platf.client.dto.StateContentDTO;
-import org.ourproject.kune.platf.client.dto.TagResultDTO;
-import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.site.Site;
-import org.ourproject.kune.workspace.client.tags.TagsSummary;
-import org.ourproject.kune.workspace.client.title.EntitySubTitle;
-import org.ourproject.kune.workspace.client.title.EntityTitle;
-
-import com.calclab.suco.client.ioc.Provider;
-
-public class DocContextEditorPresenter implements DocContextEditor {
-
- private DocContextEditorView view;
- private final Session session;
- private final Provider<TagsSummary> tagsSummaryProvider;
- private final Provider<ContentServiceAsync> contentServiceProvider;
- private final EntitySubTitle entitySubTitle;
- private final EntityTitle entityTitle;
- private final StateManager stateManager;
-
- public DocContextEditorPresenter(final Session session, final StateManager stateManager,
- final Provider<TagsSummary> tagsSummaryProvider,
- final Provider<ContentServiceAsync> contentServiceProvider, final EntityTitle entityTitle,
- final EntitySubTitle entitySubTitle) {
- this.session = session;
- this.stateManager = stateManager;
- this.tagsSummaryProvider = tagsSummaryProvider;
- this.contentServiceProvider = contentServiceProvider;
- this.entityTitle = entityTitle;
- this.entitySubTitle = entitySubTitle;
- }
-
- public void addAuthor(final String authorShortName) {
- Site.showProgressProcessing();
- final StateContainerDTO currentState = session.getContentState();
- contentServiceProvider.get().addAuthor(session.getUserHash(), currentState.getStateToken(), authorShortName,
- new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
- Site.hideProgress();
- stateManager.reload();
- }
- });
- }
-
- public void attach() {
- view.attach();
- }
-
- public void clear() {
- view.reset();
- }
-
- public void delAuthor(final String authorShortName) {
- Site.showProgressProcessing();
- final StateContainerDTO currentState = session.getContentState();
- contentServiceProvider.get().removeAuthor(session.getUserHash(), currentState.getStateToken(), authorShortName,
- new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
- Site.hideProgress();
- stateManager.reload();
- }
- });
- }
-
- public void detach() {
- view.detach();
- }
-
- public void doChangeLanguage(final String langCode) {
- Site.showProgressProcessing();
- final StateContainerDTO currentState = session.getContentState();
- contentServiceProvider.get().setLanguage(session.getUserHash(), currentState.getStateToken(), langCode,
- new AsyncCallbackSimple<I18nLanguageDTO>() {
- public void onSuccess(final I18nLanguageDTO lang) {
- Site.hideProgress();
- entitySubTitle.setContentLanguage(lang.getEnglishName());
- }
- });
- }
-
- public void init(final DocContextEditorView view) {
- this.view = view;
- }
-
- public void setPublishedOn(final Date publishedOn) {
- Site.showProgressProcessing();
- final StateContainerDTO currentState = session.getContentState();
- contentServiceProvider.get().setPublishedOn(session.getUserHash(), currentState.getStateToken(), publishedOn,
- new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
- Site.hideProgress();
- entityTitle.setContentDate(publishedOn);
- }
- });
-
- }
-
- public void setState(final StateContentDTO content) {
- // In the future check the use of these components by each tool
- final I18nLanguageDTO language = content.getLanguage();
- final AccessListsDTO accessLists = content.getAccessLists();
- final Date publishedOn = content.getPublishedOn();
- final String tags = content.getTags();
- final List<UserSimpleDTO> authors = content.getAuthors();
-
- if (tags != null) {
- view.setTags(tags);
- } else {
- view.removeTagsComponent();
- }
- if (language != null) {
- view.setLanguage(language);
- } else {
- view.removeLangComponent();
- }
- if (authors != null) {
- view.setAuthors(authors);
- } else {
- view.removeAuthorsComponent();
- }
- if (publishedOn != null) {
- view.setPublishedOn(publishedOn);
- } else {
- view.removePublishedOnComponent();
- }
- if (accessLists != null) {
- view.setAccessLists(accessLists);
- } else {
- view.removeAccessListComponent();
- }
- }
-
- public void setTags(final String tagsString) {
- Site.showProgressProcessing();
- final StateContainerDTO currentState = session.getContentState();
- contentServiceProvider.get().setTags(session.getUserHash(), currentState.getStateToken(), tagsString,
- new AsyncCallbackSimple<List<TagResultDTO>>() {
- public void onSuccess(final List<TagResultDTO> result) {
- tagsSummaryProvider.get().setGroupTags(result);
- Site.hideProgress();
- }
- });
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorView.java 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorView.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -1,58 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.docs.client.ctx.admin;
-
-import java.util.Date;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.AccessListsDTO;
-import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
-import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
-
-public interface DocContextEditorView extends View {
-
- void attach();
-
- void detach();
-
- void removeAccessListComponent();
-
- void removeAuthorsComponent();
-
- void removeLangComponent();
-
- void removePublishedOnComponent();
-
- void removeTagsComponent();
-
- void reset();
-
- void setAccessLists(AccessListsDTO accessLists);
-
- void setAuthors(List<UserSimpleDTO> authors);
-
- void setLanguage(I18nLanguageDTO language);
-
- void setPublishedOn(Date publishedOn);
-
- void setTags(String tags);
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextPropEditor.java (from rev 941, trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditor.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditor.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextPropEditor.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,32 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.ctx.admin;
+
+import org.ourproject.kune.platf.client.dto.StateContentDTO;
+
+public interface DocContextPropEditor {
+ void attach();
+
+ void clear();
+
+ void detach();
+
+ void setState(StateContentDTO content);
+}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextPropEditorPanel.java (from rev 941, trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPanel.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextPropEditorPanel.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,255 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.ctx.admin;
+
+import java.util.Date;
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.AccessListsDTO;
+import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.ContextPropertyPanel;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelector;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPanel;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.calclab.suco.client.ioc.Provider;
+import com.google.gwt.user.client.ui.ScrollPanel;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.gwtext.client.data.Record;
+import com.gwtext.client.widgets.form.ComboBox;
+import com.gwtext.client.widgets.form.Field;
+import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.form.TextArea;
+import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
+import com.gwtext.client.widgets.form.event.FieldListenerAdapter;
+
+public class DocContextPropEditorPanel extends ScrollPanel implements DocContextPropEditorView {
+
+ private static final int FORMS_WIDTH = 150;
+ public static final String TAGS_PROP = "k-dcpep-tagsp-dis";
+ public static final String LANG_PROP = "k-dcpep-tagsp-dis";
+
+ private final DocContextPropEditorPresenter presenter;
+ private final WorkspaceSkeleton ws;
+ private final I18nTranslationService i18n;
+ private TextArea tagsField;
+ private ContextPropertyPanel tagsComponent;
+ private final Provider<LanguageSelector> langSelectorProv;
+ private ContextPropertyPanel langComponent;
+ private final VerticalPanel vp;
+
+ public DocContextPropEditorPanel(final DocContextPropEditorPresenter presenter, final I18nTranslationService i18n,
+ WorkspaceSkeleton ws, Provider<LanguageSelector> langSelectorProv) {
+ this.i18n = i18n;
+ this.ws = ws;
+ this.presenter = presenter;
+ this.langSelectorProv = langSelectorProv;
+ super.addStyleName("kune-Margin-Medium-trbl");
+ vp = new VerticalPanel();
+ super.add(vp);
+ // authors_item = i18n.t("Authors");
+ // publication_item = i18n.t("Publication");
+ // perms_item = i18n.t("Permissions");
+ // language_item = i18n.t("Language");
+ // tags_item = i18n.t("Tags");
+ }
+
+ public void attach() {
+ if (!super.isAttached()) {
+ ws.getEntityWorkspace().setContext(this);
+ }
+ }
+
+ public void detach() {
+ if (super.isAttached()) {
+ super.removeFromParent();
+ }
+ }
+
+ public void removeAccessListComponent() {
+ // if (options.containsItem(perms_item)) {
+ // removeComponent(perms_item);
+ // }
+ }
+
+ public void removeAuthorsComponent() {
+ // if (options.containsItem(authors_item)) {
+ // removeComponent(authors_item);
+ // }
+ }
+
+ public void removeLangComponent() {
+ if (langComponent != null) {
+ langComponent.removeFromParent();
+ }
+ }
+
+ public void removePublishedOnComponent() {
+ // if (options.containsItem(publication_item)) {
+ // removeComponent(publication_item);
+ // }
+ }
+
+ public void removeTagsComponent() {
+ if (tagsComponent != null) {
+ tagsComponent.removeFromParent();
+ }
+ }
+
+ public void reset() {
+ tagsField.reset();
+ }
+
+ public void setAccessLists(final AccessListsDTO accessLists) {
+ // if (accessListsPanel == null) {
+ // accessListsPanel = new AccessListsPanel(i18n);
+ // }
+ // if (!options.containsItem(perms_item)) {
+ // addComponent(perms_item, i18n.t("Who can admin/edit/view this work"),
+ // accessListsPanel);
+ // }
+ // accessListsPanel.setAccessLists(accessLists);
+ }
+
+ public void setAuthors(final List<UserSimpleDTO> authors) {
+ // if (authorsComponent == null) {
+ // authorsComponent = new VerticalPanel();
+ // addAuthorLabel = new IconLabel(IMG.addGreen(), i18n.t("Add author"));
+ // addAuthorLabel.addClickListener(new ClickListener() {
+ // public void onClick(final Widget sender) {
+ // presenter.doAction(DocsEvents.ADD_AUTHOR, null);
+ // }
+ // });
+ // } else {
+ // if (options.containsItem(authors_item)) {
+ // options.removeStackItem(authors_item);
+ // }
+ // authorsComponent.clear();
+ // }
+ // if (!options.containsItem(authors_item)) {
+ // addComponent(authors_item, i18n.t("Authors of this work"),
+ // authorsComponent);
+ // }
+ // for (final Iterator<UserSimpleDTO> iterator = authors.iterator();
+ // iterator.hasNext();) {
+ // final UserSimpleDTO author = iterator.next();
+ // final StackSubItemAction[] authorActions = { new
+ // StackSubItemAction(IMG.del(), i18n.t("Remove author"),
+ // DocsEvents.REMOVE_AUTHOR) };
+ // options.addStackSubItem(authors_item, IMG.personDef(),
+ // author.getShortName(), author.getName(),
+ // authorActions, presenter);
+ // }
+ // authorsComponent.add(addAuthorLabel);
+ }
+
+ public void setLanguage(final I18nLanguageDTO language) {
+ if (langComponent == null) {
+ final LanguageSelectorPanel view = (LanguageSelectorPanel) langSelectorProv.get().getView();
+ view.setWidth(FORMS_WIDTH);
+ langComponent = new ContextPropertyPanel(i18n.t("What language is this in?"), null, true, LANG_PROP, view);
+ view.addChangeListener(new ComboBoxListenerAdapter() {
+ @Override
+ public void onSelect(final ComboBox comboBox, final Record record, final int index) {
+ presenter.doChangeLanguage(record.getAsString(LanguageSelectorPanel.LANG_ID));
+ }
+ });
+ // angComponent.addStyleName("kune-Margin-Medium-t");
+ addComponent(langComponent);
+ }
+ langSelectorProv.get().setLanguage(language);
+ }
+
+ public void setPublishedOn(final Date publishedOn) {
+ // if (publishedOnField == null) {
+ // publishedOnComponent = createPublicationComponent();
+ // }
+ // if (!options.containsItem(publication_item)) {
+ // addComponent(publication_item, i18n.t("Date of publication of this
+ // work"), publishedOnComponent);
+ // }
+ // // publishedOnField.setValue(publishedOn);
+ }
+
+ public void setTags(final String tags) {
+ if (tagsComponent == null) {
+ tagsComponent = createTagsComponent();
+ addComponent(tagsComponent);
+ }
+ tagsField.setValue(tags);
+ }
+
+ private void addComponent(ContextPropertyPanel prop) {
+ vp.add(prop);
+ }
+
+ private FormPanel createDefaultForm() {
+ final FormPanel form = new FormPanel();
+ form.setHideLabels(true);
+ form.setWidth(FORMS_WIDTH);
+ form.setBorder(false);
+ return form;
+ }
+
+ // private VerticalPanel createPublicationComponent() {
+ // // final FormPanel form = createDefaultForm();
+ // //
+ // // publishedOnField = new DateField();
+ // // publishedOnField.setWidth("140");
+ // // publishedOnField.setFormat("Y-m-d");
+ // //
+ // // publishedOnField.addListener(new FieldListenerAdapter() {
+ // // public void onChange(final Field field, final Object newVal, final
+ // // Object oldVal) {
+ // // presenter.setPublishedOn((Date) newVal);
+ // // }
+ // // });
+ // //
+ // // form.add(publishedOnField);
+ // //
+ // // final VerticalPanel vp = new VerticalPanel();
+ // // vp.add(form);
+ // // return vp;
+ // //// }
+ //
+ private ContextPropertyPanel createTagsComponent() {
+ final FormPanel form = createDefaultForm();
+ tagsField = new TextArea();
+ tagsField.setWidth(FORMS_WIDTH - 10);
+ tagsField.setHeight("3em");
+ tagsField.addListener(new FieldListenerAdapter() {
+ @Override
+ public void onChange(final Field field, final Object newVal, final Object oldVal) {
+ presenter.setTags((String) newVal);
+ }
+ });
+ form.add(tagsField);
+ ContextPropertyPanel propertyPanel = new ContextPropertyPanel(i18n.t("Tags"),
+ i18n.t("Keywords or terms associated with this work"), true, TAGS_PROP, form);
+ return propertyPanel;
+ }
+
+ // private void removeComponent(final String header) {
+ // options.removeStackItem(header);
+ // }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextPropEditorPresenter.java (from rev 941, trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorPresenter.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextPropEditorPresenter.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,176 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.ctx.admin;
+
+import java.util.Date;
+import java.util.List;
+
+import org.ourproject.kune.platf.client.dto.AccessListsDTO;
+import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.dto.StateContainerDTO;
+import org.ourproject.kune.platf.client.dto.StateContentDTO;
+import org.ourproject.kune.platf.client.dto.TagResultDTO;
+import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.tags.TagsSummary;
+import org.ourproject.kune.workspace.client.title.EntitySubTitle;
+import org.ourproject.kune.workspace.client.title.EntityTitle;
+
+import com.calclab.suco.client.ioc.Provider;
+
+public class DocContextPropEditorPresenter implements DocContextPropEditor {
+
+ private DocContextPropEditorView view;
+ private final Session session;
+ private final Provider<TagsSummary> tagsSummaryProvider;
+ private final Provider<ContentServiceAsync> contentServiceProvider;
+ private final EntitySubTitle entitySubTitle;
+ private final EntityTitle entityTitle;
+ private final StateManager stateManager;
+
+ public DocContextPropEditorPresenter(final Session session, final StateManager stateManager,
+ final Provider<TagsSummary> tagsSummaryProvider,
+ final Provider<ContentServiceAsync> contentServiceProvider, final EntityTitle entityTitle,
+ final EntitySubTitle entitySubTitle) {
+ this.session = session;
+ this.stateManager = stateManager;
+ this.tagsSummaryProvider = tagsSummaryProvider;
+ this.contentServiceProvider = contentServiceProvider;
+ this.entityTitle = entityTitle;
+ this.entitySubTitle = entitySubTitle;
+ }
+
+ public void addAuthor(final String authorShortName) {
+ Site.showProgressProcessing();
+ final StateContainerDTO currentState = session.getContentState();
+ contentServiceProvider.get().addAuthor(session.getUserHash(), currentState.getStateToken(), authorShortName,
+ new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ Site.hideProgress();
+ stateManager.reload();
+ }
+ });
+ }
+
+ public void attach() {
+ view.attach();
+ }
+
+ public void clear() {
+ view.reset();
+ }
+
+ public void delAuthor(final String authorShortName) {
+ Site.showProgressProcessing();
+ final StateContainerDTO currentState = session.getContentState();
+ contentServiceProvider.get().removeAuthor(session.getUserHash(), currentState.getStateToken(), authorShortName,
+ new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ Site.hideProgress();
+ stateManager.reload();
+ }
+ });
+ }
+
+ public void detach() {
+ view.detach();
+ }
+
+ public void doChangeLanguage(final String langCode) {
+ Site.showProgressProcessing();
+ final StateContainerDTO currentState = session.getContentState();
+ contentServiceProvider.get().setLanguage(session.getUserHash(), currentState.getStateToken(), langCode,
+ new AsyncCallbackSimple<I18nLanguageDTO>() {
+ public void onSuccess(final I18nLanguageDTO lang) {
+ Site.hideProgress();
+ entitySubTitle.setContentLanguage(lang.getEnglishName());
+ }
+ });
+ }
+
+ public void init(final DocContextPropEditorView view) {
+ this.view = view;
+ }
+
+ public void setPublishedOn(final Date publishedOn) {
+ Site.showProgressProcessing();
+ final StateContainerDTO currentState = session.getContentState();
+ contentServiceProvider.get().setPublishedOn(session.getUserHash(), currentState.getStateToken(), publishedOn,
+ new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ Site.hideProgress();
+ entityTitle.setContentDate(publishedOn);
+ }
+ });
+
+ }
+
+ public void setState(final StateContentDTO content) {
+ // In the future check the use of these components by each tool
+ final I18nLanguageDTO language = content.getLanguage();
+ final AccessListsDTO accessLists = content.getAccessLists();
+ final Date publishedOn = content.getPublishedOn();
+ final String tags = content.getTags();
+ final List<UserSimpleDTO> authors = content.getAuthors();
+
+ if (tags != null) {
+ view.setTags(tags);
+ } else {
+ view.removeTagsComponent();
+ }
+ if (language != null) {
+ view.setLanguage(language);
+ } else {
+ view.removeLangComponent();
+ }
+ if (authors != null) {
+ view.setAuthors(authors);
+ } else {
+ view.removeAuthorsComponent();
+ }
+ if (publishedOn != null) {
+ view.setPublishedOn(publishedOn);
+ } else {
+ view.removePublishedOnComponent();
+ }
+ if (accessLists != null) {
+ view.setAccessLists(accessLists);
+ } else {
+ view.removeAccessListComponent();
+ }
+ }
+
+ public void setTags(final String tagsString) {
+ Site.showProgressProcessing();
+ final StateContainerDTO currentState = session.getContentState();
+ contentServiceProvider.get().setTags(session.getUserHash(), currentState.getStateToken(), tagsString,
+ new AsyncCallbackSimple<List<TagResultDTO>>() {
+ public void onSuccess(final List<TagResultDTO> result) {
+ tagsSummaryProvider.get().setGroupTags(result);
+ Site.hideProgress();
+ }
+ });
+ }
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextPropEditorView.java (from rev 941, trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextEditorView.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/DocContextPropEditorView.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,58 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.ctx.admin;
+
+import java.util.Date;
+import java.util.List;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.AccessListsDTO;
+import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
+
+public interface DocContextPropEditorView extends View {
+
+ void attach();
+
+ void detach();
+
+ void removeAccessListComponent();
+
+ void removeAuthorsComponent();
+
+ void removeLangComponent();
+
+ void removePublishedOnComponent();
+
+ void removeTagsComponent();
+
+ void reset();
+
+ void setAccessLists(AccessListsDTO accessLists);
+
+ void setAuthors(List<UserSimpleDTO> authors);
+
+ void setLanguage(I18nLanguageDTO language);
+
+ void setPublishedOn(Date publishedOn);
+
+ void setTags(String tags);
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -57,6 +57,7 @@
import org.ourproject.kune.platf.client.state.StateManagerDefault;
import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.platf.client.tool.ToolSelectorPresenter;
+import org.ourproject.kune.platf.client.ui.QuickTipsHelper;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.palette.ColorWebSafePalette;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
@@ -70,14 +71,14 @@
import org.ourproject.kune.workspace.client.entitylogo.EntityLogoSelectorPanel;
import org.ourproject.kune.workspace.client.entitylogo.EntityLogoSelectorPresenter;
import org.ourproject.kune.workspace.client.i18n.I18nTranslator;
+import org.ourproject.kune.workspace.client.i18n.I18nTranslatorPanel;
import org.ourproject.kune.workspace.client.i18n.I18nTranslatorPresenter;
import org.ourproject.kune.workspace.client.i18n.I18nTranslatorView;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.i18n.LanguageSelector;
+import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPanel;
import org.ourproject.kune.workspace.client.i18n.LanguageSelectorPresenter;
import org.ourproject.kune.workspace.client.i18n.LanguageSelectorView;
-import org.ourproject.kune.workspace.client.i18n.ui.I18nTranslatorPanel;
-import org.ourproject.kune.workspace.client.i18n.ui.LanguageSelectorPanel;
import org.ourproject.kune.workspace.client.licensechoose.LicenseChoose;
import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePanel;
import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePresenter;
@@ -182,7 +183,15 @@
}
});
+ register(Singleton.class, new Factory<QuickTipsHelper>(QuickTipsHelper.class) {
+ @Override
+ public QuickTipsHelper create() {
+ return new QuickTipsHelper();
+ }
+ });
+
$(I18nUITranslationService.class);
+ $(QuickTipsHelper.class);
}
private void onI18nReady() {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -29,7 +29,6 @@
import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.platf.client.ui.QuickTipsHelper;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.rate.RateIt;
import org.ourproject.kune.platf.client.ui.rate.RateItPanel;
@@ -125,13 +124,6 @@
}
});
- register(ApplicationComponentGroup.class, new Factory<QuickTipsHelper>(QuickTipsHelper.class) {
- @Override
- public QuickTipsHelper create() {
- return new QuickTipsHelper();
- }
- });
-
register(ApplicationComponentGroup.class, new Factory<SiteProgress>(SiteProgress.class) {
@Override
public SiteProgress create() {
Added: trunk/src/main/java/org/ourproject/kune/platf/client/ui/ContextPropertyPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/ContextPropertyPanel.java 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/ContextPropertyPanel.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,44 @@
+package org.ourproject.kune.platf.client.ui;
+
+import org.ourproject.kune.platf.client.services.Images;
+
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.DisclosurePanel;
+import com.google.gwt.user.client.ui.DisclosurePanelImages;
+import com.google.gwt.user.client.ui.Widget;
+
+public class ContextPropertyPanel extends Composite {
+
+ public ContextPropertyPanel(AbstractImagePrototype headerIcon, String tooltip, String headerText, boolean isOpen,
+ String debugId, Widget content) {
+ this(new IconLabel(headerIcon, headerText), tooltip, isOpen, debugId, content);
+ }
+
+ public ContextPropertyPanel(String headerText, String tooltip, boolean isOpen, String debugId, Widget content) {
+ DisclosurePanelImages images = new DisclosurePanelImages() {
+ public AbstractImagePrototype disclosurePanelClosed() {
+ return Images.App.getInstance().arrowRightWhite();
+ }
+
+ public AbstractImagePrototype disclosurePanelOpen() {
+ return Images.App.getInstance().arrowDownWhite();
+ }
+ };
+ DisclosurePanel disclosure = new DisclosurePanel(images, headerText, isOpen);
+ init(disclosure, tooltip, content, debugId);
+ }
+
+ public ContextPropertyPanel(Widget header, String tooltip, boolean isOpen, String debugId, Widget content) {
+ DisclosurePanel disclosure = new DisclosurePanel(header, isOpen);
+ init(disclosure, tooltip, content, debugId);
+ }
+
+ private void init(DisclosurePanel disclosure, String tooltip, Widget content, String debugId) {
+ disclosure.setAnimationEnabled(true);
+ disclosure.ensureDebugId(debugId);
+ disclosure.setContent(content);
+ KuneUiUtils.setQuickTip(disclosure, tooltip);
+ initWidget(disclosure);
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2008-11-10 21:32:52 UTC (rev 945)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -34,6 +34,8 @@
import com.calclab.suco.client.listener.Listener;
import com.calclab.suco.client.listener.Listener0;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
public class TextEditorPresenter implements TextEditor {
public static final int AUTOSAVE_AFTER_FAILS_IN_MILLISECONS = 20000;
@@ -46,7 +48,6 @@
private final boolean autoSave;
private boolean saveAndCloseConfirmed;
private Listener<String> onSave;
- private Listener0 onEditCancelled;
private final ActionToolbar<StateToken> toolbar;
private ActionToolbarButtonDescriptor<StateToken> save;
private ActionToolbarButtonDescriptor<StateToken> close;
@@ -76,7 +77,6 @@
public void editContent(final String content, final Listener<String> onSave, final Listener0 onEditCancelled) {
this.onSave = onSave;
- this.onEditCancelled = onEditCancelled;
toolbar.attach();
view.attach();
setContent(content);
@@ -151,7 +151,6 @@
reset();
view.detach();
toolbar.detach();
- onEditCancelled.onEvent();
}
protected void onEditHTML() {
@@ -179,7 +178,11 @@
onCancel();
return false;
} else {
- onCancelConfirmed();
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ onCancelConfirmed();
+ }
+ });
return true;
}
}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java (from rev 941, trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/I18nTranslatorPanel.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,329 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.i18n;
+
+import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.AbstractSearcherPanel;
+import org.ourproject.kune.platf.client.ui.TextUtils;
+import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
+import org.ourproject.kune.workspace.client.search.SiteBottomTrayButton;
+import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Frame;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.core.RegionPosition;
+import com.gwtext.client.data.FieldDef;
+import com.gwtext.client.data.Record;
+import com.gwtext.client.data.Store;
+import com.gwtext.client.data.StringFieldDef;
+import com.gwtext.client.util.Format;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.TabPanel;
+import com.gwtext.client.widgets.Window;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+import com.gwtext.client.widgets.form.ComboBox;
+import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter;
+import com.gwtext.client.widgets.grid.CellMetadata;
+import com.gwtext.client.widgets.grid.ColumnConfig;
+import com.gwtext.client.widgets.grid.ColumnModel;
+import com.gwtext.client.widgets.grid.EditorGridPanel;
+import com.gwtext.client.widgets.grid.GridEditor;
+import com.gwtext.client.widgets.grid.GridPanel;
+import com.gwtext.client.widgets.grid.Renderer;
+import com.gwtext.client.widgets.grid.event.EditorGridListenerAdapter;
+import com.gwtext.client.widgets.grid.event.GridCellListenerAdapter;
+import com.gwtext.client.widgets.layout.BorderLayoutData;
+import com.gwtext.client.widgets.layout.FitLayout;
+
+public class I18nTranslatorPanel extends AbstractSearcherPanel implements I18nTranslatorView {
+
+ private Window dialog;
+ private final I18nTranslatorPresenter presenter;
+ private LanguageSelectorPanel languageSelectorPanel;
+ private Store unTransStore;
+ private Store transStore;
+ private GridPanel transGrid;
+ private GridPanel unTransGrid;
+ private final LanguageSelector languageSelector;
+ private final WorkspaceSkeleton ws;
+ private SiteBottomTrayButton traybarButton;
+ private final Images img;
+
+ public I18nTranslatorPanel(final I18nTranslatorPresenter initPresenter, final I18nTranslationService i18n,
+ final LanguageSelector languageSelector, final WorkspaceSkeleton ws, Images img) {
+ super(i18n);
+ this.presenter = initPresenter;
+ this.languageSelector = languageSelector;
+ this.ws = ws;
+ this.img = img;
+ }
+
+ public void close() {
+ dialog.hide();
+ }
+
+ public void hide() {
+ dialog.hide();
+ }
+
+ public void hideTranslatorAndIcon() {
+ if (dialog.isRendered()) {
+ dialog.hide();
+ }
+ if (traybarButton != null) {
+ traybarButton.destroy();
+ traybarButton = null;
+ }
+ }
+
+ public void show() {
+ if (dialog == null) {
+ dialog = createDialog();
+ }
+ // By default we use the user lang to help in translation
+ final I18nLanguageDTO lang = presenter.getLanguage();
+ setLanguage(lang);
+ final String languageNativeNameIfAvailable = lang.getNativeName().length() > 0 ? lang.getNativeName()
+ : lang.getEnglishName();
+ dialog.setTitle(i18n.t("Help to translate kune to [%s]", languageNativeNameIfAvailable));
+ dialog.show();
+ dialog.expand();
+ dialog.center();
+ if (traybarButton == null) {
+ traybarButton = new SiteBottomTrayButton("images/language.gif", i18n.t("Show/hide translator"), dialog, ws);
+ }
+ }
+
+ private Window createDialog() {
+ final Panel north = new Panel();
+ north.setBorder(false);
+
+ final Panel center = new TabPanel();
+ center.setAutoScroll(false);
+ center.setClosable(false);
+ center.setBorder(false);
+
+ final Window dialog = new BasicDialog("", false, false, 720, 330);
+ // dialog.setResizable(false);
+ dialog.setIconCls("i18n-icon");
+
+ final Button close = new Button();
+ close.setText(i18n.tWithNT("Close", "used in button"));
+ close.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(final Button button, final EventObject e) {
+ presenter.doClose();
+ }
+ });
+ dialog.addButton(close);
+
+ final Panel unTransCenterPanel = new Panel(i18n.t("Untranslated"));
+ unTransCenterPanel.setAutoScroll(false);
+ unTransCenterPanel.setLayout(new FitLayout());
+
+ final Panel transCenterPanel = new Panel(i18n.t("Translated"));
+ transCenterPanel.setAutoScroll(false);
+ transCenterPanel.setLayout(new FitLayout());
+
+ final Panel recommendationPanel = new Panel(i18n.t("Recommendations"));
+ recommendationPanel.setAutoScroll(true);
+ recommendationPanel.setLayout(new FitLayout());
+
+ transGrid = createGridPanel(true);
+ unTransGrid = createGridPanel(false);
+ final HorizontalPanel hp = new HorizontalPanel();
+ languageSelectorPanel = (LanguageSelectorPanel) languageSelector.getView();
+ languageSelectorPanel.addChangeListener(new ComboBoxListenerAdapter() {
+ @Override
+ public void onSelect(final ComboBox comboBox, final Record record, final int index) {
+ setLanguage(record.getAsString(LanguageSelectorPanel.LANG_ID));
+ dialog.setTitle(i18n.t("Help to translate kune to [%s]", record.getAsString("language")));
+ }
+ });
+ hp.add(languageSelectorPanel);
+ hp.addStyleName("kune-Margin-Large-trbl");
+ north.add(hp);
+
+ unTransCenterPanel.add(unTransGrid);
+ transCenterPanel.add(transGrid);
+ final Frame recommFrame = new Frame("html/i18n-recom.html");
+ recommFrame.setHeight("auto");
+ recommendationPanel.add(recommFrame);
+
+ center.add(unTransCenterPanel);
+ center.add(transCenterPanel);
+ center.add(recommendationPanel);
+ dialog.add(north, new BorderLayoutData(RegionPosition.NORTH));
+ dialog.add(center, new BorderLayoutData(RegionPosition.CENTER));
+
+ center.setActiveItemID(unTransCenterPanel.getId());
+
+ return dialog;
+ }
+
+ private GridPanel createGridPanel(final boolean translated) {
+
+ final Renderer renderNT = new Renderer() {
+ public String render(Object value, CellMetadata cellMetadata, Record record, int rowIndex, int colNum,
+ Store store) {
+ String renderer;
+ String[] splitted = splitNT((String) value);
+ if (splitted.length > 1) {
+ renderer = "{0} " + img.nt().getHTML();
+ String tip = "<div style='min-width: 75px'>" + splitted[1] + "</div>";
+ cellMetadata.setHtmlAttribute("ext:qtip=\"" + tip + "\" ext:qtitle=\"Note for translators\"");
+ } else {
+ renderer = "{0}";
+ }
+ return Format.format(renderer, splitted);
+ }
+ };
+
+ Store store;
+ final String id = "id";
+ final FieldDef[] fieldDefs = new FieldDef[] { new StringFieldDef("trKey"), new StringFieldDef("text"),
+ new StringFieldDef(id) };
+
+ if (translated) {
+ final String url = "/kune/json/I18nTranslationJSONService/searchtranslated";
+ transStore = createStore(fieldDefs, url, id);
+ store = transStore;
+ } else {
+ final String url = "/kune/json/I18nTranslationJSONService/search";
+ unTransStore = createStore(fieldDefs, url, id);
+ store = unTransStore;
+ }
+
+ final ColumnConfig trKeyColumn = new ColumnConfig() {
+ {
+ setHeader(i18n.t("Text to translate"));
+ setDataIndex("trKey");
+ setWidth(335);
+ setTooltip(i18n.t("Click to sort"));
+ setRenderer(renderNT);
+ }
+ };
+
+ final GridEditor textColumnEditor = new GridEditor(new TextField());
+
+ final ColumnConfig textColumn = new ColumnConfig() {
+ {
+ setHeader(i18n.t("Translation (click to edit)"));
+ setDataIndex("text");
+ setWidth(335);
+ setEditor(textColumnEditor);
+ }
+ };
+
+ final ColumnModel columnModel = new ColumnModel(new ColumnConfig[] { trKeyColumn, textColumn });
+
+ columnModel.setDefaultSortable(true);
+
+ final EditorGridPanel grid = new EditorGridPanel((translated ? "grid-translated" : "grid-untranslated"), 695,
+ 180, store, columnModel);
+ createPagingToolbar(store, grid);
+
+ // final PagingToolbar pag = new PagingToolbar(store);
+ // pag.setPageSize(PAGINATION_SIZE);
+ // pag.setDisplayInfo(true);
+ // pag.setDisplayMsg(i18n.tWithNT("Displaying results {0} - {1} of
+ // {2}",
+ // "Respect {} values in translations, "
+ // + "these will produce: 'Displaying results 1 - 25 of 95465' for
+ // instance"));
+ // pag.setEmptyMsg(i18n.t("No results to display"));
+ // pag.setAfterPageText(i18n.tWithNT("of {0}", "Used to show
+ // multiple results: '1 of 30'"));
+ // pag.setBeforePageText(i18n.t("Page"));
+ // pag.setFirstText(i18n.t("First Page"));
+ // pag.setLastText(i18n.t("Last Page"));
+ // pag.setNextText(i18n.t("Next Page"));
+ // pag.setPrevText(i18n.t("Previous Page"));
+ // pag.setRefreshText(i18n.t("Refresh"));
+ // grid.setBottomToolbar(pag);
+ // grid.setLoadMask(true);
+ // grid.setLoadMask(i18n.t("Loading"));
+ grid.setClicksToEdit(1);
+ // grid.setStripeRows(true);
+ // grid.setFrame(true);
+ // grid.setSelectionModel(new RowSelectionModel());
+
+ grid.addEditorGridListener(new EditorGridListenerAdapter() {
+ @Override
+ public void onAfterEdit(final GridPanel grid, final Record record, final String field,
+ final Object newValue, final Object oldValue, final int rowIndex, final int colIndex) {
+ final String idValue = record.getAsString(id);
+ final String trKey = record.getAsString("trKey");
+ presenter.doTranslation(idValue, trKey, (String) newValue);
+ record.set(field, TextUtils.escapeHtmlLight((String) newValue));
+ }
+ });
+
+ grid.addGridCellListener(new GridCellListenerAdapter() {
+ @Override
+ public void onCellDblClick(final GridPanel grid, final int rowIndex, final int colIndex, final EventObject e) {
+ final Record record = unTransStore.getRecordAt(rowIndex);
+ final String idValue = record.getAsString(id);
+ final String trKey = record.getAsString("trKey");
+ final String text = record.getAsString("text");
+ if (text == null || text.length() == 0) {
+ final String trWithoutNT = removeNT(trKey);
+ record.set("text", trWithoutNT);
+ presenter.doTranslation(idValue, trKey, trWithoutNT);
+ }
+ }
+ });
+
+ return grid;
+ }
+
+ private String removeNT(final String string) {
+ return i18n.removeNT(string);
+ }
+
+ private void setLanguage(final I18nLanguageDTO language) {
+ languageSelectorPanel.setLanguage(language.getCode());
+ setLanguage(language.getCode());
+ }
+
+ private void setLanguage(final String language) {
+ Site.showProgressLoading();
+ query(unTransStore, unTransGrid, language);
+ query(transStore, transGrid, language);
+ Site.hideProgress();
+ }
+
+ private String[] splitNT(final String textWithNT) {
+ String[] nt;
+ final String[] splitted = textWithNT.split(" \\[%NT ");
+ if (splitted.length > 1) {
+ nt = splitted[1].split("\\]$");
+ splitted[1] = nt[0];
+ }
+ return splitted;
+ }
+
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/I18nTranslatorPanel.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPanel.java (from rev 941, trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/LanguageSelectorPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/ui/LanguageSelectorPanel.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPanel.java 2008-11-11 13:12:39 UTC (rev 946)
@@ -0,0 +1,103 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.workspace.client.i18n;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+
+import com.gwtext.client.data.SimpleStore;
+import com.gwtext.client.data.Store;
+import com.gwtext.client.widgets.form.ComboBox;
+import com.gwtext.client.widgets.form.Field;
+import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.form.event.ComboBoxListener;
+
+public class LanguageSelectorPanel extends FormPanel implements LanguageSelectorView {
+
+ public static final String LANG_ID = "abbr";
+ public static final String LANG_FIELD = "k-langsp-lf";
+
+ private ComboBox langCombo;
+ private final LanguageSelectorPresenter presenter;
+ private final I18nTranslationService i18n;
+
+ public LanguageSelectorPanel(final LanguageSelectorPresenter presenter, final I18nTranslationService i18n) {
+ this(presenter, null, i18n);
+ }
+
+ public LanguageSelectorPanel(final LanguageSelectorPresenter presenter, final String langFieldTitle,
+ final I18nTranslationService i18n) {
+ super();
+ this.i18n = i18n;
+ super.setBorder(false);
+ if (langFieldTitle == null) {
+ setHideLabels(true);
+ }
+ this.presenter = presenter;
+ createLangCombo(langFieldTitle);
+ super.add(langCombo);
+ }
+
+ public void addChangeListener(final ComboBoxListener listener) {
+ langCombo.addListener(listener);
+ }
+
+ public String getLanguage() {
+ return langCombo.getValueAsString();
+ }
+
+ public void reset() {
+ langCombo.reset();
+ }
+
+ public void setLanguage(final String languageCode) {
+ langCombo.setValue(languageCode);
+ }
+
+ private void createLangCombo(final String langFieldTitle) {
+ final Store langStore = new SimpleStore(new String[] { LANG_ID, "language" }, getLanguages());
+ langStore.load();
+
+ Field.setMsgTarget("side");
+ langCombo = new ComboBox();
+ langCombo.setName(LANG_FIELD);
+ langCombo.setMinChars(1);
+ if (langFieldTitle != null) {
+ langCombo.setFieldLabel(langFieldTitle);
+ }
+ langCombo.setStore(langStore);
+ langCombo.setDisplayField("language");
+ langCombo.setMode(ComboBox.LOCAL);
+ langCombo.setTriggerAction(ComboBox.ALL);
+ langCombo.setEmptyText(i18n.t("Enter language"));
+ langCombo.setLoadingText(i18n.t("Searching..."));
+ langCombo.setTypeAhead(true);
+ langCombo.setTypeAheadDelay(1000);
+ langCombo.setSelectOnFocus(false);
+ langCombo.setWidth(140);
+ langCombo.setValueField(LANG_ID);
+ langCombo.setPageSize(7);
+ langCombo.setForceSelection(true);
+ langCombo.setAllowBlank(false);
+ }
+
+ private Object[][] getLanguages() {
+ return presenter.getLanguages();
+ }
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/workspace/client/i18n/LanguageSelectorPanel.java
___________________________________________________________________
Name: svn:mergeinfo
+
1
0
10 Nov '08
Author: vjrj
Date: 2008-11-10 22:32:52 +0100 (Mon, 10 Nov 2008)
New Revision: 945
Added:
trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractContentRegistry.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/RenamableContentRegistry.java
Modified:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/FoldableAbstractClientTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableIconLabel.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconHyperlink.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
Log:
Complete - task Renamable/non-renamables content types support (rooms are not renamable)
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-11-10 20:44:20 UTC (rev 944)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-11-10 21:32:52 UTC (rev 945)
@@ -30,6 +30,7 @@
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.actions.DragDropContentRegistry;
+import org.ourproject.kune.platf.client.actions.RenamableContentRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.ToolGroup;
@@ -57,7 +58,8 @@
@Override
public ChatClientActions create() {
return new ChatClientActions($(I18nUITranslationService.class), $(Session.class),
- $(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(ChatEngine.class), $$(AddRoom.class));
+ $(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(ChatEngine.class),
+ $$(AddRoom.class));
}
});
@@ -66,7 +68,7 @@
public ChatClientTool create() {
return new ChatClientTool($(I18nUITranslationService.class), $(WorkspaceSkeleton.class),
$(ToolSelector.class), $(WsThemePresenter.class), $(ContentIconsRegistry.class),
- $(DragDropContentRegistry.class));
+ $(DragDropContentRegistry.class), $(RenamableContentRegistry.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-11-10 20:44:20 UTC (rev 944)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-11-10 21:32:52 UTC (rev 945)
@@ -21,6 +21,7 @@
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.actions.DragDropContentRegistry;
+import org.ourproject.kune.platf.client.actions.RenamableContentRegistry;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
@@ -35,9 +36,10 @@
public ChatClientTool(final I18nTranslationService i18n, final WorkspaceSkeleton ws,
final ToolSelector toolSelector, final WsThemePresenter wsThemePresenter,
- final ContentIconsRegistry contentIconsRegistry, final DragDropContentRegistry dragDropContentRegistry) {
+ final ContentIconsRegistry contentIconsRegistry, final DragDropContentRegistry dragDropContentRegistry,
+ RenamableContentRegistry renamablesContentRegistry) {
super(NAME, i18n.t("chat rooms"), toolSelector, wsThemePresenter, ws, contentIconsRegistry,
- dragDropContentRegistry);
+ dragDropContentRegistry, renamablesContentRegistry);
}
public String getName() {
@@ -48,4 +50,5 @@
protected void registerIcons() {
contentIconsRegistry.registerContentTypeIcon(TYPE_ROOM, "images/emite-room.png");
}
+
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-11-10 20:44:20 UTC (rev 944)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-11-10 21:32:52 UTC (rev 945)
@@ -36,6 +36,7 @@
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.actions.DragDropContentRegistry;
+import org.ourproject.kune.platf.client.actions.RenamableContentRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.app.ToolGroup;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
@@ -72,7 +73,7 @@
$(DocumentClientActions.class);
return new DocumentClientTool($(I18nUITranslationService.class), $(ToolSelector.class),
$(WsThemePresenter.class), $(WorkspaceSkeleton.class), $(DragDropContentRegistry.class),
- $(ContentIconsRegistry.class));
+ $(ContentIconsRegistry.class), $(RenamableContentRegistry.class));
}
});
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-11-10 20:44:20 UTC (rev 944)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-11-10 21:32:52 UTC (rev 945)
@@ -21,6 +21,7 @@
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.actions.DragDropContentRegistry;
+import org.ourproject.kune.platf.client.actions.RenamableContentRegistry;
import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
@@ -42,9 +43,10 @@
public DocumentClientTool(final I18nUITranslationService i18n, final ToolSelector toolSelector,
final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws,
- final DragDropContentRegistry dragDropContentRegistry, final ContentIconsRegistry contentIconsRegistry) {
+ final DragDropContentRegistry dragDropContentRegistry, final ContentIconsRegistry contentIconsRegistry,
+ RenamableContentRegistry renamableContentRegistry) {
super(NAME, i18n.t("documents"), toolSelector, wsThemePresenter, ws, contentIconsRegistry,
- dragDropContentRegistry);
+ dragDropContentRegistry, renamableContentRegistry);
}
public String getName() {
@@ -91,4 +93,10 @@
"mspowerpoint"), "images/nav/page_pps.png");
contentIconsRegistry.registerContentTypeIcon(TYPE_UPLOADEDFILE, "images/nav/page.png");
}
+
+ @Override
+ protected void registerRenamableTypes() {
+ renamableContentRegistry.register(TYPE_DOCUMENT, TYPE_FOLDER, TYPE_BLOG, TYPE_GALLERY, TYPE_POST,
+ TYPE_UPLOADEDFILE, TYPE_WIKI, TYPE_WIKIPAGE);
+ }
}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractContentRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractContentRegistry.java 2008-11-10 20:44:20 UTC (rev 944)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/AbstractContentRegistry.java 2008-11-10 21:32:52 UTC (rev 945)
@@ -0,0 +1,31 @@
+package org.ourproject.kune.platf.client.actions;
+
+import java.util.ArrayList;
+
+import com.allen_sauer.gwt.log.client.Log;
+
+public abstract class AbstractContentRegistry {
+ private final ArrayList<String> registry;
+
+ public AbstractContentRegistry() {
+ registry = new ArrayList<String>();
+ }
+
+ public boolean contains(String typeId) {
+ Log.debug("Renables: " + registry + " checking: " + typeId);
+ return registry.contains(typeId);
+ }
+
+ public void register(String... typeIds) {
+ for (String typeId : typeIds) {
+ registry.add(typeId);
+ }
+ }
+
+ public void unregister(String... typeIds) {
+ for (String typeId : typeIds) {
+ registry.remove(typeId);
+ }
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/actions/RenamableContentRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/RenamableContentRegistry.java 2008-11-10 20:44:20 UTC (rev 944)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/RenamableContentRegistry.java 2008-11-10 21:32:52 UTC (rev 945)
@@ -0,0 +1,4 @@
+package org.ourproject.kune.platf.client.actions;
+
+public class RenamableContentRegistry extends AbstractContentRegistry {
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-11-10 20:44:20 UTC (rev 944)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-11-10 21:32:52 UTC (rev 945)
@@ -24,6 +24,7 @@
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.actions.DragDropContentRegistry;
import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
+import org.ourproject.kune.platf.client.actions.RenamableContentRegistry;
import org.ourproject.kune.platf.client.actions.UserActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbarPresenter;
@@ -414,6 +415,13 @@
}
});
+ register(Singleton.class, new Factory<RenamableContentRegistry>(RenamableContentRegistry.class) {
+ @Override
+ public RenamableContentRegistry create() {
+ return new RenamableContentRegistry();
+ }
+ });
+
register(Singleton.class, new Factory<ContentIconsRegistry>(ContentIconsRegistry.class) {
@Override
public ContentIconsRegistry create() {
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-11-10 20:44:20 UTC (rev 944)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-11-10 21:32:52 UTC (rev 945)
@@ -21,6 +21,7 @@
import org.ourproject.kune.chat.client.ChatEngine;
import org.ourproject.kune.platf.client.actions.ActionManager;
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
+import org.ourproject.kune.platf.client.actions.RenamableContentRegistry;
import org.ourproject.kune.platf.client.actions.UserActionRegistry;
import org.ourproject.kune.platf.client.app.ApplicationComponentGroup;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
@@ -277,7 +278,8 @@
public EntityTitle create() {
final EntityTitlePresenter presenter = new EntityTitlePresenter($(I18nUITranslationService.class),
$(KuneErrorHandler.class), $(StateManager.class), $(Session.class),
- $$(ContentServiceAsync.class), $$(ContextNavigator.class), $(ContentIconsRegistry.class));
+ $$(ContentServiceAsync.class), $$(ContextNavigator.class), $(ContentIconsRegistry.class),
+ $(RenamableContentRegistry.class));
final EntityTitlePanel panel = new EntityTitlePanel($(WorkspaceSkeleton.class), presenter);
presenter.init(panel);
return presenter;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/tool/FoldableAbstractClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/FoldableAbstractClientTool.java 2008-11-10 20:44:20 UTC (rev 944)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/FoldableAbstractClientTool.java 2008-11-10 21:32:52 UTC (rev 945)
@@ -2,21 +2,25 @@
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.actions.DragDropContentRegistry;
+import org.ourproject.kune.platf.client.actions.RenamableContentRegistry;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
public abstract class FoldableAbstractClientTool extends AbstractClientTool {
protected final DragDropContentRegistry dragDropContentRegistry;
protected final ContentIconsRegistry contentIconsRegistry;
+ protected final RenamableContentRegistry renamableContentRegistry;
public FoldableAbstractClientTool(String shortName, String longName, ToolSelector toolSelector,
WsThemePresenter wsThemePresenter, WorkspaceSkeleton ws, final ContentIconsRegistry contentIconsRegistry,
- final DragDropContentRegistry dragDropContentRegistry) {
+ final DragDropContentRegistry dragDropContentRegistry, RenamableContentRegistry renamableContentRegistry) {
super(shortName, longName, toolSelector, wsThemePresenter, ws);
this.dragDropContentRegistry = dragDropContentRegistry;
this.contentIconsRegistry = contentIconsRegistry;
+ this.renamableContentRegistry = renamableContentRegistry;
registerDragDropTypes();
registerIcons();
+ registerRenamableTypes();
}
protected void registerDragDropTypes() {
@@ -24,4 +28,7 @@
protected void registerIcons() {
}
+
+ protected void registerRenamableTypes() {
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableIconLabel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableIconLabel.java 2008-11-10 20:44:20 UTC (rev 944)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/EditableIconLabel.java 2008-11-10 21:32:52 UTC (rev 945)
@@ -107,7 +107,7 @@
// label.addDoubleClickListener(listener);
label.addMouseListener(mouseOverListener);
} else {
- label.setTitle("");
+ label.setTitle(null);
label.addStyleDependentName("noneditable");
}
}
@@ -146,10 +146,12 @@
}
};
mouseOverListener = new MouseListenerAdapter() {
+ @Override
public void onMouseEnter(final Widget sender) {
label.addStyleDependentName("high");
}
+ @Override
public void onMouseLeave(final Widget sender) {
label.removeStyleDependentName("high");
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconHyperlink.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconHyperlink.java 2008-11-10 20:44:20 UTC (rev 944)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/IconHyperlink.java 2008-11-10 21:32:52 UTC (rev 945)
@@ -83,10 +83,22 @@
doubleClickListeners.add(listener);
}
+ public void addMouseListener(final MouseListener listener) {
+ if (mouseListeners == null) {
+ mouseListeners = new MouseListenerCollection();
+ }
+ mouseListeners.add(listener);
+ }
+
public String getTargetHistoryToken() {
return targetHistoryToken;
}
+ public String getText() {
+ return DOM.getInnerText(link);
+ }
+
+ @Override
public void onBrowserEvent(final Event event) {
switch (DOM.eventGetType(event)) {
case Event.ONDBLCLICK:
@@ -126,52 +138,40 @@
}
}
- public void setLabelHTML(final String html) {
- DOM.setInnerHTML(link, html);
+ public void removeMouseListener(final MouseListener listener) {
+ if (mouseListeners != null) {
+ mouseListeners.remove(listener);
+ }
}
- public void setTargetHistoryToken(final String targetHistoryToken) {
- this.targetHistoryToken = targetHistoryToken;
- DOM.setElementProperty(anchorElem, "href", "#" + targetHistoryToken);
+ public void setColor(final String color) {
+ DOM.setStyleAttribute(link, "color", color);
}
- public void setLabelText(final String text) {
- DOM.setInnerText(link, text);
- }
-
public void setImage(final AbstractImagePrototype image) {
DOM.setInnerHTML(icon, image.getHTML());
}
- public void setTitle(final String title) {
- // DOM.setElementAttribute(anchorElem, "ext:qtip", title);
- KuneUiUtils.setQuickTip(icon, title);
- KuneUiUtils.setQuickTip(anchorElem, title);
- // KuneUiUtils.setQuickTip(getElement(), title);
+ public void setLabelHTML(final String html) {
+ DOM.setInnerHTML(link, html);
}
- public void addMouseListener(final MouseListener listener) {
- if (mouseListeners == null) {
- mouseListeners = new MouseListenerCollection();
- }
- mouseListeners.add(listener);
+ public void setLabelText(final String text) {
+ DOM.setInnerText(link, text);
}
- public String getText() {
- return DOM.getInnerText(link);
+ public void setTargetHistoryToken(final String targetHistoryToken) {
+ this.targetHistoryToken = targetHistoryToken;
+ DOM.setElementProperty(anchorElem, "href", "#" + targetHistoryToken);
}
- public void removeMouseListener(final MouseListener listener) {
- if (mouseListeners != null) {
- mouseListeners.remove(listener);
- }
+ public void setText(final String text) {
+ setLabelText(text);
}
- public void setColor(final String color) {
- DOM.setStyleAttribute(link, "color", color);
+ @Override
+ public void setTitle(final String title) {
+ KuneUiUtils.setQuickTip(icon, title);
+ KuneUiUtils.setQuickTip(anchorElem, title);
}
-
- public void setText(final String text) {
- setLabelText(text);
- }
}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java 2008-11-10 20:44:20 UTC (rev 944)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java 2008-11-10 21:32:52 UTC (rev 945)
@@ -23,6 +23,7 @@
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
+import org.ourproject.kune.platf.client.actions.RenamableContentRegistry;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
@@ -49,23 +50,26 @@
private final Session session;
private final Provider<ContextNavigator> contextNavigatorProvider;
private final ContentIconsRegistry iconsRegistry;
+ private final RenamableContentRegistry renamableContentRegistry;
public EntityTitlePresenter(final I18nTranslationService i18n, final KuneErrorHandler errorHandler,
final StateManager stateManager, final Session session,
final Provider<ContentServiceAsync> contentServiceProvider,
- final Provider<ContextNavigator> contextNavigatorProvider, final ContentIconsRegistry iconsRegistry) {
+ final Provider<ContextNavigator> contextNavigatorProvider, final ContentIconsRegistry iconsRegistry,
+ RenamableContentRegistry renamableContentRegistry) {
this.i18n = i18n;
this.errorHandler = errorHandler;
this.session = session;
this.contentServiceProvider = contentServiceProvider;
this.contextNavigatorProvider = contextNavigatorProvider;
this.iconsRegistry = iconsRegistry;
+ this.renamableContentRegistry = renamableContentRegistry;
stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
public void onEvent(final StateAbstractDTO state) {
- if (state instanceof StateContainerDTO) {
+ if (state instanceof StateContentDTO) {
+ setState((StateContentDTO) state);
+ } else if (state instanceof StateContainerDTO) {
setState((StateContainerDTO) state);
- } else if (state instanceof StateContentDTO) {
- setState((StateContentDTO) state);
} else {
view.setContentIconVisible(false);
view.setContentTitleVisible(false);
@@ -96,12 +100,6 @@
view.setContentTitleVisible(true);
}
- public void setContentTitle(final String title, final boolean editable) {
- setContentTitle(title);
- view.setContentTitleEditable(editable);
- view.setContentTitleVisible(true);
- }
-
protected void onTitleRename(final String newName) {
Site.showProgressSaving();
final StateToken stateToken = session.getCurrentState().getStateToken();
@@ -129,6 +127,12 @@
view.setDateVisible(visible);
}
+ private void setContentTitle(final String title, final boolean editable) {
+ setContentTitle(title);
+ view.setContentTitleEditable(editable);
+ view.setContentTitleVisible(true);
+ }
+
private void setIcon(final String contentTypeIcon) {
if (contentTypeIcon.length() > 0) {
view.setContentIcon(contentTypeIcon);
@@ -139,13 +143,8 @@
}
private void setState(final StateContainerDTO state) {
- if (state.getContainer().getParentFolderId() == null) {
- // We translate root folder names (documents, chat room,
- // etcetera)
- setContentTitle(i18n.t(state.getTitle()), false);
- } else {
- setContentTitle(state.getTitle(), state.getContainerRights().isEditable());
- }
+ setContentTitle(state.getTitle(), state.getContainerRights().isEditable()
+ && renamableContentRegistry.contains(state.getContainer().getTypeId()));
setContentDateVisible(false);
final String contentTypeIcon = iconsRegistry.getContentTypeIcon(state.getTypeId(), null);
setIcon(contentTypeIcon);
@@ -153,7 +152,8 @@
}
private void setState(final StateContentDTO state) {
- setContentTitle(state.getTitle(), state.getContentRights().isEditable());
+ setContentTitle(state.getTitle(), state.getContentRights().isEditable()
+ && renamableContentRegistry.contains(state.getTypeId()));
Date publishedOn = state.getPublishedOn();
if (publishedOn != null) {
setContentDateVisible(true);
1
0
10 Nov '08
Author: vjrj
Date: 2008-11-10 21:44:20 +0100 (Mon, 10 Nov 2008)
New Revision: 944
Added:
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoom.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPanel.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/
trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/FoldableContextPresenter.java
Removed:
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdmin.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdminPresenter.java
Modified:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContext.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java
Log:
Incomplete - taskUI tools & workspace refactorization
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -18,6 +18,7 @@
*
*/package org.ourproject.kune.chat.client;
+import org.ourproject.kune.chat.client.ctx.room.AddRoom;
import org.ourproject.kune.docs.client.DocumentClientTool;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonSeparator;
@@ -39,15 +40,17 @@
private final ContentActionRegistry contentActionRegistry;
private final I18nUITranslationService i18n;
private final ContextActionRegistry contextActionRegistry;
+ private final Provider<AddRoom> addRoomProvider;
public ChatClientActions(final I18nUITranslationService i18n, final Session session,
final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
- final Provider<ChatEngine> chatEngine) {
+ final Provider<ChatEngine> chatEngine, Provider<AddRoom> addRoomProvider) {
this.i18n = i18n;
this.session = session;
this.contentActionRegistry = contentActionRegistry;
this.contextActionRegistry = contextActionRegistry;
this.chatEngineProvider = chatEngine;
+ this.addRoomProvider = addRoomProvider;
createActions();
}
@@ -68,8 +71,10 @@
ActionToolbarButtonDescriptor<StateToken> joinRoom = new ActionToolbarButtonDescriptor<StateToken>(
AccessRolDTO.Viewer, ActionToolbarPosition.topbar, new Listener<StateToken>() {
public void onEvent(StateToken token) {
- chatEngineProvider.get().joinRoom(session.getContainerState().getContainer().getName(),
+ ChatEngine chatEngine = chatEngineProvider.get();
+ chatEngine.joinRoom(session.getContainerState().getContainer().getName(),
session.getCurrentUserInfo().getShortName());
+ chatEngine.show();
}
});
joinRoom.setTextDescription(i18n.t("Enter room"));
@@ -79,7 +84,7 @@
ActionToolbarButtonDescriptor<StateToken> addRoom = new ActionToolbarButtonDescriptor<StateToken>(
AccessRolDTO.Administrator, ActionToolbarPosition.topbar, new Listener<StateToken>() {
public void onEvent(StateToken token) {
-
+ addRoomProvider.get().show();
}
});
addRoom.setTextDescription(i18n.t("New room"));
@@ -92,6 +97,7 @@
contentActionRegistry.addAction(chatAbout, DocumentClientTool.TYPE_POST);
contentActionRegistry.addAction(chatAbout, DocumentClientTool.TYPE_UPLOADEDFILE);
- contextActionRegistry.addAction(joinRoom, ChatClientTool.TYPE_ROOT);
+ contextActionRegistry.addAction(addRoom, ChatClientTool.TYPE_ROOT, ChatClientTool.TYPE_ROOM);
+ contentActionRegistry.addAction(joinRoom, ChatClientTool.TYPE_ROOM);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -23,8 +23,9 @@
import org.ourproject.kune.chat.client.cnt.room.ChatRoomPresenter;
import org.ourproject.kune.chat.client.ctx.ChatContext;
import org.ourproject.kune.chat.client.ctx.ChatContextPresenter;
-import org.ourproject.kune.chat.client.ctx.room.RoomAdmin;
-import org.ourproject.kune.chat.client.ctx.room.RoomAdminPresenter;
+import org.ourproject.kune.chat.client.ctx.room.AddRoom;
+import org.ourproject.kune.chat.client.ctx.room.AddRoomPanel;
+import org.ourproject.kune.chat.client.ctx.room.AddRoomPresenter;
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
@@ -56,7 +57,7 @@
@Override
public ChatClientActions create() {
return new ChatClientActions($(I18nUITranslationService.class), $(Session.class),
- $(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(ChatEngine.class));
+ $(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(ChatEngine.class), $$(AddRoom.class));
}
});
@@ -69,11 +70,11 @@
}
});
- register(Singleton.class, new Factory<ChatContext>(ChatContext.class) {
+ register(ToolGroup.class, new Factory<ChatContext>(ChatContext.class) {
@Override
public ChatContext create() {
final ChatContextPresenter presenter = new ChatContextPresenter($(StateManager.class),
- $$(ContextNavigator.class), $$(RoomAdmin.class));
+ $$(ContextNavigator.class));
return presenter;
}
});
@@ -99,12 +100,13 @@
}
});
- register(Singleton.class, new Factory<RoomAdmin>(RoomAdmin.class) {
+ register(Singleton.class, new Factory<AddRoom>(AddRoom.class) {
@Override
- public RoomAdmin create() {
- final RoomAdminPresenter presenter = new RoomAdminPresenter($(ContextNavigator.class),
- $(I18nUITranslationService.class), $$(StateManager.class), $(Session.class),
- $$(ContentServiceAsync.class));
+ public AddRoom create() {
+ final AddRoomPresenter presenter = new AddRoomPresenter($(Session.class),
+ $$(ContentServiceAsync.class), $(StateManager.class));
+ final AddRoomPanel panel = new AddRoomPanel(presenter, $(I18nTranslationService.class));
+ presenter.init(panel);
return presenter;
}
});
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -46,6 +46,6 @@
@Override
protected void registerIcons() {
- contentIconsRegistry.registerContentTypeIcon(TYPE_ROOM, "public/images/emite-room.png");
+ contentIconsRegistry.registerContentTypeIcon(TYPE_ROOM, "images/emite-room.png");
}
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContext.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContext.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContext.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -19,10 +19,6 @@
*/
package org.ourproject.kune.chat.client.ctx;
-import org.ourproject.kune.platf.client.dto.StateContainerDTO;
public interface ChatContext {
-
- void setState(StateContainerDTO state);
-
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -19,24 +19,23 @@
*/
package org.ourproject.kune.chat.client.ctx;
-import org.ourproject.kune.chat.client.ctx.room.RoomAdmin;
+import org.ourproject.kune.chat.client.ChatClientTool;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.FoldableContextPresenter;
import com.calclab.suco.client.ioc.Provider;
-public class ChatContextPresenter implements ChatContext {
+public class ChatContextPresenter extends FoldableContextPresenter implements ChatContext {
- private final Provider<RoomAdmin> roomAdminsProvider;
-
public ChatContextPresenter(final StateManager stateManager,
- final Provider<ContextNavigator> contextNavigatorProvider, final Provider<RoomAdmin> roomAdminsProvider) {
- this.roomAdminsProvider = roomAdminsProvider;
+ final Provider<ContextNavigator> contextNavigatorProvider) {
+ super(ChatClientTool.NAME, stateManager, contextNavigatorProvider);
}
- public void setState(final StateContainerDTO state) {
- final RoomAdmin rooms = roomAdminsProvider.get();
- rooms.showRoom(state.getStateToken(), state.getContainer(), state.getContainerRights());
+ @Override
+ protected void setState(final StateContainerDTO state) {
+ super.setState(state);
}
}
Added: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoom.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoom.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoom.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.chat.client.ctx.room;
+
+public interface AddRoom {
+
+ void show();
+
+}
Added: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPanel.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPanel.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -0,0 +1,99 @@
+package org.ourproject.kune.chat.client.ctx.room;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.TextUtils;
+
+import com.calclab.emiteuimodule.client.dialog.BasicDialogExtended;
+import com.calclab.emiteuimodule.client.dialog.BasicDialogListener;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.form.Field;
+import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.form.TextField;
+import com.gwtext.client.widgets.form.event.FieldListenerAdapter;
+
+public class AddRoomPanel implements AddRoomView {
+
+ public static final String CANCEL_ID = "k-ct-arp-cb";
+ public static final String ADD_ROOM_ID = "k-ct-arp-ab";
+ public static final String ROOM_NAME_ID = "k-ct-arp-rfield";
+ private final AddRoomPresenter presenter;
+ private BasicDialogExtended dialog;
+ private final I18nTranslationService i18n;
+ private FormPanel formPanel;
+ private TextField roomName;
+
+ public AddRoomPanel(final AddRoomPresenter presenter, final I18nTranslationService i18n) {
+ this.i18n = i18n;
+ this.presenter = presenter;
+ }
+
+ public void reset() {
+ formPanel.getForm().reset();
+ }
+
+ public void show() {
+ if (dialog == null) {
+ dialog = new BasicDialogExtended(i18n.t("Add a chat room"), false, false, 330, 130, "chat-icon",
+ i18n.tWithNT("Add", "used in button"), ADD_ROOM_ID, i18n.tWithNT("Cancel", "used in button"),
+ CANCEL_ID, new BasicDialogListener() {
+ public void onCancelButtonClick() {
+ dialog.hide();
+ reset();
+ }
+
+ public void onFirstButtonClick() {
+ doAddRoom();
+ }
+ });
+ dialog.setResizable(false);
+ createForm();
+
+ // TODO define a UI Extension Point here
+ }
+ dialog.show();
+ roomName.focus();
+ }
+
+ protected void doAddRoom() {
+ roomName.validate();
+ if (formPanel.getForm().isValid()) {
+ DeferredCommand.addCommand(new Command() {
+ public void execute() {
+ presenter.addRoom(roomName.getValueAsString());
+ reset();
+ }
+ });
+ dialog.hide();
+ }
+ }
+
+ private void createForm() {
+ formPanel = new FormPanel();
+ formPanel.setFrame(true);
+ formPanel.setAutoScroll(false);
+
+ formPanel.setWidth(333);
+ formPanel.setLabelWidth(100);
+ formPanel.setPaddings(10);
+
+ roomName = new TextField(i18n.t("Room Name"), "name", 150);
+ roomName.setAllowBlank(false);
+ roomName.setValidationEvent(false);
+ roomName.setRegex(TextUtils.UNIX_NAME);
+ roomName.setRegexText(i18n.t("Can only contain characters, numbers, and dashes"));
+ roomName.setId(ROOM_NAME_ID);
+ formPanel.add(roomName);
+
+ dialog.add(formPanel);
+ roomName.addListener(new FieldListenerAdapter() {
+ @Override
+ public void onSpecialKey(Field field, EventObject e) {
+ if (e.getKey() == 13) {
+ doAddRoom();
+ }
+ }
+ });
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPresenter.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomPresenter.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -0,0 +1,51 @@
+package org.ourproject.kune.chat.client.ctx.room;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.StateContainerDTO;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.site.Site;
+
+import com.calclab.suco.client.ioc.Provider;
+
+public class AddRoomPresenter implements AddRoom {
+
+ private AddRoomView view;
+ private final Session session;
+ private final Provider<ContentServiceAsync> contentServiceProvider;
+ private final StateManager stateManager;
+
+ public AddRoomPresenter(Session session, final Provider<ContentServiceAsync> contentServiceProvider,
+ StateManager stateManager) {
+ this.session = session;
+ this.contentServiceProvider = contentServiceProvider;
+ this.stateManager = stateManager;
+ }
+
+ public void addRoom(String roomName) {
+ Site.showProgressProcessing();
+ final String groupShortName = session.getCurrentState().getGroup().getShortName();
+ contentServiceProvider.get().addRoom(session.getUserHash(),
+ session.getContainerState().getRootContainer().getStateToken(), groupShortName + "-" + roomName,
+ new AsyncCallbackSimple<StateContainerDTO>() {
+ public void onSuccess(final StateContainerDTO state) {
+ stateManager.setRetrievedState(state);
+ Site.hideProgress();
+ }
+ });
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void init(AddRoomView view) {
+ this.view = view;
+ }
+
+ public void show() {
+ view.show();
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomView.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/AddRoomView.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -0,0 +1,9 @@
+package org.ourproject.kune.chat.client.ctx.room;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface AddRoomView extends View {
+
+ void show();
+
+}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdmin.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdmin.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdmin.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client.ctx.room;
-
-import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
-import org.ourproject.kune.platf.client.dto.ContainerDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public interface RoomAdmin {
- void showRoom(final StateToken token, final ContainerDTO container, final AccessRightsDTO rights);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdminPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdminPresenter.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdminPresenter.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -1,77 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client.ctx.room;
-
-import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
-import org.ourproject.kune.platf.client.dto.ContainerDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
-
-import com.calclab.suco.client.ioc.Provider;
-
-public class RoomAdminPresenter implements RoomAdmin {
- private final ContextNavigator contextNavigator;
-
- public RoomAdminPresenter(final ContextNavigator contextNavigator, final I18nTranslationService i18n,
- final Provider<StateManager> stateManagerProvider, final Session session,
- final Provider<ContentServiceAsync> contentServiceProvider) {
- this.contextNavigator = contextNavigator;
- // final ContextNavigatorImages images =
- // ContextNavigatorImages.App.getInstance();
- // contextNavigator.registerType(ChatClientTool.TYPE_CHAT,
- // images.page());
- // contextNavigator.registerType(ChatClientTool.TYPE_ROOM,
- // images.chatGreen());
- // contextNavigator.canCreate(i18n.t("New chat room"), i18n.t("Add a
- // chat room"), new Listener<String>() {
- // public void onEvent(final String name) {
- // Site.showProgressProcessing();
- // final String groupShortName =
- // session.getCurrentState().getGroup().getShortName();
- // final Long containerId =
- // session.getCurrentState().getFolder().getId();
- // contentServiceProvider.get().addRoom(session.getUserHash(),
- // groupShortName, containerId,
- // groupShortName + "-" + name, new AsyncCallbackSimple<StateDTO>() {
- // public void onSuccess(final StateDTO state) {
- // final StateManager stateManager = stateManagerProvider.get();
- // stateManager.setRetrievedState(state);
- // // FIXME: Isn't using cache (same in Add folder)
- // stateManager.reloadContextAndTitles();
- // Site.hideProgress();
- // }
- // });
- // }
- // });
- }
-
- public void showRoom(final StateToken token, final ContainerDTO container, final AccessRightsDTO rights) {
- // contextNavigator.showContainer(token, container, rights);
- // final String type = container.getTypeId();
- // if (type.equals(ChatClientTool.TYPE_ROOM)) {
- // contextNavigator.setControlsVisible(false);
- // }
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/DocumentContextPresenter.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -21,43 +21,34 @@
import org.ourproject.kune.docs.client.DocumentClientTool;
import org.ourproject.kune.docs.client.ctx.admin.DocContextEditor;
-import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.FoldableContextPresenter;
import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.listener.Listener;
-public class DocumentContextPresenter implements DocumentContext {
- private final Provider<ContextNavigator> contextNavigatorProvider;
+public class DocumentContextPresenter extends FoldableContextPresenter implements DocumentContext {
private final Provider<DocContextEditor> adminContextProvider;
public DocumentContextPresenter(final StateManager stateManager,
- final Provider<ContextNavigator> contextNavigatorProvider, final Provider<DocContextEditor> adminContextProvider) {
- this.contextNavigatorProvider = contextNavigatorProvider;
+ final Provider<ContextNavigator> contextNavigatorProvider,
+ final Provider<DocContextEditor> adminContextProvider) {
+ super(DocumentClientTool.NAME, stateManager, contextNavigatorProvider);
this.adminContextProvider = adminContextProvider;
- stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
- public void onEvent(final StateAbstractDTO state) {
- if (state instanceof StateContainerDTO) {
- StateContainerDTO stateCntCtx = (StateContainerDTO) state;
- if (DocumentClientTool.NAME.equals(stateCntCtx.getToolName())) {
- setState(stateCntCtx);
- contextNavigatorProvider.get().attach();
- }
- } else {
- contextNavigatorProvider.get().detach();
- adminContextProvider.get().detach();
- contextNavigatorProvider.get().clear();
- adminContextProvider.get().clear();
- }
- }
- });
}
- private void setState(final StateContainerDTO state) {
- contextNavigatorProvider.get().setState(state, true);
+ @Override
+ protected void detach() {
+ super.detach();
+ adminContextProvider.get().detach();
+ adminContextProvider.get().clear();
+ }
+
+ @Override
+ protected void setState(final StateContainerDTO state) {
+ super.setState(state);
if (state instanceof StateContentDTO) {
adminContextProvider.get().setState((StateContentDTO) state);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/TextUtils.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -28,6 +28,8 @@
// Original regexp from http://www.regular-expressions.info/email.html
public static final String EMAIL_REGEXP = "[-!#$%&\'*+/=?_`{|}~a-z0-9^]+(\\.[-!#$%&\'*+/=?_`{|}~a-z0-9^]+)*@(localhost|([a-z0-9]([-a-z0-9]*[a-z0-9])?\\.)+[a-z0-9]([-a-z0-9]*[a-z0-9]))?";
+ public static final String UNIX_NAME = "^[a-z0-9_\\-]+$";
+
/*
* This method escape only some dangerous html chars
*/
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPanel.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPanel.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -4,7 +4,7 @@
import com.google.gwt.user.client.ui.Widget;
-public class AbstractContentPanel {
+public abstract class AbstractContentPanel {
private final WorkspaceSkeleton ws;
private Widget widget;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -10,7 +10,7 @@
import com.google.gwt.user.client.ui.Label;
import com.google.gwt.user.client.ui.Widget;
-public class FoldableContentPanel extends AbstractContentPanel {
+public abstract class FoldableContentPanel extends AbstractContentPanel {
private final I18nTranslationService i18n;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -13,7 +13,7 @@
import com.calclab.suco.client.listener.Listener;
-public class FoldableContentPresenter extends AbstractContentPresenter {
+public abstract class FoldableContentPresenter extends AbstractContentPresenter {
private final String toolName;
private final ActionRegistry<StateToken> actionRegistry;
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/FoldableContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/FoldableContextPresenter.java 2008-11-10 19:00:10 UTC (rev 943)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/FoldableContextPresenter.java 2008-11-10 20:44:20 UTC (rev 944)
@@ -0,0 +1,42 @@
+package org.ourproject.kune.workspace.client.cxt;
+
+import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
+import org.ourproject.kune.platf.client.dto.StateContainerDTO;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.listener.Listener;
+
+public abstract class FoldableContextPresenter {
+ private final Provider<ContextNavigator> contextNavigatorProvider;
+ protected final String toolname;
+
+ public FoldableContextPresenter(final String toolname, final StateManager stateManager,
+ final Provider<ContextNavigator> contextNavigatorProvider) {
+ this.toolname = toolname;
+ this.contextNavigatorProvider = contextNavigatorProvider;
+ stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
+ public void onEvent(final StateAbstractDTO state) {
+ if (state instanceof StateContainerDTO) {
+ StateContainerDTO stateCntCtx = (StateContainerDTO) state;
+ if (toolname.equals(stateCntCtx.getToolName())) {
+ setState(stateCntCtx);
+ contextNavigatorProvider.get().attach();
+ }
+ } else {
+ detach();
+ }
+ }
+ });
+ }
+
+ protected void detach() {
+ contextNavigatorProvider.get().detach();
+ contextNavigatorProvider.get().clear();
+ }
+
+ protected void setState(StateContainerDTO state) {
+ contextNavigatorProvider.get().setState(state, true);
+ }
+}
1
0
10 Nov '08
Author: vjrj
Date: 2008-11-10 20:00:10 +0100 (Mon, 10 Nov 2008)
New Revision: 943
Added:
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java
Removed:
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentView.java
Modified:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPanel.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewer.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerView.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java
Log:
Incomplete - task UI tools & workspace refactorization
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -33,6 +33,7 @@
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.ToolGroup;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.tool.ToolSelector;
@@ -71,7 +72,8 @@
register(Singleton.class, new Factory<ChatContext>(ChatContext.class) {
@Override
public ChatContext create() {
- final ChatContextPresenter presenter = new ChatContextPresenter($$(RoomAdmin.class));
+ final ChatContextPresenter presenter = new ChatContextPresenter($(StateManager.class),
+ $$(ContextNavigator.class), $$(RoomAdmin.class));
return presenter;
}
});
@@ -90,7 +92,8 @@
final ChatRoomPresenter presenter = new ChatRoomPresenter($(StateManager.class), $(Session.class),
$(I18nUITranslationService.class), $(ActionContentToolbar.class),
$(ContentActionRegistry.class));
- final ChatRoomPanel panel = new ChatRoomPanel($(WorkspaceSkeleton.class));
+ final ChatRoomPanel panel = new ChatRoomPanel($(WorkspaceSkeleton.class),
+ $(I18nTranslationService.class));
presenter.init(panel);
return presenter;
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPanel.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPanel.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -19,24 +19,17 @@
*/
package org.ourproject.kune.chat.client.cnt.room;
-import org.ourproject.kune.workspace.client.cnt.AbstractContentPanel;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-import com.google.gwt.user.client.ui.Label;
+public class ChatRoomPanel extends FoldableContentPanel implements ChatRoomView {
-public class ChatRoomPanel extends AbstractContentPanel implements ChatRoomView {
-
- private final Label label;
-
- public ChatRoomPanel(final WorkspaceSkeleton ws) {
- super(ws);
- label = new Label();
- label.setStyleName("kune-Content-Main");
- label.addStyleName("kune-Margin-7-trbl");
- initWidget(label);
+ public ChatRoomPanel(final WorkspaceSkeleton ws, I18nTranslationService i18n) {
+ super(ws, i18n);
}
public void setInfo(String info) {
- label.setText(info);
+ setLabel(info);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -21,6 +21,8 @@
import org.ourproject.kune.chat.client.ctx.room.RoomAdmin;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import com.calclab.suco.client.ioc.Provider;
@@ -28,7 +30,8 @@
private final Provider<RoomAdmin> roomAdminsProvider;
- public ChatContextPresenter(final Provider<RoomAdmin> roomAdminsProvider) {
+ public ChatContextPresenter(final StateManager stateManager,
+ final Provider<ContextNavigator> contextNavigatorProvider, final Provider<RoomAdmin> roomAdminsProvider) {
this.roomAdminsProvider = roomAdminsProvider;
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -28,7 +28,7 @@
import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_WIKI;
import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_WIKIPAGE;
-import org.ourproject.kune.docs.client.cnt.DocumentContent;
+import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewer;
import org.ourproject.kune.docs.client.ctx.admin.DocContextEditor;
import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
import org.ourproject.kune.platf.client.actions.ActionMenuItemDescriptor;
@@ -86,7 +86,7 @@
private final EntityLogo entityLogo;
private final Provider<TextEditor> textEditorProvider;
private final KuneErrorHandler errorHandler;
- private final DocumentContent documentContent;
+ private final DocumentViewer documentViewer;
private final Provider<DocContextEditor> adminContextProvider;
public DocumentClientActions(final I18nUITranslationService i18n, final ContextNavigator contextNavigator,
@@ -96,7 +96,7 @@
final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
final Provider<FileDownloadUtils> fileDownloadProvider, final EntityLogo entityLogo,
final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler,
- final DocumentContent documentContent, final Provider<DocContextEditor> adminContextProvider) {
+ final DocumentViewer documentViewer, final Provider<DocContextEditor> adminContextProvider) {
this.i18n = i18n;
this.contextNavigator = contextNavigator;
this.session = session;
@@ -110,7 +110,7 @@
this.entityLogo = entityLogo;
this.textEditorProvider = textEditorProvider;
this.errorHandler = errorHandler;
- this.documentContent = documentContent;
+ this.documentViewer = documentViewer;
this.adminContextProvider = adminContextProvider;
createActions();
}
@@ -337,7 +337,7 @@
session.check(new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
final TextEditor editor = textEditorProvider.get();
- documentContent.detach();
+ documentViewer.detach();
contextNavigator.detach();
adminContextProvider.get().attach();
editor.editContent(session.getContentState().getContent(), new Listener<String>() {
@@ -370,11 +370,11 @@
// onClose
DeferredCommand.addCommand(new Command() {
public void execute() {
- documentContent.attach();
+ documentViewer.attach();
adminContextProvider.get().detach();
contextNavigator.attach();
if (session.getCurrentStateToken().equals(stateToken)) {
- documentContent.refreshState();
+ documentViewer.refreshState();
}
}
});
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -18,9 +18,6 @@
*
*/package org.ourproject.kune.docs.client;
-import org.ourproject.kune.docs.client.cnt.DocumentContent;
-import org.ourproject.kune.docs.client.cnt.DocumentContentPanel;
-import org.ourproject.kune.docs.client.cnt.DocumentContentPresenter;
import org.ourproject.kune.docs.client.cnt.folder.viewer.DocFolderContent;
import org.ourproject.kune.docs.client.cnt.folder.viewer.DocFolderContentPanel;
import org.ourproject.kune.docs.client.cnt.folder.viewer.DocFolderContentPresenter;
@@ -86,23 +83,11 @@
$(Session.class), $(StateManager.class), $$(ContentServiceAsync.class),
$$(GroupServiceAsync.class), $$(FileUploader.class), $(ContentActionRegistry.class),
$(ContextActionRegistry.class), $$(FileDownloadUtils.class), $(EntityLogo.class),
- $$(TextEditor.class), $(KuneErrorHandler.class), $(DocumentContent.class),
+ $$(TextEditor.class), $(KuneErrorHandler.class), $(DocumentViewer.class),
$$(DocContextEditor.class));
}
});
- register(ToolGroup.class, new Factory<DocumentContent>(DocumentContent.class) {
- @Override
- public DocumentContent create() {
- final DocumentContentPresenter presenter = new DocumentContentPresenter($(StateManager.class),
- $(Session.class), $$(DocumentViewer.class), $$(TextEditor.class),
- $(ActionContentToolbar.class), $(ContentActionRegistry.class));
- final DocumentContentPanel panel = new DocumentContentPanel($(WorkspaceSkeleton.class));
- presenter.init(panel);
- return presenter;
- }
- });
-
register(Singleton.class, new Factory<DocContextEditor>(DocContextEditor.class) {
@Override
public DocContextEditor create() {
@@ -128,9 +113,12 @@
register(Singleton.class, new Factory<DocumentViewer>(DocumentViewer.class) {
@Override
public DocumentViewer create() {
+ final DocumentViewerPresenter presenter = new DocumentViewerPresenter($(StateManager.class),
+ $(Session.class), $(I18nUITranslationService.class), $(ActionContentToolbar.class),
+ $(ContentActionRegistry.class), $$(FileDownloadUtils.class));
final DocumentViewerView view = new DocumentViewerPanel($(WorkspaceSkeleton.class),
$(I18nTranslationService.class));
- final DocumentViewerPresenter presenter = new DocumentViewerPresenter(view, $$(FileDownloadUtils.class));
+ presenter.init(view);
return presenter;
}
});
@@ -140,7 +128,8 @@
public DocFolderContent create() {
final DocFolderContentPresenter presenter = new DocFolderContentPresenter($(StateManager.class),
$(Session.class), $(ActionContentToolbar.class), $(ContentActionRegistry.class));
- final DocFolderContentView view = new DocFolderContentPanel($(WorkspaceSkeleton.class));
+ final DocFolderContentView view = new DocFolderContentPanel($(WorkspaceSkeleton.class),
+ $(I18nTranslationService.class));
presenter.init(view);
return presenter;
}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContent.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.docs.client.cnt;
-
-public interface DocumentContent {
-
- void attach();
-
- void detach();
-
- void refreshState();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPanel.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPanel.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -1,37 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */package org.ourproject.kune.docs.client.cnt;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import com.google.gwt.user.client.ui.Widget;
-
-public class DocumentContentPanel implements DocumentContentView {
-
- private final WorkspaceSkeleton ws;
-
- public DocumentContentPanel(final WorkspaceSkeleton ws) {
- this.ws = ws;
- }
-
- public void setContent(final View view) {
- ws.getEntityWorkspace().setContent((Widget) view);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -1,113 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.docs.client.cnt;
-
-import org.ourproject.kune.docs.client.DocumentClientTool;
-import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewer;
-import org.ourproject.kune.platf.client.actions.ActionItemCollection;
-import org.ourproject.kune.platf.client.actions.ActionRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
-import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
-import org.ourproject.kune.platf.client.dto.StateContainerDTO;
-import org.ourproject.kune.platf.client.dto.StateContentDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.editor.TextEditor;
-
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.listener.Listener;
-import com.calclab.suco.client.listener.Listener2;
-
-public class DocumentContentPresenter implements DocumentContent {
- private DocumentContentView view;
- private final Session session;
- private final Provider<DocumentViewer> docReaderProvider;
- private final Provider<TextEditor> textEditorProvider;
- private final ActionToolbar<StateToken> toolbar;
- private final ActionRegistry<StateToken> actionRegistry;
-
- public DocumentContentPresenter(final StateManager stateManager, final Session session,
- final Provider<DocumentViewer> docReaderProvider, final Provider<TextEditor> textEditorProvider,
- final ActionToolbar<StateToken> toolbar, final ActionRegistry<StateToken> actionRegistry) {
- this.session = session;
- this.docReaderProvider = docReaderProvider;
- this.textEditorProvider = textEditorProvider;
- this.toolbar = toolbar;
- this.actionRegistry = actionRegistry;
- stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
- public void onEvent(final StateAbstractDTO state) {
- setState(state);
- }
- });
- stateManager.onToolChanged(new Listener2<String, String>() {
- public void onEvent(final String oldTool, final String newTool) {
- if (oldTool != null && oldTool.equals(DocumentClientTool.NAME)) {
- toolbar.detach();
- }
- }
- });
- }
-
- public void attach() {
- toolbar.attach();
- }
-
- public void detach() {
- toolbar.detach();
- }
-
- public void init(final DocumentContentView view) {
- this.view = view;
- }
-
- public void refreshState() {
- setState(session.getCurrentState());
- }
-
- private void setState(final StateAbstractDTO state) {
- if (state instanceof StateContainerDTO) {
- StateContainerDTO stateCntCtx = (StateContainerDTO) state;
- if (stateCntCtx.getToolName().equals(DocumentClientTool.NAME)) {
- // This tool
- if (stateCntCtx instanceof StateContentDTO) {
- setState((StateContentDTO) stateCntCtx);
- } else if (stateCntCtx instanceof StateContainerDTO) {
- // FIXME setState(stateCntCtx);
- }
- }
- }
- }
-
- private void setState(final StateContentDTO state) {
- ActionItemCollection<StateToken> collection = actionRegistry.getCurrentActions(state.getStateToken(),
- state.getTypeId(), session.isLogged(), state.getContentRights(), true);
- setToolbar(collection);
- docReaderProvider.get().showDocument(state.getStateToken(), state.getContent(), state.getTypeId(),
- state.getMimeType());
- textEditorProvider.get().reset();
- }
-
- private void setToolbar(ActionItemCollection<StateToken> collection) {
- toolbar.disableMenusAndClearButtons();
- toolbar.setActions(collection);
- toolbar.attach();
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentView.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentView.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -1,27 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */package org.ourproject.kune.docs.client.cnt;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface DocumentContentView {
-
- void setContent(View view);
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPanel.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPanel.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -19,19 +19,15 @@
*/
package org.ourproject.kune.docs.client.cnt.folder.viewer;
-import org.ourproject.kune.workspace.client.cnt.AbstractContentPanel;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
import org.ourproject.kune.workspace.client.site.Site;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-import com.google.gwt.user.client.ui.Label;
+public class DocFolderContentPanel extends FoldableContentPanel implements DocFolderContentView {
-public class DocFolderContentPanel extends AbstractContentPanel implements DocFolderContentView {
-
- public DocFolderContentPanel(WorkspaceSkeleton ws) {
- super(ws);
- Label label = new Label("Folder properties, translations ..." + Site.IN_DEVELOPMENT);
- label.setStyleName("kune-Content-Main");
- label.addStyleName("kune-Margin-7-trbl");
- initWidget(label);
+ public DocFolderContentPanel(WorkspaceSkeleton ws, I18nTranslationService i18n) {
+ super(ws, i18n);
+ super.setLabel("Folder properties, translations ..." + Site.IN_DEVELOPMENT);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewer.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewer.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewer.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -19,13 +19,12 @@
*/
package org.ourproject.kune.docs.client.cnt.viewer;
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
-
public interface DocumentViewer {
- View getView();
+ void attach();
- void showDocument(StateToken token, String text, String typeId, BasicMimeTypeDTO mimeType);
+ void detach();
+
+ void refreshState();
+
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPanel.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPanel.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -20,54 +20,11 @@
package org.ourproject.kune.docs.client.cnt.viewer;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.ui.KuneUiUtils;
+import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.HTML;
-import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Widget;
-
-public class DocumentViewerPanel implements DocumentViewerView {
-
- private final WorkspaceSkeleton ws;
- private final I18nTranslationService i18n;
-
+public class DocumentViewerPanel extends FoldableContentPanel implements DocumentViewerView {
public DocumentViewerPanel(final WorkspaceSkeleton ws, I18nTranslationService i18n) {
- this.ws = ws;
- this.i18n = i18n;
+ super(ws, i18n);
}
-
- public void setContent(final String content) {
- final HTML html = new HTML(content);
- setDefStyle(html);
- ws.getEntityWorkspace().setContent(html);
- }
-
- public void showImage(String imageUrl, String imageResizedUrl) {
- final Image imgOrig = new Image(imageUrl);
- final Image imgResized = new Image(imageResizedUrl);
- KuneUiUtils.setQuickTip(imgOrig, i18n.t("Click to zoom out"));
- KuneUiUtils.setQuickTip(imgResized, i18n.t("Click to zoom in"));
- setDefStyle(imgOrig);
- setDefStyle(imgResized);
- imgOrig.addStyleName("kune-pointer");
- imgResized.addStyleName("kune-pointer");
- imgResized.addClickListener(new ClickListener() {
- public void onClick(Widget sender) {
- ws.getEntityWorkspace().setContent(imgOrig);
- }
- });
- imgOrig.addClickListener(new ClickListener() {
- public void onClick(Widget sender) {
- ws.getEntityWorkspace().setContent(imgResized);
- }
- });
- ws.getEntityWorkspace().setContent(imgResized);
- }
-
- private void setDefStyle(final Widget widget) {
- widget.setStyleName("kune-Content-Main");
- widget.addStyleName("kune-Margin-7-trbl");
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPresenter.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPresenter.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -20,29 +20,47 @@
package org.ourproject.kune.docs.client.cnt.viewer;
import org.ourproject.kune.docs.client.DocumentClientTool;
-import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
+import org.ourproject.kune.platf.client.dto.StateContentDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.platf.client.ui.download.ImageSize;
+import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import com.calclab.suco.client.ioc.Provider;
-public class DocumentViewerPresenter implements DocumentViewer {
- private final DocumentViewerView view;
+public class DocumentViewerPresenter extends FoldableContentPresenter implements DocumentViewer {
+ private DocumentViewerView view;
private final Provider<FileDownloadUtils> downloadProvider;
- public DocumentViewerPresenter(final DocumentViewerView view, final Provider<FileDownloadUtils> downloadProvider) {
- this.view = view;
+ public DocumentViewerPresenter(StateManager stateManager, Session session, I18nUITranslationService i18n,
+ ActionContentToolbar toolbar, ContentActionRegistry actionRegistry,
+ Provider<FileDownloadUtils> downloadProvider) {
+ super(DocumentClientTool.NAME, stateManager, session, toolbar, actionRegistry);
this.downloadProvider = downloadProvider;
}
- public View getView() {
- return view;
+ public void init(DocumentViewerView view) {
+ super.init(view);
+ this.view = view;
}
- public void showDocument(final StateToken token, final String text, final String typeId,
- final BasicMimeTypeDTO mimeType) {
+ public void refreshState() {
+ setState(session.getContentState());
+ }
+
+ @Override
+ protected void setState(StateContentDTO state) {
+ super.setState(state);
+ String typeId = state.getTypeId();
+ String text = state.getContent();
+ StateToken token = state.getStateToken();
+ BasicMimeTypeDTO mimeType = state.getMimeType();
if (typeId.equals(DocumentClientTool.TYPE_UPLOADEDFILE)) {
if (mimeType != null) {
FileDownloadUtils fileDownloadUtils = downloadProvider.get();
@@ -58,5 +76,6 @@
} else {
view.setContent(text);
}
+ view.attach();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerView.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerView.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -19,9 +19,9 @@
*/
package org.ourproject.kune.docs.client.cnt.viewer;
-import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.cnt.AbstractContentView;
-public interface DocumentViewerView extends View {
+public interface DocumentViewerView extends AbstractContentView {
void setContent(String content);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -253,7 +253,8 @@
final EntityLogoPresenter presenter = new EntityLogoPresenter($(StateManager.class),
$(WsThemePresenter.class), $(Session.class));
final EntityLogoPanel panel = new EntityLogoPanel($(I18nUITranslationService.class),
- $(WorkspaceSkeleton.class), $$(FileDownloadUtils.class), $$(EntityLogoSelector.class), $(Images.class));
+ $(WorkspaceSkeleton.class), $$(FileDownloadUtils.class), $$(EntityLogoSelector.class),
+ $(Images.class));
presenter.init(panel);
return presenter;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPanel.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPanel.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -13,18 +13,18 @@
}
public void attach() {
- if (!widget.isAttached()) {
+ if (widget != null && !widget.isAttached()) {
ws.getEntityWorkspace().setContent(widget);
}
}
public void detach() {
- if (widget.isAttached()) {
+ if (widget != null && widget.isAttached()) {
widget.removeFromParent();
}
}
- public void initWidget(Widget widget) {
+ public void setWidget(Widget widget) {
this.widget = widget;
}
}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -0,0 +1,66 @@
+package org.ourproject.kune.workspace.client.cnt;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.KuneUiUtils;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.Widget;
+
+public class FoldableContentPanel extends AbstractContentPanel {
+
+ private final I18nTranslationService i18n;
+
+ public FoldableContentPanel(final WorkspaceSkeleton ws, I18nTranslationService i18n) {
+ super(ws);
+ this.i18n = i18n;
+ }
+
+ public void setContent(final String content) {
+ final HTML html = new HTML(content);
+ setDefStyle(html);
+ setWidget(html);
+ attach();
+ }
+
+ public void setLabel(String text) {
+ Label label = new Label(text);
+ setDefStyle(label);
+ setWidget(label);
+ }
+
+ public void showImage(String imageUrl, String imageResizedUrl) {
+ final Image imgOrig = new Image(imageUrl);
+ final Image imgResized = new Image(imageResizedUrl);
+ KuneUiUtils.setQuickTip(imgOrig, i18n.t("Click to zoom out"));
+ KuneUiUtils.setQuickTip(imgResized, i18n.t("Click to zoom in"));
+ setDefStyle(imgOrig);
+ setDefStyle(imgResized);
+ imgOrig.addStyleName("kune-pointer");
+ imgResized.addStyleName("kune-pointer");
+ imgResized.addClickListener(new ClickListener() {
+ public void onClick(Widget sender) {
+ detach();
+ setWidget(imgOrig);
+ attach();
+ }
+ });
+ imgOrig.addClickListener(new ClickListener() {
+ public void onClick(Widget sender) {
+ detach();
+ setWidget(imgResized);
+ attach();
+ }
+ });
+ setWidget(imgResized);
+ attach();
+ }
+
+ private void setDefStyle(final Widget widget) {
+ widget.setStyleName("kune-Content-Main");
+ widget.addStyleName("kune-Margin-7-trbl");
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java 2008-11-06 21:03:52 UTC (rev 942)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java 2008-11-10 19:00:10 UTC (rev 943)
@@ -3,6 +3,7 @@
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.actions.ActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
+import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import org.ourproject.kune.platf.client.dto.StateContentDTO;
@@ -16,7 +17,7 @@
private final String toolName;
private final ActionRegistry<StateToken> actionRegistry;
- private final Session session;
+ protected final Session session;
private final ActionContentToolbar toolbar;
public FoldableContentPresenter(final String toolName, StateManager stateManager, Session session,
@@ -52,15 +53,21 @@
}
protected void setState(StateContainerDTO state) {
- ActionItemCollection<StateToken> collection = actionRegistry.getCurrentActions(state.getStateToken(),
- state.getTypeId(), session.isLogged(), state.getContainerRights(), true);
+ ActionItemCollection<StateToken> collection = getActionCollection(state, state.getContainerRights());
setToolbar(collection);
attach();
}
protected void setState(StateContentDTO state) {
+ ActionItemCollection<StateToken> collection = getActionCollection(state, state.getContentRights());
+ setToolbar(collection);
}
+ private ActionItemCollection<StateToken> getActionCollection(StateContainerDTO state, AccessRightsDTO rights) {
+ return actionRegistry.getCurrentActions(state.getStateToken(), state.getTypeId(), session.isLogged(), rights,
+ true);
+ }
+
private void setToolbar(ActionItemCollection<StateToken> collection) {
toolbar.disableMenusAndClearButtons();
toolbar.setActions(collection);
1
0
Author: vjrj
Date: 2008-11-06 22:03:52 +0100 (Thu, 06 Nov 2008)
New Revision: 942
Added:
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContent.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentView.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java
Removed:
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContent.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewer.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerView.java
Modified:
trunk/CREDITS
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoom.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPanel.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomView.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
Log:
Incomplete - task UI tools & workspace refactorization
Modified: trunk/CREDITS
===================================================================
--- trunk/CREDITS 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/CREDITS 2008-11-06 21:03:52 UTC (rev 942)
@@ -10,7 +10,12 @@
Contributors
--------------------------------------------------------------------------------
+* Thanks to Samer Hassan for all the feedback and ideas.
+* Antonio Martins, Jéferson Assumção, Moacir Gadotti and the Instituto Paulo
+Freire staff.
+* Daniel Jiménez for the initial help
+* Javier de la Cueva and Leovigildo García-Bobadilla for the legal support
* Thanks to David Trigo and http://www.esperanto-es.net/ for suggest the name of
'kune' for our initiative:
http://ourproject.org/forum/forum.php?thread_id=500&forum_id=469
-
+* and ourproject.org and xsto.info for sharing whit us their resources
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -18,10 +18,6 @@
*
*/package org.ourproject.kune.chat.client;
-import org.ourproject.kune.chat.client.cnt.ChatContent;
-import org.ourproject.kune.chat.client.cnt.ChatContentPresenter;
-import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
-import org.ourproject.kune.chat.client.cnt.info.ChatInfoPanel;
import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
import org.ourproject.kune.chat.client.cnt.room.ChatRoomPanel;
import org.ourproject.kune.chat.client.cnt.room.ChatRoomPresenter;
@@ -33,6 +29,7 @@
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.actions.DragDropContentRegistry;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.ToolGroup;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
@@ -71,22 +68,6 @@
}
});
- register(Singleton.class, new Factory<ChatInfo>(ChatInfo.class) {
- @Override
- public ChatInfo create() {
- return new ChatInfoPanel();
- }
- });
-
- register(Singleton.class, new Factory<ChatContent>(ChatContent.class) {
- @Override
- public ChatContent create() {
- final ChatContentPresenter presenter = new ChatContentPresenter($(EmiteUIDialog.class),
- $$(ChatInfo.class), $$(ChatRoom.class));
- return presenter;
- }
- });
-
register(Singleton.class, new Factory<ChatContext>(ChatContext.class) {
@Override
public ChatContext create() {
@@ -95,7 +76,7 @@
}
});
- register(Singleton.class, new Factory<ChatEngine>(ChatEngine.class) {
+ register(ToolGroup.class, new Factory<ChatEngine>(ChatEngine.class) {
@Override
public ChatEngine create() {
return new ChatEngineDefault($(I18nUITranslationService.class), $(WorkspaceSkeleton.class),
@@ -103,11 +84,14 @@
}
});
- register(Singleton.class, new Factory<ChatRoom>(ChatRoom.class) {
+ register(ToolGroup.class, new Factory<ChatRoom>(ChatRoom.class) {
@Override
public ChatRoom create() {
+ final ChatRoomPresenter presenter = new ChatRoomPresenter($(StateManager.class), $(Session.class),
+ $(I18nUITranslationService.class), $(ActionContentToolbar.class),
+ $(ContentActionRegistry.class));
final ChatRoomPanel panel = new ChatRoomPanel($(WorkspaceSkeleton.class));
- final ChatRoomPresenter presenter = new ChatRoomPresenter(panel);
+ presenter.init(panel);
return presenter;
}
});
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContent.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContent.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -1,28 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client.cnt;
-
-import org.ourproject.kune.platf.client.dto.StateContainerDTO;
-
-public interface ChatContent {
-
- void setState(StateContainerDTO state);
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatContentPresenter.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -1,62 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client.cnt;
-
-import org.ourproject.kune.chat.client.ChatClientTool;
-import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
-import org.ourproject.kune.platf.client.dto.StateContainerDTO;
-
-import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
-import com.calclab.emiteuimodule.client.EmiteUIDialog;
-import com.calclab.suco.client.ioc.Provider;
-
-public class ChatContentPresenter implements ChatContent {
-
- private StateContainerDTO state;
- private final EmiteUIDialog emiteUIDialog;
- private final Provider<ChatInfo> chatInfoProvider;
- private final Provider<ChatRoom> chatRoomProvider;
-
- public ChatContentPresenter(final EmiteUIDialog emiteUIDialog, final Provider<ChatInfo> chatInfoProvider,
- final Provider<ChatRoom> chatRoomProvider) {
- this.emiteUIDialog = emiteUIDialog;
- this.chatInfoProvider = chatInfoProvider;
- this.chatRoomProvider = chatRoomProvider;
- }
-
- public void onEnterRoom() {
- final String roomName = state.getContainer().getName();
- emiteUIDialog.joinRoom(XmppURI.uri(roomName));
- }
-
- public void setState(final StateContainerDTO state) {
- this.state = state;
- final String typeId = state.getTypeId();
- if (typeId.equals(ChatClientTool.TYPE_ROOT)) {
- chatInfoProvider.get().show();
- } else if (typeId.equals(ChatClientTool.TYPE_ROOM)) {
- chatRoomProvider.get().show();
- } else {
- Log.error("Programming error: unknown component!! please contact kune-devel(a)lists-ourproject.org");
- }
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoom.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoom.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoom.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -20,6 +20,4 @@
package org.ourproject.kune.chat.client.cnt.room;
public interface ChatRoom {
-
- void show();
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPanel.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPanel.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -19,15 +19,24 @@
*/
package org.ourproject.kune.chat.client.cnt.room;
-import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.cnt.AbstractContentPanel;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.Label;
-public class ChatRoomPanel implements ChatRoomView {
+public class ChatRoomPanel extends AbstractContentPanel implements ChatRoomView {
+ private final Label label;
+
public ChatRoomPanel(final WorkspaceSkeleton ws) {
- ws.getEntityWorkspace().setContent(new Label("History of room conversations." + Site.IN_DEVELOPMENT));
+ super(ws);
+ label = new Label();
+ label.setStyleName("kune-Content-Main");
+ label.addStyleName("kune-Margin-7-trbl");
+ initWidget(label);
}
+ public void setInfo(String info) {
+ label.setText(info);
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPresenter.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomPresenter.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -19,21 +19,44 @@
*/
package org.ourproject.kune.chat.client.cnt.room;
-import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.chat.client.ChatClientTool;
+import org.ourproject.kune.platf.client.actions.ActionRegistry;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
+import org.ourproject.kune.platf.client.dto.StateContainerDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.site.Site;
-public class ChatRoomPresenter implements ChatRoom {
+public class ChatRoomPresenter extends FoldableContentPresenter implements ChatRoom {
- private final ChatRoomView view;
+ private ChatRoomView view;
+ private final I18nUITranslationService i18n;
- public ChatRoomPresenter(final ChatRoomView view) {
- this.view = view;
+ public ChatRoomPresenter(StateManager stateManager, Session session, I18nUITranslationService i18n,
+ ActionContentToolbar toolbar, final ActionRegistry<StateToken> actionRegistry) {
+ super(ChatClientTool.NAME, stateManager, session, toolbar, actionRegistry);
+ this.i18n = i18n;
}
- public View getView() {
- return view;
+ public void init(final ChatRoomView view) {
+ super.init(view);
+ this.view = view;
}
- public void show() {
+ @Override
+ protected void setState(StateContainerDTO state) {
+ if (state.getTypeId().equals(ChatClientTool.TYPE_ROOT)) {
+ if (state.getRootContainer().getChilds().size() == 0) {
+ view.setInfo(i18n.t("This group has no chat rooms."));
+ } else {
+ view.setInfo("");
+ }
+ } else {
+ view.setInfo("History of room conversations ..." + Site.IN_DEVELOPMENT);
+ }
+ super.setState(state);
}
-
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomView.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomView.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -19,8 +19,9 @@
*/
package org.ourproject.kune.chat.client.cnt.room;
-import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.workspace.client.cnt.AbstractContentView;
-public interface ChatRoomView extends View {
+public interface ChatRoomView extends AbstractContentView {
+ void setInfo(String info);
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -21,10 +21,10 @@
import org.ourproject.kune.docs.client.cnt.DocumentContent;
import org.ourproject.kune.docs.client.cnt.DocumentContentPanel;
import org.ourproject.kune.docs.client.cnt.DocumentContentPresenter;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerPanel;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerPresenter;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerView;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.DocFolderContent;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.DocFolderContentPanel;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.DocFolderContentPresenter;
+import org.ourproject.kune.docs.client.cnt.folder.viewer.DocFolderContentView;
import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewer;
import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewerPanel;
import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewerPresenter;
@@ -35,16 +35,12 @@
import org.ourproject.kune.docs.client.ctx.admin.DocContextEditorPanel;
import org.ourproject.kune.docs.client.ctx.admin.DocContextEditorPresenter;
import org.ourproject.kune.docs.client.ctx.admin.DocContextEditorView;
-import org.ourproject.kune.platf.client.actions.ActionManager;
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.actions.DragDropContentRegistry;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
-import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPresenter;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
import org.ourproject.kune.platf.client.app.ToolGroup;
-import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
@@ -98,14 +94,9 @@
register(ToolGroup.class, new Factory<DocumentContent>(DocumentContent.class) {
@Override
public DocumentContent create() {
- final ActionToolbarPanel<StateToken> contentNavigatorToolbar = new ActionToolbarPanel<StateToken>(
- ActionToolbarPanel.Position.content, $$(ActionManager.class), $(WorkspaceSkeleton.class));
- final ActionToolbar<StateToken> toolbar = new ActionToolbarPresenter<StateToken>(
- contentNavigatorToolbar);
-
final DocumentContentPresenter presenter = new DocumentContentPresenter($(StateManager.class),
- $(Session.class), $$(DocumentViewer.class), $$(TextEditor.class), $$(FolderViewer.class),
- toolbar, $(ContentActionRegistry.class));
+ $(Session.class), $$(DocumentViewer.class), $$(TextEditor.class),
+ $(ActionContentToolbar.class), $(ContentActionRegistry.class));
final DocumentContentPanel panel = new DocumentContentPanel($(WorkspaceSkeleton.class));
presenter.init(panel);
return presenter;
@@ -118,8 +109,8 @@
final DocContextEditorPresenter presenter = new DocContextEditorPresenter($(Session.class),
$(StateManager.class), $$(TagsSummary.class), $$(ContentServiceAsync.class),
$(EntityTitle.class), $(EntitySubTitle.class));
- final DocContextEditorView view = new DocContextEditorPanel(presenter, $(I18nUITranslationService.class),
- $(WorkspaceSkeleton.class));
+ final DocContextEditorView view = new DocContextEditorPanel(presenter,
+ $(I18nUITranslationService.class), $(WorkspaceSkeleton.class));
presenter.init(view);
return presenter;
}
@@ -144,11 +135,13 @@
}
});
- register(Singleton.class, new Factory<FolderViewer>(FolderViewer.class) {
+ register(ToolGroup.class, new Factory<DocFolderContent>(DocFolderContent.class) {
@Override
- public FolderViewer create() {
- final FolderViewerView view = new FolderViewerPanel();
- final FolderViewerPresenter presenter = new FolderViewerPresenter(view);
+ public DocFolderContent create() {
+ final DocFolderContentPresenter presenter = new DocFolderContentPresenter($(StateManager.class),
+ $(Session.class), $(ActionContentToolbar.class), $(ContentActionRegistry.class));
+ final DocFolderContentView view = new DocFolderContentPanel($(WorkspaceSkeleton.class));
+ presenter.init(view);
return presenter;
}
});
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -20,7 +20,6 @@
package org.ourproject.kune.docs.client.cnt;
import org.ourproject.kune.docs.client.DocumentClientTool;
-import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewer;
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.actions.ActionRegistry;
@@ -42,18 +41,15 @@
private final Session session;
private final Provider<DocumentViewer> docReaderProvider;
private final Provider<TextEditor> textEditorProvider;
- private final Provider<FolderViewer> folderViewerProvider;
private final ActionToolbar<StateToken> toolbar;
private final ActionRegistry<StateToken> actionRegistry;
public DocumentContentPresenter(final StateManager stateManager, final Session session,
final Provider<DocumentViewer> docReaderProvider, final Provider<TextEditor> textEditorProvider,
- final Provider<FolderViewer> folderViewerProvider, final ActionToolbar<StateToken> toolbar,
- final ActionRegistry<StateToken> actionRegistry) {
+ final ActionToolbar<StateToken> toolbar, final ActionRegistry<StateToken> actionRegistry) {
this.session = session;
this.docReaderProvider = docReaderProvider;
this.textEditorProvider = textEditorProvider;
- this.folderViewerProvider = folderViewerProvider;
this.toolbar = toolbar;
this.actionRegistry = actionRegistry;
stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
@@ -94,21 +90,12 @@
if (stateCntCtx instanceof StateContentDTO) {
setState((StateContentDTO) stateCntCtx);
} else if (stateCntCtx instanceof StateContainerDTO) {
- setState(stateCntCtx);
+ // FIXME setState(stateCntCtx);
}
}
}
}
- private void setState(final StateContainerDTO state) {
- ActionItemCollection<StateToken> collection = actionRegistry.getCurrentActions(state.getStateToken(),
- state.getTypeId(), session.isLogged(), state.getContainerRights(), true);
- setToolbar(collection);
- final FolderViewer viewer = folderViewerProvider.get();
- viewer.setFolder(state.getContainer());
- view.setContent(viewer.getView());
- }
-
private void setState(final StateContentDTO state) {
ActionItemCollection<StateToken> collection = actionRegistry.getCurrentActions(state.getStateToken(),
state.getTypeId(), session.isLogged(), state.getContentRights(), true);
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContent.java (from rev 939, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewer.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewer.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContent.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -0,0 +1,23 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt.folder.viewer;
+
+public interface DocFolderContent {
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContent.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPanel.java (from rev 939, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPanel.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPanel.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -0,0 +1,37 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt.folder.viewer;
+
+import org.ourproject.kune.workspace.client.cnt.AbstractContentPanel;
+import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Label;
+
+public class DocFolderContentPanel extends AbstractContentPanel implements DocFolderContentView {
+
+ public DocFolderContentPanel(WorkspaceSkeleton ws) {
+ super(ws);
+ Label label = new Label("Folder properties, translations ..." + Site.IN_DEVELOPMENT);
+ label.setStyleName("kune-Content-Main");
+ label.addStyleName("kune-Margin-7-trbl");
+ initWidget(label);
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPresenter.java (from rev 939, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPresenter.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPresenter.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -0,0 +1,40 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt.folder.viewer;
+
+import org.ourproject.kune.docs.client.DocumentClientTool;
+import org.ourproject.kune.platf.client.actions.ActionRegistry;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
+
+public class DocFolderContentPresenter extends FoldableContentPresenter implements DocFolderContent {
+
+ public DocFolderContentPresenter(StateManager stateManager, Session session, ActionContentToolbar toolbar,
+ final ActionRegistry<StateToken> actionRegistry) {
+ super(DocumentClientTool.NAME, stateManager, session, toolbar, actionRegistry);
+ }
+
+ public void init(final DocFolderContentView view) {
+ super.init(view);
+ }
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentPresenter.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentView.java (from rev 939, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerView.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentView.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -0,0 +1,25 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt.folder.viewer;
+
+import org.ourproject.kune.workspace.client.cnt.AbstractContentView;
+
+public interface DocFolderContentView extends AbstractContentView {
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/DocFolderContentView.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewer.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewer.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewer.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -1,29 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.docs.client.cnt.folder.viewer;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.ContainerDTO;
-
-public interface FolderViewer {
- void setFolder(ContainerDTO folder);
-
- View getView();
-}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPanel.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPanel.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -1,33 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.docs.client.cnt.folder.viewer;
-
-import org.ourproject.kune.workspace.client.site.Site;
-
-import com.google.gwt.user.client.ui.Label;
-
-public class FolderViewerPanel extends Label implements FolderViewerView {
-
- public FolderViewerPanel() {
- super("Folder properties, translations ..." + Site.IN_DEVELOPMENT);
- super.setStyleName("kune-Content-Main");
- super.addStyleName("kune-Margin-7-trbl");
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPresenter.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerPresenter.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -1,39 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.docs.client.cnt.folder.viewer;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.ContainerDTO;
-
-public class FolderViewerPresenter implements FolderViewer {
-
- private final FolderViewerView view;
-
- public FolderViewerPresenter(final FolderViewerView view) {
- this.view = view;
- }
-
- public View getView() {
- return view;
- }
-
- public void setFolder(final ContainerDTO folder) {
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerView.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/folder/viewer/FolderViewerView.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.docs.client.cnt.folder.viewer;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface FolderViewerView extends View {
-
-}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbar.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbar.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.actions.toolbar;
+
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public interface ActionContentToolbar extends ActionToolbar<StateToken> {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbarPresenter.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContentToolbarPresenter.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -0,0 +1,11 @@
+package org.ourproject.kune.platf.client.actions.toolbar;
+
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public class ActionContentToolbarPresenter extends ActionToolbarPresenter<StateToken> implements ActionContentToolbar {
+
+ public ActionContentToolbarPresenter(ActionToolbarView<StateToken> toolbar) {
+ super(toolbar);
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbar.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbar.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.actions.toolbar;
+
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public interface ActionContextToolbar extends ActionToolbar<StateToken> {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbarPresenter.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionContextToolbarPresenter.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -0,0 +1,11 @@
+package org.ourproject.kune.platf.client.actions.toolbar;
+
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public class ActionContextToolbarPresenter extends ActionToolbarPresenter<StateToken> implements ActionContextToolbar {
+
+ public ActionContextToolbarPresenter(ActionToolbarView<StateToken> toolbar) {
+ super(toolbar);
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -126,11 +126,13 @@
if (!topbar.isAttached()) {
switch (position) {
case content:
+ ws.getEntityWorkspace().getContentTopBar().removeAll();
ws.getEntityWorkspace().getContentTopBar().add(topbar);
ws.getEntityWorkspace().getContentBottomBar().add(bottombar);
break;
case context:
default:
+ ws.getEntityWorkspace().getContextTopBar().removeAll();
ws.getEntityWorkspace().getContextTopBar().add(topbar);
ws.getEntityWorkspace().getContextBottomBar().add(bottombar);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -25,6 +25,10 @@
import org.ourproject.kune.platf.client.actions.DragDropContentRegistry;
import org.ourproject.kune.platf.client.actions.GroupActionRegistry;
import org.ourproject.kune.platf.client.actions.UserActionRegistry;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbarPresenter;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContextToolbar;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContextToolbarPresenter;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPanel;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbarPresenter;
@@ -107,6 +111,7 @@
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.title.EntityTitle;
+import com.calclab.suco.client.ioc.decorator.NoDecoration;
import com.calclab.suco.client.ioc.decorator.Singleton;
import com.calclab.suco.client.ioc.module.AbstractModule;
import com.calclab.suco.client.ioc.module.Factory;
@@ -416,17 +421,32 @@
}
});
+ register(NoDecoration.class, new Factory<ActionContentToolbar>(ActionContentToolbar.class) {
+ @Override
+ public ActionContentToolbar create() {
+ final ActionToolbarPanel<StateToken> contentNavigatorToolbar = new ActionToolbarPanel<StateToken>(
+ ActionToolbarPanel.Position.content, $$(ActionManager.class), $(WorkspaceSkeleton.class));
+ final ActionContentToolbar toolbar = new ActionContentToolbarPresenter(contentNavigatorToolbar);
+ return toolbar;
+ }
+ });
+
+ register(NoDecoration.class, new Factory<ActionContextToolbar>(ActionContextToolbar.class) {
+ @Override
+ public ActionContextToolbar create() {
+ final ActionToolbarPanel<StateToken> contentNavigatorToolbar = new ActionToolbarPanel<StateToken>(
+ ActionToolbarPanel.Position.context, $$(ActionManager.class), $(WorkspaceSkeleton.class));
+ final ActionContextToolbar toolbar = new ActionContextToolbarPresenter(contentNavigatorToolbar);
+ return toolbar;
+ }
+ });
+
register(Singleton.class, new Factory<ContextNavigator>(ContextNavigator.class) {
@Override
public ContextNavigator create() {
- final ActionToolbarPanel<StateToken> contextNavigatorToolbar = new ActionToolbarPanel<StateToken>(
- ActionToolbarPanel.Position.context, $$(ActionManager.class), $(WorkspaceSkeleton.class));
- final ActionToolbar<StateToken> toolbar = new ActionToolbarPresenter<StateToken>(
- contextNavigatorToolbar);
-
final ContextNavigatorPresenter presenter = new ContextNavigatorPresenter($(StateManager.class),
$(Session.class), $$(ContentServiceAsync.class), i18n, $(EntityTitle.class),
- $(ContentIconsRegistry.class), $(DragDropContentRegistry.class), toolbar,
+ $(ContentIconsRegistry.class), $(DragDropContentRegistry.class), $(ActionContextToolbar.class),
$(ContextActionRegistry.class), $$(FileDownloadUtils.class), true);
final ContextNavigatorPanel panel = new ContextNavigatorPanel(presenter, i18n,
$(WorkspaceSkeleton.class), $(ActionManager.class));
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -204,9 +204,6 @@
private void checkGroupAndToolChange(final StateAbstractDTO newState) {
final String previousGroup = previousToken == null ? "" : previousToken.getGroup();
final String newGroup = newState.getStateToken().getGroup();
- if (previousToken == null || !previousGroup.equals(newGroup)) {
- onGroupChanged.fire(previousGroup, newGroup);
- }
String previousTokenTool = previousToken == null ? "" : previousToken.getTool();
String newTokenTool = newState.getStateToken().getTool();
String previousToolName = previousTokenTool == null ? "" : previousTokenTool;
@@ -215,6 +212,9 @@
if (previousToken == null || previousToolName == null || !previousToolName.equals(newToolName)) {
onToolChanged.fire(previousToolName, newToolName);
}
+ if (previousToken == null || !previousGroup.equals(newGroup)) {
+ onGroupChanged.fire(previousGroup, newGroup);
+ }
}
private void clearResumedToken() {
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPanel.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPanel.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -0,0 +1,30 @@
+package org.ourproject.kune.workspace.client.cnt;
+
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.Widget;
+
+public class AbstractContentPanel {
+ private final WorkspaceSkeleton ws;
+ private Widget widget;
+
+ public AbstractContentPanel(final WorkspaceSkeleton ws) {
+ this.ws = ws;
+ }
+
+ public void attach() {
+ if (!widget.isAttached()) {
+ ws.getEntityWorkspace().setContent(widget);
+ }
+ }
+
+ public void detach() {
+ if (widget.isAttached()) {
+ widget.removeFromParent();
+ }
+ }
+
+ public void initWidget(Widget widget) {
+ this.widget = widget;
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPresenter.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentPresenter.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -0,0 +1,22 @@
+package org.ourproject.kune.workspace.client.cnt;
+
+public abstract class AbstractContentPresenter {
+
+ private AbstractContentView view;
+
+ public AbstractContentPresenter() {
+ }
+
+ public void attach() {
+ view.attach();
+ }
+
+ public void detach() {
+ view.detach();
+ }
+
+ public void init(final AbstractContentView view) {
+ this.view = view;
+ }
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentView.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/AbstractContentView.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -0,0 +1,9 @@
+package org.ourproject.kune.workspace.client.cnt;
+
+public interface AbstractContentView {
+
+ void attach();
+
+ void detach();
+
+}
Added: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java 2008-11-06 00:35:01 UTC (rev 941)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPresenter.java 2008-11-06 21:03:52 UTC (rev 942)
@@ -0,0 +1,70 @@
+package org.ourproject.kune.workspace.client.cnt;
+
+import org.ourproject.kune.platf.client.actions.ActionItemCollection;
+import org.ourproject.kune.platf.client.actions.ActionRegistry;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
+import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
+import org.ourproject.kune.platf.client.dto.StateContainerDTO;
+import org.ourproject.kune.platf.client.dto.StateContentDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+
+import com.calclab.suco.client.listener.Listener;
+
+public class FoldableContentPresenter extends AbstractContentPresenter {
+
+ private final String toolName;
+ private final ActionRegistry<StateToken> actionRegistry;
+ private final Session session;
+ private final ActionContentToolbar toolbar;
+
+ public FoldableContentPresenter(final String toolName, StateManager stateManager, Session session,
+ final ActionContentToolbar toolbar, ActionRegistry<StateToken> actionRegistry) {
+ this.toolName = toolName;
+ this.session = session;
+ this.toolbar = toolbar;
+ this.actionRegistry = actionRegistry;
+ stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
+ public void onEvent(final StateAbstractDTO state) {
+ setState(state);
+ }
+ });
+ }
+
+ public String getToolName() {
+ return toolName;
+ }
+
+ protected void setState(StateAbstractDTO state) {
+ toolbar.detach();
+ if (state instanceof StateContainerDTO) {
+ StateContainerDTO stateCntCtx = (StateContainerDTO) state;
+ if (stateCntCtx.getToolName().equals(toolName)) {
+ // This tool
+ if (stateCntCtx instanceof StateContentDTO) {
+ setState((StateContentDTO) stateCntCtx);
+ } else if (stateCntCtx instanceof StateContainerDTO) {
+ setState(stateCntCtx);
+ }
+ }
+ }
+ }
+
+ protected void setState(StateContainerDTO state) {
+ ActionItemCollection<StateToken> collection = actionRegistry.getCurrentActions(state.getStateToken(),
+ state.getTypeId(), session.isLogged(), state.getContainerRights(), true);
+ setToolbar(collection);
+ attach();
+ }
+
+ protected void setState(StateContentDTO state) {
+ }
+
+ private void setToolbar(ActionItemCollection<StateToken> collection) {
+ toolbar.disableMenusAndClearButtons();
+ toolbar.setActions(collection);
+ toolbar.attach();
+ }
+
+}
1
0
Author: vjrj
Date: 2008-11-06 01:35:01 +0100 (Thu, 06 Nov 2008)
New Revision: 941
Added:
trunk/img/icons/persons/person2-60.png
trunk/src/main/java/org/ourproject/kune/platf/public/images/persons/person2-60.png
trunk/src/test/java/org/ourproject/kune/workspace/client/entitylogo/
trunk/src/test/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenterTest.java
Modified:
trunk/img/icons/person.svg
trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/Images.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoSelectorPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoSelectorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoSelectorView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java
trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java
Log:
Complete - task Personal homepage logo
Modified: trunk/img/icons/person.svg
===================================================================
--- trunk/img/icons/person.svg 2008-11-05 22:07:07 UTC (rev 940)
+++ trunk/img/icons/person.svg 2008-11-06 00:35:01 UTC (rev 941)
@@ -45,8 +45,8 @@
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="false"
- inkscape:window-width="1280"
- inkscape:window-height="951"
+ inkscape:window-width="1270"
+ inkscape:window-height="773"
inkscape:window-x="1280"
inkscape:window-y="25" />
<metadata
@@ -658,5 +658,34 @@
d="M 459.05116,237.9606 C 454.38897,244.83149 431.14686,253.27664 423.78848,245.95076 C 416.51844,238.7128 416.5378,226.91334 423.78848,219.65598 C 431.03916,212.39863 442.80837,212.39863 450.05905,219.65599 C 457.30973,226.91335 454.3126,230.25764 459.05116,237.9606 z"
style="fill:#da5f0e;fill-opacity:1;fill-rule:nonzero;stroke:#673030;stroke-width:5.30990171;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
</g>
+ <g
+ id="g2497"
+ transform="matrix(0.7058822,0,0,0.7059232,202.61473,-43.156624)"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/img/icons/persons/person2-60.png"
+ inkscape:export-xdpi="90"
+ inkscape:export-ydpi="90">
+ <path
+ inkscape:export-ydpi="90"
+ inkscape:export-xdpi="90"
+ inkscape:export-filename="/home/vjrj/proyectos/ourproject.org/kune/svn/trunk/img/group-def-icon.png"
+ sodipodi:type="arc"
+ style="opacity:1;fill:#eeaaff;fill-opacity:1;fill-rule:nonzero;stroke:#954f2c;stroke-width:1.63299322;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ id="path2499"
+ sodipodi:cx="-55.5"
+ sodipodi:cy="242.36218"
+ sodipodi:rx="12.5"
+ sodipodi:ry="12"
+ d="M -43,242.36218 A 12.5,12 0 1 1 -68,242.36218 A 12.5,12 0 1 1 -43,242.36218 z"
+ transform="matrix(3.1844753,0,0,3.3202165,608.65933,-692.76155)" />
+ <path
+ id="path2501"
+ d="M 431.92095,72.158845 C 421.73175,72.158845 411.49371,76.003865 403.72508,83.779605 C 388.30176,99.217125 388.19614,124.14781 403.39336,139.72526 C 401.23073,130.24809 403.98472,119.87609 411.35455,112.49948 C 422.75019,101.09333 441.09171,101.09333 452.48735,112.49948 C 459.85713,119.87609 462.61117,130.24809 460.44854,139.72526 C 475.64581,124.14776 475.54025,99.217125 460.11683,83.779605 C 452.34825,76.003865 442.11016,72.158845 431.92095,72.158845 z"
+ style="fill:#dbdee3;fill-opacity:1;fill-rule:nonzero;stroke:#954f2c;stroke-width:5.30990267;stroke-linecap:butt;stroke-linejoin:round;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dasharray:none;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate" />
+ <path
+ style="fill:#ff9955;fill-opacity:1;fill-rule:nonzero;stroke:#784421;stroke-width:5.30990171;stroke-linecap:butt;stroke-linejoin:miter;marker:none;marker-start:none;marker-mid:none;marker-end:none;stroke-miterlimit:4;stroke-dashoffset:0;stroke-opacity:1;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
+ d="M 454.05116,106.46307 C 449.38897,113.33396 426.14686,121.7791 418.78848,114.45323 C 411.51844,107.21527 411.5378,95.415805 418.78848,88.158448 C 426.03916,80.901092 437.80837,80.901094 445.05905,88.158453 C 452.30973,95.415815 449.3126,98.760105 454.05116,106.46307 z"
+ id="path2503"
+ sodipodi:nodetypes="csssc" />
+ </g>
</g>
</svg>
Added: trunk/img/icons/persons/person2-60.png
===================================================================
(Binary files differ)
Property changes on: trunk/img/icons/persons/person2-60.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java 2008-11-05 22:07:07 UTC (rev 940)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java 2008-11-06 00:35:01 UTC (rev 941)
@@ -122,6 +122,10 @@
return getHasLogo();
}
+ public boolean isPersonalGroup() {
+ return groupType.equals(GroupType.PERSONAL);
+ }
+
public void setDefaultContent(final ContentSimpleDTO defaultContent) {
this.defaultContent = defaultContent;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/Images.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/Images.java 2008-11-05 22:07:07 UTC (rev 940)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/Images.java 2008-11-06 00:35:01 UTC (rev 941)
@@ -339,6 +339,9 @@
@Resource("org/ourproject/kune/platf/public/images/opentriangle.gif")
AbstractImagePrototype opentriangle();
+ @Resource("org/ourproject/kune/platf/public/images/persons/person2-60.png")
+ AbstractImagePrototype personAvatarDef();
+
@Resource("org/ourproject/kune/platf/public/images/person-def.png")
AbstractImagePrototype personDef();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-11-05 22:07:07 UTC (rev 940)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-11-06 00:35:01 UTC (rev 941)
@@ -253,7 +253,7 @@
final EntityLogoPresenter presenter = new EntityLogoPresenter($(StateManager.class),
$(WsThemePresenter.class), $(Session.class));
final EntityLogoPanel panel = new EntityLogoPanel($(I18nUITranslationService.class),
- $(WorkspaceSkeleton.class), $$(FileDownloadUtils.class), $$(EntityLogoSelector.class));
+ $(WorkspaceSkeleton.class), $$(FileDownloadUtils.class), $$(EntityLogoSelector.class), $(Images.class));
presenter.init(panel);
return presenter;
}
Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/persons/person2-60.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/persons/person2-60.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java 2008-11-05 22:07:07 UTC (rev 940)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPanel.java 2008-11-06 00:35:01 UTC (rev 941)
@@ -24,11 +24,13 @@
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsTheme;
import com.calclab.suco.client.ioc.Provider;
+import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.ClickListener;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.Image;
@@ -103,6 +105,10 @@
setLogoText("");
}
+ public void setChangeYourAvatarText() {
+ putYourLogoHL.setText(i18n.t("Change Your Avatar"));
+ }
+
public void setChangeYourLogo() {
putYourLogoHL.setText(i18n.t("Change Your Logo"));
}
@@ -112,6 +118,10 @@
logoLabel.addStyleName(LOGO_LARGE_FONT_STYLE);
}
+ public void setLogoImage(AbstractImagePrototype imageProto) {
+ imageProto.applyTo(logoImage);
+ }
+
public void setLogoImage(final String url) {
Image.prefetch(url);
logoImage.setUrl(url);
@@ -130,6 +140,10 @@
logoLabel.addStyleName(LOGO_MEDIUM_FONT_STYLE);
}
+ public void setPutYourAvatarText() {
+ putYourLogoHL.setText(i18n.t("Put Your Avatar Here"));
+ }
+
public void setPutYourLogo() {
putYourLogoHL.setText(i18n.t("Put Your Logo Here"));
}
@@ -157,21 +171,27 @@
private final Provider<EntityLogoSelector> entityLogoSelectorProvider;
private EntityTextLogo entityTextLogo;
private final I18nTranslationService i18n;
+ private final Images images;
public EntityLogoPanel(final I18nTranslationService i18n, final WorkspaceSkeleton ws,
final Provider<FileDownloadUtils> dowloadProvider,
- final Provider<EntityLogoSelector> entityLogoSelectorProvider) {
+ final Provider<EntityLogoSelector> entityLogoSelectorProvider, Images images) {
this.i18n = i18n;
this.downloadProvider = dowloadProvider;
this.entityLogoSelectorProvider = entityLogoSelectorProvider;
+ this.images = images;
ws.addToEntityMainHeader(this);
}
public void reloadImage(GroupDTO group) {
- entityTextLogo.setLogoImage(downloadProvider.get().getLogoImageUrl(group.getStateToken()) + "&nocache="
- + new Date().getTime());
+ getEntityTextLogo().setLogoImage(
+ downloadProvider.get().getLogoImageUrl(group.getStateToken()) + "&nocache=" + new Date().getTime());
}
+ public void setChangeYourAvatarText() {
+ getEntityTextLogo().setChangeYourAvatarText();
+ }
+
public void setChangeYourLogoText() {
getEntityTextLogo().setChangeYourLogo();
@@ -213,6 +233,10 @@
getEntityTextLogo().setMediumFont();
}
+ public void setPutYourAvatarText() {
+ getEntityTextLogo().setPutYourAvatarText();
+ }
+
public void setPutYourLogoText() {
getEntityTextLogo().setPutYourLogo();
}
@@ -232,6 +256,10 @@
getEntityTextLogo().addStyleDependentName(newTheme.toString());
}
+ public void showDefUserLogo() {
+ getEntityTextLogo().setLogoImage(images.personAvatarDef());
+ }
+
private EntityTextLogo getEntityTextLogo() {
if (entityTextLogo == null) {
this.entityTextLogo = new EntityTextLogo(entityLogoSelectorProvider);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java 2008-11-05 22:07:07 UTC (rev 940)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenter.java 2008-11-06 00:35:01 UTC (rev 941)
@@ -20,6 +20,7 @@
import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.GroupType;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
@@ -46,14 +47,7 @@
});
stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
public void onEvent(final StateAbstractDTO state) {
- final boolean isAdmin = state.getGroupRights().isAdministrable();
- if (state.getGroup().hasLogo()) {
- view.setChangeYourLogoText();
- view.setSetYourLogoVisible(isAdmin);
- } else {
- view.setPutYourLogoText();
- view.setSetYourLogoVisible(isAdmin);
- }
+ setEntityLogoLink(state);
}
});
theme.onThemeChanged(new Listener2<WsTheme, WsTheme>() {
@@ -75,21 +69,47 @@
view.reloadImage(session.getCurrentState().getGroup());
}
- private void setGroupLogo(final GroupDTO group) {
+ void setEntityLogoLink(final StateAbstractDTO state) {
+ final boolean isAdmin = state.getGroupRights().isAdministrable();
+ switch (state.getGroup().getGroupType()) {
+ case PERSONAL:
+ if (state.getGroup().hasLogo()) {
+ view.setChangeYourAvatarText();
+ } else {
+ view.setPutYourAvatarText();
+ }
+ break;
+ default:
+ if (state.getGroup().hasLogo()) {
+ view.setChangeYourLogoText();
+ } else {
+ view.setPutYourLogoText();
+ }
+ break;
+ }
+ view.setSetYourLogoVisible(isAdmin);
+ }
+
+ void setGroupLogo(final GroupDTO group) {
final ContentSimpleDTO groupFullLogo = group.getGroupFullLogo();
if (groupFullLogo != null) {
view.setFullLogo(groupFullLogo.getStateToken(), true);
} else if (group.hasLogo()) {
+ setLogoText(group.getLongName());
view.setLogoImage(group.getStateToken());
- setLogoText(group.getLongName());
view.setLogoImageVisible(true);
} else {
setLogoText(group.getLongName());
- view.setLogoImageVisible(false);
+ if (group.getGroupType().equals(GroupType.PERSONAL)) {
+ view.showDefUserLogo();
+ view.setLogoImageVisible(true);
+ } else {
+ view.setLogoImageVisible(false);
+ }
}
}
- private void setLogoText(String name) {
+ void setLogoText(String name) {
int length = name.length();
if (length <= GROUP_LARGE_NAME_LIMIT_SIZE) {
view.setLargeFont();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoSelectorPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoSelectorPanel.java 2008-11-05 22:07:07 UTC (rev 940)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoSelectorPanel.java 2008-11-06 00:35:01 UTC (rev 941)
@@ -39,7 +39,8 @@
public class EntityLogoSelectorPanel implements EntityLogoSelectorView {
- public static final String TITLE = "Select a logo for your group";
+ public static final String NORMAL_TITLE = "Select a logo for your group";
+ public static final String PERSON_TITLE = "Select your avatar";
public static final String ICON_UPLOAD_SERVLET = "/kune/servlets/EntityLogoUploadManager";
public static final String SUBID = "k-elogoselp-subb";
public static final String CANCELID = "k-elogoselp-canb";
@@ -49,10 +50,13 @@
private final Hidden userhashField;
private final Hidden tokenField;
private final TextField file;
+ private final Label dialogInfoLabel;
+ private final I18nTranslationService i18n;
public EntityLogoSelectorPanel(final EntityLogoSelectorPresenter presenter, final WorkspaceSkeleton ws,
I18nTranslationService i18n) {
- dialog = new BasicDialogExtended(i18n.t(TITLE), true, true, 400, 200, "", i18n.t("Select"), SUBID,
+ this.i18n = i18n;
+ dialog = new BasicDialogExtended(i18n.t(NORMAL_TITLE), true, true, 400, 200, "", i18n.t("Select"), SUBID,
i18n.tWithNT("Cancel", "used in button"), CANCELID, new Listener0() {
public void onEvent() {
String filename = file.getValueAsString();
@@ -95,16 +99,8 @@
presenter.onSubmitFailed(httpStatus, responseText);
}
});
- // We will automatically resize images to 64x64 pixels. For good
- // results, start with a square image. For best results, use a 64x64
- // pixel image.
- String text = i18n.t("Select an image in your computer as the logo for this group. "
- + "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
- EntityLogoView.LOGO_ICON_DEFAULT_HEIGHT, EntityLogoView.LOGO_ICON_DEFAULT_HEIGHT);
- Label label = new Label();
- label.setHtml(text + "<br/><br/>");
-
- formPanel.add(label);
+ dialogInfoLabel = new Label();
+ formPanel.add(dialogInfoLabel);
file = new TextField("File", EntityLogoView.LOGO_FORM_FIELD);
EventCallback keyListener = new EventCallback() {
public void execute(EventObject e) {
@@ -145,6 +141,22 @@
formPanel.getForm().reset();
}
+ public void setNormalGroupsLabels() {
+ dialogInfoLabel.setHtml(i18n.t("Select an image in your computer as the logo for this group. "
+ + "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
+ EntityLogoView.LOGO_ICON_DEFAULT_HEIGHT, EntityLogoView.LOGO_ICON_DEFAULT_HEIGHT)
+ + "<br/><br/>");
+ dialog.setTitle(NORMAL_TITLE);
+ }
+
+ public void setPersonalGroupsLabels() {
+ dialogInfoLabel.setHtml(i18n.t("Select an image in your computer as your avatar. "
+ + "For best results use a [%d]x[%d] pixel image. We will automatically resize bigger images.",
+ EntityLogoView.LOGO_ICON_DEFAULT_HEIGHT, EntityLogoView.LOGO_ICON_DEFAULT_HEIGHT)
+ + "<br/><br/>");
+ dialog.setTitle(PERSON_TITLE);
+ }
+
public void setUploadParams(String userHash, String token) {
userhashField.setValue(userHash);
tokenField.setValue(token);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoSelectorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoSelectorPresenter.java 2008-11-05 22:07:07 UTC (rev 940)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoSelectorPresenter.java 2008-11-06 00:35:01 UTC (rev 941)
@@ -59,6 +59,11 @@
session.check(new AsyncCallbackSimple<Object>() {
public void onSuccess(Object result) {
view.setUploadParams(session.getUserHash(), session.getCurrentStateToken().toString());
+ if (session.getCurrentState().getGroup().isPersonalGroup()) {
+ view.setPersonalGroupsLabels();
+ } else {
+ view.setNormalGroupsLabels();
+ }
view.show();
}
});
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoSelectorView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoSelectorView.java 2008-11-05 22:07:07 UTC (rev 940)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoSelectorView.java 2008-11-06 00:35:01 UTC (rev 941)
@@ -23,6 +23,10 @@
public interface EntityLogoSelectorView extends View {
void hide();
+ void setNormalGroupsLabels();
+
+ void setPersonalGroupsLabels();
+
void setUploadParams(String userHash, String token);
void show();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java 2008-11-05 22:07:07 UTC (rev 940)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoView.java 2008-11-06 00:35:01 UTC (rev 941)
@@ -34,6 +34,8 @@
void reloadImage(GroupDTO group);
+ void setChangeYourAvatarText();
+
void setChangeYourLogoText();
void setFullLogo(StateToken stateToken, boolean clipped);
@@ -48,6 +50,8 @@
void setMediumFont();
+ void setPutYourAvatarText();
+
void setPutYourLogoText();
void setSetYourLogoVisible(final boolean visible);
@@ -55,4 +59,6 @@
void setSmallFont();
void setTheme(final WsTheme oldTheme, WsTheme newTheme);
+
+ void showDefUserLogo();
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java 2008-11-05 22:07:07 UTC (rev 940)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/selenium/EntityLogoSeleniumTest.java 2008-11-06 00:35:01 UTC (rev 941)
@@ -20,7 +20,7 @@
private void setLogo(String filename) throws Exception, IOException {
click(gid(EntityLogoPanel.PUT_YOUR_LOGO_LINK));
- waitForTextInside(EntityLogoSelectorPanel.DIALOG_ID, EntityLogoSelectorPanel.TITLE);
+ waitForTextInside(EntityLogoSelectorPanel.DIALOG_ID, EntityLogoSelectorPanel.NORMAL_TITLE);
File dir = new File(".");
type(EntityLogoView.LOGO_FORM_FIELD, dir.getCanonicalPath() + File.separator + "img" + File.separator
+ filename);
Added: trunk/src/test/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenterTest.java 2008-11-05 22:07:07 UTC (rev 940)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/entitylogo/EntityLogoPresenterTest.java 2008-11-06 00:35:01 UTC (rev 941)
@@ -0,0 +1,87 @@
+package org.ourproject.kune.workspace.client.entitylogo;
+
+import org.junit.Before;
+import org.junit.Test;
+import org.mockito.Mockito;
+import org.ourproject.kune.platf.client.dto.GroupDTO;
+import org.ourproject.kune.platf.client.dto.GroupType;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+
+public class EntityLogoPresenterTest {
+
+ private StateManager stateManager;
+ private Session session;
+ private EntityLogoPresenter entityLogoPresenter;
+ private EntityLogoView view;
+
+ @Before
+ public void before() {
+ stateManager = Mockito.mock(StateManager.class);
+ session = Mockito.mock(Session.class);
+ WsThemePresenter theme = Mockito.mock(WsThemePresenter.class);
+ entityLogoPresenter = new EntityLogoPresenter(stateManager, theme, session);
+ view = Mockito.mock(EntityLogoView.class);
+ entityLogoPresenter.init(view);
+ }
+
+ @Test
+ public void testCommProjectNoLogo() {
+ GroupDTO group = new GroupDTO("shortname", "longname", GroupType.COMMUNITY);
+ group.setHasLogo(false);
+ entityLogoPresenter.setGroupLogo(group);
+ Mockito.verify(view, Mockito.never()).setLogoImageVisible(true);
+ Mockito.verify(view, Mockito.times(1)).setLogoImageVisible(false);
+ Mockito.verify(view, Mockito.never()).showDefUserLogo();
+ Mockito.verify(view, Mockito.never()).setLogoImage((StateToken) Mockito.anyObject());
+ }
+
+ @Test
+ public void testCommunityWithLogo() {
+ testGroupWIthLogo(GroupType.COMMUNITY);
+ }
+
+ @Test
+ public void testOrgWithLogo() {
+ testGroupWIthLogo(GroupType.ORGANIZATION);
+ }
+
+ @Test
+ public void testOrphWithLogo() {
+ testGroupWIthLogo(GroupType.ORPHANED_PROJECT);
+ }
+
+ @Test
+ public void testPersonalGroupWithLogo() {
+ testGroupWIthLogo(GroupType.PERSONAL);
+ }
+
+ @Test
+ public void testPersonalProjectNoLogo() {
+ GroupDTO group = new GroupDTO("shortname", "longname", GroupType.PERSONAL);
+ group.setHasLogo(false);
+ entityLogoPresenter.setGroupLogo(group);
+ Mockito.verify(view, Mockito.times(1)).setLogoImageVisible(true);
+ Mockito.verify(view, Mockito.never()).setLogoImageVisible(false);
+ Mockito.verify(view, Mockito.times(1)).showDefUserLogo();
+ Mockito.verify(view, Mockito.never()).setLogoImage((StateToken) Mockito.anyObject());
+ }
+
+ @Test
+ public void testProjectWithLogo() {
+ testGroupWIthLogo(GroupType.PROJECT);
+ }
+
+ private void testGroupWIthLogo(GroupType groupType) {
+ GroupDTO group = new GroupDTO("shortname", "longname", groupType);
+ group.setHasLogo(true);
+ entityLogoPresenter.setGroupLogo(group);
+ Mockito.verify(view, Mockito.times(1)).setLogoImageVisible(true);
+ Mockito.verify(view, Mockito.never()).setLogoImageVisible(false);
+ Mockito.verify(view, Mockito.never()).showDefUserLogo();
+ Mockito.verify(view, Mockito.times(1)).setLogoImage((StateToken) Mockito.anyObject());
+ }
+
+}
1
0
Author: vjrj
Date: 2008-11-05 23:07:07 +0100 (Wed, 05 Nov 2008)
New Revision: 940
Added:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdmin.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdminPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewer.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPanel.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerView.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/BeforeActionCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/BeforeActionListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/FoldableAbstractClientTool.java
Removed:
trunk/src/main/java/org/ourproject/kune/app/public/css/img/chat.gif
trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/RoomViewListener.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/RoomViewPanel.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/info/ui/
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPanel.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlView.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ui/
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomsAdmin.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomsAdminPresenter.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentReader.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentReaderPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentReaderView.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/ui/
trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeActionListener.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeCollection.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gwtcustom/
trunk/src/main/java/org/ourproject/kune/platf/public/images/chat.png
Modified:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngine.java
trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/ImageDescriptor.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/ImageUtils.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/Images.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLink.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java
trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java
Log:
Complete - task ChatEngine/Tool refactorization
Incomplete - task UI tools & workspace refactorization
Complete - task Implements beforeSignOut (to prevent unsaved docs or chat opened)
Deleted: trunk/src/main/java/org/ourproject/kune/app/public/css/img/chat.gif
===================================================================
(Binary files differ)
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -35,15 +35,19 @@
public class ChatClientActions {
private final Session session;
- private final Provider<ChatClientTool> chatClientToolProvider;
+ private final Provider<ChatEngine> chatEngineProvider;
private final ContentActionRegistry contentActionRegistry;
+ private final I18nUITranslationService i18n;
+ private final ContextActionRegistry contextActionRegistry;
public ChatClientActions(final I18nUITranslationService i18n, final Session session,
final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
- final Provider<ChatClientTool> chatClientToolProvider) {
+ final Provider<ChatEngine> chatEngine) {
+ this.i18n = i18n;
this.session = session;
this.contentActionRegistry = contentActionRegistry;
- this.chatClientToolProvider = chatClientToolProvider;
+ this.contextActionRegistry = contextActionRegistry;
+ this.chatEngineProvider = chatEngine;
createActions();
}
@@ -51,9 +55,9 @@
final ActionToolbarButtonDescriptor<StateToken> chatAbout = new ActionToolbarButtonDescriptor<StateToken>(
AccessRolDTO.Viewer, ActionToolbarPosition.topbar, new Listener<StateToken>() {
public void onEvent(final StateToken token) {
- chatClientToolProvider.get().getChat().joinRoom(token.toString().replaceAll("\\.", "-"),
+ chatEngineProvider.get().joinRoom(token.toString().replaceAll("\\.", "-"),
session.getCurrentUserInfo().getShortName());
- chatClientToolProvider.get().getChat().show();
+ chatEngineProvider.get().show();
}
});
// chatAbout.setTextDescription(i18n.t("Chat about"));
@@ -61,10 +65,33 @@
chatAbout.setToolTip("Chat and comment this");
chatAbout.setLeftSeparator(ActionToolbarButtonSeparator.fill);
+ ActionToolbarButtonDescriptor<StateToken> joinRoom = new ActionToolbarButtonDescriptor<StateToken>(
+ AccessRolDTO.Viewer, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ public void onEvent(StateToken token) {
+ chatEngineProvider.get().joinRoom(session.getContainerState().getContainer().getName(),
+ session.getCurrentUserInfo().getShortName());
+ }
+ });
+ joinRoom.setTextDescription(i18n.t("Enter room"));
+ joinRoom.setToolTip(i18n.t("Enter in this chat room"));
+ joinRoom.setMustBeAuthenticated(true);
+
+ ActionToolbarButtonDescriptor<StateToken> addRoom = new ActionToolbarButtonDescriptor<StateToken>(
+ AccessRolDTO.Administrator, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ public void onEvent(StateToken token) {
+
+ }
+ });
+ addRoom.setTextDescription(i18n.t("New room"));
+ addRoom.setToolTip(i18n.t("Create a new chat room"));
+ addRoom.setMustBeAuthenticated(true);
+
contentActionRegistry.addAction(chatAbout, DocumentClientTool.TYPE_DOCUMENT);
contentActionRegistry.addAction(chatAbout, DocumentClientTool.TYPE_GALLERY);
contentActionRegistry.addAction(chatAbout, DocumentClientTool.TYPE_WIKIPAGE);
contentActionRegistry.addAction(chatAbout, DocumentClientTool.TYPE_POST);
contentActionRegistry.addAction(chatAbout, DocumentClientTool.TYPE_UPLOADEDFILE);
+
+ contextActionRegistry.addAction(joinRoom, ChatClientTool.TYPE_ROOT);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -23,17 +23,16 @@
import org.ourproject.kune.chat.client.cnt.info.ChatInfo;
import org.ourproject.kune.chat.client.cnt.info.ChatInfoPanel;
import org.ourproject.kune.chat.client.cnt.room.ChatRoom;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomControl;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlPanel;
-import org.ourproject.kune.chat.client.cnt.room.ChatRoomControlPresenter;
import org.ourproject.kune.chat.client.cnt.room.ChatRoomPanel;
import org.ourproject.kune.chat.client.cnt.room.ChatRoomPresenter;
import org.ourproject.kune.chat.client.ctx.ChatContext;
import org.ourproject.kune.chat.client.ctx.ChatContextPresenter;
-import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
-import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdminPresenter;
+import org.ourproject.kune.chat.client.ctx.room.RoomAdmin;
+import org.ourproject.kune.chat.client.ctx.room.RoomAdminPresenter;
import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
+import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
+import org.ourproject.kune.platf.client.actions.DragDropContentRegistry;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.ToolGroup;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
@@ -43,7 +42,6 @@
import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import com.calclab.emiteuimodule.client.EmiteUIDialog;
@@ -60,16 +58,16 @@
@Override
public ChatClientActions create() {
return new ChatClientActions($(I18nUITranslationService.class), $(Session.class),
- $(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(ChatClientTool.class));
+ $(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(ChatEngine.class));
}
});
register(ToolGroup.class, new Factory<ChatClientTool>(ChatClientTool.class) {
@Override
public ChatClientTool create() {
- return new ChatClientTool($(Session.class), $(Application.class), $(I18nUITranslationService.class),
- $(EmiteUIDialog.class), $(WorkspaceSkeleton.class), $$(GroupMembersSummary.class),
- $(ToolSelector.class), $(WsThemePresenter.class), $$(ChatContent.class), $$(ChatContext.class));
+ return new ChatClientTool($(I18nUITranslationService.class), $(WorkspaceSkeleton.class),
+ $(ToolSelector.class), $(WsThemePresenter.class), $(ContentIconsRegistry.class),
+ $(DragDropContentRegistry.class));
}
});
@@ -92,19 +90,16 @@
register(Singleton.class, new Factory<ChatContext>(ChatContext.class) {
@Override
public ChatContext create() {
- final ChatContextPresenter presenter = new ChatContextPresenter($$(RoomsAdmin.class));
+ final ChatContextPresenter presenter = new ChatContextPresenter($$(RoomAdmin.class));
return presenter;
}
});
- register(Singleton.class, new Factory<ChatRoomControl>(ChatRoomControl.class) {
+ register(Singleton.class, new Factory<ChatEngine>(ChatEngine.class) {
@Override
- public ChatRoomControl create() {
- final ChatRoomControlPresenter presenter = new ChatRoomControlPresenter();
- final ChatRoomControlPanel panel = new ChatRoomControlPanel($(I18nUITranslationService.class),
- presenter);
- presenter.init(panel);
- return presenter;
+ public ChatEngine create() {
+ return new ChatEngineDefault($(I18nUITranslationService.class), $(WorkspaceSkeleton.class),
+ $(Application.class), $(Session.class), $$(EmiteUIDialog.class));
}
});
@@ -117,10 +112,10 @@
}
});
- register(Singleton.class, new Factory<RoomsAdmin>(RoomsAdmin.class) {
+ register(Singleton.class, new Factory<RoomAdmin>(RoomAdmin.class) {
@Override
- public RoomsAdmin create() {
- final RoomsAdminPresenter presenter = new RoomsAdminPresenter($(ContextNavigator.class),
+ public RoomAdmin create() {
+ final RoomAdminPresenter presenter = new RoomAdminPresenter($(ContextNavigator.class),
$(I18nUITranslationService.class), $$(StateManager.class), $(Session.class),
$$(ContentServiceAsync.class));
return presenter;
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientTool.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -19,109 +19,33 @@
*/
package org.ourproject.kune.chat.client;
-import org.ourproject.kune.chat.client.cnt.ChatContent;
-import org.ourproject.kune.chat.client.ctx.ChatContext;
-import org.ourproject.kune.platf.client.app.Application;
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.dto.InitDataDTO;
-import org.ourproject.kune.platf.client.dto.StateContainerDTO;
-import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
+import org.ourproject.kune.platf.client.actions.DragDropContentRegistry;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.tool.AbstractClientTool;
+import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
-import org.ourproject.kune.platf.client.ui.MenuItem;
-import org.ourproject.kune.platf.client.ui.WindowUtils;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummary;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
-import com.allen_sauer.gwt.log.client.Log;
-import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
-import com.calclab.emiteuimodule.client.EmiteUIDialog;
-import com.calclab.suco.client.ioc.Provider;
-import com.calclab.suco.client.listener.Listener;
-import com.calclab.suco.client.listener.Listener0;
-
-public class ChatClientTool extends AbstractClientTool {
+public class ChatClientTool extends FoldableAbstractClientTool {
public static final String NAME = "chats";
public static final String TYPE_ROOT = "chat.root";
public static final String TYPE_ROOM = "chat.room";
public static final String TYPE_CHAT = "chat.chat";
- private ChatEngine chat;
- private final Provider<ChatContext> chatContextProvider;
- private final Provider<ChatContent> chatContentProvider;
- public ChatClientTool(final Session session, final Application application, final I18nTranslationService i18n,
- final EmiteUIDialog emiteUIDialog, final WorkspaceSkeleton ws,
- final Provider<GroupMembersSummary> groupMembersSummaryProvider, final ToolSelector toolSelector,
- final WsThemePresenter wsThemePresenter, final Provider<ChatContent> chatContentProvider,
- final Provider<ChatContext> chatContextProvider) {
- super(NAME, i18n.t("chat rooms"), toolSelector, wsThemePresenter, ws);
- this.chatContentProvider = chatContentProvider;
- this.chatContextProvider = chatContextProvider;
- session.onInitDataReceived(new Listener<InitDataDTO>() {
- public void onEvent(final InitDataDTO initData) {
- checkChatDomain(initData.getChatDomain());
- final ChatConnectionOptions chatOptions = new ChatConnectionOptions(initData.getChatHttpBase(),
- initData.getChatDomain(), initData.getChatRoomHost());
- chat = new ChatEngineXmpp(emiteUIDialog, chatOptions, i18n, ws);
- groupMembersSummaryProvider.get().addUserOperation(
- new MenuItem<GroupDTO>("images/new-chat.gif", i18n.t("Start a chat with this member"),
- new Listener<GroupDTO>() {
- public void onEvent(final GroupDTO group) {
- emiteUIDialog.show();
- if (emiteUIDialog.isLoggedIn()) {
- emiteUIDialog.chat(XmppURI.jid(group.getShortName() + "@"
- + initData.getChatDomain()));
- } else {
- ws.showAlertMessage(i18n.t("Error"),
- i18n.t("To start a chat you need to be 'online'."));
- }
- }
- }), true);
- }
-
- private void checkChatDomain(final String chatDomain) {
- final String httpDomain = WindowUtils.getLocation().getHostName();
- if (!chatDomain.equals(httpDomain)) {
- Log.error("Your http domain (" + httpDomain + ") is different from the chat domain (" + chatDomain
- + "). This will produce problems with the chat functionality. "
- + "Check kune.properties on the server.");
- }
- }
- });
- application.onApplicationStop(new Listener0() {
- public void onEvent() {
- chat.stop();
- }
- });
- session.onUserSignOut(new Listener0() {
- public void onEvent() {
- chat.logout();
- }
- });
- session.onUserSignIn(new Listener<UserInfoDTO>() {
- public void onEvent(final UserInfoDTO user) {
- chat.login(user.getChatName(), user.getChatPassword());
- }
- });
+ public ChatClientTool(final I18nTranslationService i18n, final WorkspaceSkeleton ws,
+ final ToolSelector toolSelector, final WsThemePresenter wsThemePresenter,
+ final ContentIconsRegistry contentIconsRegistry, final DragDropContentRegistry dragDropContentRegistry) {
+ super(NAME, i18n.t("chat rooms"), toolSelector, wsThemePresenter, ws, contentIconsRegistry,
+ dragDropContentRegistry);
}
- public ChatEngine getChat() {
- return chat;
- }
-
public String getName() {
return NAME;
}
- public void setContent(final StateContainerDTO state) {
- chatContentProvider.get().setState(state);
+ @Override
+ protected void registerIcons() {
+ contentIconsRegistry.registerContentTypeIcon(TYPE_ROOM, "public/images/emite-room.png");
}
-
- public void setContext(final StateContainerDTO state) {
- chatContextProvider.get().setState(state);
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngine.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngine.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngine.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -19,11 +19,18 @@
*/
package org.ourproject.kune.chat.client;
+import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
+
public interface ChatEngine {
+
void addNewBuddie(String shortName);
+ void chat(XmppURI jid);
+
ChatConnectionOptions getChatOptions();
+ boolean isLoggedIn();
+
void joinRoom(String roomName, String userAlias);
void login(String jid, String passwd);
@@ -33,4 +40,5 @@
void show();
void stop();
+
}
Copied: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java (from rev 939, trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -0,0 +1,207 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.chat.client;
+
+import java.util.Date;
+
+import org.ourproject.kune.platf.client.app.Application;
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
+import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.ui.WindowUtils;
+import org.ourproject.kune.workspace.client.site.Site;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
+import com.calclab.emiteuimodule.client.EmiteUIDialog;
+import com.calclab.emiteuimodule.client.SubscriptionMode;
+import com.calclab.emiteuimodule.client.UserChatOptions;
+import com.calclab.emiteuimodule.client.params.AvatarProvider;
+import com.calclab.emiteuimodule.client.status.OwnPresence.OwnStatus;
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.listener.Listener;
+import com.calclab.suco.client.listener.Listener0;
+import com.google.gwt.user.client.Window;
+import com.gwtext.client.core.EventObject;
+import com.gwtext.client.widgets.Button;
+import com.gwtext.client.widgets.ToolbarButton;
+import com.gwtext.client.widgets.event.ButtonListenerAdapter;
+
+class ChatEngineDefault implements ChatEngine {
+ private ChatConnectionOptions chatOptions;
+ private final I18nTranslationService i18n;
+ private final WorkspaceSkeleton ws;
+ private ToolbarButton traybarButton;
+ private final Provider<EmiteUIDialog> emiteUIProvider;
+
+ public ChatEngineDefault(final I18nTranslationService i18n, final WorkspaceSkeleton ws, Application application,
+ Session session, final Provider<EmiteUIDialog> emiteUIProvider) {
+ this.i18n = i18n;
+ this.ws = ws;
+ this.emiteUIProvider = emiteUIProvider;
+ session.onInitDataReceived(new Listener<InitDataDTO>() {
+ public void onEvent(final InitDataDTO initData) {
+ checkChatDomain(initData.getChatDomain());
+ chatOptions = new ChatConnectionOptions(initData.getChatHttpBase(), initData.getChatDomain(),
+ initData.getChatRoomHost());
+ }
+
+ private void checkChatDomain(final String chatDomain) {
+ final String httpDomain = WindowUtils.getLocation().getHostName();
+ if (!chatDomain.equals(httpDomain)) {
+ Log.error("Your http domain (" + httpDomain + ") is different from the chat domain (" + chatDomain
+ + "). This will produce problems with the chat functionality. "
+ + "Check kune.properties on the server.");
+ }
+ }
+ });
+ session.onUserSignOut(new Listener0() {
+ public void onEvent() {
+ logout();
+ }
+ });
+ session.onUserSignIn(new Listener<UserInfoDTO>() {
+ public void onEvent(final UserInfoDTO user) {
+ login(user.getChatName(), user.getChatPassword());
+ }
+ });
+ application.onApplicationStop(new Listener0() {
+ public void onEvent() {
+ stop();
+ }
+ });
+ }
+
+ public void addNewBuddie(String shortName) {
+ Site.important("In development (emite)");
+ }
+
+ public void chat(XmppURI jid) {
+ emiteUIProvider.get().chat(jid);
+ }
+
+ public ChatConnectionOptions getChatOptions() {
+ return chatOptions;
+ }
+
+ public boolean isLoggedIn() {
+ return emiteUIProvider.get().isLoggedIn();
+ }
+
+ public void joinRoom(final String roomName, final String userAlias) {
+ if (emiteUIProvider.get().isLoggedIn()) {
+ final XmppURI roomURI = XmppURI.uri(roomName + "@" + chatOptions.roomHost + "/"
+ + chatOptions.userOptions.getUserJid().getNode());
+ emiteUIProvider.get().joinRoom(roomURI);
+ } else {
+ ws.showAlertMessage(i18n.t("Error"), i18n.t("To join a chatroom you need to be 'online'."));
+ }
+ }
+
+ public void login(final String jid, final String passwd) {
+ final UserChatOptions userChatOptions = getUserChatOptions(jid, passwd);
+ // FIXME: Avatar provider
+ final AvatarProvider avatarProvider = new AvatarProvider() {
+ public String getAvatarURL(XmppURI userURI) {
+ return "images/person-def.gif";
+ }
+ };
+ final String initialWindowTitle = Window.getTitle();
+ chatOptions.userOptions = userChatOptions;
+ if (emiteUIProvider.get().isDialogNotStarted()) {
+ emiteUIProvider.get().start(userChatOptions, chatOptions.httpBase, chatOptions.roomHost,
+ initialWindowTitle, avatarProvider, i18n.t("Chat"));
+ } else {
+ emiteUIProvider.get().setEnableStatusUI(true);
+ emiteUIProvider.get().refreshUserInfo(chatOptions.userOptions);
+ }
+ emiteUIProvider.get().show(OwnStatus.online);
+ if (traybarButton == null) {
+ traybarButton = new ToolbarButton();
+ traybarButton.setTooltip(i18n.t("Show/hide the chat window"));
+ // traybarButton.setIcon("images/emite-chat.gif");
+ traybarButton.setIcon("images/e-icon.gif");
+ traybarButton.addListener(new ButtonListenerAdapter() {
+ @Override
+ public void onClick(final Button button, final EventObject e) {
+ if (emiteUIProvider.get().isVisible()) {
+ emiteUIProvider.get().hide();
+ } else {
+ emiteUIProvider.get().show();
+ }
+ }
+ });
+ ws.getSiteTraybar().addButton(traybarButton);
+ emiteUIProvider.get().onChatAttended(new Listener<String>() {
+ public void onEvent(final String parameter) {
+ traybarButton.setIcon("images/e-icon.gif");
+ }
+ });
+ emiteUIProvider.get().onChatUnattendedWithActivity(new Listener<String>() {
+ public void onEvent(final String parameter) {
+ traybarButton.setIcon("images/e-icon-a.gif");
+ }
+ });
+ }
+ emiteUIProvider.get().hide();
+ emiteUIProvider.get().onChatAttended(new Listener<String>() {
+ public void onEvent(final String parameter) {
+ Window.setTitle(initialWindowTitle);
+ }
+ });
+ emiteUIProvider.get().onChatUnattendedWithActivity(new Listener<String>() {
+ public void onEvent(final String chatTitle) {
+ Window.setTitle("(* " + chatTitle + ") " + initialWindowTitle);
+ }
+ });
+ }
+
+ public void logout() {
+ if (!emiteUIProvider.get().isDialogNotStarted()) {
+ emiteUIProvider.get().setOwnPresence(OwnStatus.offline);
+ chatOptions.userOptions = getUserChatOptions("reset(a)example.com", "");
+ emiteUIProvider.get().refreshUserInfo(chatOptions.userOptions);
+ emiteUIProvider.get().setEnableStatusUI(false);
+ }
+ }
+
+ public void show() {
+ emiteUIProvider.get().show();
+ }
+
+ public void stop() {
+ if (!emiteUIProvider.get().isDialogNotStarted()) {
+ emiteUIProvider.get().destroy();
+ }
+ if (emiteUIProvider.get().getSession().isLoggedIn()) {
+ emiteUIProvider.get().getSession().logout();
+ }
+ }
+
+ private UserChatOptions getUserChatOptions(final String jid, final String passwd) {
+ final String resource = "emiteui-" + new Date().getTime() + "-kune"; // +
+ // getGwtMetaProperty(GWT_PROPERTY_RELEASE);
+ // FIXME, get this from user profile
+ return new UserChatOptions(jid + "@" + chatOptions.domain, passwd, resource, "blue",
+ SubscriptionMode.autoAcceptAll, true);
+ }
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineDefault.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -1,161 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client;
-
-import java.util.Date;
-
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.site.Site;
-import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
-
-import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
-import com.calclab.emiteuimodule.client.EmiteUIDialog;
-import com.calclab.emiteuimodule.client.SubscriptionMode;
-import com.calclab.emiteuimodule.client.UserChatOptions;
-import com.calclab.emiteuimodule.client.params.AvatarProvider;
-import com.calclab.emiteuimodule.client.status.OwnPresence.OwnStatus;
-import com.calclab.suco.client.listener.Listener;
-import com.google.gwt.user.client.Window;
-import com.gwtext.client.core.EventObject;
-import com.gwtext.client.widgets.Button;
-import com.gwtext.client.widgets.ToolbarButton;
-import com.gwtext.client.widgets.event.ButtonListenerAdapter;
-
-class ChatEngineXmpp implements ChatEngine {
- private final ChatConnectionOptions chatOptions;
- private final EmiteUIDialog emiteDialog;
- private final I18nTranslationService i18n;
- private final WorkspaceSkeleton ws;
- private ToolbarButton traybarButton;
-
- public ChatEngineXmpp(final EmiteUIDialog emiteUIDialog, final ChatConnectionOptions chatOptions,
- final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
- this.emiteDialog = emiteUIDialog;
- this.chatOptions = chatOptions;
- this.i18n = i18n;
- this.ws = ws;
- }
-
- public void addNewBuddie(String shortName) {
- Site.important("In development (emite)");
- }
-
- public ChatConnectionOptions getChatOptions() {
- return chatOptions;
- }
-
- public void joinRoom(final String roomName, final String userAlias) {
- if (emiteDialog.isLoggedIn()) {
- final XmppURI roomURI = XmppURI.uri(roomName + "@" + chatOptions.roomHost + "/"
- + chatOptions.userOptions.getUserJid().getNode());
- emiteDialog.joinRoom(roomURI);
- } else {
- ws.showAlertMessage(i18n.t("Error"), i18n.t("To join a chatroom you need to be 'online'."));
- }
- }
-
- public void login(final String jid, final String passwd) {
- final UserChatOptions userChatOptions = getUserChatOptions(jid, passwd);
- // FIXME: Avatar provider
- final AvatarProvider avatarProvider = new AvatarProvider() {
- public String getAvatarURL(XmppURI userURI) {
- return "images/person-def.gif";
- }
- };
- final String initialWindowTitle = Window.getTitle();
- chatOptions.userOptions = userChatOptions;
- if (emiteDialog.isDialogNotStarted()) {
- emiteDialog.start(userChatOptions, chatOptions.httpBase, chatOptions.roomHost, initialWindowTitle,
- avatarProvider, i18n.t("Chat"));
- } else {
- emiteDialog.setEnableStatusUI(true);
- emiteDialog.refreshUserInfo(chatOptions.userOptions);
- }
- emiteDialog.show(OwnStatus.online);
- if (traybarButton == null) {
- traybarButton = new ToolbarButton();
- traybarButton.setTooltip(i18n.t("Show/hide the chat window"));
- // traybarButton.setIcon("images/emite-chat.gif");
- traybarButton.setIcon("images/e-icon.gif");
- traybarButton.addListener(new ButtonListenerAdapter() {
- @Override
- public void onClick(final Button button, final EventObject e) {
- if (emiteDialog.isVisible()) {
- emiteDialog.hide();
- } else {
- emiteDialog.show();
- }
- }
- });
- ws.getSiteTraybar().addButton(traybarButton);
- emiteDialog.onChatAttended(new Listener<String>() {
- public void onEvent(final String parameter) {
- traybarButton.setIcon("images/e-icon.gif");
- }
- });
- emiteDialog.onChatUnattendedWithActivity(new Listener<String>() {
- public void onEvent(final String parameter) {
- traybarButton.setIcon("images/e-icon-a.gif");
- }
- });
- }
- emiteDialog.hide();
- emiteDialog.onChatAttended(new Listener<String>() {
- public void onEvent(final String parameter) {
- Window.setTitle(initialWindowTitle);
- }
- });
- emiteDialog.onChatUnattendedWithActivity(new Listener<String>() {
- public void onEvent(final String chatTitle) {
- Window.setTitle("(* " + chatTitle + ") " + initialWindowTitle);
- }
- });
- }
-
- public void logout() {
- if (!emiteDialog.isDialogNotStarted()) {
- emiteDialog.setOwnPresence(OwnStatus.offline);
- chatOptions.userOptions = getUserChatOptions("reset(a)example.com", "");
- emiteDialog.refreshUserInfo(chatOptions.userOptions);
- emiteDialog.setEnableStatusUI(false);
- }
- }
-
- public void show() {
- emiteDialog.show();
- }
-
- public void stop() {
- if (!emiteDialog.isDialogNotStarted()) {
- emiteDialog.destroy();
- }
- if (emiteDialog.getSession().isLoggedIn()) {
- emiteDialog.getSession().logout();
- }
- }
-
- private UserChatOptions getUserChatOptions(final String jid, final String passwd) {
- final String resource = "emiteui-" + new Date().getTime() + "-kune"; // +
- // getGwtMetaProperty(GWT_PROPERTY_RELEASE);
- // FIXME, get this from user profile
- return new UserChatOptions(jid + "@" + chatOptions.domain, passwd, resource, "blue",
- SubscriptionMode.autoAcceptAll, true);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/RoomViewListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/RoomViewListener.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/RoomViewListener.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client.cnt;
-
-public interface RoomViewListener {
-
- void onEnterRoom();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/RoomViewPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/RoomViewPanel.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/RoomViewPanel.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client.cnt;
-
-import org.ourproject.kune.platf.client.View;
-
-import com.google.gwt.user.client.ui.Button;
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.FlowPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class RoomViewPanel extends VerticalPanel implements View {
-
- public RoomViewPanel(final RoomViewListener listener) {
- FlowPanel flow = new FlowPanel();
- Button btnEnter = new Button("entrar", new ClickListener() {
- public void onClick(Widget arg0) {
- listener.onEnterRoom();
- }
- });
- flow.add(btnEnter);
- Label label = new Label("panel del chat: contenido por defecto");
-
- add(flow);
- add(label);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControl.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -1,24 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client.cnt.room;
-
-public interface ChatRoomControl {
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPanel.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPanel.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -1,46 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client.cnt.room;
-
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.ui.CustomPushButton;
-
-import com.google.gwt.user.client.ui.ClickListener;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class ChatRoomControlPanel extends HorizontalPanel implements ChatRoomControlView {
- private final CustomPushButton enterRoomBtn;
-
- public ChatRoomControlPanel(final I18nTranslationService i18n, final ChatRoomControlPresenter presenter) {
- enterRoomBtn = new CustomPushButton(i18n.t("Enter room"), new ClickListener() {
- public void onClick(final Widget sender) {
- presenter.onEnterRoom();
- }
- });
- add(enterRoomBtn);
- setEnterRoomEnabled(true);
- }
-
- public void setEnterRoomEnabled(final boolean isEnabled) {
- enterRoomBtn.setEnabled(isEnabled);
- }
-
-}
\ No newline at end of file
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPresenter.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlPresenter.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -1,41 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client.cnt.room;
-
-import org.ourproject.kune.platf.client.View;
-
-public class ChatRoomControlPresenter implements ChatRoomControl {
-
- private ChatRoomControlView view;
-
- public View getView() {
- return view;
- }
-
- public void init(final ChatRoomControlView view) {
- this.view = view;
- }
-
- public void onEnterRoom() {
- // TODO Auto-generated method stub
-
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlView.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/room/ChatRoomControlView.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -1,26 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client.cnt.room;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface ChatRoomControlView extends View {
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/ChatContextPresenter.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -19,21 +19,21 @@
*/
package org.ourproject.kune.chat.client.ctx;
-import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
+import org.ourproject.kune.chat.client.ctx.room.RoomAdmin;
import org.ourproject.kune.platf.client.dto.StateContainerDTO;
import com.calclab.suco.client.ioc.Provider;
public class ChatContextPresenter implements ChatContext {
- private final Provider<RoomsAdmin> roomAdminsProvider;
+ private final Provider<RoomAdmin> roomAdminsProvider;
- public ChatContextPresenter(final Provider<RoomsAdmin> roomAdminsProvider) {
+ public ChatContextPresenter(final Provider<RoomAdmin> roomAdminsProvider) {
this.roomAdminsProvider = roomAdminsProvider;
}
public void setState(final StateContainerDTO state) {
- final RoomsAdmin rooms = roomAdminsProvider.get();
+ final RoomAdmin rooms = roomAdminsProvider.get();
rooms.showRoom(state.getStateToken(), state.getContainer(), state.getContainerRights());
}
}
Copied: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room (from rev 934, trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms)
Property changes on: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdmin.java (from rev 934, trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdmin.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdmin.java 2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdmin.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -0,0 +1,28 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.chat.client.ctx.room;
+
+import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
+import org.ourproject.kune.platf.client.dto.ContainerDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public interface RoomAdmin {
+ void showRoom(final StateToken token, final ContainerDTO container, final AccessRightsDTO rights);
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdmin.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdminPresenter.java (from rev 934, trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java 2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdminPresenter.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -0,0 +1,77 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.chat.client.ctx.room;
+
+import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
+import org.ourproject.kune.platf.client.dto.ContainerDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+
+import com.calclab.suco.client.ioc.Provider;
+
+public class RoomAdminPresenter implements RoomAdmin {
+ private final ContextNavigator contextNavigator;
+
+ public RoomAdminPresenter(final ContextNavigator contextNavigator, final I18nTranslationService i18n,
+ final Provider<StateManager> stateManagerProvider, final Session session,
+ final Provider<ContentServiceAsync> contentServiceProvider) {
+ this.contextNavigator = contextNavigator;
+ // final ContextNavigatorImages images =
+ // ContextNavigatorImages.App.getInstance();
+ // contextNavigator.registerType(ChatClientTool.TYPE_CHAT,
+ // images.page());
+ // contextNavigator.registerType(ChatClientTool.TYPE_ROOM,
+ // images.chatGreen());
+ // contextNavigator.canCreate(i18n.t("New chat room"), i18n.t("Add a
+ // chat room"), new Listener<String>() {
+ // public void onEvent(final String name) {
+ // Site.showProgressProcessing();
+ // final String groupShortName =
+ // session.getCurrentState().getGroup().getShortName();
+ // final Long containerId =
+ // session.getCurrentState().getFolder().getId();
+ // contentServiceProvider.get().addRoom(session.getUserHash(),
+ // groupShortName, containerId,
+ // groupShortName + "-" + name, new AsyncCallbackSimple<StateDTO>() {
+ // public void onSuccess(final StateDTO state) {
+ // final StateManager stateManager = stateManagerProvider.get();
+ // stateManager.setRetrievedState(state);
+ // // FIXME: Isn't using cache (same in Add folder)
+ // stateManager.reloadContextAndTitles();
+ // Site.hideProgress();
+ // }
+ // });
+ // }
+ // });
+ }
+
+ public void showRoom(final StateToken token, final ContainerDTO container, final AccessRightsDTO rights) {
+ // contextNavigator.showContainer(token, container, rights);
+ // final String type = container.getTypeId();
+ // if (type.equals(ChatClientTool.TYPE_ROOM)) {
+ // contextNavigator.setControlsVisible(false);
+ // }
+ }
+
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomAdminPresenter.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomsAdmin.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdmin.java 2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomsAdmin.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client.ctx.rooms;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
-import org.ourproject.kune.platf.client.dto.ContainerDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public interface RoomsAdmin {
- View getView();
-
- void showRoom(final StateToken token, final ContainerDTO container, final AccessRightsDTO rights);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomsAdminPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ctx/rooms/RoomsAdminPresenter.java 2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ctx/room/RoomsAdminPresenter.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -1,82 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.chat.client.ctx.rooms;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
-import org.ourproject.kune.platf.client.dto.ContainerDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.platf.client.state.StateManager;
-import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
-
-import com.calclab.suco.client.ioc.Provider;
-
-public class RoomsAdminPresenter implements RoomsAdmin {
- private final ContextNavigator contextNavigator;
-
- public RoomsAdminPresenter(final ContextNavigator contextNavigator, final I18nTranslationService i18n,
- final Provider<StateManager> stateManagerProvider, final Session session,
- final Provider<ContentServiceAsync> contentServiceProvider) {
- this.contextNavigator = contextNavigator;
- // final ContextNavigatorImages images =
- // ContextNavigatorImages.App.getInstance();
- // contextNavigator.registerType(ChatClientTool.TYPE_CHAT,
- // images.page());
- // contextNavigator.registerType(ChatClientTool.TYPE_ROOM,
- // images.chatGreen());
- // contextNavigator.canCreate(i18n.t("New chat room"), i18n.t("Add a
- // chat room"), new Listener<String>() {
- // public void onEvent(final String name) {
- // Site.showProgressProcessing();
- // final String groupShortName =
- // session.getCurrentState().getGroup().getShortName();
- // final Long containerId =
- // session.getCurrentState().getFolder().getId();
- // contentServiceProvider.get().addRoom(session.getUserHash(),
- // groupShortName, containerId,
- // groupShortName + "-" + name, new AsyncCallbackSimple<StateDTO>() {
- // public void onSuccess(final StateDTO state) {
- // final StateManager stateManager = stateManagerProvider.get();
- // stateManager.setRetrievedState(state);
- // // FIXME: Isn't using cache (same in Add folder)
- // stateManager.reloadContextAndTitles();
- // Site.hideProgress();
- // }
- // });
- // }
- // });
- }
-
- public View getView() {
- return contextNavigator.getView();
- }
-
- public void showRoom(final StateToken token, final ContainerDTO container, final AccessRightsDTO rights) {
- // contextNavigator.showContainer(token, container, rights);
- // final String type = container.getTypeId();
- // if (type.equals(ChatClientTool.TYPE_ROOM)) {
- // contextNavigator.setControlsVisible(false);
- // }
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientModule.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -25,10 +25,10 @@
import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerPanel;
import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerPresenter;
import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewerView;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentViewer;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentViewerPanel;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentViewerPresenter;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentViewerView;
+import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewer;
+import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewerPanel;
+import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewerPresenter;
+import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewerView;
import org.ourproject.kune.docs.client.ctx.DocumentContext;
import org.ourproject.kune.docs.client.ctx.DocumentContextPresenter;
import org.ourproject.kune.docs.client.ctx.admin.DocContextEditor;
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -22,14 +22,13 @@
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.actions.DragDropContentRegistry;
import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
-import org.ourproject.kune.platf.client.tool.AbstractClientTool;
+import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
import org.ourproject.kune.platf.client.tool.ToolSelector;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
-
-public class DocumentClientTool extends AbstractClientTool {
+public class DocumentClientTool extends FoldableAbstractClientTool {
public static final String TYPE_ROOT = "docs.root";
public static final String TYPE_FOLDER = "docs.folder";
public static final String TYPE_DOCUMENT = "docs.doc";
@@ -39,28 +38,21 @@
public static final String TYPE_WIKI = "docs.wiki";
public static final String TYPE_WIKIPAGE = "docs.wikipage";
public static final String TYPE_UPLOADEDFILE = "docs.uploaded";
-
public static final String NAME = "docs";
- private final DragDropContentRegistry dragDropContentRegistry;
- private final ContentIconsRegistry contentIconsRegistry;
-
public DocumentClientTool(final I18nUITranslationService i18n, final ToolSelector toolSelector,
final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws,
- final DragDropContentRegistry dragDropContentRegistry,
- final ContentIconsRegistry contentIconsRegistry) {
- super(NAME, i18n.t("documents"), toolSelector, wsThemePresenter, ws);
- this.dragDropContentRegistry = dragDropContentRegistry;
- this.contentIconsRegistry = contentIconsRegistry;
- registerDragDropTypes();
- registerIcons();
+ final DragDropContentRegistry dragDropContentRegistry, final ContentIconsRegistry contentIconsRegistry) {
+ super(NAME, i18n.t("documents"), toolSelector, wsThemePresenter, ws, contentIconsRegistry,
+ dragDropContentRegistry);
}
public String getName() {
return NAME;
}
- private void registerDragDropTypes() {
+ @Override
+ protected void registerDragDropTypes() {
dragDropContentRegistry.registerDraggableType(TYPE_DOCUMENT);
dragDropContentRegistry.registerDraggableType(TYPE_FOLDER);
dragDropContentRegistry.registerDraggableType(TYPE_UPLOADEDFILE);
@@ -70,7 +62,8 @@
dragDropContentRegistry.registerDroppableType(TYPE_GALLERY);
}
- private void registerIcons() {
+ @Override
+ protected void registerIcons() {
contentIconsRegistry.registerContentTypeIcon(TYPE_FOLDER, "images/nav/folder.png");
contentIconsRegistry.registerContentTypeIcon(TYPE_BLOG, "images/nav/blog.png");
contentIconsRegistry.registerContentTypeIcon(TYPE_GALLERY, "images/nav/gallery.png");
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -21,7 +21,7 @@
import org.ourproject.kune.docs.client.DocumentClientTool;
import org.ourproject.kune.docs.client.cnt.folder.viewer.FolderViewer;
-import org.ourproject.kune.docs.client.cnt.reader.DocumentViewer;
+import org.ourproject.kune.docs.client.cnt.viewer.DocumentViewer;
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.actions.ActionRegistry;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer (from rev 934, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader)
Property changes on: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentReader.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReader.java 2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentReader.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.docs.client.cnt.reader;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public interface DocumentReader {
-
- View getView();
-
- void showDocument(StateToken token, String text, String typeId, BasicMimeTypeDTO mimeType);
-}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentReaderPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderPresenter.java 2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentReaderPresenter.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -1,62 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.docs.client.cnt.reader;
-
-import org.ourproject.kune.docs.client.DocumentClientTool;
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
-import org.ourproject.kune.platf.client.ui.download.ImageSize;
-
-import com.calclab.suco.client.ioc.Provider;
-
-public class DocumentReaderPresenter implements DocumentReader {
- private final DocumentReaderView view;
- private final Provider<FileDownloadUtils> downloadProvider;
-
- public DocumentReaderPresenter(final DocumentReaderView view, final Provider<FileDownloadUtils> downloadProvider) {
- this.view = view;
- this.downloadProvider = downloadProvider;
- }
-
- public View getView() {
- return view;
- }
-
- public void showDocument(final StateToken token, final String text, final String typeId,
- final BasicMimeTypeDTO mimeType) {
- if (typeId.equals(DocumentClientTool.TYPE_UPLOADEDFILE)) {
- if (mimeType != null) {
- FileDownloadUtils fileDownloadUtils = downloadProvider.get();
- if (mimeType.getType().equals("image")) {
- view.showImage(fileDownloadUtils.getImageUrl(token), fileDownloadUtils.getImageResizedUrl(token,
- ImageSize.sized));
- } else if (mimeType.toString().equals("text/plain") || mimeType.toString().equals("application/pdf")) {
- view.setContent(text);
- } else {
- view.setContent("");
- }
- }
- } else {
- view.setContent(text);
- }
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentReaderView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentReaderView.java 2008-10-28 15:40:27 UTC (rev 934)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentReaderView.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -1,30 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.docs.client.cnt.reader;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface DocumentReaderView extends View {
-
- void setContent(String content);
-
- void showImage(String imageUrl, String imageResizedUrl);
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewer.java (from rev 939, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewer.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewer.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewer.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -0,0 +1,31 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt.viewer;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+
+public interface DocumentViewer {
+
+ View getView();
+
+ void showDocument(StateToken token, String text, String typeId, BasicMimeTypeDTO mimeType);
+}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPanel.java (from rev 939, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerPanel.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerPanel.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPanel.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -0,0 +1,73 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt.viewer;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.KuneUiUtils;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.HTML;
+import com.google.gwt.user.client.ui.Image;
+import com.google.gwt.user.client.ui.Widget;
+
+public class DocumentViewerPanel implements DocumentViewerView {
+
+ private final WorkspaceSkeleton ws;
+ private final I18nTranslationService i18n;
+
+ public DocumentViewerPanel(final WorkspaceSkeleton ws, I18nTranslationService i18n) {
+ this.ws = ws;
+ this.i18n = i18n;
+ }
+
+ public void setContent(final String content) {
+ final HTML html = new HTML(content);
+ setDefStyle(html);
+ ws.getEntityWorkspace().setContent(html);
+ }
+
+ public void showImage(String imageUrl, String imageResizedUrl) {
+ final Image imgOrig = new Image(imageUrl);
+ final Image imgResized = new Image(imageResizedUrl);
+ KuneUiUtils.setQuickTip(imgOrig, i18n.t("Click to zoom out"));
+ KuneUiUtils.setQuickTip(imgResized, i18n.t("Click to zoom in"));
+ setDefStyle(imgOrig);
+ setDefStyle(imgResized);
+ imgOrig.addStyleName("kune-pointer");
+ imgResized.addStyleName("kune-pointer");
+ imgResized.addClickListener(new ClickListener() {
+ public void onClick(Widget sender) {
+ ws.getEntityWorkspace().setContent(imgOrig);
+ }
+ });
+ imgOrig.addClickListener(new ClickListener() {
+ public void onClick(Widget sender) {
+ ws.getEntityWorkspace().setContent(imgResized);
+ }
+ });
+ ws.getEntityWorkspace().setContent(imgResized);
+ }
+
+ private void setDefStyle(final Widget widget) {
+ widget.setStyleName("kune-Content-Main");
+ widget.addStyleName("kune-Margin-7-trbl");
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPresenter.java (from rev 939, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerPresenter.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerPresenter.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerPresenter.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -0,0 +1,62 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt.viewer;
+
+import org.ourproject.kune.docs.client.DocumentClientTool;
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.download.ImageSize;
+
+import com.calclab.suco.client.ioc.Provider;
+
+public class DocumentViewerPresenter implements DocumentViewer {
+ private final DocumentViewerView view;
+ private final Provider<FileDownloadUtils> downloadProvider;
+
+ public DocumentViewerPresenter(final DocumentViewerView view, final Provider<FileDownloadUtils> downloadProvider) {
+ this.view = view;
+ this.downloadProvider = downloadProvider;
+ }
+
+ public View getView() {
+ return view;
+ }
+
+ public void showDocument(final StateToken token, final String text, final String typeId,
+ final BasicMimeTypeDTO mimeType) {
+ if (typeId.equals(DocumentClientTool.TYPE_UPLOADEDFILE)) {
+ if (mimeType != null) {
+ FileDownloadUtils fileDownloadUtils = downloadProvider.get();
+ if (mimeType.getType().equals("image")) {
+ view.showImage(fileDownloadUtils.getImageUrl(token), fileDownloadUtils.getImageResizedUrl(token,
+ ImageSize.sized));
+ } else if (mimeType.toString().equals("text/plain") || mimeType.toString().equals("application/pdf")) {
+ view.setContent(text);
+ } else {
+ view.setContent("");
+ }
+ }
+ } else {
+ view.setContent(text);
+ }
+ }
+}
Copied: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerView.java (from rev 939, trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerView.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/reader/DocumentViewerView.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/viewer/DocumentViewerView.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -0,0 +1,30 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.docs.client.cnt.viewer;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface DocumentViewerView extends View {
+
+ void setContent(String content);
+
+ void showImage(String imageUrl, String imageResizedUrl);
+
+}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/actions/BeforeActionCollection.java (from rev 939, trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeCollection.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeCollection.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/BeforeActionCollection.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -0,0 +1,18 @@
+package org.ourproject.kune.platf.client.actions;
+
+import java.util.ArrayList;
+
+public class BeforeActionCollection extends ArrayList<BeforeActionListener> {
+
+ private static final long serialVersionUID = 1L;
+
+ public boolean checkBeforeAction() {
+ for (BeforeActionListener listener : this) {
+ if (!listener.beforeAction()) {
+ return false;
+ }
+ }
+ return true;
+ }
+
+}
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/client/actions/BeforeActionCollection.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/actions/BeforeActionListener.java (from rev 939, trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeActionListener.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeActionListener.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/BeforeActionListener.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -0,0 +1,7 @@
+package org.ourproject.kune.platf.client.actions;
+
+public interface BeforeActionListener {
+
+ boolean beforeAction();
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/ImageDescriptor.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/ImageDescriptor.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/ImageDescriptor.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -19,5 +19,5 @@
*/package org.ourproject.kune.platf.client.services;
public enum ImageDescriptor {
- accept, add, addGreen, alert, anybody, arrowDownBlack, arrowDownGreen, arrowDownWhite, arrowLeftGreen, arrowRightBlack, arrowRightGreen, arrowRightWhite, arrowUpGreen, bulletAdd, bulletBlack, bulletBlue, bulletDelete, bulletGreen, bulletPink, bulletPurple, bulletRed, bulletStar, bulletToggleMinus, bulletTogglePlus, bulletYellow, button15cblue, button15cdark, button15clight, button15cxlight, button15lblue, button15ldark, button15llight, button15lxlight, button15rblue, button15rdark, button15rlight, button15rxlight, button17cblue, button17cdark, button17clight, button17cxlight, button17lblue, button17ldark, button17llight, button17lxlight, button17rblue, button17rdark, button17rlight, button17rxlight, button20cblue, button20cdark, button20clight, button20cxlight, button20lblue, button20ldark, button20llight, button20lxlight, button20rblue, button20rdark, button20rlight, button20rxlight, buttonArrowDown, buttonHelpBlue, buttonHelpDark, buttonHelpLight, buttonSitebarArrowDown, by80x15, bync80x15, byncnd80x15, byncsa80x15, bynd80x15, bysa80x15, cancel, chat, clear, copyleft, cross, crossDark, del, emblemImportant, error, everybody, fullscreen, gnuFdl, groupDefIcon, groupHome, important, info, infoLight, kuneClose, kuneExternalWindow, kuneHelpTranslationIcon, kuneIcon16, kuneLogo16px, kunePreferences, kuneSearchIco, kuneSearchIcoPush, language, nobody, noCopyleft, nt, opentriangle, personDef, remove, rssIcon, searchIco, spinKuneThundGreen, splitterVertBar, star10, star20, star30, star40, star50, star60, star70, star80, star90, starGrey, starSmallYellow, starVsmallYellow, starYellow, step1, step2, step3, step4, step5, themeChoose, triangle
+ accept, add, addGreen, alert, anybody, arrowDownBlack, arrowDownGreen, arrowDownWhite, arrowLeftGreen, arrowRightBlack, arrowRightGreen, arrowRightWhite, arrowUpGreen, bulletAdd, bulletBlack, bulletBlue, bulletDelete, bulletGreen, bulletPink, bulletPurple, bulletRed, bulletStar, bulletToggleMinus, bulletTogglePlus, bulletYellow, button15cblue, button15cdark, button15clight, button15cxlight, button15lblue, button15ldark, button15llight, button15lxlight, button15rblue, button15rdark, button15rlight, button15rxlight, button17cblue, button17cdark, button17clight, button17cxlight, button17lblue, button17ldark, button17llight, button17lxlight, button17rblue, button17rdark, button17rlight, button17rxlight, button20cblue, button20cdark, button20clight, button20cxlight, button20lblue, button20ldark, button20llight, button20lxlight, button20rblue, button20rdark, button20rlight, button20rxlight, buttonArrowDown, buttonHelpBlue, buttonHelpDark, buttonHelpLight, buttonSitebarArrowDown, by80x15, bync80x15, byncnd80x15, byncsa80x15, bynd80x15, bysa80x15, cancel, clear, copyleft, cross, crossDark, del, emblemImportant, error, everybody, fullscreen, gnuFdl, groupDefIcon, groupHome, important, info, infoLight, kuneClose, kuneExternalWindow, kuneHelpTranslationIcon, kuneIcon16, kuneLogo16px, kunePreferences, kuneSearchIco, kuneSearchIcoPush, language, nobody, noCopyleft, nt, opentriangle, personDef, remove, rssIcon, searchIco, spinKuneThundGreen, splitterVertBar, star10, star20, star30, star40, star50, star60, star70, star80, star90, starGrey, starSmallYellow, starVsmallYellow, starYellow, step1, step2, step3, step4, step5, themeChoose, triangle
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/ImageUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/ImageUtils.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/ImageUtils.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -249,9 +249,6 @@
case cancel: {
return img.cancel();
}
- case chat: {
- return img.chat();
- }
case clear: {
return img.clear();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/Images.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/Images.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/Images.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -255,9 +255,6 @@
@Resource("org/ourproject/kune/platf/public/images/cancel.png")
AbstractImagePrototype cancel();
- @Resource("org/ourproject/kune/platf/public/images/chat.png")
- AbstractImagePrototype chat();
-
@Resource("org/ourproject/kune/platf/public/images/clear.png")
AbstractImagePrototype clear();
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -102,6 +102,7 @@
import org.ourproject.kune.workspace.client.site.SiteToken;
import org.ourproject.kune.workspace.client.site.rpc.UserService;
import org.ourproject.kune.workspace.client.site.rpc.UserServiceAsync;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
import org.ourproject.kune.workspace.client.title.EntityTitle;
@@ -348,7 +349,7 @@
contentNavigatorToolbar);
final TextEditorPresenter presenter = new TextEditorPresenter(true, toolbar,
- $(I18nUITranslationService.class), $(StateManager.class));
+ $(I18nUITranslationService.class), $(StateManager.class), $(SiteSignOutLink.class));
final TextEditorPanel panel = new TextEditorPanel(presenter, $(I18nTranslationService.class),
$(WorkspaceSkeleton.class), $(ColorWebSafePalette.class));
presenter.init(panel);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -18,7 +18,7 @@
*
*/package org.ourproject.kune.platf.client.services;
-import org.ourproject.kune.chat.client.ChatClientTool;
+import org.ourproject.kune.chat.client.ChatEngine;
import org.ourproject.kune.platf.client.actions.ActionManager;
import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
import org.ourproject.kune.platf.client.actions.UserActionRegistry;
@@ -334,7 +334,7 @@
final GroupMembersSummaryPresenter presenter = new GroupMembersSummaryPresenter(
$(I18nUITranslationService.class), $(StateManager.class), $(ImageUtils.class),
$(Session.class), $$(SocialNetworkServiceAsync.class), $$(GroupLiveSearcher.class),
- $(WsThemePresenter.class));
+ $(WsThemePresenter.class), $$(ChatEngine.class));
final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter,
$(I18nUITranslationService.class), $(WorkspaceSkeleton.class));
presenter.init(view);
@@ -359,7 +359,7 @@
public BuddiesSummary create() {
final BuddiesSummaryPresenter presenter = new BuddiesSummaryPresenter($(StateManager.class),
$(Session.class), $(UserActionRegistry.class), $(I18nTranslationService.class),
- $$(ChatClientTool.class));
+ $$(ChatEngine.class));
final BuddiesSummaryPanel panel = new BuddiesSummaryPanel(presenter, $(WorkspaceSkeleton.class),
$(I18nTranslationService.class), $(ActionManager.class));
presenter.init(panel);
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeActionListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeActionListener.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeActionListener.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -1,7 +0,0 @@
-package org.ourproject.kune.platf.client.state;
-
-public interface BeforeActionListener {
-
- boolean beforeAction();
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeCollection.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeCollection.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/BeforeStateChangeCollection.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -1,9 +0,0 @@
-package org.ourproject.kune.platf.client.state;
-
-import java.util.ArrayList;
-
-public class BeforeStateChangeCollection extends ArrayList<BeforeActionListener> {
-
- private static final long serialVersionUID = 1L;
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManager.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -19,6 +19,7 @@
*/
package org.ourproject.kune.platf.client.state;
+import org.ourproject.kune.platf.client.actions.BeforeActionListener;
import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -21,6 +21,8 @@
import java.util.HashMap;
+import org.ourproject.kune.platf.client.actions.BeforeActionCollection;
+import org.ourproject.kune.platf.client.actions.BeforeActionListener;
import org.ourproject.kune.platf.client.app.HistoryWrapper;
import org.ourproject.kune.platf.client.dto.ParticipationDataDTO;
import org.ourproject.kune.platf.client.dto.SocialNetworkDTO;
@@ -55,7 +57,7 @@
private final Event<StateAbstractDTO> onSocialNetworkChanged;
private final Event2<String, String> onToolChanged;
private final Event2<String, String> onGroupChanged;
- private final BeforeStateChangeCollection beforeStateChangeCollection;
+ private final BeforeActionCollection beforeStateChangeCollection;
public StateManagerDefault(final ContentProvider contentProvider, final Session session,
final HistoryWrapper history) {
@@ -84,7 +86,7 @@
}
});
siteTokens = new HashMap<String, Listener0>();
- beforeStateChangeCollection = new BeforeStateChangeCollection();
+ beforeStateChangeCollection = new BeforeActionCollection();
}
public void addBeforeStateChangeListener(BeforeActionListener listener) {
@@ -109,7 +111,7 @@
}
public void onHistoryChanged(final String historyToken) {
- if (beforeStateListenersAllowChange()) {
+ if (beforeStateChangeCollection.checkBeforeAction()) {
final Listener0 tokenListener = siteTokens.get(historyToken);
Log.debug("StateManager: history token changed (" + historyToken + ")");
if (tokenListener == null) {
@@ -199,15 +201,6 @@
previousToken = newState.getStateToken();
}
- private boolean beforeStateListenersAllowChange() {
- for (BeforeActionListener listener : beforeStateChangeCollection) {
- if (!listener.beforeAction()) {
- return false;
- }
- }
- return true;
- }
-
private void checkGroupAndToolChange(final StateAbstractDTO newState) {
final String previousGroup = previousToken == null ? "" : previousToken.getGroup();
final String newGroup = newState.getStateToken().getGroup();
Added: trunk/src/main/java/org/ourproject/kune/platf/client/tool/FoldableAbstractClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/FoldableAbstractClientTool.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/FoldableAbstractClientTool.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -0,0 +1,27 @@
+package org.ourproject.kune.platf.client.tool;
+
+import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
+import org.ourproject.kune.platf.client.actions.DragDropContentRegistry;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+
+public abstract class FoldableAbstractClientTool extends AbstractClientTool {
+ protected final DragDropContentRegistry dragDropContentRegistry;
+ protected final ContentIconsRegistry contentIconsRegistry;
+
+ public FoldableAbstractClientTool(String shortName, String longName, ToolSelector toolSelector,
+ WsThemePresenter wsThemePresenter, WorkspaceSkeleton ws, final ContentIconsRegistry contentIconsRegistry,
+ final DragDropContentRegistry dragDropContentRegistry) {
+ super(shortName, longName, toolSelector, wsThemePresenter, ws);
+ this.dragDropContentRegistry = dragDropContentRegistry;
+ this.contentIconsRegistry = contentIconsRegistry;
+ registerDragDropTypes();
+ registerIcons();
+ }
+
+ protected void registerDragDropTypes() {
+ }
+
+ protected void registerIcons() {
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/gridmenu/GridMenuPanel.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -244,15 +244,13 @@
@Override
public void setHeight(final int height) {
super.setHeight(height);
- // grid.setHeight(height);
doLayoutIfNeeded();
}
@Override
public void setWidth(final int width) {
// grid.setWidth(width - 27);
- grid.setWidth(width - 27);
- // super.setWidth(width - 11);
+ super.setWidth(width);
doLayoutIfNeeded();
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/public/images/chat.png
===================================================================
(Binary files differ)
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenter.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -24,12 +24,13 @@
import org.ourproject.kune.platf.client.actions.ActionItemCollection;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
import org.ourproject.kune.platf.client.actions.ActionToolbarPosition;
+import org.ourproject.kune.platf.client.actions.BeforeActionListener;
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.dto.AccessRolDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.state.BeforeActionListener;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
import com.calclab.suco.client.listener.Listener;
import com.calclab.suco.client.listener.Listener0;
@@ -52,13 +53,15 @@
private final I18nUITranslationService i18n;
private final BeforeActionListener beforeStateChangeListener;
private final StateManager stateManager;
+ private final SiteSignOutLink siteSignOutLink;
public TextEditorPresenter(final boolean isAutoSave, final ActionToolbar<StateToken> toolbar,
- final I18nUITranslationService i18n, StateManager stateManager) {
+ final I18nUITranslationService i18n, StateManager stateManager, SiteSignOutLink siteSignOutLink) {
this.toolbar = toolbar;
autoSave = isAutoSave;
this.i18n = i18n;
this.stateManager = stateManager;
+ this.siteSignOutLink = siteSignOutLink;
savePending = false;
editingHtml = false;
saveAndCloseConfirmed = false;
@@ -78,6 +81,7 @@
view.attach();
setContent(content);
stateManager.addBeforeStateChangeListener(beforeStateChangeListener);
+ siteSignOutLink.addBeforeSignOut(beforeStateChangeListener);
}
public String getContent() {
@@ -142,6 +146,7 @@
protected void onCancelConfirmed() {
stateManager.removeBeforeStateChangeListener(beforeStateChangeListener);
+ siteSignOutLink.removeBeforeSignOut(beforeStateChangeListener);
stateManager.resumeTokenChange();
reset();
view.detach();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLink.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLink.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLink.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -18,6 +18,12 @@
*
*/package org.ourproject.kune.workspace.client.sitebar.sitesign;
+import org.ourproject.kune.platf.client.actions.BeforeActionListener;
+
public interface SiteSignOutLink {
+ void addBeforeSignOut(BeforeActionListener listener);
+
+ void removeBeforeSignOut(BeforeActionListener listener);
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/sitesign/SiteSignOutLinkPresenter.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -21,6 +21,8 @@
import java.util.Date;
import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.actions.BeforeActionCollection;
+import org.ourproject.kune.platf.client.actions.BeforeActionListener;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.errors.SessionExpiredException;
import org.ourproject.kune.platf.client.errors.UserMustBeLoggedException;
@@ -41,6 +43,7 @@
private SiteSignOutLinkView view;
private final Session session;
private final Provider<UserServiceAsync> userServiceProvider;
+ private final BeforeActionCollection beforeSignOutCollection;
public SiteSignOutLinkPresenter(final Session session, final Provider<UserServiceAsync> userServiceProvider,
final Provider<KuneErrorHandler> kuneErrorHandlerProvider) {
@@ -61,31 +64,39 @@
clientUIsignOut();
}
});
+ beforeSignOutCollection = new BeforeActionCollection();
}
+ public void addBeforeSignOut(BeforeActionListener listener) {
+ beforeSignOutCollection.add(listener);
+ }
+
public void doSignOut() {
- final AsyncCallback<Object> callback = new AsyncCallback<Object>() {
- public void onFailure(final Throwable caught) {
- Site.hideProgress();
- try {
- throw caught;
- } catch (final SessionExpiredException e) {
+ if (beforeSignOutCollection.checkBeforeAction()) {
+ userServiceProvider.get().logout(session.getUserHash(), new AsyncCallback<Object>() {
+ public void onFailure(final Throwable caught) {
+ Site.hideProgress();
+ try {
+ throw caught;
+ } catch (final SessionExpiredException e) {
+ clientUIsignOut();
+ } catch (final UserMustBeLoggedException e) {
+ clientUIsignOut();
+ } catch (final Throwable e) {
+ GWT.log("Other kind of exception in doLogout", null);
+ throw new RuntimeException();
+ }
+ }
+
+ public void onSuccess(final Object arg0) {
+ Site.hideProgress();
clientUIsignOut();
- } catch (final UserMustBeLoggedException e) {
- clientUIsignOut();
- } catch (final Throwable e) {
- GWT.log("Other kind of exception in doLogout", null);
- throw new RuntimeException();
}
- }
- public void onSuccess(final Object arg0) {
- Site.hideProgress();
- clientUIsignOut();
- }
-
- };
- userServiceProvider.get().logout(session.getUserHash(), callback);
+ });
+ } else {
+ Site.hideProgress();
+ }
}
public View getView() {
@@ -97,6 +108,10 @@
view.setVisible(false);
}
+ public void removeBeforeSignOut(BeforeActionListener listener) {
+ beforeSignOutCollection.remove(listener);
+ }
+
private void clientUIsignOut() {
// FIXME: Remove cookie doesn't works in all browsers, know
// issue:
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/BuddiesSummaryPresenter.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -20,7 +20,7 @@
import java.util.List;
-import org.ourproject.kune.chat.client.ChatClientTool;
+import org.ourproject.kune.chat.client.ChatEngine;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.actions.ActionEnableCondition;
import org.ourproject.kune.platf.client.actions.ActionMenuItemDescriptor;
@@ -46,16 +46,16 @@
private final StateManager stateManager;
private final UserActionRegistry actionRegistry;
private final I18nTranslationService i18n;
- private final Provider<ChatClientTool> chatClientToolProvider;
+ private final Provider<ChatEngine> chatEngineProvider;
private final Session session;
public BuddiesSummaryPresenter(StateManager stateManager, final Session session, UserActionRegistry actionRegistry,
- I18nTranslationService i18n, final Provider<ChatClientTool> chatClientToolProvider) {
+ I18nTranslationService i18n, final Provider<ChatEngine> chatEngineProvider) {
this.stateManager = stateManager;
this.session = session;
this.actionRegistry = actionRegistry;
this.i18n = i18n;
- this.chatClientToolProvider = chatClientToolProvider;
+ this.chatEngineProvider = chatEngineProvider;
stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
public void onEvent(StateAbstractDTO state) {
setState(state);
@@ -118,7 +118,7 @@
final ActionToolbarButtonAndItemDescriptor<UserSimpleDTO> addAsBuddie = new ActionToolbarButtonAndItemDescriptor<UserSimpleDTO>(
AccessRolDTO.Viewer, ActionToolbarPosition.bottombar, new Listener<UserSimpleDTO>() {
public void onEvent(final UserSimpleDTO group) {
- chatClientToolProvider.get().getChat().addNewBuddie(group.getShortName());
+ chatEngineProvider.get().addNewBuddie(group.getShortName());
}
});
addAsBuddie.setMustBeAuthenticated(true);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -20,10 +20,12 @@
import java.util.List;
+import org.ourproject.kune.chat.client.ChatEngine;
import org.ourproject.kune.platf.client.dto.AccessListsDTO;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.GroupType;
+import org.ourproject.kune.platf.client.dto.InitDataDTO;
import org.ourproject.kune.platf.client.dto.LinkDTO;
import org.ourproject.kune.platf.client.dto.SocialNetworkDTO;
import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
@@ -34,6 +36,7 @@
import org.ourproject.kune.platf.client.services.ImageUtils;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.MenuItem;
import org.ourproject.kune.platf.client.ui.gridmenu.GridButton;
import org.ourproject.kune.platf.client.ui.gridmenu.GridGroup;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
@@ -42,6 +45,7 @@
import org.ourproject.kune.workspace.client.themes.WsTheme;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import com.calclab.emite.core.client.xmpp.stanzas.XmppURI;
import com.calclab.suco.client.ioc.Provider;
import com.calclab.suco.client.listener.Listener;
import com.calclab.suco.client.listener.Listener2;
@@ -61,7 +65,8 @@
public GroupMembersSummaryPresenter(final I18nUITranslationService i18n, final StateManager stateManager,
final ImageUtils imageUtils, final Session session,
final Provider<SocialNetworkServiceAsync> snServiceProvider,
- final Provider<GroupLiveSearcher> liveSearcherProvider, final WsThemePresenter wsThemePresenter) {
+ final Provider<GroupLiveSearcher> liveSearcherProvider, final WsThemePresenter wsThemePresenter,
+ final Provider<ChatEngine> chatEngineProvider) {
super(i18n, stateManager, imageUtils, session, snServiceProvider);
this.i18n = i18n;
this.stateManager = stateManager;
@@ -79,6 +84,22 @@
view.setTheme(oldTheme, newTheme);
}
});
+ session.onInitDataReceived(new Listener<InitDataDTO>() {
+ public void onEvent(final InitDataDTO initData) {
+ addUserOperation(new MenuItem<GroupDTO>("images/new-chat.gif", i18n.t("Start a chat with this member"),
+ new Listener<GroupDTO>() {
+ public void onEvent(final GroupDTO group) {
+ chatEngineProvider.get().show();
+ if (chatEngineProvider.get().isLoggedIn()) {
+ chatEngineProvider.get().chat(
+ XmppURI.jid(group.getShortName() + "@" + initData.getChatDomain()));
+ } else {
+ Site.important(i18n.t("To start a chat you need to be 'online'."));
+ }
+ }
+ }), true);
+ }
+ });
final String adminsTitle = i18n.t("Admins");
final String collabsTitle = i18n.t("Collaborators");
final String pendingTitle = i18n.t("Pending");
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -44,6 +44,9 @@
setState((StateContentDTO) state);
} else if (state instanceof StateContainerDTO) {
setState((StateContainerDTO) state);
+ } else {
+ view.setContentSubTitleLeftVisible(false);
+ view.setContentSubTitleRightVisible(false);
}
}
});
Modified: trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/test/java/org/ourproject/kune/platf/client/state/StateManagerTest.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -5,6 +5,7 @@
import org.junit.Before;
import org.junit.Test;
import org.mockito.Mockito;
+import org.ourproject.kune.platf.client.actions.BeforeActionListener;
import org.ourproject.kune.platf.client.app.HistoryWrapper;
import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
Modified: trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java 2008-11-04 15:07:14 UTC (rev 939)
+++ trunk/src/test/java/org/ourproject/kune/workspace/client/editor/TextEditorPresenterTest.java 2008-11-05 22:07:07 UTC (rev 940)
@@ -9,6 +9,7 @@
import org.ourproject.kune.platf.client.actions.toolbar.ActionToolbar;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.sitesign.SiteSignOutLink;
import com.calclab.suco.testing.listener.MockListener;
import com.calclab.suco.testing.listener.MockListener0;
@@ -21,6 +22,7 @@
@SuppressWarnings("unchecked")
private ActionToolbar toolbar;
private StateManager stateManager;
+ private SiteSignOutLink signOutLink;
@SuppressWarnings("unchecked")
@Before
@@ -28,7 +30,8 @@
I18nUITranslationService i18n = Mockito.mock(I18nUITranslationService.class);
stateManager = Mockito.mock(StateManager.class);
toolbar = Mockito.mock(ActionToolbar.class);
- presenter = new TextEditorPresenter(true, toolbar, i18n, stateManager);
+ signOutLink = Mockito.mock(SiteSignOutLink.class);
+ presenter = new TextEditorPresenter(true, toolbar, i18n, stateManager, signOutLink);
view = Mockito.mock(TextEditorView.class);
presenter.init(view);
saveListener = new MockListener<String>();
1
0