[kune-commits] r975 - in trunk: script src/main/java/org/ourproject/kune/app/public/css src/main/java/org/ourproject/kune/app/public/css/img src/main/java/org/ourproject/kune/platf/client/actions src/main/java/org/ourproject/kune/platf/client/app src/main/java/org/ourproject/kune/platf/client/dto src/main/java/org/ourproject/kune/platf/client/rpc src/main/java/org/ourproject/kune/platf/client/services src/main/java/org/ourproject/kune/platf/client/state src/main/java/org/ourproject/kune/platf/client/ui/dialogs src/main/java/org/ourproject/kune/platf/public/images src/main/java/org/ourproject/kune/platf/server src/main/java/org/ourproject/kune/platf/server/manager src/main/java/org/ourproject/kune/platf/server/manager/impl src/main/java/org/ourproject/kune/platf/server/rpc src/main/java/org/ourproject/kune/platf/server/tool src/main/java/org/ourproject/kune/workspace/client src/main/java/org/ourproject/kune/workspace/client/cxt src/main/java/org/ourproject/kune/workspace/client/options src/main/java/org/ourproject/kune/workspace/client/title src/test/java/org/ourproject/kune/platf/integration/site

vjrj vjrj at ourproject.org
Mon Dec 1 22:05:58 CET 2008


Author: vjrj
Date: 2008-12-01 22:05:52 +0100 (Mon, 01 Dec 2008)
New Revision: 975

Added:
   trunk/src/main/java/org/ourproject/kune/app/public/css/img/emblem-system.gif
   trunk/src/main/java/org/ourproject/kune/platf/client/app/EntityOptionsGroup.java
   trunk/src/main/java/org/ourproject/kune/platf/public/images/emblem-system.gif
   trunk/src/main/java/org/ourproject/kune/platf/public/images/emblem-system.png
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsView.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptions.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConf.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConfPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConfPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConfView.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsView.java
Modified:
   trunk/script/generateBasicUIElements.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/platf/client/actions/ActionRegistry.java
   trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java
   trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java
   trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupServiceAsync.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/KuneCoreModule.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/Session.java
   trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
   trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java
   trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java
   trunk/src/main/java/org/ourproject/kune/platf/server/manager/GroupManager.java
   trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/GroupManagerDefault.java
   trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java
   trunk/src/main/java/org/ourproject/kune/platf/server/tool/ServerToolRegistry.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitle.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitleView.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitle.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitleView.java
   trunk/src/test/java/org/ourproject/kune/platf/integration/site/SiteServiceTest.java
Log:
Incomplete - task Abstract and Group options dialog (for user/group preferences)

Modified: trunk/script/generateBasicUIElements.sh
===================================================================
--- trunk/script/generateBasicUIElements.sh	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/script/generateBasicUIElements.sh	2008-12-01 21:05:52 UTC (rev 975)
@@ -9,7 +9,7 @@
   if [ $PARAMS -ne 2 ]
   then
   	echo "Use: $0 <packageDirDest> <ClassName>"
-    echo "$0 src/main/java/com/calclab/emiteui/client/chatuiplugin/chat ChatUI"
+    echo "$0 src/main/java/org/ourproject/kune/workspace/client/options/ GroupOptions"
     exit
   fi
 

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-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/all.css	2008-12-01 21:05:52 UTC (rev 975)
@@ -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;}.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;}.k-bsp-buddie{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-bsp-buddie td{padding:2px 3px;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}
\ 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;}.k-bsp-buddie{background:#FAFAFA none repeat scroll 0 50%;border:1px solid #EBEBEB;padding:3px;margin:3px;}.k-bsp-buddie td{padding:2px 3px;}.k-text-gray{color:gray;}.k-elp-limg{margin-top:4px;margin-left:5px;cursor:pointer;}.k-tsp-tag{float:right;margin-right:5px;cursor:pointer;color:#00F;}.k-tsp-cloud{vertical-align:bottom;}.k-options-icon{background-image:url(img/emblem-system.gif)!important;}
\ No newline at end of file

Added: trunk/src/main/java/org/ourproject/kune/app/public/css/img/emblem-system.gif
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/org/ourproject/kune/app/public/css/img/emblem-system.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

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-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css	2008-12-01 21:05:52 UTC (rev 975)
@@ -812,3 +812,7 @@
   vertical-align: bottom;
 }
 
