[kune-commits] r1354 - in trunk/src/main/java: cc/kune/core/client/sn cc/kune/gspace/client cc/kune/gspace/client/resources cc/kune/gspace/client/tool cc/kune/gspace/client/viewers org/ourproject/kune/workspace/client

Vicente J. Ruiz Jurado vjrj_ at ourproject.org
Fri May 6 16:30:35 CEST 2011


Author: vjrj_
Date: 2011-05-06 16:30:34 +0200 (Fri, 06 May 2011)
New Revision: 1354

Added:
   trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java
Removed:
   trunk/src/main/java/org/ourproject/kune/workspace/client/nohomepage/
Modified:
   trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java
   trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
   trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
   trunk/src/main/java/cc/kune/gspace/client/resources/wsArmor.css
   trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java
Log:
No Home Page

Modified: trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java	2011-05-06 12:42:51 UTC (rev 1353)
+++ trunk/src/main/java/cc/kune/core/client/sn/UserSNPanel.java	2011-05-06 14:30:34 UTC (rev 1354)
@@ -25,7 +25,6 @@
     setVisibleImpl(false);
     mainTitle.setText(i18n.t("His/her network:"));
     mainTitle.setTitle(i18n.t("This user buddies and groups where participes"));
-    firstCategoryLabel.setText(i18n.t("Buddies"));
     setTooltip(firstCategoryLabel, i18n.t("This user buddies"));
     sndCategoryLabel.setText(i18n.t("Participates in"));
     setTooltip(sndCategoryLabel, i18n.t("Groups in which this user participates"));
@@ -60,6 +59,7 @@
   @Override
   public void setBuddiesCount(final int count) {
     firstCategoryCount.setText(new StringBuffer("(").append(count).append(")").toString());
+    firstCategoryLabel.setText(i18n.t("Buddies"));
   }
 
   @Override
@@ -69,8 +69,7 @@
 
   @Override
   public void setNoBuddies() {
-    firstDeckLabel.setText(i18n.t("This user has no buddies yet"));
-    deck.showWidget(0);
+    firstCategoryLabel.setText(i18n.t("This user has no buddies yet"));
   }
 
   @Override

