[kune-commits] r820 - in trunk/src/main/java/org/ourproject/kune: platf/client/services platf/client/state workspace/client/socialnet workspace/client/socialnet/ui workspace/client/workspace

vjrj vjrj at ourproject.org
Sun Jul 27 05:03:17 CEST 2008


Author: vjrj
Date: 2008-07-27 05:03:11 +0200 (Sun, 27 Jul 2008)
New Revision: 820

Modified:
   trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
   trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java
   trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java
Log:
Complete - task 20: EntityLive not show... 


Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java	2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneErrorHandler.java	2008-07-27 03:03:11 UTC (rev 820)
@@ -69,7 +69,7 @@
 	    logException(e);
 	    Site.error(i18n.t("You don't have rights to do that"));
 	} catch (final SessionExpiredException e) {
-	    logException(e);
+	    logException(e, true);
 	    doSessionExpired();
 	} catch (final UserMustBeLoggedException e) {
 	    logException(e);
@@ -99,7 +99,7 @@
 	    logException(e);
 	    Site.error(i18n.t("This user is already a member of this group"));
 	} catch (final Throwable e) {
-	    logException(e);
+	    logException(e, true);
 	    Site.error(i18n.t("Error performing operation"));
 	    GWT.log("Other kind of exception in StateManagerDefault/processErrorException", null);
 	    throw new RuntimeException();
@@ -113,7 +113,15 @@
     }
 
     private void logException(final Throwable e) {
-	Log.debug("Exception in KuneErrorHandler", e);
+	logException(e, false);
     }
 
+    private void logException(final Throwable e, final boolean showException) {
+	if (showException) {
+	    Log.debug("Exception in KuneErrorHandler", e);
+	} else {
+	    Log.debug(e.getMessage());
+	}
+    }
+
 }

Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java	2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java	2008-07-27 03:03:11 UTC (rev 820)
@@ -33,6 +33,7 @@
 import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
 import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
 
+import com.allen_sauer.gwt.log.client.Log;
 import com.calclab.suco.client.container.Provider;
 import com.calclab.suco.client.signal.Signal;
 import com.calclab.suco.client.signal.Slot;
@@ -63,6 +64,7 @@
     }
 
     public void check(final AsyncCallbackSimple<?> callback) {
+	Log.debug("Checking session (userhash: " + getUserHash() + ")");
 	userServiceProvider.get().onlyCheckSession(getUserHash(), callback);
     }
 

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java	2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/EntityLiveSearcherPresenter.java	2008-07-27 03:03:11 UTC (rev 820)
@@ -23,16 +23,14 @@
 import org.ourproject.kune.platf.client.dto.LinkDTO;
 import org.ourproject.kune.workspace.client.workspace.EntityLiveSearcher;
 