+.k-options-icon {
+  background-image: url(img/emblem-system.gif) !important;
+}
+

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionRegistry.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/ActionRegistry.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -40,7 +40,8 @@
     public void addAction(final ActionDescriptor<T> action, String... typeIds) {
         assert (action != null);
         for (final String typeId : typeIds) {
-            Log.debug("Registering action '" + action.getText() + "' for " + typeId);
+            String text = action.getText();
+            Log.debug("Registering action " + (text == null ? "with icon" : "'" + text + "'") + " for " + typeId);
             final ActionCollection<T> actionColl = getActions(typeId);
             actionColl.add(action);
         }

Added: trunk/src/main/java/org/ourproject/kune/platf/client/app/EntityOptionsGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/EntityOptionsGroup.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/EntityOptionsGroup.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -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.platf.client.app;
+
+import com.calclab.suco.client.ioc.Container;
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.ioc.decorator.ProviderCollection;
+import com.calclab.suco.client.ioc.decorator.Singleton;
+
+public class EntityOptionsGroup extends ProviderCollection {
+
+    public EntityOptionsGroup(final Container container) {
+        super(container, Singleton.instance);
+    }
+
+    public void createAll() {
+        for (final Provider<?> p : getProviders()) {
+            p.get();
+        }
+    }
+}

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/InitDataDTO.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -20,7 +20,6 @@
 package org.ourproject.kune.platf.client.dto;
 
 import java.util.ArrayList;
-import java.util.Collection;
 
 import com.google.gwt.user.client.rpc.IsSerializable;
 
@@ -39,8 +38,8 @@
     private String siteLogoUrl;
     private String galleryPermittedExtensions;
     private String maxFileSizeInMb;
-    private Collection<ToolSimpleDTO> userTools;
-    private Collection<ToolSimpleDTO> groupTools;
+    private ArrayList<ToolSimpleDTO> userTools;
+    private ArrayList<ToolSimpleDTO> groupTools;
 
     public String getChatDomain() {
         return chatDomain;
@@ -66,7 +65,7 @@
         return galleryPermittedExtensions;
     }
 
-    public Collection<ToolSimpleDTO> getGroupTools() {
+    public ArrayList<ToolSimpleDTO> getGroupTools() {
         return groupTools;
     }
 
@@ -98,7 +97,7 @@
         return userInfo;
     }
 
-    public Collection<ToolSimpleDTO> getUserTools() {
+    public ArrayList<ToolSimpleDTO> getUserTools() {
         return userTools;
     }
 
@@ -134,7 +133,7 @@
         this.galleryPermittedExtensions = galleryPermittedExtensions;
     }
 
-    public void setGroupTools(Collection<ToolSimpleDTO> groupTools) {
+    public void setGroupTools(ArrayList<ToolSimpleDTO> groupTools) {
         this.groupTools = groupTools;
     }
 
@@ -166,7 +165,7 @@
         this.userInfo = currentUser;
     }
 
-    public void setUserTools(Collection<ToolSimpleDTO> userTools) {
+    public void setUserTools(ArrayList<ToolSimpleDTO> userTools) {
         this.userTools = userTools;
     }
 

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -39,4 +39,6 @@
 
     void setSocialNetworkVisibility(String userHash, StateToken groupToken, SocialNetworkVisibilityDTO visibility);
 
+    void setToolEnabled(String userHash, StateToken groupToken, String toolName, boolean enabled);
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupServiceAsync.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupServiceAsync.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupServiceAsync.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -39,4 +39,7 @@
     void setSocialNetworkVisibility(String userHash, StateToken token, SocialNetworkVisibilityDTO visibility,
             AsyncCallback<?> asyncCallback);
 
+    void setToolEnabled(String userHash, StateToken groupToken, String toolName, boolean enabled,
+            AsyncCallback<?> asyncCallback);
+
 }

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-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/ImageDescriptor.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -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, 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, emblemSystem, 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-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/ImageUtils.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -267,6 +267,9 @@
         case emblemImportant: {
             return img.emblemImportant();
         }
+        case emblemSystem: {
+            return img.emblemSystem();
+        }
         case error: {
             return img.error();
         }

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-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/Images.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -273,6 +273,9 @@
     @Resource("org/ourproject/kune/platf/public/images/emblem-important.png")
     AbstractImagePrototype emblemImportant();
 
+    @Resource("org/ourproject/kune/platf/public/images/emblem-system.png")
+    AbstractImagePrototype emblemSystem();
+
     @Resource("org/ourproject/kune/platf/public/images/error.png")
     AbstractImagePrototype error();
 

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneCoreModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneCoreModule.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneCoreModule.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -19,6 +19,7 @@
  */package org.ourproject.kune.platf.client.services;
 
 import org.ourproject.kune.platf.client.app.ApplicationComponentGroup;
+import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
 import org.ourproject.kune.platf.client.app.ToolGroup;
 
 import com.calclab.suco.client.ioc.module.AbstractModule;
@@ -29,5 +30,6 @@
     public void onInstall() {
         registerDecorator(ApplicationComponentGroup.class, new ApplicationComponentGroup(container));
         registerDecorator(ToolGroup.class, new ToolGroup(container));
+        registerDecorator(EntityOptionsGroup.class, new EntityOptionsGroup(container));
     }
 }

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-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -506,7 +506,7 @@
             public ContextPropEditor create() {
                 final ContextPropEditorPresenter presenter = new ContextPropEditorPresenter($(Session.class),
                         $(StateManager.class), $(ContentCapabilitiesRegistry.class), $$(TagsSummary.class),
-                        $$(ContentServiceAsync.class), $(EntityTitle.class), $(EntitySubTitle.class));
+                        $$(ContentServiceAsync.class), $(EntitySubTitle.class));
                 final ContextPropEditorView view = new ContextPropEditorPanel(presenter,
                         $(I18nUITranslationService.class), $(WorkspaceSkeleton.class), $$(LanguageSelector.class),
                         $(Images.class));

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-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneWorkspaceModule.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -27,6 +27,7 @@
 import org.ourproject.kune.platf.client.actions.toolbar.ActionGroupSummaryToolbar;
 import org.ourproject.kune.platf.client.actions.toolbar.ActionParticipationToolbar;
 import org.ourproject.kune.platf.client.app.ApplicationComponentGroup;
+import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
 import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
 import org.ourproject.kune.platf.client.registry.RenamableRegistry;
 import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
@@ -52,6 +53,12 @@
 import org.ourproject.kune.workspace.client.nohomepage.NoHomePage;
 import org.ourproject.kune.workspace.client.nohomepage.NoHomePagePanel;
 import org.ourproject.kune.workspace.client.nohomepage.NoHomePagePresenter;
+import org.ourproject.kune.workspace.client.options.EntityOptions;
+import org.ourproject.kune.workspace.client.options.EntityOptionsPanel;
+import org.ourproject.kune.workspace.client.options.EntityOptionsPresenter;
+import org.ourproject.kune.workspace.client.options.EntityOptionsToolsConf;
+import org.ourproject.kune.workspace.client.options.EntityOptionsToolsConfPanel;
+import org.ourproject.kune.workspace.client.options.EntityOptionsToolsConfPresenter;
 import org.ourproject.kune.workspace.client.search.GroupLiveSearcher;
 import org.ourproject.kune.workspace.client.search.SiteSearcher;
 import org.ourproject.kune.workspace.client.site.Site;
@@ -273,10 +280,9 @@
         register(ApplicationComponentGroup.class, new Factory<EntityTitle>(EntityTitle.class) {
             @Override
             public EntityTitle create() {
-                final EntityTitlePresenter presenter = new EntityTitlePresenter($(I18nUITranslationService.class),
-                        $(KuneErrorHandler.class), $(StateManager.class), $(Session.class),
-                        $$(ContentServiceAsync.class), $$(ContextNavigator.class), $(ContentIconsRegistry.class),
-                        $(RenamableRegistry.class));
+                final EntityTitlePresenter presenter = new EntityTitlePresenter($(KuneErrorHandler.class),
+                        $(StateManager.class), $(Session.class), $$(ContentServiceAsync.class),
+                        $$(ContextNavigator.class), $(ContentIconsRegistry.class), $(RenamableRegistry.class));
                 final EntityTitlePanel panel = new EntityTitlePanel($(WorkspaceSkeleton.class), presenter);
                 presenter.init(panel);
                 return presenter;
@@ -287,7 +293,7 @@
             @Override
             public EntitySubTitle create() {
                 final EntitySubTitlePresenter presenter = new EntitySubTitlePresenter(
-                        $(I18nUITranslationService.class), $(StateManager.class), false);
+                        $(I18nUITranslationService.class), $(StateManager.class), $(Session.class), false);
                 final EntitySubTitlePanel panel = new EntitySubTitlePanel(presenter, $(WorkspaceSkeleton.class));
                 presenter.init(panel);
                 return presenter;
@@ -412,5 +418,29 @@
             }
         });
 