Modified: trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java	2011-05-06 12:42:51 UTC (rev 1353)
+++ trunk/src/main/java/cc/kune/core/client/sn/UserSNPresenter.java	2011-05-06 14:30:34 UTC (rev 1354)
@@ -124,10 +124,11 @@
       getView().setVisible(false);
     } else {
       getView().clear();
+      setParticipationState(state);
       if (state.getSocialNetworkData().isBuddiesVisible()) {
         // In fact now we show the user network or not.
-        final int buddies = setBuddiesState(state);
-        final int participeIn = setParticipationState(state);
+        setBuddiesState(state);
+        getView().setBuddiesVisible(true);
         // getView().setVisible(buddies + participeIn > 0);
       } else {
         getView().showBuddiesNotPublic();
@@ -156,7 +157,6 @@
       getView().addBuddie(user, avatarUrl, user.getName(), "",
           createMenuItems(user, userMenuItemsRegistry, user.getName()));
     }
-    getView().setBuddiesVisible(buddies.size() > 0);
     final boolean hasLocalBuddies = buddies.size() > 0;
     final int numExtBuddies = userBuddiesData.getOtherExtBuddies();
     if (numExtBuddies > 0) {

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java	2011-05-06 12:42:51 UTC (rev 1353)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceGinModule.java	2011-05-06 14:30:34 UTC (rev 1354)
@@ -79,6 +79,7 @@
 import cc.kune.gspace.client.viewers.ContentViewerPresenter;
 import cc.kune.gspace.client.viewers.FolderViewerAsTablePanel;
 import cc.kune.gspace.client.viewers.FolderViewerPresenter;
+import cc.kune.gspace.client.viewers.NoHomePageViewer;
 
 import com.google.inject.Singleton;
 
@@ -108,6 +109,8 @@
     bindPresenter(SitebarSearchPresenter.class, SitebarSearchPresenter.SitebarSearchView.class,
         SitebarSearchPanel.class, SitebarSearchPresenter.SitebarSearchProxy.class);
 
+    s(NoHomePageViewer.class);
+
     s(GroupOptions.class, GroupOptionsPresenter.class);
     s(GroupOptionsView.class, GroupOptionsPanel.class);
     s(UserOptions.class, UserOptionsPresenter.class);

Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java	2011-05-06 12:42:51 UTC (rev 1353)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java	2011-05-06 14:30:34 UTC (rev 1354)
@@ -21,6 +21,7 @@
 import cc.kune.gspace.client.ui.footer.license.EntityLicensePresenter;
 import cc.kune.gspace.client.viewers.ContentViewerPresenter;
 import cc.kune.gspace.client.viewers.FolderViewerPresenter;
+import cc.kune.gspace.client.viewers.NoHomePageViewer;
 
 import com.google.inject.Inject;
 import com.google.inject.Provider;
@@ -30,14 +31,14 @@
   @Inject
   public GSpaceParts(final Session session, final Provider<EntityLicensePresenter> licenseFooter,
       final Provider<TagsSummaryPresenter> tagsPresenter, final Provider<ToolSelector> toolSelector,
-      final Provider<ContentViewerPresenter> docsViewer, final Provider<FolderViewerPresenter> folderViewer,
-      final Provider<GroupOptions> go, final Provider<UserOptions> uo,
-      final Provider<GroupOptionsCollection> goc, final Provider<UserOptionsCollection> uoc,
-      final Provider<GroupOptionsDefLicense> gdl, final Provider<GroupOptionsPublicSpaceConf> gps,
-      final Provider<GroupOptionsLogo> gl, final Provider<GroupOptionsToolsConf> gtc,
-      final Provider<UserOptionsDefLicense> udl, final Provider<UserOptionsPublicSpaceConf> ups,
-      final Provider<UserOptionsLogo> ul, final Provider<UserOptionsToolsConf> utc,
-      final Provider<SitebarSearchPresenter> siteSearch) {
+      final Provider<NoHomePageViewer> noHome, final Provider<ContentViewerPresenter> docsViewer,
+      final Provider<FolderViewerPresenter> folderViewer, final Provider<GroupOptions> go,
+      final Provider<UserOptions> uo, final Provider<GroupOptionsCollection> goc,
+      final Provider<UserOptionsCollection> uoc, final Provider<GroupOptionsDefLicense> gdl,
+      final Provider<GroupOptionsPublicSpaceConf> gps, final Provider<GroupOptionsLogo> gl,
+      final Provider<GroupOptionsToolsConf> gtc, final Provider<UserOptionsDefLicense> udl,
+      final Provider<UserOptionsPublicSpaceConf> ups, final Provider<UserOptionsLogo> ul,
+      final Provider<UserOptionsToolsConf> utc, final Provider<SitebarSearchPresenter> siteSearch) {
     // , final Provider<GroupOptionsPanel> gop,
     // , final Provider<UserOptionsPanel> uop,
     // final Provider<GroupOptionsPublicSpaceConfPanel> gpsp,
@@ -58,6 +59,7 @@
         docsViewer.get();
         folderViewer.get();
         siteSearch.get();
+        noHome.get();
 
         // Add User & Groups Options
         goc.get().add(gtc);

Modified: trunk/src/main/java/cc/kune/gspace/client/resources/wsArmor.css
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/resources/wsArmor.css	2011-05-06 12:42:51 UTC (rev 1353)
+++ trunk/src/main/java/cc/kune/gspace/client/resources/wsArmor.css	2011-05-06 14:30:34 UTC (rev 1354)
@@ -21,17 +21,17 @@
 }
 
 .entityHeader {
-  -webkit-border-top-right-radius: 10px;
-  -moz-border-radius-topright: 10px;
-  border-top-right-radius: 10px;
+  -webkit-border-top-right-radius: 7px;
+  -moz-border-radius-topright: 7px;
+  border-top-right-radius: 7px;
   background-color: #f4e3d7;
   overflow: hidden;
 }
 
 .entityFooter {
-  -webkit-border-bottom-right-radius: 10px;
-  -moz-border-radius-bottomright: 10px;
-  border-bottom-right-radius: 10px;
+  -webkit-border-bottom-right-radius: 7px;
+  -moz-border-radius-bottomright: 7px;
+  border-bottom-right-radius: 7px;
   background-color: #f7ebe3;
   /* padding: 7px 10px 0px 17px; */
   overflow: hidden;
@@ -160,12 +160,12 @@
 }
 
 .entityTools {
-  -webkit-border-top-left-radius: 10px;
-  -moz-border-radius-topleft: 10px;
-  border-top-left-radius: 10px;
-  -webkit-border-bottom-left-radius: 10px;
-  -moz-border-radius-bottomleft: 10px;
-  border-bottom-left-radius: 10px;
+  -webkit-border-top-left-radius: 7px;
+  -moz-border-radius-topleft: 7px;
+  border-top-left-radius: 7px;
+  -webkit-border-bottom-left-radius: 7px;
+  -moz-border-radius-bottomleft: 7px;
+  border-bottom-left-radius: 7px;
   background-color: #DEAA87;
 }
 

Modified: trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java	2011-05-06 12:42:51 UTC (rev 1353)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/ContentViewerSelector.java	2011-05-06 14:30:34 UTC (rev 1354)
@@ -18,93 +18,98 @@
 import cc.kune.core.shared.dto.StateAbstractDTO;
 import cc.kune.core.shared.dto.StateContainerDTO;
 import cc.kune.core.shared.dto.StateContentDTO;
+import cc.kune.gspace.client.viewers.NoHomePageViewer;
 
 import com.google.inject.Inject;
+import com.google.inject.Provider;
 import com.google.inject.Singleton;
 
 @Singleton
 public class ContentViewerSelector {
 
-    private ContentViewer currentView;
-    private final HashMap<String, ContentViewer> defViewsRegister;
-    private final Session session;
-    private final StateManager stateManager;
-    private final HashMap<String, List<ContentViewer>> viewsRegister;
+  private ContentViewer currentView;
+  private final HashMap<String, ContentViewer> defViewsRegister;
+  private final Provider<NoHomePageViewer> noHome;
+  private final Session session;
+  private final StateManager stateManager;
+  private final HashMap<String, List<ContentViewer>> viewsRegister;
 
-    @Inject
-    public ContentViewerSelector(final StateManager stateManager, final Session session) {
-        this.stateManager = stateManager;
-        this.session = session;
-        viewsRegister = new HashMap<String, List<ContentViewer>>();
-        defViewsRegister = new HashMap<String, ContentViewer>();
-    }
+  @Inject
+  public ContentViewerSelector(final StateManager stateManager, final Session session,
+      final Provider<NoHomePageViewer> noHome) {
+    this.stateManager = stateManager;
+    this.session = session;
+    this.noHome = noHome;
+    viewsRegister = new HashMap<String, List<ContentViewer>>();
+    defViewsRegister = new HashMap<String, ContentViewer>();
+  }
 
-    private void detachCurrent() {
-        if (currentView != null) {
-            currentView.detach();
-        }
+  private void detachCurrent() {
+    if (currentView != null) {
+      currentView.detach();
     }
+  }
 
-    public void init() {
-        session.onAppStart(true, new AppStartHandler() {
-            @Override
-            public void onAppStart(final AppStartEvent event) {
-                stateManager.onStateChanged(true, new StateChangedHandler() {
-                    @Override
-                    public void onStateChanged(final StateChangedEvent event) {
-                        final StateAbstractDTO state = event.getState();
-                        if (state instanceof StateContentDTO || state instanceof StateContainerDTO) {
-                            setContent((HasContent) state);
-                        } else {
-                            // NoContent
-                            detachCurrent();
-                        }
-                    }
-                });
+  public void init() {
+    session.onAppStart(true, new AppStartHandler() {
+      @Override
+      public void onAppStart(final AppStartEvent event) {
+        stateManager.onStateChanged(true, new StateChangedHandler() {
+          @Override
+          public void onStateChanged(final StateChangedEvent event) {
+            final StateAbstractDTO state = event.getState();
+            if (state instanceof StateContentDTO || state instanceof StateContainerDTO) {
+              setContent((HasContent) state);
+            } else {
+              setContent(noHome.get(), null);
             }
+          }
         });
-    }
+      }
+    });
+  }
 
-    public void register(@Nonnull final ContentViewer view, final boolean isDefault, @Nonnull final String... typeIds) {
-        for (final String typeId : typeIds) {
-            List<ContentViewer> list = viewsRegister.get(typeId);
-            if (list == null) {
-                list = new ArrayList<ContentViewer>();
-            }
-            if (!list.contains(view)) {
-                list.add(view);
-            }
-            if (isDefault) {
-                defViewsRegister.put(typeId, view);
-            }
-        }
+  public void register(@Nonnull final ContentViewer view, final boolean isDefault,
+      @Nonnull final String... typeIds) {
+    for (final String typeId : typeIds) {
+      List<ContentViewer> list = viewsRegister.get(typeId);
+      if (list == null) {
+        list = new ArrayList<ContentViewer>();
+      }
+      if (!list.contains(view)) {
+        list.add(view);
+      }
+      if (isDefault) {
+        defViewsRegister.put(typeId, view);
+      }
     }
+  }
 
-    public void register(final String typeId, final ContentViewer view) {
-        Log.info("Registered " + typeId + " with class " + ContentViewer.class);
-        register(view, false, typeId);
-    }
+  public void register(final String typeId, final ContentViewer view) {
+    Log.info("Registered " + typeId + " with class " + ContentViewer.class);
+    register(view, false, typeId);
+  }
 
-    private void setContent(final ContentViewer view, final HasContent state) {
-        detachCurrent();
-        view.setContent(state);
-        view.attach();
-        currentView = view;
-    }
+  private void setContent(final ContentViewer view, final HasContent state) {
+    detachCurrent();
+    view.setContent(state);
+    view.attach();
+    currentView = view;
+  }
 
-    public void setContent(@Nonnull final HasContent state) {
-        final String typeId = state.getTypeId();
-        assert typeId != null;
-        final ContentViewer defView = defViewsRegister.get(typeId);
-        if (defView == null) {
-            final List<ContentViewer> viewsList = viewsRegister.get(typeId);
-            if (viewsList != null && !viewsList.isEmpty()) {
-                setContent(viewsList.get(0), state);
-            } else {
-                NotifyUser.error("Unsupported typeId: " + typeId);
-            }
-        } else {
-            setContent(defView, state);
-        }
+  public void setContent(@Nonnull final HasContent state) {
+    final String typeId = state.getTypeId();
+    assert typeId != null;
+    final ContentViewer defView = defViewsRegister.get(typeId);
+    if (defView == null) {
+      final List<ContentViewer> viewsList = viewsRegister.get(typeId);
+      if (viewsList != null && !viewsList.isEmpty()) {
+        setContent(viewsList.get(0), state);
+      } else {
+        NotifyUser.error("Unsupported typeId: " + typeId);
+      }
+    } else {
+      setContent(defView, state);
     }
+  }
 }

Added: trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java	                        (rev 0)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java	2011-05-06 14:30:34 UTC (rev 1354)
@@ -0,0 +1,41 @@
+package cc.kune.gspace.client.viewers;
+
+import cc.kune.common.client.ui.UiUtils;
+import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
+import cc.kune.core.client.resources.CoreMessages;
+import cc.kune.core.shared.dto.HasContent;
+import cc.kune.core.shared.i18n.I18nTranslationService;
+import cc.kune.gspace.client.GSpaceArmor;
+import cc.kune.gspace.client.tool.ContentViewer;
+
+import com.google.inject.Inject;
+
+public class NoHomePageViewer implements ContentViewer {
+
+  private final ContentTitleWidget contentTitle;
+  private final GSpaceArmor gsArmor;
+  private final I18nTranslationService i18n;
+
+  @Inject
+  public NoHomePageViewer(final GSpaceArmor gsArmor, final I18nTranslationService i18n,
+      final ContentCapabilitiesRegistry capabilitiesRegistry) {
+    this.gsArmor = gsArmor;
+    this.i18n = i18n;
+    contentTitle = new ContentTitleWidget(i18n, gsArmor, capabilitiesRegistry.getIconsRegistry());
+  }
+
+  @Override
+  public void attach() {
+  }
+
+  @Override
+  public void detach() {
+    UiUtils.clear(gsArmor.getDocHeader());
+  }
+
+  @Override
+  public void setContent(final HasContent state) {
+    contentTitle.setTitle(i18n.t(CoreMessages.USER_DOESN_T_HAVE_A_HOMEPAGE), null, null, false);
+  }
+
+}


Property changes on: trunk/src/main/java/cc/kune/gspace/client/viewers/NoHomePageViewer.java
___________________________________________________________________
Name: svn:mime-type
   + text/plain




More information about the kune-commits mailing list