[kune-commits] r1654 - in trunk/src/main/java/cc/kune: client core/client core/client/auth core/client/groups/newgroup core/client/state core/server core/server/error core/server/manager/impl core/server/properties core/server/rack core/server/rack/filters/rest gspace/client
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Tue Jan 3 02:47:19 CET 2012
Author: vjrj_
Date: 2012-01-03 02:47:18 +0100 (Tue, 03 Jan 2012)
New Revision: 1654
Added:
trunk/src/main/java/cc/kune/core/server/error/
trunk/src/main/java/cc/kune/core/server/error/ServerException.java
Removed:
trunk/src/main/java/cc/kune/core/server/ServerException.java
Modified:
trunk/src/main/java/cc/kune/client/OnAppStartFactory.java
trunk/src/main/java/cc/kune/core/client/CoreParts.java
trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java
trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java
trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java
trunk/src/main/java/cc/kune/core/server/KunePersistenceService.java
trunk/src/main/java/cc/kune/core/server/manager/impl/ServerManagerException.java
trunk/src/main/java/cc/kune/core/server/manager/impl/SocialNetworkManagerDefault.java
trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java
trunk/src/main/java/cc/kune/core/server/rack/RackServletFilter.java
trunk/src/main/java/cc/kune/core/server/rack/filters/rest/JSONLibRESTSerializer.java
trunk/src/main/java/cc/kune/core/server/rack/filters/rest/RESTMethod.java
trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
Log:
Removing some dep. cycles
Modified: trunk/src/main/java/cc/kune/client/OnAppStartFactory.java
===================================================================
--- trunk/src/main/java/cc/kune/client/OnAppStartFactory.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/client/OnAppStartFactory.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -19,19 +19,26 @@
*/
package cc.kune.client;
+import cc.kune.core.client.auth.SignIn;
+import cc.kune.core.client.groups.newgroup.NewGroup;
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.SiteTokenListeners;
import com.google.inject.Inject;
+import com.google.inject.Provider;
public class OnAppStartFactory {
@Inject
- public OnAppStartFactory(final Session session) {
+ public OnAppStartFactory(final Session session, final Provider<NewGroup> newGroup,
+ final Provider<SignIn> signIn, final SiteTokenListeners tokenListener) {
session.onAppStart(true, new AppStartHandler() {
@Override
public void onAppStart(final AppStartEvent event) {
+ newGroup.get();
+ //
}
});
}
Modified: trunk/src/main/java/cc/kune/core/client/CoreParts.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/CoreParts.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/core/client/CoreParts.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -20,16 +20,27 @@
package cc.kune.core.client;
import cc.kune.core.client.auth.AnonUsersManager;
+import cc.kune.core.client.auth.Register;
+import cc.kune.core.client.auth.SignIn;
+import cc.kune.core.client.groups.newgroup.NewGroup;
import cc.kune.core.client.init.AppStartEvent;
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
+import cc.kune.core.client.sitebar.AboutKuneDialog;
import cc.kune.core.client.sitebar.SiteUserOptionsPresenter;
+import cc.kune.core.client.sitebar.spaces.Space;
+import cc.kune.core.client.sitebar.spaces.SpaceSelectEvent;
import cc.kune.core.client.sitebar.spaces.SpaceSelectorPresenter;
import cc.kune.core.client.sn.GroupSNPresenter;
import cc.kune.core.client.sn.UserSNPresenter;
import cc.kune.core.client.sn.actions.registry.GroupSNConfActions;
import cc.kune.core.client.sn.actions.registry.UserSNConfActions;
+import cc.kune.core.client.state.HistoryTokenCallback;
import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.SiteTokenListeners;
+import cc.kune.core.client.state.SiteTokens;
+import cc.kune.core.client.sub.SubtitlesManager;
+import com.google.gwt.event.shared.EventBus;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -41,7 +52,10 @@
final Provider<GroupSNConfActions> groupMembersConfActions,
final Provider<UserSNConfActions> userSNConfActions, final Provider<AnonUsersManager> anonUsers,
final Provider<SiteUserOptionsPresenter> userOptions,
- final Provider<SpaceSelectorPresenter> spaceSelector) {
+ final Provider<SpaceSelectorPresenter> spaceSelector, final SiteTokenListeners tokenListener,
+ final Provider<SignIn> signIn, final Provider<Register> register,
+ final Provider<AboutKuneDialog> aboutKuneDialog, final Provider<NewGroup> newGroup,
+ final Provider<SubtitlesManager> subProvider, final EventBus eventBus) {
session.onAppStart(true, new AppStartHandler() {
@Override
public void onAppStart(final AppStartEvent event) {
@@ -54,5 +68,48 @@
spaceSelector.get();
}
});
+ tokenListener.put(SiteTokens.SIGNIN, new HistoryTokenCallback() {
+ @Override
+ public void onHistoryToken(final String token) {
+ signIn.get().showSignInDialog();
+ }
+ });
+ tokenListener.put(SiteTokens.ABOUTKUNE, new HistoryTokenCallback() {
+ @Override
+ public void onHistoryToken(final String token) {
+ // FIXME, something to come back
+ aboutKuneDialog.get().showCentered();
+ }
+ });
+ tokenListener.put(SiteTokens.REGISTER, new HistoryTokenCallback() {
+ @Override
+ public void onHistoryToken(final String token) {
+ register.get().doRegister();
+ }
+ });
+ tokenListener.put(SiteTokens.NEWGROUP, new HistoryTokenCallback() {
+ @Override
+ public void onHistoryToken(final String token) {
+ newGroup.get().doNewGroup();
+ }
+ });
+ tokenListener.put(SiteTokens.SUBTITLES, new HistoryTokenCallback() {
+ @Override
+ public void onHistoryToken(final String token) {
+ subProvider.get().show(token);
+ }
+ });
+ tokenListener.put(SiteTokens.HOME, new HistoryTokenCallback() {
+ @Override
+ public void onHistoryToken(final String token) {
+ SpaceSelectEvent.fire(eventBus, Space.homeSpace);
+ }
+ });
+ tokenListener.put(SiteTokens.WAVEINBOX, new HistoryTokenCallback() {
+ @Override
+ public void onHistoryToken(final String token) {
+ SpaceSelectEvent.fire(eventBus, Space.userSpace);
+ }
+ });
}
}
Modified: trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/core/client/auth/SignInPresenter.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -120,7 +120,6 @@
@Override
public void onSuccess(final Void arg) {
-
final AsyncCallback<UserInfoDTO> callback = new AsyncCallback<UserInfoDTO>() {
@Override
public void onFailure(final Throwable caught) {
Modified: trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/core/client/groups/newgroup/NewGroupPresenter.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -29,9 +29,7 @@
import cc.kune.core.client.resources.CoreMessages;
import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
import cc.kune.core.client.rpcservices.GroupServiceAsync;
-import cc.kune.core.client.state.HistoryTokenCallback;
import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.SiteTokens;
import cc.kune.core.client.state.StateManager;
import cc.kune.core.shared.dto.GroupDTO;
import cc.kune.core.shared.dto.GroupType;
@@ -64,12 +62,10 @@
}
private final GroupOptions groupOptions;
-
private final Provider<GroupServiceAsync> groupService;
private final I18nTranslationService i18n;
private final Session session;
private final Provider<SignIn> signIn;
-
private final StateManager stateManager;
@Inject
@@ -84,12 +80,6 @@
this.groupService = groupService;
this.signIn = signIn;
this.groupOptions = groupOptions;
- stateManager.addSiteToken(SiteTokens.NEWGROUP, new HistoryTokenCallback() {
- @Override
- public void onHistoryToken(final String token) {
- doNewGroup();
- }
- });
}
@Override
Modified: trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/core/client/state/SiteTokenListeners.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -21,97 +21,6 @@
import java.util.HashMap;
-import cc.kune.core.client.auth.Register;
-import cc.kune.core.client.auth.SignIn;
-import cc.kune.core.client.groups.newgroup.NewGroup;
-import cc.kune.core.client.sitebar.AboutKuneDialog;
-import cc.kune.core.client.sitebar.spaces.Space;
-import cc.kune.core.client.sitebar.spaces.SpaceSelectEvent;
-import cc.kune.core.client.sub.SubtitlesManager;
-import cc.kune.gspace.client.i18n.I18nTranslator;
-
-import com.google.gwt.event.shared.EventBus;
-import com.google.inject.Inject;
-import com.google.inject.Provider;
-
@SuppressWarnings("serial")
public class SiteTokenListeners extends HashMap<String, HistoryTokenCallback> {
- private final Provider<AboutKuneDialog> aboutKuneDialog;
- private final EventBus eventBus;
- private final Provider<NewGroup> newGroup;
- private final Provider<Register> register;
- private final Session session;
- private final Provider<SignIn> signIn;
- private final Provider<SubtitlesManager> subProvider;
- private final Provider<I18nTranslator> translator;
-
- @Inject
- public SiteTokenListeners(final Session session, final EventBus eventBus,
- final Provider<SignIn> signIn, final Provider<Register> register,
- final Provider<NewGroup> newGroup, final Provider<AboutKuneDialog> aboutKuneDialog,
- final Provider<I18nTranslator> translator, final Provider<SubtitlesManager> subProvider) {
- this.session = session;
- this.eventBus = eventBus;
- this.signIn = signIn;
- this.register = register;
- this.newGroup = newGroup;
- this.aboutKuneDialog = aboutKuneDialog;
- this.translator = translator;
- this.subProvider = subProvider;
- putValues();
- }
-
- private void putValues() {
- put(SiteTokens.HOME, new HistoryTokenCallback() {
- @Override
- public void onHistoryToken(final String token) {
- SpaceSelectEvent.fire(eventBus, Space.homeSpace);
- }
- });
- put(SiteTokens.WAVEINBOX, new HistoryTokenCallback() {
- @Override
- public void onHistoryToken(final String token) {
- SpaceSelectEvent.fire(eventBus, Space.userSpace);
- }
- });
- put(SiteTokens.SIGNIN, new HistoryTokenCallback() {
- @Override
- public void onHistoryToken(final String token) {
- signIn.get().showSignInDialog();
- }
- });
- put(SiteTokens.REGISTER, new HistoryTokenCallback() {
- @Override
- public void onHistoryToken(final String token) {
- register.get().doRegister();
- }
- });
- put(SiteTokens.NEWGROUP, new HistoryTokenCallback() {
- @Override
- public void onHistoryToken(final String token) {
- newGroup.get().doNewGroup();
- }
- });
- put(SiteTokens.ABOUTKUNE, new HistoryTokenCallback() {
- @Override
- public void onHistoryToken(final String token) {
- // FIXME, something to come back
- aboutKuneDialog.get().showCentered();
- }
- });
- put(SiteTokens.TRANSLATE, new HistoryTokenCallback() {
- @Override
- public void onHistoryToken(final String token) {
- if (session.isLogged() && session.getInitData().isTranslatorEnabled()) {
- translator.get().show();
- }
- }
- });
- put(SiteTokens.SUBTITLES, new HistoryTokenCallback() {
- @Override
- public void onHistoryToken(final String token) {
- subProvider.get().show(token);
- }
- });
- }
}
Modified: trunk/src/main/java/cc/kune/core/server/KunePersistenceService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/KunePersistenceService.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/core/server/KunePersistenceService.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -19,6 +19,7 @@
*/
package cc.kune.core.server;
+import cc.kune.core.server.error.ServerException;
import cc.kune.core.server.init.DatabaseInitializer;
import com.google.inject.Inject;
Deleted: trunk/src/main/java/cc/kune/core/server/ServerException.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/ServerException.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/core/server/ServerException.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -1,50 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package cc.kune.core.server;
-
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-public class ServerException extends RuntimeException {
-
- private static final long serialVersionUID = 2028618233098694418L;
-
- private static final Log LOG = LogFactory.getLog(ServerException.class);
-
- public ServerException() {
- super();
- }
-
- public ServerException(final String text) {
- super(text);
- LOG.error(text);
- }
-
- public ServerException(final String text, final Throwable cause) {
- super(text, cause);
- LOG.error(text, cause);
- }
-
- public ServerException(final Throwable cause) {
- super(cause);
- LOG.error("ServerManagerException", cause);
- }
-
-}
Copied: trunk/src/main/java/cc/kune/core/server/error/ServerException.java (from rev 1647, trunk/src/main/java/cc/kune/core/server/ServerException.java)
===================================================================
--- trunk/src/main/java/cc/kune/core/server/error/ServerException.java (rev 0)
+++ trunk/src/main/java/cc/kune/core/server/error/ServerException.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -0,0 +1,50 @@
+/*
+ *
+ * Copyright (C) 2007-2011 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package cc.kune.core.server.error;
+
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+public class ServerException extends RuntimeException {
+
+ private static final Log LOG = LogFactory.getLog(ServerException.class);
+
+ private static final long serialVersionUID = 2028618233098694418L;
+
+ public ServerException() {
+ super();
+ }
+
+ public ServerException(final String text) {
+ super(text);
+ LOG.error(text);
+ }
+
+ public ServerException(final String text, final Throwable cause) {
+ super(text, cause);
+ LOG.error(text, cause);
+ }
+
+ public ServerException(final Throwable cause) {
+ super(cause);
+ LOG.error("ServerException", cause);
+ }
+
+}
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/ServerManagerException.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/ServerManagerException.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/ServerManagerException.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -19,7 +19,7 @@
*/
package cc.kune.core.server.manager.impl;
-import cc.kune.core.server.ServerException;
+import cc.kune.core.server.error.ServerException;
public class ServerManagerException extends ServerException {
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/SocialNetworkManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/SocialNetworkManagerDefault.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/SocialNetworkManagerDefault.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -29,8 +29,8 @@
import cc.kune.core.client.errors.DefaultException;
import cc.kune.core.client.errors.LastAdminInGroupException;
import cc.kune.core.client.errors.UserMustBeLoggedException;
-import cc.kune.core.server.ServerException;
import cc.kune.core.server.access.AccessRightsService;
+import cc.kune.core.server.error.ServerException;
import cc.kune.core.server.manager.SocialNetworkManager;
import cc.kune.core.server.manager.UserManager;
import cc.kune.core.shared.domain.AdmissionType;
Modified: trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/core/server/manager/impl/UserManagerDefault.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -52,12 +52,11 @@
import cc.kune.core.client.errors.I18nNotFoundException;
import cc.kune.core.client.errors.UserRegistrationException;
import cc.kune.core.client.errors.WrongCurrentPasswordException;
-import cc.kune.core.server.mail.FormatedString;
-import cc.kune.core.server.mail.MailService;
import cc.kune.core.server.manager.GroupManager;
import cc.kune.core.server.manager.I18nCountryManager;
import cc.kune.core.server.manager.I18nLanguageManager;
import cc.kune.core.server.manager.UserManager;
+import cc.kune.core.server.notifier.NotifyService;
import cc.kune.core.server.properties.ChatProperties;
import cc.kune.core.server.properties.KuneBasicProperties;
import cc.kune.core.server.xmpp.ChatConnection;
@@ -89,7 +88,7 @@
private final I18nTranslationService i18n;
private final KuneWaveService kuneWaveManager;
private final I18nLanguageManager languageManager;
- private final MailService mailService;
+ private final NotifyService notifyService;
private final ParticipantUtils participantUtils;
private final KuneBasicProperties properties;
private final UserFinder userFinder;
@@ -104,7 +103,7 @@
final I18nTranslationService i18n, final CustomUserRegistrationServlet waveUserRegister,
final AccountStore waveAccountStore, final KuneWaveService kuneWaveManager,
final ParticipantUtils participantUtils, final KuneBasicProperties properties,
- final GroupManager groupManager, final MailService mailService) {
+ final GroupManager groupManager, final NotifyService notifyService) {
super(provider, User.class);
this.userFinder = finder;
this.languageManager = languageManager;
@@ -118,7 +117,7 @@
this.participantUtils = participantUtils;
this.properties = properties;
this.groupManager = groupManager;
- this.mailService = mailService;
+ this.notifyService = notifyService;
}
@Override
@@ -211,7 +210,10 @@
// Is this necessary? try to remove (used when we were setting the def
// content
// contentManager.save(userGroup.getDefaultContent());
- mailService.sendPlain(new FormatedString("Welcome", ""), new FormatedString("welcome"), email);
+
+ // FIXME: notifyService.
+ // mailService.sendPlain(new FormatedString("Welcome", ""), new
+ // FormatedString("welcome"), email);
return user;
} catch (final RuntimeException e) {
try {
Modified: trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/core/server/properties/KunePropertiesDefault.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -27,7 +27,7 @@
import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.configuration.SystemConfiguration;
-import cc.kune.core.server.ServerException;
+import cc.kune.core.server.error.ServerException;
import com.google.inject.Inject;
import com.google.inject.Singleton;
Modified: trunk/src/main/java/cc/kune/core/server/rack/RackServletFilter.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rack/RackServletFilter.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/core/server/rack/RackServletFilter.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -35,7 +35,7 @@
import org.quartz.SchedulerException;
import org.waveprotocol.box.server.rpc.ServerRpcProvider;
-import cc.kune.core.server.ServerException;
+import cc.kune.core.server.error.ServerException;
import cc.kune.core.server.rack.dock.Dock;
import cc.kune.core.server.rack.dock.RequestMatcher;
import cc.kune.core.server.scheduler.CronServerTasksManager;
Modified: trunk/src/main/java/cc/kune/core/server/rack/filters/rest/JSONLibRESTSerializer.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rack/filters/rest/JSONLibRESTSerializer.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/core/server/rack/filters/rest/JSONLibRESTSerializer.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -23,7 +23,7 @@
import net.sf.json.JsonConfig;
import net.sf.json.util.CycleDetectionStrategy;
-import cc.kune.core.server.ServerException;
+import cc.kune.core.server.error.ServerException;
public class JSONLibRESTSerializer implements RESTSerializer {
private final JsonConfig config;
Modified: trunk/src/main/java/cc/kune/core/server/rack/filters/rest/RESTMethod.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rack/filters/rest/RESTMethod.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/core/server/rack/filters/rest/RESTMethod.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -21,7 +21,7 @@
import java.lang.reflect.Method;
-import cc.kune.core.server.ServerException;
+import cc.kune.core.server.error.ServerException;
public class RESTMethod {
public static final String FORMAT_JSON = "json";
Modified: trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java 2012-01-02 20:12:42 UTC (rev 1653)
+++ trunk/src/main/java/cc/kune/gspace/client/GSpaceParts.java 2012-01-03 01:47:18 UTC (rev 1654)
@@ -23,9 +23,13 @@
import cc.kune.core.client.init.AppStartEvent.AppStartHandler;
import cc.kune.core.client.sitebar.search.SitebarSearchPresenter;
import cc.kune.core.client.sn.actions.WriteToBuddyHeaderButton;
+import cc.kune.core.client.state.HistoryTokenCallback;
import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.SiteTokenListeners;
+import cc.kune.core.client.state.SiteTokens;
import cc.kune.gspace.client.actions.GiveUsFeedbackBtn;
import cc.kune.gspace.client.i18n.I18nToTranslateGridPanel;
+import cc.kune.gspace.client.i18n.I18nTranslator;
import cc.kune.gspace.client.i18n.I18nTranslatorTabsCollection;
import cc.kune.gspace.client.i18n.SiteOptionsI18nTranslatorAction;
import cc.kune.gspace.client.options.GroupOptions;
@@ -74,10 +78,8 @@
final Provider<GiveUsFeedbackBtn> giveUsFeedback,
final Provider<I18nToTranslateGridPanel> toTrans,
final Provider<I18nTranslatorTabsCollection> gtranslator,
- final Provider<WriteToBuddyHeaderButton> writeToBuddie
-
- ) {
-
+ final Provider<I18nTranslator> translator, final Provider<WriteToBuddyHeaderButton> writeToBuddie,
+ final SiteTokenListeners tokenListener) {
session.onAppStart(true, new AppStartHandler() {
@Override
public void onAppStart(final AppStartEvent event) {
@@ -123,5 +125,13 @@
writeToBuddie.get();
}
});
+ tokenListener.put(SiteTokens.TRANSLATE, new HistoryTokenCallback() {
+ @Override
+ public void onHistoryToken(final String token) {
+ if (session.isLogged() && session.getInitData().isTranslatorEnabled()) {
+ translator.get().show();
+ }
+ }
+ });
}
}
More information about the kune-commits
mailing list