+        register(ApplicationComponentGroup.class, new Factory<EntityOptions>(EntityOptions.class) {
+            @Override
+            public EntityOptions create() {
+                final EntityOptionsPresenter presenter = new EntityOptionsPresenter($(StateManager.class));
+                final EntityOptionsPanel panel = new EntityOptionsPanel(presenter, $(WorkspaceSkeleton.class),
+                        $(I18nTranslationService.class), $(Images.class), $(EntityOptionsGroup.class));
+                presenter.init(panel);
+                return presenter;
+            }
+        });
+
+        register(EntityOptionsGroup.class, new Factory<EntityOptionsToolsConf>(EntityOptionsToolsConf.class) {
+            @Override
+            public EntityOptionsToolsConf create() {
+                final EntityOptionsToolsConfPresenter presenter = new EntityOptionsToolsConfPresenter(
+                        $(StateManager.class), $(Session.class), $(I18nTranslationService.class),
+                        $(EntityOptions.class), $$(GroupServiceAsync.class));
+                final EntityOptionsToolsConfPanel panel = new EntityOptionsToolsConfPanel(presenter,
+                        $(WorkspaceSkeleton.class), $(I18nTranslationService.class));
+                presenter.init(panel);
+                return presenter;
+            }
+        });
+
     }
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -37,6 +37,7 @@
  *
  */package org.ourproject.kune.platf.client.state;
 
+import java.util.Collection;
 import java.util.List;
 
 import org.ourproject.kune.platf.client.dto.I18nCountryDTO;
@@ -48,6 +49,7 @@
 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.dto.ToolSimpleDTO;
 import org.ourproject.kune.platf.client.dto.UserInfoDTO;
 import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
 import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
@@ -84,6 +86,8 @@
 
     String getGalleryPermittedExtensions();
 
+    Collection<ToolSimpleDTO> getGroupTools();
+
     List<I18nLanguageSimpleDTO> getLanguages();
 
     Object[][] getLanguagesArray();
@@ -94,6 +98,8 @@
 
     String getUserHash();
 
+    Collection<ToolSimpleDTO> getUserTools();
+
     boolean isLogged();
 
     void onInitDataReceived(Listener<InitDataDTO> listener);

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionDefault.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -19,6 +19,7 @@
  */
 package org.ourproject.kune.platf.client.state;
 
+import java.util.Collection;
 import java.util.List;
 
 import org.ourproject.kune.platf.client.dto.I18nCountryDTO;
@@ -30,6 +31,7 @@
 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.dto.ToolSimpleDTO;
 import org.ourproject.kune.platf.client.dto.UserInfoDTO;
 import org.ourproject.kune.platf.client.dto.UserSimpleDTO;
 import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
@@ -113,6 +115,10 @@
         return initData.getGalleryPermittedExtensions();
     }
 
+    public Collection<ToolSimpleDTO> getGroupTools() {
+        return initData.getGroupTools();
+    }
+
     public List<I18nLanguageSimpleDTO> getLanguages() {
         return initData.getLanguages();
     }
@@ -139,6 +145,10 @@
         return userHash;
     }
 
+    public Collection<ToolSimpleDTO> getUserTools() {
+        return initData.getUserTools();
+    }
+
     public boolean isLogged() {
         return userHash != null;
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -22,6 +22,7 @@
 import com.gwtext.client.widgets.form.Field;
 import com.gwtext.client.widgets.form.FieldSet;
 import com.gwtext.client.widgets.form.FormPanel;
+import com.gwtext.client.widgets.form.Label;
 
 public class DefaultForm {
 
@@ -43,6 +44,11 @@
         form.setHeader(false);
     }
 
+    public DefaultForm(String title) {
+        this();
+        form.setTitle(title);
+    }
+
     public void add(final Field field) {
         form.add(field);
     }
@@ -51,10 +57,18 @@
         form.add(fieldset);
     }
 
+    public void add(Label label) {
+        form.add(label);
+    }
+
     public void addStyleName(final String cls) {
         form.addStyleName(cls);
     }
 
+    public Field findField(String id) {
+        return form.getForm().findField(id);
+    }
+
     public FormPanel getForm() {
         return form;
     }
@@ -79,6 +93,10 @@
         form.setAutoWidth(autoWidth);
     }
 
+    public void setHeight(int height) {
+        form.setHeight(height);
+    }
+
     public void setWidth(int width) {
         form.setWidth(width);
     }
@@ -89,5 +107,4 @@
             field.validate();
         }
     }
-
 }

Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/emblem-system.gif
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/emblem-system.gif
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/emblem-system.png
===================================================================
(Binary files differ)


Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/emblem-system.png
___________________________________________________________________
Name: svn:mime-type
   + application/octet-stream

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/InitData.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -19,7 +19,7 @@
  */
 package org.ourproject.kune.platf.server;
 
-import java.util.Collection;
+import java.util.ArrayList;
 import java.util.List;
 
 import org.ourproject.kune.platf.server.domain.I18nCountry;
@@ -43,8 +43,8 @@
     private String siteLogoUrl;
     private String galleryPermittedExtensions;
     private String maxFileSizeInMb;
-    private Collection<ToolSimple> userTools;
-    private Collection<ToolSimple> groupTools;
+    private ArrayList<ToolSimple> userTools;
+    private ArrayList<ToolSimple> groupTools;
 
     public String getChatDomain() {
         return chatDomain;
@@ -70,7 +70,7 @@
         return galleryPermittedExtensions;
     }
 
-    public Collection<ToolSimple> getGroupTools() {
+    public ArrayList<ToolSimple> getGroupTools() {
         return groupTools;
     }
 
@@ -102,7 +102,7 @@
         return userInfo;
     }
 
-    public Collection<ToolSimple> getUserTools() {
+    public ArrayList<ToolSimple> getUserTools() {
         return userTools;
     }
 
@@ -134,7 +134,7 @@
         this.galleryPermittedExtensions = galleryPermittedExtensions;
     }
 
-    public void setGroupTools(Collection<ToolSimple> groupTools) {
+    public void setGroupTools(ArrayList<ToolSimple> groupTools) {
         this.groupTools = groupTools;
     }
 
@@ -166,7 +166,7 @@
         this.userInfo = currentUserInfo;
     }
 
-    public void setUserTools(Collection<ToolSimple> userTools) {
+    public void setUserTools(ArrayList<ToolSimple> userTools) {
         this.userTools = userTools;
     }
 

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/GroupManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/GroupManager.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/GroupManager.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -69,4 +69,6 @@
 
     void setGroupLogo(Group group, Content content);
 
+    void setToolEnabled(User userLogged, String groupShortName, String toolName, boolean enabled);
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/GroupManagerDefault.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/GroupManagerDefault.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/GroupManagerDefault.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -43,6 +43,7 @@
 import org.ourproject.kune.platf.server.domain.GroupListMode;
 import org.ourproject.kune.platf.server.domain.License;
 import org.ourproject.kune.platf.server.domain.SocialNetwork;
+import org.ourproject.kune.platf.server.domain.ToolConfiguration;
 import org.ourproject.kune.platf.server.domain.User;
 import org.ourproject.kune.platf.server.manager.GroupManager;
 import org.ourproject.kune.platf.server.properties.DatabaseProperties;
@@ -159,15 +160,15 @@
         return finder.findEnabledTools(id);
     }
 
+    public Group getGroupOfUserWithId(final Long userId) {
+        return userId != null ? find(User.class, userId).getUserGroup() : null;
+    }
+
     public Group getSiteDefaultGroup() {
         final String shortName = properties.getDefaultSiteShortName();
         return findByShortName(shortName);
     }
 