-import com.calclab.suco.client.signal.Signal;
 import com.calclab.suco.client.signal.Slot;
 
 public class EntityLiveSearcherPresenter implements EntityLiveSearcher {
 
     private EntityLiveSearcherView view;
-    private Signal<LinkDTO> onSelection;
+    private Slot<LinkDTO> slot;
 
-    public void addListener(final EntityLiveSearchListener listener) {
-	this.onSelection = new Signal<LinkDTO>("onSelection");
+    public EntityLiveSearcherPresenter() {
     }
 
     public View getView() {
@@ -44,20 +42,15 @@
     }
 
     public void onSelection(final LinkDTO link) {
-	onSelection.fire(link);
+	slot.onEvent(link);
 	view.hide();
     }
 
-    public void onSelectionAdd(final Slot<LinkDTO> slot) {
-	onSelection.add(slot);
+    public void onSelection(final Slot<LinkDTO> slot) {
+	this.slot = slot;
     }
 
-    public void onSelectionRemove(final Slot<LinkDTO> slot) {
-	onSelection.remove(slot);
-    }
-
     public void show() {
 	view.show();
     }
-
 }

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java	2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPanel.java	2008-07-27 03:03:11 UTC (rev 820)
@@ -14,6 +14,8 @@
 import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
 
 import com.calclab.emiteuimodule.client.users.UserGridPanel;
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
 import com.gwtext.client.core.EventObject;
 import com.gwtext.client.widgets.BoxComponent;
 import com.gwtext.client.widgets.Button;
@@ -65,7 +67,11 @@
 	    button.setTooltip(gridButton.getTooltip());
 	    button.addListener(new ButtonListenerAdapter() {
 		public void onClick(final Button button, final EventObject e) {
-		    gridButton.getSlot().onEvent("");
+		    DeferredCommand.addCommand(new Command() {
+			public void execute() {
+			    gridButton.getSlot().onEvent("");
+			}
+		    });
 		}
 	    });
 	    buttonsCache.put(gridButton, button);
@@ -95,7 +101,11 @@
 		new MessageBox.ConfirmCallback() {
 		    public void execute(final String btnID) {
 			if (btnID.equals("yes")) {
-			    presenter.addCollab(groupShortName);
+			    DeferredCommand.addCommand(new Command() {
+				public void execute() {
+				    presenter.addCollab(groupShortName);
+				}
+			    });
 			}
 		    }
 		});

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java	2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java	2008-07-27 03:03:11 UTC (rev 820)
@@ -57,10 +57,9 @@
 	addMember = new GridButton("images/add-green.gif", i18n.t("Add member"), i18n
 		.t("Add a group or a person as member of this group"), new Slot<String>() {
 	    public void onEvent(final String parameter) {
-		groupLiveSearcherProvider.get().onSelectionAdd(new Slot<LinkDTO>() {
+		groupLiveSearcherProvider.get().onSelection(new Slot<LinkDTO>() {
 		    public void onEvent(final LinkDTO link) {
 			view.confirmAddCollab(link.getShortName(), link.getLongName());
-			groupLiveSearcherProvider.get().onSelectionRemove(this);
 		    }
 		});
 		groupLiveSearcherProvider.get().show();

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java	2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java	2008-07-27 03:03:11 UTC (rev 820)
@@ -155,7 +155,7 @@
 		.t("Change to collaborator"), new Slot<GroupDTO>() {
 	    public void onEvent(final GroupDTO group) {
 		Site.showProgressProcessing();
-		snServiceProvider.get().setCollabAsAdmin(session.getUserHash(),
+		snServiceProvider.get().setAdminAsCollab(session.getUserHash(),
 			session.getCurrentState().getGroup().getShortName(), group.getShortName(),
 			new AsyncCallbackSimple<SocialNetworkResultDTO>() {
 			    public void onSuccess(final SocialNetworkResultDTO result) {
@@ -189,12 +189,12 @@
 		new Slot<GroupDTO>() {
 		    public void onEvent(final GroupDTO group) {
 			Site.showProgressProcessing();
-			snServiceProvider.get().addAdminMember(session.getUserHash(),
+			snServiceProvider.get().setCollabAsAdmin(session.getUserHash(),
 				session.getCurrentState().getGroup().getShortName(), group.getShortName(),
 				new AsyncCallbackSimple<SocialNetworkResultDTO>() {
 				    public void onSuccess(final SocialNetworkResultDTO result) {
 					Site.hideProgress();
-					Site.info(i18n.t("Member added as admin"));
+					Site.info(i18n.t("Type of member changed"));
 					getStateManager().setSocialNetwork(result);
 				    }
 				});

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java	2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/EntityLiveSearcherPanel.java	2008-07-27 03:03:11 UTC (rev 820)
@@ -22,9 +22,11 @@
 import org.ourproject.kune.platf.client.dto.LinkDTO;
 import org.ourproject.kune.platf.client.services.I18nTranslationService;
 import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog;
+import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherPresenter;
 import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherView;
-import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearcherPresenter;
 
+import com.google.gwt.user.client.Command;
+import com.google.gwt.user.client.DeferredCommand;
 import com.gwtext.client.core.Connection;
 import com.gwtext.client.core.Template;
 import com.gwtext.client.core.UrlParam;
@@ -138,10 +140,14 @@
 
 	cb.addListener(new ComboBoxListenerAdapter() {
 	    public void onSelect(final ComboBox comboBox, final Record record, final int index) {
-		final LinkDTO link = new LinkDTO(record.getAsString(SHORT_NAME_FIELD), record
-			.getAsString(LONG_NAME_FIELD), record.getAsString(ICON_URL_FIELD), record
-			.getAsString(LINK_FIELD));
-		presenter.onSelection(link);
+		DeferredCommand.addCommand(new Command() {
+		    public void execute() {
+			final LinkDTO link = new LinkDTO(record.getAsString(SHORT_NAME_FIELD), record
+				.getAsString(LONG_NAME_FIELD), record.getAsString(ICON_URL_FIELD), record
+				.getAsString(LINK_FIELD));
+			presenter.onSelection(link);
+		    }
+		});
 	    }
 	});
 

Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java	2008-07-27 01:15:27 UTC (rev 819)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/EntityLiveSearcher.java	2008-07-27 03:03:11 UTC (rev 820)
@@ -25,10 +25,8 @@
 
 public interface EntityLiveSearcher {
 
-    void onSelectionAdd(Slot<LinkDTO> slot);
+    void onSelection(Slot<LinkDTO> slot);
 
-    void onSelectionRemove(Slot<LinkDTO> slot);
-
     void show();
 
 }




More information about the kune-commits mailing list