-    public Group getGroupOfUserWithId(final Long userId) {
-        return userId != null ? find(User.class, userId).getUserGroup() : null;
-    }
-
     public SearchResult<Group> search(final String search) {
         return this.search(search, null, null);
     }
@@ -197,6 +198,15 @@
         }
     }
 
+    public void setToolEnabled(User userLogged, String groupShortName, String tool, boolean enabled) {
+        final Group group = findByShortName(groupShortName);
+        ToolConfiguration toolConfiguration = group.getToolConfiguration(tool);
+        if (toolConfiguration == null) {
+            toolConfiguration = serverToolRegistry.get(tool).initGroup(userLogged, group).getToolConfiguration(tool);
+        }
+        toolConfiguration.setEnabled(enabled);
+    }
+
     private void initGroup(final User user, final Group group, Collection<String> toolsToEnable)
             throws GroupNameInUseException {
         try {

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/GroupRPC.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -65,18 +65,16 @@
     @Transactional(type = TransactionType.READ_WRITE)
     public void changeGroupWsTheme(final String userHash, final StateToken groupToken, final String theme)
             throws DefaultException {
-        final UserSession userSession = getUserSession();
-        final User user = userSession.getUser();
+        final User user = getUserLogged();
         final Group group = groupManager.findByShortName(groupToken.getGroup());
         groupManager.changeWsTheme(user, group, theme);
-    };
+    }
 
     @Authenticated
     @Transactional(type = TransactionType.READ_WRITE, rollbackOn = DefaultException.class)
     public StateToken createNewGroup(final String userHash, final GroupDTO groupDTO, String publicDesc, String tags,
             String[] enabledTools) throws DefaultException {
-        final UserSession userSession = getUserSession();
-        final User user = userSession.getUser();
+        final User user = getUserLogged();
         final Group group = mapper.map(groupDTO, Group.class);
         final Group newGroup = groupManager.createGroup(group, user);
         final Long defContentId = newGroup.getDefaultContent().getId();
@@ -90,7 +88,7 @@
     public GroupDTO getGroup(String userHash, StateToken groupToken) {
         final Group group = groupManager.findByShortName(groupToken.getGroup());
         return mapper.map(group, GroupDTO.class);
-    }
+    };
 
     @Authenticated
     @Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
@@ -111,6 +109,20 @@
         group.getSocialNetwork().setVisibility(SocialNetworkVisibility.valueOf(visibility.toString()));
     }
 
+    @Authenticated
+    @Authorizated(actionLevel = ActionLevel.group, accessRolRequired = AccessRol.Administrator)
+    @Transactional(type = TransactionType.READ_WRITE)
+    public void setToolEnabled(final String userHash, final StateToken groupToken, final String toolName,
+            final boolean enabled) {
+        groupManager.setToolEnabled(getUserLogged(), groupToken.getGroup(), toolName, enabled);
+    }
+
+    private User getUserLogged() {
+        final UserSession userSession = getUserSession();
+        final User user = userSession.getUser();
+        return user;
+    }
+
     private UserSession getUserSession() {
         return userSessionProvider.get();
     }

Modified: trunk/src/main/java/org/ourproject/kune/platf/server/tool/ServerToolRegistry.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/tool/ServerToolRegistry.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/tool/ServerToolRegistry.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -35,8 +35,6 @@
     public static Collection<String> emptyToolList = new ArrayList<String>();
 
     private final HashMap<String, ServerTool> tools;
-    // private final List<ToolSimple> toolsForGroupsList;
-    // private final List<ToolSimple> toolsForUsersList;
     private final HashMap<String, ToolSimple> toolsForUsersMap;
     private final HashMap<String, ToolSimple> toolsForGroupsMap;
 
@@ -44,8 +42,6 @@
         tools = new HashMap<String, ServerTool>();
         toolsForUsersMap = new HashMap<String, ToolSimple>();
         toolsForGroupsMap = new HashMap<String, ToolSimple>();
-        // toolsForGroupsList = new ArrayList<ToolSimple>();
-        // toolsForUsersList = new ArrayList<ToolSimple>();
     }
 
     public Collection<ServerTool> all() {
@@ -56,13 +52,8 @@
         return tools.get(toolName);
     }
 
-    //
-    // public List<ToolSimple> getToolsForGroupsList() {
-    // return toolsForGroupsList;
-    // }
-
-    public Collection<ToolSimple> getToolsForGroups() {
-        return toolsForGroupsMap.values();
+    public ArrayList<ToolSimple> getToolsForGroups() {
+        return new ArrayList<ToolSimple>(toolsForGroupsMap.values());
     }
 
     public Collection<String> getToolsForGroupsKeys() {
@@ -73,14 +64,10 @@
         return toolsForUsersMap.keySet();
     }
 
-    public Collection<ToolSimple> getToolsForUsers() {
-        return toolsForUsersMap.values();
+    public ArrayList<ToolSimple> getToolsForUsers() {
+        return new ArrayList<ToolSimple>(toolsForUsersMap.values());
     }
 
-    // public List<ToolSimple> getToolsForUsersList() {
-    // return toolsForUsersList;
-    // }
-
     public void register(final ServerTool tool) {
         String name = tool.getName();
         String rootName = tool.getRootName();
@@ -90,13 +77,11 @@
             toolsForGroupsMap.put(name, new ToolSimple(name, rootName));
             break;
         case forUsers:
-            // toolsForUsersList.add(new ToolSimple(name, rootName));
             toolsForUsersMap.put(name, new ToolSimple(name, rootName));
             break;
         case forBoth:
             toolsForGroupsMap.put(name, new ToolSimple(name, rootName));
             toolsForUsersMap.put(name, new ToolSimple(name, rootName));
-            // toolsForUsersList.add(new ToolSimple(name, rootName));
             break;
         }
     }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPresenter.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cxt/ContextPropEditorPresenter.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -36,7 +36,6 @@
 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;
 
@@ -47,20 +46,17 @@
     private final Provider<TagsSummary> tagsSummaryProvider;
     private final Provider<ContentServiceAsync> contentServiceProvider;
     private final EntitySubTitle entitySubTitle;
-    private final EntityTitle entityTitle;
     private final StateManager stateManager;
     private final ContentCapabilitiesRegistry capabilitiesRegistry;
 
     public ContextPropEditorPresenter(final Session session, final StateManager stateManager,
             ContentCapabilitiesRegistry capabilitiesRegistry, final Provider<TagsSummary> tagsSummaryProvider,
-            final Provider<ContentServiceAsync> contentServiceProvider, final EntityTitle entityTitle,
-            final EntitySubTitle entitySubTitle) {
+            final Provider<ContentServiceAsync> contentServiceProvider, final EntitySubTitle entitySubTitle) {
         this.session = session;
         this.stateManager = stateManager;
         this.capabilitiesRegistry = capabilitiesRegistry;
         this.tagsSummaryProvider = tagsSummaryProvider;
         this.contentServiceProvider = contentServiceProvider;
-        this.entityTitle = entityTitle;
         this.entitySubTitle = entitySubTitle;
     }
 
@@ -107,7 +103,6 @@
                 new AsyncCallbackSimple<I18nLanguageDTO>() {
                     public void onSuccess(final I18nLanguageDTO lang) {
                         Site.hideProgress();
-                        entitySubTitle.setContentLanguage(lang.getEnglishName());
                     }
                 });
     }
@@ -123,7 +118,7 @@
                 new AsyncCallbackSimple<Object>() {
                     public void onSuccess(final Object result) {
                         Site.hideProgress();
-                        entityTitle.setContentDate(publishedOn);
+                        entitySubTitle.setContentDate(publishedOn);
                     }
                 });
     }

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsPanel.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -0,0 +1,97 @@
+package org.ourproject.kune.workspace.client.options;
+
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
+import org.ourproject.kune.platf.client.ui.dialogs.MessageToolbar;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+
+import com.gwtext.client.widgets.Panel;
+import com.gwtext.client.widgets.TabPanel;
+
+public abstract class AbstractOptionsPanel {
+    private BasicDialog dialog;
+    private MessageToolbar messageErrorBar;
+    private TabPanel tabPanel;
+    private final String title;
+    private final int width;
+    private final int height;
+    private final int minWidth;
+    private final int minHeight;
+    private final Images images;
+    private final String errorLabelId;
+    private String iconCls;
+
+    public AbstractOptionsPanel(String title, int width, int height, int minWidth, int minHeight, Images images,
+            String errorLabelId) {
+        this.title = title;
+        this.width = width;
+        this.height = height;
+        this.minWidth = minWidth;
+        this.minHeight = minHeight;
+        this.images = images;
+        this.errorLabelId = errorLabelId;
+    }
+
+    public void addTab(Panel newTab) {
+        createDialogIfNecessary();
+        tabPanel.add(newTab);
+    }
+
+    public void doLayoutIfNeeded() {
+        if (dialog.isRendered()) {
+            dialog.doLayout(false);
+        }
+    }
+
+    public void hide() {
+        createDialogIfNecessary();
+        dialog.hide();
+    }
+
+    public void hideMessages() {
+        messageErrorBar.hideErrorMessage();
+    }
+
+    public boolean isVisible() {
+        createDialogIfNecessary();
+        return dialog.isVisible();
+    }
+
+    public void setErrorMessage(final String message, final SiteErrorType type) {
+        messageErrorBar.setErrorMessage(message, type);
+    }
+
+    public void setFirstTabActive() {
+        tabPanel.setActiveTab(1);
+    }
+
+    public void setIconCls(String iconCls) {
+        this.iconCls = iconCls;
+        if (dialog != null) {
+            dialog.setIconCls(iconCls);
+        }
+    }
+
+    public void show() {
+        createDialogIfNecessary();
+        dialog.show();
+    }
+
+    private void createDialog() {
+        dialog = new BasicDialog(title, false, true, width, height, minWidth, minHeight);
+        messageErrorBar = new MessageToolbar(images, errorLabelId);
+        dialog.setBottomToolbar(messageErrorBar.getToolbar());
+        tabPanel = new TabPanel();
+        tabPanel.setBorder(false);
+        dialog.add(tabPanel);
+        if (iconCls != null) {
+            dialog.setIconCls(iconCls);
+        }
+    }
+
+    private void createDialogIfNecessary() {
+        if (dialog == null) {
+            createDialog();
+        }
+    }
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsView.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/AbstractOptionsView.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -0,0 +1,11 @@
+package org.ourproject.kune.workspace.client.options;
+
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+
+public interface AbstractOptionsView {
+
+    void hideMessages();
+
+    void setErrorMessage(final String message, final SiteErrorType type);
+
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptions.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptions.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -0,0 +1,9 @@
+package org.ourproject.kune.workspace.client.options;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface EntityOptions extends AbstractOptionsView {
+
+    void addOptionTab(View view);
+
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPanel.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -0,0 +1,71 @@
+package org.ourproject.kune.workspace.client.options;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.app.EntityOptionsGroup;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.Images;
+import org.ourproject.kune.platf.client.ui.KuneUiUtils;
+import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
+import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.google.gwt.user.client.ui.ClickListener;
+import com.google.gwt.user.client.ui.PushButton;
+import com.google.gwt.user.client.ui.Widget;
+import com.gwtext.client.widgets.Panel;
+
+public class EntityOptionsPanel extends AbstractOptionsPanel implements EntityOptionsView {
+
+    public static final String GROUP_OPTIONS_ERROR_ID = "gop-err-mess";
+    private final I18nTranslationService i18n;
+    private final WorkspaceSkeleton ws;
+    private PushButton optionsButton;
+    private final Images images;
+    private final EntityOptionsGroup entityPreferencesGroup;
+
+    public EntityOptionsPanel(final EntityOptionsPresenter presenter, final WorkspaceSkeleton ws,
+            I18nTranslationService i18n, Images images, EntityOptionsGroup entityOptionsGroup) {
+        super(i18n.t("Group options"), 400, 250, 400, 250, images, GROUP_OPTIONS_ERROR_ID);
+        this.ws = ws;
+        this.i18n = i18n;
+        this.images = images;
+        this.entityPreferencesGroup = entityOptionsGroup;
+        super.setIconCls("k-options-icon");
+        createOptionsButton();
+    }
+
+    public void addOptionTab(View view) {
+        if (view instanceof Panel) {
+            super.addTab((Panel) view);
+        } else if (view instanceof DefaultForm) {
+            super.addTab(((DefaultForm) view).getForm());
+        } else {
+            Log.error("Programatic error: Unexpected element added to GroupOptions");
+        }
+        doLayoutIfNeeded();
+    }
+
+    public void setButtonVisible(boolean visible) {
+        optionsButton.setVisible(visible);
+    }
+
+    private void createOptionsButton() {
+        optionsButton = new PushButton(images.emblemSystem().createImage(), new ClickListener() {
+            public void onClick(Widget arg0) {
+                if (isVisible()) {
+                    hide();
+                } else {
+                    entityPreferencesGroup.createAll();
+                    show();
+                    setFirstTabActive();
+                }
+            }
+        });
+        KuneUiUtils.setQuickTip(optionsButton, i18n.t("Show/hide the group options dialog"));
+
+        optionsButton.addStyleName("kune-Margin-Medium-r");
+        final SimpleToolbar wsTitle = ws.getEntityWorkspace().getTitleComponent();
+        wsTitle.add(optionsButton);
+    }
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPresenter.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsPresenter.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -0,0 +1,45 @@
+package org.ourproject.kune.workspace.client.options;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.newgroup.SiteErrorType;
+
+import com.calclab.suco.client.listener.Listener;
+
+public class EntityOptionsPresenter implements EntityOptions {
+
+    private EntityOptionsView view;
+
+    public EntityOptionsPresenter(StateManager stateManager) {
+        stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
+            public void onEvent(StateAbstractDTO parameter) {
+                if (parameter.getGroupRights().isAdministrable()) {
+                    view.setButtonVisible(true);
+                } else {
+                    view.setButtonVisible(false);
+                }
+            }
+        });
+    }
+
+    public void addOptionTab(View tab) {
+        view.addOptionTab(tab);
+    }
+
+    public View getView() {
+        return view;
+    }
+
+    public void hideMessages() {
+        view.hideMessages();
+    }
+
+    public void init(EntityOptionsView view) {
+        this.view = view;
+    }
+
+    public void setErrorMessage(String message, SiteErrorType type) {
+        view.setErrorMessage(message, type);
+    }
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConf.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConf.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConf.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -0,0 +1,5 @@
+package org.ourproject.kune.workspace.client.options;
+
+public interface EntityOptionsToolsConf {
+
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConfPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConfPanel.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConfPanel.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -0,0 +1,93 @@
+package org.ourproject.kune.workspace.client.options;
+
+import java.util.HashMap;
+
+import org.ourproject.kune.platf.client.dto.ToolSimpleDTO;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.ui.dialogs.DefaultForm;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+import com.allen_sauer.gwt.log.client.Log;
+import com.gwtext.client.widgets.ToolTip;
+import com.gwtext.client.widgets.form.Checkbox;
+import com.gwtext.client.widgets.form.Hidden;
+import com.gwtext.client.widgets.form.Label;
+import com.gwtext.client.widgets.form.event.CheckboxListenerAdapter;
+
+public class EntityOptionsToolsConfPanel extends DefaultForm implements EntityOptionsToolsConfView {
+
+    private final EntityOptionsToolsConfPresenter presenter;
+    private final HashMap<String, Checkbox> fields;
+    private final I18nTranslationService i18n;
+
+    public EntityOptionsToolsConfPanel(final EntityOptionsToolsConfPresenter presenter, final WorkspaceSkeleton ws,
+            I18nTranslationService i18n) {
+        super(i18n.t("Tools"));
+        this.i18n = i18n;
+        super.setAutoWidth(true);
+        super.setAutoHeight(true);
+        super.add(new Hidden());
+        super.getForm().setLabelWidth(20);
+        this.presenter = presenter;
+        fields = new HashMap<String, Checkbox>();
+    }
+
+    public void add(final ToolSimpleDTO tool) {
+        Checkbox checkbox = new Checkbox(tool.getRootName(), new CheckboxListenerAdapter() {
+            @Override
+            public void onCheck(Checkbox field, boolean checked) {
+                presenter.onCheck(tool, checked);
+            }
+        });
+        checkbox.setChecked(false);
+        super.add(checkbox);
+        fields.put(tool.getName(), checkbox);
+        doLayoutIfNeeded();
+    }
+
+    public void clear() {
+        super.getForm().removeAll(true);
+        fields.clear();
+        Label label = new Label();
+        label.setHtml(i18n.t("Here you can select the tools used in this group:") + "<br/><br/>");
+        super.add(label);
+    }
+
+    public void setChecked(String tool, boolean checked) {
+        Checkbox field = getTool(tool);
+        field.setValue(checked);
+    }
+
+    public void setEnabled(String tool, boolean enabled) {
+        Checkbox field = getTool(tool);
+        if (enabled) {
+            field.enable();
+        } else {
+            field.disable();
+        }
+    }
+
+    public void setTooltip(String tool, String tip) {
+        Checkbox field = getTool(tool);
+        ToolTip tooltip = new ToolTip();
+        tooltip.setHtml(tip);
+        tooltip.setWidth(250);
+        tooltip.applyTo(field);
+        field.setTitle(tip);
+        doLayoutIfNeeded();
+    }
+
+    private void doLayoutIfNeeded() {
+        if (super.getForm().isRendered()) {
+            super.getForm().doLayout();
+        }
+    }
+
+    private Checkbox getTool(String tool) {
+        Checkbox field = fields.get(tool);
+        if (field == null) {
+            Log.error("Field " + tool + " not found in EOTCP");
+        }
+        return field;
+    }
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConfPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConfPresenter.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConfPresenter.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -0,0 +1,116 @@
+package org.ourproject.kune.workspace.client.options;
+
+import java.util.Collection;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
+import org.ourproject.kune.platf.client.dto.ToolSimpleDTO;
+import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+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.newgroup.SiteErrorType;
+
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.listener.Listener2;
+import com.google.gwt.user.client.rpc.AsyncCallback;
+
+public class EntityOptionsToolsConfPresenter implements EntityOptionsToolsConf {
+
+    private EntityOptionsToolsConfView view;
+    private final Session session;
+    private final EntityOptions entityOptions;
+    private final Provider<GroupServiceAsync> groupServiceProvider;
+    private final I18nTranslationService i18n;
+    private final StateManager stateManager;
+
+    public EntityOptionsToolsConfPresenter(StateManager stateManager, Session session, I18nTranslationService i18n,
+            EntityOptions entityOptions, Provider<GroupServiceAsync> groupServiceProvider) {
+        this.stateManager = stateManager;
+        this.session = session;
+        this.i18n = i18n;
+        this.entityOptions = entityOptions;
+        this.groupServiceProvider = groupServiceProvider;
+        stateManager.onGroupChanged(new Listener2<String, String>() {
+            public void onEvent(String group1, String group2) {
+                setState();
+            }
+        });
+    }
+
+    public View getView() {
+        return view;
+    }
+
+    public void init(EntityOptionsToolsConfView view) {
+        this.view = view;
+        setState();
+        entityOptions.addOptionTab(view);
+    }
+
+    public void onCheck(ToolSimpleDTO tool, boolean checked) {
+        StateAbstractDTO state = session.getCurrentState();
+        String toolName = tool.getName();
+        if (checked) {
+            if (!(state.getEnabledTools().contains(toolName))) {
+                // Log.info("Tool " + tool.getName() + " checked: " + checked +
+                // " enabled tools: "
+                // + state.getEnabledTools().toString());
+                setToolCheckedInServer(checked, toolName);
+            } else {
+                // do nothing
+            }
+        } else {
+            if (state.getEnabledTools().contains(tool.getName())) {
+                // Log.info("Tool " + tool.getName() + " checked: " + checked);
+                setToolCheckedInServer(checked, toolName);
+                if (session.getCurrentStateToken().getTool().equals(toolName)) {
+                    stateManager.gotoToken(session.getCurrentState().getGroup().getDefaultContent().getStateToken());
+                }
+            }
+        }
+    }
+
+    private void reset() {
+        // TODO Auto-generated method stub
+        view.clear();
+        entityOptions.hideMessages();
+    }
+
+    private void setState() {
+        StateAbstractDTO state = session.getCurrentState();
+        reset();
+        Collection<ToolSimpleDTO> toolCollection;
+        if (state.getGroup().isPersonalGroup()) {
+            toolCollection = session.getUserTools();
+        } else {
+            toolCollection = session.getGroupTools();
+        }
+        for (ToolSimpleDTO tool : toolCollection) {
+            view.add(tool);
+            view.setEnabled(tool.getName(), true);
+        }
+        for (String tool : state.getEnabledTools()) {
+            view.setChecked(tool, true);
+        }
+        String defContentTool = session.getCurrentState().getGroup().getDefaultContent().getStateToken().getTool();
+        view.setEnabled(defContentTool, false);
+        view.setTooltip(
+                defContentTool,
+                i18n.t("You cannot disable this tool because it's where the current group home page is located. To do that you have to select other content as the default group home page but in another tool."));
+    }
+
+    private void setToolCheckedInServer(final boolean checked, final String toolName) {
+        groupServiceProvider.get().setToolEnabled(session.getUserHash(), session.getCurrentStateToken(), toolName,
+                checked, new AsyncCallback<Object>() {
+                    public void onFailure(Throwable caught) {
+                        view.setChecked(toolName, !checked);
+                        entityOptions.setErrorMessage(i18n.t("Error configuring the tool"), SiteErrorType.error);
+                    }
+
+                    public void onSuccess(Object result) {
+                        stateManager.reload();
+                    }
+                });
+    }
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConfView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConfView.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsToolsConfView.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -0,0 +1,17 @@
+package org.ourproject.kune.workspace.client.options;
+
+import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.ToolSimpleDTO;
+
+public interface EntityOptionsToolsConfView extends View {
+
+    void add(ToolSimpleDTO tool);
+
+    void clear();
+
+    void setChecked(String tool, boolean checked);
+
+    void setEnabled(String tool, boolean enabled);
+
+    void setTooltip(String tool, String tip);
+}

Added: trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsView.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/options/EntityOptionsView.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -0,0 +1,10 @@
+package org.ourproject.kune.workspace.client.options;
+
+import org.ourproject.kune.platf.client.View;
+
+public interface EntityOptionsView extends View, AbstractOptionsView {
+
+    void addOptionTab(View tab);
+
+    void setButtonVisible(boolean visible);
+}

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitle.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitle.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitle.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -18,8 +18,10 @@
  *
  */package org.ourproject.kune.workspace.client.title;
 
+import java.util.Date;
+
 public interface EntitySubTitle {
 
-    void setContentLanguage(String langName);
+    void setContentDate(Date publishedOn);
 
 }

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-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePresenter.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -19,24 +19,30 @@
  */
 package org.ourproject.kune.workspace.client.title;
 
+import java.util.Date;
+
 import org.ourproject.kune.platf.client.View;
 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.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
 
 import com.calclab.suco.client.listener.Listener;
+import com.google.gwt.i18n.client.DateTimeFormat;
 
 public class EntitySubTitlePresenter implements EntitySubTitle {
 
     private EntitySubTitleView view;
     private final I18nTranslationService i18n;
     private final boolean showLanguage;
+    private final Session session;
 
-    public EntitySubTitlePresenter(final I18nTranslationService i18n, final StateManager stateManager,
+    public EntitySubTitlePresenter(final I18nTranslationService i18n, final StateManager stateManager, Session session,
             boolean showLanguage) {
         this.i18n = i18n;
+        this.session = session;
         this.showLanguage = showLanguage;
         stateManager.onStateChanged(new Listener<StateAbstractDTO>() {
             public void onEvent(final StateAbstractDTO state) {
@@ -60,12 +66,35 @@
         this.view = view;
     }
 
+    public void setContentDate(final Date publishedOn) {
+        if (publishedOn != null) {
+            String dateFormat = session.getCurrentLanguage().getDateFormat();
+            final DateTimeFormat fmt;
+            if (dateFormat == null) {
+                fmt = DateTimeFormat.getFormat("M/d/yyyy h:mm a");
+            } else {
+                String abrevMonthInEnglish = DateTimeFormat.getFormat("MMM").format(publishedOn);
+                String monthToTranslate = abrevMonthInEnglish + " [%NT abbreviated month]";
+                dateFormat = dateFormat.replaceFirst("MMM", "'" + i18n.t(monthToTranslate) + "'");
+                fmt = DateTimeFormat.getFormat(dateFormat + " h:mm a");
+            }
+            view.setContentSubTitleRight(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
+            setContentDateVisible(true);
+        } else {
+            setContentDateVisible(false);
+        }
+    }
+
     public void setContentLanguage(final String langName) {
         if (showLanguage) {
             view.setContentSubTitleRight(i18n.t("Language: [%s]", langName));
         }
     }
 
+    private void setContentDateVisible(final boolean visible) {
+        view.setContentSubTitleRightVisible(visible);
+    }
+
     private void setLanguage(final StateContainerDTO state) {
         if (state.getLanguage() != null && showLanguage) {
             final String langName = state.getLanguage().getEnglishName();
@@ -77,8 +106,9 @@
     }
 
     private void setState(final StateContainerDTO state) {
-        view.setContentSubTitleLeftVisible(false);
+        view.setContentSubTitleRightVisible(false);
         setLanguage(state);
+        setContentDateVisible(false);
     }
 
     private void setState(final StateContentDTO state) {
@@ -86,6 +116,8 @@
                 state.getAuthors().get(0).getName()));
         view.setContentSubTitleLeftVisible(true);
         setLanguage(state);
+        Date publishedOn = state.getPublishedOn();
+        setContentDate(publishedOn);
     }
 
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitleView.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitleView.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -25,9 +25,10 @@
 
     void setContentSubTitleLeft(String subTitle);
 
+    void setContentSubTitleLeftVisible(boolean visible);
+
     void setContentSubTitleRight(String subTitle);
 
-    void setContentSubTitleLeftVisible(boolean visible);
+    void setContentSubTitleRightVisible(boolean visible);
 
-    void setContentSubTitleRightVisible(boolean visible);
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitle.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitle.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitle.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -18,12 +18,9 @@
  *
  */package org.ourproject.kune.workspace.client.title;
 
-import java.util.Date;
 
 public interface EntityTitle {
 
-    void setContentDate(Date publishedOn);
-
     void setContentTitle(String title);
 
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -25,12 +25,10 @@
 import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
 
 import com.google.gwt.user.client.ui.Image;
-import com.google.gwt.user.client.ui.Label;
 
 public class EntityTitlePanel implements EntityTitleView {
     public static final String ENTITY_TITLE_RIGHT_TITLE = "k-entity-title-title";
     private final EditableIconLabel titleLabel;
-    private final Label dateLabel;
     private final Image icon;
 
     public EntityTitlePanel(final WorkspaceSkeleton ws, final EntityTitlePresenter presenter) {
@@ -40,20 +38,16 @@
                 presenter.onTitleRename(text);
             }
         });
-        dateLabel = new Label();
 
         final SimpleToolbar wsTitle = ws.getEntityWorkspace().getTitleComponent();
         wsTitle.add(icon);
         wsTitle.add(titleLabel);
         wsTitle.addFill();
-        wsTitle.add(dateLabel);
+        // wsTitle.add(dateLabel);
         icon.addStyleName("kune-Margin-Large-l");
         titleLabel.addStyleName("kune-Margin-Medium-l");
         titleLabel.addStyleName("kune-ft17px");
         titleLabel.ensureDebugId(ENTITY_TITLE_RIGHT_TITLE);
-        dateLabel.addStyleName("kune-Margin-Large-r");
-        dateLabel.addStyleName("kune-ft12px");
-        dateLabel.ensureDebugId("k-entity-title-date");
         icon.setVisible(false);
     }
 
@@ -61,10 +55,6 @@
         titleLabel.restoreOldText();
     }
 
-    public void setContentDate(final String date) {
-        dateLabel.setText(date);
-    }
-
     public void setContentIcon(final String iconUrl) {
         icon.setUrl(iconUrl);
     }
@@ -92,8 +82,4 @@
         titleLabel.setVisible(visible);
     }
 
-    public void setDateVisible(final boolean visible) {
-        dateLabel.setVisible(visible);
-    }
-
 }

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-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePresenter.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -19,8 +19,6 @@
  */
 package org.ourproject.kune.workspace.client.title;
 
-import java.util.Date;
-
 import org.ourproject.kune.platf.client.View;
 import org.ourproject.kune.platf.client.actions.ContentIconsRegistry;
 import org.ourproject.kune.platf.client.dto.StateAbstractDTO;
@@ -29,7 +27,6 @@
 import org.ourproject.kune.platf.client.dto.StateToken;
 import org.ourproject.kune.platf.client.registry.RenamableRegistry;
 import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
 import org.ourproject.kune.platf.client.services.KuneErrorHandler;
 import org.ourproject.kune.platf.client.state.Session;
 import org.ourproject.kune.platf.client.state.StateManager;
@@ -38,13 +35,11 @@
 
 import com.calclab.suco.client.ioc.Provider;
 import com.calclab.suco.client.listener.Listener;
-import com.google.gwt.i18n.client.DateTimeFormat;
 import com.google.gwt.user.client.rpc.AsyncCallback;
 
 public class EntityTitlePresenter implements EntityTitle {
 
     private EntityTitleView view;
-    private final I18nTranslationService i18n;
     private final KuneErrorHandler errorHandler;
     private final Provider<ContentServiceAsync> contentServiceProvider;
     private final Session session;
@@ -52,12 +47,10 @@
     private final ContentIconsRegistry iconsRegistry;
     private final RenamableRegistry renamableContentRegistry;
 
-    public EntityTitlePresenter(final I18nTranslationService i18n, final KuneErrorHandler errorHandler,
-            final StateManager stateManager, final Session session,
-            final Provider<ContentServiceAsync> contentServiceProvider,
+    public EntityTitlePresenter(final KuneErrorHandler errorHandler, final StateManager stateManager,
+            final Session session, final Provider<ContentServiceAsync> contentServiceProvider,
             final Provider<ContextNavigator> contextNavigatorProvider, final ContentIconsRegistry iconsRegistry,
             RenamableRegistry renamableContentRegistry) {
-        this.i18n = i18n;
         this.errorHandler = errorHandler;
         this.session = session;
         this.contentServiceProvider = contentServiceProvider;
@@ -73,7 +66,6 @@
                 } else {
                     view.setContentIconVisible(false);
                     view.setContentTitleVisible(false);
-                    view.setDateVisible(false);
                 }
             }
         });
@@ -87,25 +79,6 @@
         this.view = view;
     }
 
-    public void setContentDate(final Date publishedOn) {
-        if (publishedOn != null) {
-            String dateFormat = session.getCurrentLanguage().getDateFormat();
-            final DateTimeFormat fmt;
-            if (dateFormat == null) {
-                fmt = DateTimeFormat.getFormat("M/d/yyyy h:mm a");
-            } else {
-                String abrevMonthInEnglish = DateTimeFormat.getFormat("MMM").format(publishedOn);
-                String monthToTranslate = abrevMonthInEnglish + " [%NT abbreviated month]";
-                dateFormat = dateFormat.replaceFirst("MMM", "'" + i18n.t(monthToTranslate) + "'");
-                fmt = DateTimeFormat.getFormat(dateFormat + " h:mm a");
-            }
-            view.setContentDate(i18n.t("Published on: [%s]", fmt.format(publishedOn)));
-            setContentDateVisible(true);
-        } else {
-            setContentDateVisible(false);
-        }
-    }
-
     /**
      * Used renaming from context
      */
@@ -137,10 +110,6 @@
         Site.hideProgress();
     }
 
-    private void setContentDateVisible(final boolean visible) {
-        view.setDateVisible(visible);
-    }
-
     private void setContentTitle(final String title, final boolean editable) {
         setContentTitle(title);
         view.setContentTitleEditable(editable);
@@ -159,7 +128,6 @@
     private void setState(final StateContainerDTO state) {
         setContentTitle(state.getTitle(), state.getContainerRights().isEditable()
                 && renamableContentRegistry.contains(state.getContainer().getTypeId()));
-        setContentDateVisible(false);
         final String contentTypeIcon = iconsRegistry.getContentTypeIcon(state.getTypeId(), null);
         setIcon(contentTypeIcon);
         view.setContentTitleVisible(true);
@@ -168,8 +136,6 @@
     private void setState(final StateContentDTO state) {
         setContentTitle(state.getTitle(), state.getContentRights().isEditable()
                 && renamableContentRegistry.contains(state.getTypeId()));
-        Date publishedOn = state.getPublishedOn();
-        setContentDate(publishedOn);
         final String contentTypeIcon = iconsRegistry.getContentTypeIcon(state.getTypeId(), state.getMimeType());
         setIcon(contentTypeIcon);
         view.setContentTitleVisible(true);

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitleView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitleView.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitleView.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -25,8 +25,6 @@
 
     void restoreOldTitle();
 
-    void setContentDate(String date);
-
     void setContentIcon(String iconUrl);
 
     void setContentIconVisible(boolean visible);
@@ -37,6 +35,4 @@
 
     void setContentTitleVisible(boolean visible);
 
-    void setDateVisible(boolean visible);
-
 }

Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/site/SiteServiceTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/site/SiteServiceTest.java	2008-12-01 10:07:15 UTC (rev 974)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/site/SiteServiceTest.java	2008-12-01 21:05:52 UTC (rev 975)
@@ -44,6 +44,10 @@
         assertTrue(initData.getCountries().size() > 0);
         assertNotNull(initData.getLanguages().get(0).getCode());
         assertNotNull(initData.getCountries().get(0).getCode());
+        assertNotNull(initData.getGroupTools());
+        assertNotNull(initData.getUserTools());
+        assertTrue(initData.getGroupTools().size() > 0);
+        assertTrue(initData.getUserTools().size() > 0);
     }
 
     private void assertValidLicenseDTOList(final ArrayList<LicenseDTO> licenseList) {




More information about the kune-commits mailing list