[kune-commits] r815 - in trunk/src/main/java/org/ourproject/kune:
chat/client docs/client/cnt docs/client/ui platf/client/rpc
platf/client/services platf/client/state
platf/client/ui/dialogs workspace/client
workspace/client/actions workspace/client/actions/sn
workspace/client/licensechoose workspace/client/newgroup
workspace/client/newgroup/ui workspace/client/sitebar
workspace/client/sitebar/bar workspace/client/sitebar/login
workspace/client/sitebar/rpc workspace/client/socialnet
workspace/client/socialnet/ui workspace/client/theme
workspace/client/ui/newtmp
workspace/client/ui/newtmp/sitebar/sitenewgroup
workspace/client/ui/newtmp/sitebar/sitesign
workspace/client/ui/newtmp/themes workspace/client/workspace
workspace/client/workspace/ui
vjrj
vjrj at ourproject.org
Sat Jul 26 13:39:14 CEST 2008
Author: vjrj
Date: 2008-07-26 13:38:54 +0200 (Sat, 26 Jul 2008)
New Revision: 815
Removed:
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ChangeGroupWsThemeAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/CreateNewGroupAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/OnlyCheckUserSessionAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AcceptJoinGroupAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddAdminAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddCollabAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddViewerAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/DeleteMemberAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/DenyJoinGroupAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/RequestJoinGroupAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetAdminAsCollabAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetCollabAsAdminAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/UnJoinGroupAction.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupListener.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersSummaryPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuView.java
Modified:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SocialNetworkService.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/ColorTheme.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java
trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java
trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java
trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroup.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java
trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/RegisterForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInForm.java
trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/rpc/UserService.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenterNew.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java
trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
Log:
Incomplete - task 15: Resolve signIn dialog issues (margins, message, overflow)
Incomplete - task 16: NewGroup refactorization
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -106,7 +106,6 @@
public void logout() {
if (!emiteDialog.isDialogNotStarted()) {
- emiteDialog.closeAllChats(false);
emiteDialog.setOwnPresence(OwnStatus.offline);
final UserChatOptions userChatOptions = getUserChatOptions("reset at example.com", "");
emiteDialog.refreshUserInfo(userChatOptions);
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -35,6 +35,7 @@
import org.ourproject.kune.platf.client.extend.ExtensibleWidgetChild;
import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.WorkspaceEvents;
import org.ourproject.kune.workspace.client.component.WorkspaceDeckView;
import org.ourproject.kune.workspace.client.editor.TextEditor;
@@ -47,14 +48,16 @@
private final DocumentContentListener listener;
private final DocumentReader reader;
private final DocumentReaderControl readerControl;
+ private final Session session;
public DocumentContentPresenter(final DocumentFactory documentFactory, final DocumentContentListener listener,
- final WorkspaceDeckView view) {
- this.listener = listener;
- this.view = view;
- this.components = new DocumentContentComponents(documentFactory, this);
- reader = components.getDocumentReader();
- readerControl = components.getDocumentReaderControl();
+ final WorkspaceDeckView view, final Session session) {
+ this.listener = listener;
+ this.view = view;
+ this.session = session;
+ this.components = new DocumentContentComponents(documentFactory, this);
+ reader = components.getDocumentReader();
+ readerControl = components.getDocumentReaderControl();
}
public void attach() {
@@ -64,88 +67,85 @@
}
public View getView() {
- return view;
+ return view;
}
public void onCancel() {
- showContent();
- listener.onCancel();
- // Re-enable rateIt widget
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.ENABLE_RATEIT, null);
+ showContent();
+ listener.onCancel();
+ // Re-enable rateIt widget
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.ENABLE_RATEIT, null);
}
public void onDelete() {
- DefaultDispatcher.getInstance().fire(DocsEvents.DEL_CONTENT, content.getDocumentId());
+ DefaultDispatcher.getInstance().fire(DocsEvents.DEL_CONTENT, content.getDocumentId());
}
public void onEdit() {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.ONLY_CHECK_USER_SESSION,
- new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
- if (content.hasDocument()) {
- // Don't permit rate content while your are editing
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.DISABLE_RATEIT, null);
- TextEditor editor = components.getDocumentEditor();
- editor.setContent(content.getContent());
- view.show(editor.getView());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
- DefaultDispatcher.getInstance().fire(
- PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT, editor
- .getToolBar()));
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, null);
- } else {
- FolderEditor editor = components.getFolderEditor();
- editor.setFolder(content.getFolder());
- view.show(editor.getView());
- }
- listener.onEdit();
- }
- });
+ session.check(new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ if (content.hasDocument()) {
+ // Don't permit rate content while your are editing
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.DISABLE_RATEIT, null);
+ final TextEditor editor = components.getDocumentEditor();
+ editor.setContent(content.getContent());
+ view.show(editor.getView());
+ DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
+ ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
+ DefaultDispatcher.getInstance().fire(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
+ new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT, editor.getToolBar()));
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, null);
+ } else {
+ final FolderEditor editor = components.getFolderEditor();
+ editor.setFolder(content.getFolder());
+ view.show(editor.getView());
+ }
+ listener.onEdit();
+ }
+ });
}
public void onSave(final String text) {
- content.setContent(text);
- DefaultDispatcher.getInstance().fire(DocsEvents.SAVE_DOCUMENT, new SaveDocumentActionParams(content, this));
- // Re-enable rateIt widget
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.ENABLE_RATEIT, null);
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, null);
+ content.setContent(text);
+ DefaultDispatcher.getInstance().fire(DocsEvents.SAVE_DOCUMENT, new SaveDocumentActionParams(content, this));
+ // Re-enable rateIt widget
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.ENABLE_RATEIT, null);
+ DefaultDispatcher.getInstance().fire(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, null);
}
public void onSaved() {
- components.getDocumentEditor().onSaved();
+ components.getDocumentEditor().onSaved();
}
public void onSaveFailed() {
- components.getDocumentEditor().onSaveFailed();
+ components.getDocumentEditor().onSaveFailed();
}
public void onTranslate() {
}
public void setContent(final StateDTO content) {
- this.content = content;
- showContent();
+ this.content = content;
+ showContent();
}
private void showContent() {
- if (content.hasDocument()) {
- reader.showDocument(content.getContent());
- components.getDocumentEditor().reset();
- readerControl.setRights(content.getContentRights());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
- DefaultDispatcher.getInstance().fire(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
- new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT, readerControl.getView()));
- view.show(reader.getView());
- } else {
- FolderViewer viewer = components.getFolderViewer();
- viewer.setFolder(content.getFolder());
- DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
- ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
- view.show(viewer.getView());
- }
+ if (content.hasDocument()) {
+ reader.showDocument(content.getContent());
+ components.getDocumentEditor().reset();
+ readerControl.setRights(content.getContentRights());
+ DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
+ ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
+ DefaultDispatcher.getInstance().fire(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET,
+ new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT, readerControl.getView()));
+ view.show(reader.getView());
+ } else {
+ final FolderViewer viewer = components.getFolderViewer();
+ viewer.setFolder(content.getFolder());
+ DefaultDispatcher.getInstance().fire(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET,
+ ExtensibleWidgetId.CONTENT_TOOLBAR_LEFT);
+ view.show(viewer.getView());
+ }
}
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -81,7 +81,7 @@
public DocumentContent createDocumentContent(final DocumentContentListener listener) {
final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
- final DocumentContentPresenter presenter = new DocumentContentPresenter(this, listener, panel);
+ final DocumentContentPresenter presenter = new DocumentContentPresenter(this, listener, panel, session);
return presenter;
}
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-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/GroupService.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -30,19 +30,6 @@
public interface GroupService extends RemoteService {
- public class App {
- private static GroupServiceAsync ourInstance = null;
-
- public static synchronized GroupServiceAsync getInstance() {
- if (ourInstance == null) {
- ourInstance = (GroupServiceAsync) GWT.create(GroupService.class);
- ((ServiceDefTarget) ourInstance).setServiceEntryPoint(GWT.getModuleBaseURL() + "GroupService");
- }
- return ourInstance;
- }
-
- }
-
void changeGroupWsTheme(String userHash, String groupShortName, String theme) throws DefaultException;
StateToken createNewGroup(String userHash, GroupDTO group) throws DefaultException;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SocialNetworkService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SocialNetworkService.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/SocialNetworkService.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -24,25 +24,10 @@
import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
import org.ourproject.kune.platf.client.errors.DefaultException;
-import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
-import com.google.gwt.user.client.rpc.ServiceDefTarget;
public interface SocialNetworkService extends RemoteService {
- public static class App {
- private static SocialNetworkServiceAsync instance;
-
- public static SocialNetworkServiceAsync getInstance() {
- if (instance == null) {
- instance = (SocialNetworkServiceAsync) GWT.create(SocialNetworkService.class);
- ((ServiceDefTarget) instance).setServiceEntryPoint(GWT.getModuleBaseURL() + "SocialNetworkService");
- }
- return instance;
- }
-
- }
-
SocialNetworkResultDTO AcceptJoinGroup(String hash, String groupShortName, String groupToAcceptShortName)
throws DefaultException;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/ColorTheme.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/ColorTheme.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/ColorTheme.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -21,6 +21,7 @@
import com.google.gwt.i18n.client.Dictionary;
+ at Deprecated
public class ColorTheme {
private static final String DEFAULT_KUNE_THEME = "defaultKuneTheme";
@@ -28,71 +29,71 @@
private Dictionary theme;
public ColorTheme() {
- this(DEFAULT_KUNE_THEME);
+ this(DEFAULT_KUNE_THEME);
}
public ColorTheme(final String theme) {
- this.theme = Dictionary.getDictionary(theme);
+ this.theme = Dictionary.getDictionary(theme);
}
- public void setTheme(final String theme) {
- this.theme = Dictionary.getDictionary(theme);
+ public String getContentBottomText() {
+ return theme.get("contentBottomText");
}
- public String getThemeName() {
- return theme.get("themeName");
+ public String getContentMainBorder() {
+ return theme.get("contentMainBorder");
}
- public String getToolSelected() {
- return theme.get("toolSelected");
+ public String getContentSubTitleText() {
+ return theme.get("contentSubTitleText");
}
- public String getToolUnselected() {
- return theme.get("toolUnselected");
+ public String getContentTitle() {
+ return theme.get("contentTitle");
}
- public String getContentMainBorder() {
- return theme.get("contentMainBorder");
+ public String getContentTitleText() {
+ return theme.get("contentTitleText");
}
- public String getContentTitle() {
- return theme.get("contentTitle");
+ public String getContext() {
+ return theme.get("context");
}
- public String getContentTitleText() {
- return theme.get("contentTitleText");
+ public String getGroupMembersDD() {
+ return theme.get("groupMembersDD");
}
- public String getContentSubTitleText() {
- return theme.get("contentSubTitleText");
+ public String getParticipationDD() {
+ return theme.get("participationDD");
}
- public String getContentBottomText() {
- return theme.get("contentBottomText");
+ public String getSplitter() {
+ return theme.get("splitter");
}
- public String getContext() {
- return theme.get("context");
+ public String getSummaryDD() {
+ return theme.get("summaryDD");
}
- public String getSplitter() {
- return theme.get("splitter");
+ public String getTagsDD() {
+ return theme.get("tagsDD");
}
- public String getGroupMembersDD() {
- return theme.get("groupMembersDD");
+ public String getThemeName() {
+ return theme.get("themeName");
}
- public String getParticipationDD() {
- return theme.get("participationDD");
+ public String getToolSelected() {
+ return theme.get("toolSelected");
}
- public String getSummaryDD() {
- return theme.get("summaryDD");
+ public String getToolUnselected() {
+ return theme.get("toolUnselected");
}
- public String getTagsDD() {
- return theme.get("tagsDD");
+ public void setTheme(final String theme) {
+ this.theme = Dictionary.getDictionary(theme);
}
}
\ No newline at end of file
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-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -11,13 +11,19 @@
import org.ourproject.kune.platf.client.extend.ExtensibleWidgetsManager;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.rpc.ContentService;
+import org.ourproject.kune.platf.client.rpc.GroupService;
+import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
+import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
import org.ourproject.kune.platf.client.state.ContentProviderImpl;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.platf.client.state.SessionImpl;
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.platf.client.state.StateManagerDefault;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.licensechoose.LicenseChoose;
+import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePanel;
+import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePresenter;
import org.ourproject.kune.workspace.client.newgroup.NewGroup;
import org.ourproject.kune.workspace.client.newgroup.NewGroupPresenter;
import org.ourproject.kune.workspace.client.newgroup.ui.NewGroupPanel;
@@ -36,6 +42,7 @@
import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessagePresenter;
import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessageView;
import org.ourproject.kune.workspace.client.sitebar.rpc.UserService;
+import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPanelNew;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPresenterNew;
import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryViewNew;
@@ -92,12 +99,15 @@
import com.calclab.suco.client.modules.ModuleBuilder;
import com.calclab.suco.client.scopes.SingletonScope;
import com.calclab.suco.client.signal.Slot;
+import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Cookies;
import com.google.gwt.user.client.History;
+import com.google.gwt.user.client.rpc.ServiceDefTarget;
public class KuneModule implements Module {
private final I18nLanguageDTO initialLang;
private final HashMap<String, String> lexicon;
+ private ModuleBuilder builder;
public KuneModule(final I18nLanguageDTO initialLang, final HashMap<String, String> lexicon) {
this.initialLang = initialLang;
@@ -109,6 +119,8 @@
}
public void onLoad(final ModuleBuilder builder) {
+ this.builder = builder;
+
builder.registerProvider(Kune.class, new Provider<Kune>() {
public Kune get() {
return new Kune(builder);
@@ -124,9 +136,35 @@
}
}, SingletonScope.class);
+ builder.registerProvider(UserServiceAsync.class, new Provider<UserServiceAsync>() {
+ public UserServiceAsync get() {
+ final UserServiceAsync service = (UserServiceAsync) GWT.create(UserService.class);
+ ((ServiceDefTarget) service).setServiceEntryPoint(GWT.getModuleBaseURL() + "UserService");
+ return service;
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(SocialNetworkServiceAsync.class, new Provider<SocialNetworkServiceAsync>() {
+ public SocialNetworkServiceAsync get() {
+ final SocialNetworkServiceAsync snServiceAsync = (SocialNetworkServiceAsync) GWT
+ .create(SocialNetworkService.class);
+ ((ServiceDefTarget) snServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL()
+ + "SocialNetworkService");
+ return snServiceAsync;
+ }
+ }, SingletonScope.class);
+
+ builder.registerProvider(GroupServiceAsync.class, new Provider<GroupServiceAsync>() {
+ public GroupServiceAsync get() {
+ final GroupServiceAsync groupServiceAsync = (GroupServiceAsync) GWT.create(GroupService.class);
+ ((ServiceDefTarget) groupServiceAsync).setServiceEntryPoint(GWT.getModuleBaseURL() + "GroupService");
+ return groupServiceAsync;
+ }
+ }, SingletonScope.class);
+
builder.registerProvider(Session.class, new Provider<Session>() {
public Session get() {
- return new SessionImpl(Cookies.getCookie(Site.USERHASH), initialLang);
+ return new SessionImpl(Cookies.getCookie(Site.USERHASH), initialLang, p(UserServiceAsync.class));
}
}, SingletonScope.class);
@@ -142,11 +180,10 @@
}
}, SingletonScope.class);
- final I18nUITranslationService i18n = builder.getInstance(I18nUITranslationService.class);
+ final I18nUITranslationService i18n = i(I18nUITranslationService.class);
builder.registerProvider(KuneErrorHandler.class, new Provider<KuneErrorHandler>() {
public KuneErrorHandler get() {
- return new KuneErrorHandler(builder.getInstance(Session.class), i18n, builder
- .getProvider(WorkspaceSkeleton.class));
+ return new KuneErrorHandler(i(Session.class), i18n, p(WorkspaceSkeleton.class));
}
}, SingletonScope.class);
@@ -156,7 +193,7 @@
}
}, SingletonScope.class);
- final KuneErrorHandler errorHandler = builder.getInstance(KuneErrorHandler.class);
+ final KuneErrorHandler errorHandler = i(KuneErrorHandler.class);
AsyncCallbackSimple.init(errorHandler);
builder.registerProvider(ColorTheme.class, new Provider<ColorTheme>() {
@@ -177,16 +214,16 @@
}
}, SingletonScope.class);
- final WorkspaceSkeleton ws = builder.getInstance(WorkspaceSkeleton.class);
- final Images images = builder.getInstance(Images.class);
+ final WorkspaceSkeleton ws = i(WorkspaceSkeleton.class);
+ final Images images = i(Images.class);
builder.registerProvider(Application.class, new Provider<Application>() {
public Application get() {
- final Session session = builder.getInstance(Session.class);
+ final Session session = i(Session.class);
final ExtensibleWidgetsManager extensionPointManager = builder
.getInstance(ExtensibleWidgetsManager.class);
return new ApplicationDefault(session, extensionPointManager, i18n, builder
- .getInstance(ColorTheme.class), builder.getInstance(KuneErrorHandler.class), ws);
+ .getInstance(ColorTheme.class), i(KuneErrorHandler.class), ws);
}
}, SingletonScope.class);
@@ -211,7 +248,7 @@
builder.registerProvider(Site.class, new Provider<Site>() {
public Site get() {
- return new Site(i18n, builder.getInstance(SiteProgress.class), builder.getProvider(SiteMessage.class));
+ return new Site(i18n, i(SiteProgress.class), p(SiteMessage.class));
}
}, SingletonScope.class);
@@ -224,13 +261,12 @@
}
}, SingletonScope.class);
- builder.getInstance(SiteProgress.class);
- builder.getInstance(Site.class);
+ i(SiteProgress.class);
+ i(Site.class);
builder.registerProvider(SiteSignInLink.class, new Provider<SiteSignInLink>() {
public SiteSignInLink get() {
- final SiteSignInLinkPresenter presenter = new SiteSignInLinkPresenter(builder
- .getInstance(Session.class));
+ final SiteSignInLinkPresenter presenter = new SiteSignInLinkPresenter(i(Session.class));
final SiteSignInLinkPanel panel = new SiteSignInLinkPanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
@@ -239,9 +275,8 @@
builder.registerProvider(SiteSignOutLink.class, new Provider<SiteSignOutLink>() {
public SiteSignOutLink get() {
- final SiteSignOutLinkPresenter presenter = new SiteSignOutLinkPresenter(builder
- .getInstance(Session.class), UserService.App.getInstance(), builder
- .getInstance(KuneErrorHandler.class));
+ final SiteSignOutLinkPresenter presenter = new SiteSignOutLinkPresenter(i(Session.class),
+ p(UserServiceAsync.class), p(KuneErrorHandler.class));
final SiteSignOutLinkPanel panel = new SiteSignOutLinkPanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
@@ -251,7 +286,7 @@
builder.registerProvider(SiteNewGroupLink.class, new Provider<SiteNewGroupLink>() {
public SiteNewGroupLink get() {
final SiteNewGroupLinkPresenter presenter = new SiteNewGroupLinkPresenter();
- final SiteNewGroupLinkPanel panel = new SiteNewGroupLinkPanel(presenter, ws);
+ final SiteNewGroupLinkPanel panel = new SiteNewGroupLinkPanel(presenter, ws, i18n);
presenter.init(panel);
return presenter;
}
@@ -268,7 +303,7 @@
builder.registerProvider(SiteLogo.class, new Provider<SiteLogo>() {
public SiteLogo get() {
- final SiteLogoPresenter presenter = new SiteLogoPresenter(builder.getInstance(Session.class));
+ final SiteLogoPresenter presenter = new SiteLogoPresenter(i(Session.class));
final SiteLogoPanel panel = new SiteLogoPanel(presenter, ws);
presenter.init(panel);
return presenter;
@@ -286,7 +321,7 @@
builder.registerProvider(SiteSearch.class, new Provider<SiteSearch>() {
public SiteSearch get() {
- final SiteSearchPresenter presenter = new SiteSearchPresenter(builder.getProvider(SiteSearcher.class));
+ final SiteSearchPresenter presenter = new SiteSearchPresenter(p(SiteSearcher.class));
final SiteSearchPanel panel = new SiteSearchPanel(presenter, ws, i18n);
presenter.init(panel);
return presenter;
@@ -295,29 +330,39 @@
builder.registerProvider(SignIn.class, new Provider<SignIn>() {
public SignIn get() {
- final SignInPresenter presenter = new SignInPresenter(builder.getInstance(Session.class), builder
- .getInstance(StateManager.class), i18n, UserService.App.getInstance());
+ final SignInPresenter presenter = new SignInPresenter(i(Session.class), builder
+ .getInstance(StateManager.class), i18n, i(UserServiceAsync.class));
final SignInPanel view = new SignInPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
}
}, SingletonScope.class);
+ builder.registerProvider(LicenseChoose.class, new Provider<LicenseChoose>() {
+ public LicenseChoose get() {
+ final LicenseChoosePresenter presenter = new LicenseChoosePresenter(i(Session.class));
+ final LicenseChoosePanel view = new LicenseChoosePanel(presenter, i18n);
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
builder.registerProvider(NewGroup.class, new Provider<NewGroup>() {
public NewGroup get() {
- final NewGroupPresenter presenter = new NewGroupPresenter(null, i18n);
- final NewGroupPanel view = new NewGroupPanel(presenter, i18n);
+ final NewGroupPresenter presenter = new NewGroupPresenter(i18n, i(Session.class),
+ i(StateManager.class), p(GroupServiceAsync.class));
+ final NewGroupPanel view = new NewGroupPanel(presenter, i18n, p(LicenseChoose.class));
presenter.init(view);
return presenter;
}
}, SingletonScope.class);
- builder.getInstance(SitePublicSpaceLink.class);
- builder.getInstance(SiteSignInLink.class);
- builder.getInstance(SiteSignOutLink.class);
- builder.getInstance(SiteNewGroupLink.class);
- builder.getInstance(SiteSearch.class);
- builder.getInstance(SiteLogo.class);
+ i(SitePublicSpaceLink.class);
+ i(SiteSignInLink.class);
+ i(SiteSignOutLink.class);
+ i(SiteNewGroupLink.class);
+ i(SiteSearch.class);
+ i(SiteLogo.class);
builder.registerProvider(EntityLogo.class, new Provider<EntityLogo>() {
public EntityLogo get() {
@@ -327,7 +372,7 @@
builder.registerProvider(WsThemePresenter.class, new Provider<WsThemePresenter>() {
public WsThemePresenter get() {
- final WsThemePresenter presenter = new WsThemePresenter(builder.getInstance(Session.class));
+ final WsThemePresenter presenter = new WsThemePresenter(i(Session.class), p(GroupServiceAsync.class));
final WsThemePanel panel = new WsThemePanel(ws, presenter, i18n);
presenter.init(panel);
return presenter;
@@ -364,14 +409,12 @@
builder.registerProvider(WorkspaceManager.class, new Provider<WorkspaceManager>() {
public WorkspaceManager get() {
- final WorkspaceManager presenter = new WorkspaceManager(builder.getInstance(SitePublicSpaceLink.class),
- builder.getInstance(EntityLogo.class), builder.getInstance(EntityTitlePresenter.class), builder
+ final WorkspaceManager presenter = new WorkspaceManager(i(SitePublicSpaceLink.class),
+ i(EntityLogo.class), i(EntityTitlePresenter.class), builder
.getInstance(EntitySubTitlePresenter.class), builder
- .getInstance(WsThemePresenter.class),
- builder.getInstance(EntityLicensePresenter.class), builder
+ .getInstance(WsThemePresenter.class), i(EntityLicensePresenter.class), builder
.getProvider(GroupMembersSummary.class), builder
- .getProvider(ParticipationSummary.class), builder.getProvider(TagsSummary.class),
- builder.getProvider(GroupSummary.class));
+ .getProvider(ParticipationSummary.class), p(TagsSummary.class), p(GroupSummary.class));
return presenter;
}
}, SingletonScope.class);
@@ -379,8 +422,8 @@
builder.registerProvider(StateManager.class, new Provider<StateManager>() {
public StateManager get() {
final StateManagerDefault stateManager = new StateManagerDefault(new ContentProviderImpl(
- ContentService.App.getInstance()), builder.getInstance(Session.class),
- new HistoryWrapperImpl(), builder.getInstance(WorkspaceManager.class));
+ ContentService.App.getInstance()), i(Session.class), new HistoryWrapperImpl(),
+ i(WorkspaceManager.class));
History.addHistoryListener(stateManager);
return stateManager;
}
@@ -388,9 +431,9 @@
builder.registerProvider(GroupMembersSummary.class, new Provider<GroupMembersSummary>() {
public GroupMembersSummary get() {
- final GroupMembersSummaryPresenterNew presenter = new GroupMembersSummaryPresenterNew(i18n, builder
- .getProvider(StateManager.class), builder.getInstance(ImageUtils.class), builder
- .getInstance(Session.class), SocialNetworkService.App.getInstance());
+ final GroupMembersSummaryPresenterNew presenter = new GroupMembersSummaryPresenterNew(i18n,
+ p(StateManager.class), i(ImageUtils.class), i(Session.class),
+ p(SocialNetworkServiceAsync.class));
final GroupMembersSummaryViewNew view = new GroupMembersSummaryPanelNew(presenter, i18n, ws);
presenter.init(view);
return presenter;
@@ -408,9 +451,9 @@
builder.registerProvider(ParticipationSummary.class, new Provider<ParticipationSummary>() {
public ParticipationSummary get() {
- final ParticipationSummaryPresenter presenter = new ParticipationSummaryPresenter(i18n, builder
- .getProvider(StateManager.class), builder.getInstance(ImageUtils.class), builder
- .getInstance(Session.class), SocialNetworkService.App.getInstance());
+ final ParticipationSummaryPresenter presenter = new ParticipationSummaryPresenter(i18n,
+ p(StateManager.class), i(ImageUtils.class), i(Session.class),
+ p(SocialNetworkServiceAsync.class));
final ParticipationSummaryView view = new ParticipationSummaryPanel(presenter, i18n, ws);
presenter.init(view);
return presenter;
@@ -419,8 +462,8 @@
builder.registerProvider(TagsSummary.class, new Provider<TagsSummary>() {
public TagsSummary get() {
- final TagsSummaryPresenter presenter = new TagsSummaryPresenter(builder.getProvider(Session.class),
- builder.getProvider(SiteSearcher.class));
+ final TagsSummaryPresenter presenter = new TagsSummaryPresenter(p(Session.class), builder
+ .getProvider(SiteSearcher.class));
final TagsSummaryPanel panel = new TagsSummaryPanel(presenter, i18n, ws);
presenter.init(panel);
return presenter;
@@ -428,15 +471,26 @@
}, SingletonScope.class);
// Register of tokens like "signin", "newgroup", "translate" etcetera
- builder.getInstance(StateManager.class).addSiteToken(SiteToken.signin.toString(), new Slot<StateToken>() {
+ i(StateManager.class).addSiteToken(SiteToken.signin.toString(), new Slot<StateToken>() {
public void onEvent(final StateToken previousStateToken) {
- builder.getInstance(SignIn.class).doSignIn(previousStateToken);
+ i(SignIn.class).doSignIn(previousStateToken);
}
});
- // builder.registerProvider(type, new Provider<>() {},
- // SingletonScope.class)
+ i(StateManager.class).addSiteToken(SiteToken.newgroup.toString(), new Slot<StateToken>() {
+ public void onEvent(final StateToken previousStateToken) {
+ i(NewGroup.class).doNewGroup(previousStateToken);
+ }
+ });
}
+ private <T> T i(final Class<T> componentType) {
+ return builder.getInstance(componentType);
+ }
+
+ private <T> Provider<T> p(final Class<T> componentKey) {
+ return builder.getProvider(componentKey);
+ }
+
}
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-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/Session.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -28,6 +28,7 @@
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import com.calclab.suco.client.signal.Slot;
@@ -38,6 +39,8 @@
*/
public static int SESSION_DURATION = 1000 * 60 * 60 * 24 * 14;
+ public void check(AsyncCallbackSimple<?> callback);
+
public List<I18nCountryDTO> getCountries();
public Object[][] getCountriesArray();
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-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/state/SessionImpl.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -30,7 +30,10 @@
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
+import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Signal;
import com.calclab.suco.client.signal.Slot;
@@ -46,16 +49,23 @@
private final Signal<InitDataDTO> onInitDataReceived;
private final Signal<UserInfoDTO> onUserSignIn;
private final Signal<Object> onUserSignOut;
+ private final Provider<UserServiceAsync> userServiceProvider;
- public SessionImpl(final String userHash, final I18nLanguageDTO initialLanguage) {
+ public SessionImpl(final String userHash, final I18nLanguageDTO initialLanguage,
+ final Provider<UserServiceAsync> userServiceProvider) {
this.userHash = userHash;
currentLanguage = initialLanguage;
+ this.userServiceProvider = userServiceProvider;
languagesArray = null;
this.onInitDataReceived = new Signal<InitDataDTO>("initDataReceived");
this.onUserSignIn = new Signal<UserInfoDTO>("onUserSignIn");
this.onUserSignOut = new Signal<Object>("onUserSignOut");
}
+ public void check(final AsyncCallbackSimple<?> callback) {
+ userServiceProvider.get().onlyCheckSession(getUserHash(), callback);
+ }
+
public List<I18nCountryDTO> getCountries() {
return initData.getCountries();
}
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-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/dialogs/DefaultForm.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -25,6 +25,10 @@
form.add(field);
}
+ public void addStyleName(final String cls) {
+ form.addStyleName(cls);
+ }
+
public FormPanel getForm() {
return form;
}
@@ -33,6 +37,10 @@
return form.getForm().isValid();
}
+ public void removeStyleName(final String cls) {
+ form.removeStyleName(cls);
+ }
+
public void reset() {
form.getForm().reset();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -29,13 +29,10 @@
import org.ourproject.kune.workspace.client.actions.AddGroupLiveSearchAction;
import org.ourproject.kune.workspace.client.actions.AddUserLiveSearchAction;
import org.ourproject.kune.workspace.client.actions.AttachToExtensibleWidgetAction;
-import org.ourproject.kune.workspace.client.actions.ChangeGroupWsThemeAction;
import org.ourproject.kune.workspace.client.actions.ClearExtensibleWidgetAction;
-import org.ourproject.kune.workspace.client.actions.CreateNewGroupAction;
import org.ourproject.kune.workspace.client.actions.DetachFromExtensibleWidgetAction;
import org.ourproject.kune.workspace.client.actions.DisableRateItAction;
import org.ourproject.kune.workspace.client.actions.EnableRateItAction;
-import org.ourproject.kune.workspace.client.actions.OnlyCheckUserSessionAction;
import org.ourproject.kune.workspace.client.actions.RateContentAction;
import org.ourproject.kune.workspace.client.actions.RecalculateWorkspaceAction;
import org.ourproject.kune.workspace.client.actions.ReloadContextAction;
@@ -43,16 +40,6 @@
import org.ourproject.kune.workspace.client.actions.i18n.GetLexiconAction;
import org.ourproject.kune.workspace.client.actions.i18n.GetTranslationAction;
import org.ourproject.kune.workspace.client.actions.i18n.ShowTranslatorAction;
-import org.ourproject.kune.workspace.client.actions.sn.AcceptJoinGroupAction;
-import org.ourproject.kune.workspace.client.actions.sn.AddAdminAction;
-import org.ourproject.kune.workspace.client.actions.sn.AddCollabAction;
-import org.ourproject.kune.workspace.client.actions.sn.AddViewerAction;
-import org.ourproject.kune.workspace.client.actions.sn.DeleteMemberAction;
-import org.ourproject.kune.workspace.client.actions.sn.DenyJoinGroupAction;
-import org.ourproject.kune.workspace.client.actions.sn.RequestJoinGroupAction;
-import org.ourproject.kune.workspace.client.actions.sn.SetAdminAsCollabAction;
-import org.ourproject.kune.workspace.client.actions.sn.SetCollabAsAdminAction;
-import org.ourproject.kune.workspace.client.actions.sn.UnJoinGroupAction;
import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
import org.ourproject.kune.workspace.client.workspace.Workspace;
@@ -74,27 +61,10 @@
}
public void configure(final Register register) {
- register.addAction(WorkspaceEvents.ONLY_CHECK_USER_SESSION, new OnlyCheckUserSessionAction(session));
register.addAction(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET, new AttachToExtensibleWidgetAction(workspace));
register.addAction(PlatformEvents.DETACH_FROM_EXTENSIBLE_WIDGET,
new DetachFromExtensibleWidgetAction(workspace));
register.addAction(PlatformEvents.CLEAR_EXTENSIBLE_WIDGET, new ClearExtensibleWidgetAction(workspace));
- register.addAction(WorkspaceEvents.REQ_JOIN_GROUP, new RequestJoinGroupAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.ACCEPT_JOIN_GROUP, new AcceptJoinGroupAction(session, stateManager,
- workspace, i18n));
- register.addAction(WorkspaceEvents.DENY_JOIN_GROUP, new DenyJoinGroupAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.DEL_MEMBER, new DeleteMemberAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.SET_COLLAB_AS_ADMIN, new SetCollabAsAdminAction(session, stateManager,
- workspace, i18n));
- register.addAction(WorkspaceEvents.SET_ADMIN_AS_COLLAB, new SetAdminAsCollabAction(session, stateManager,
- workspace, i18n));
- register
- .addAction(WorkspaceEvents.ADD_ADMIN_MEMBER, new AddAdminAction(session, stateManager, workspace, i18n));
- register.addAction(WorkspaceEvents.ADD_COLLAB_MEMBER, new AddCollabAction(session, stateManager, workspace,
- i18n));
- register.addAction(WorkspaceEvents.ADD_VIEWER_MEMBER, new AddViewerAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.UNJOIN_GROUP, new UnJoinGroupAction(session, stateManager, i18n));
- register.addAction(WorkspaceEvents.CHANGE_GROUP_WSTHEME, new ChangeGroupWsThemeAction(session, workspace));
register.addAction(WorkspaceEvents.RATE_CONTENT, new RateContentAction(session, stateManager, i18n));
register.addAction(WorkspaceEvents.ENABLE_RATEIT, new EnableRateItAction(workspace));
register.addAction(WorkspaceEvents.DISABLE_RATEIT, new DisableRateItAction(workspace));
@@ -104,7 +74,6 @@
register.addAction(WorkspaceEvents.SHOW_TRANSLATOR, new ShowTranslatorAction(session, workspace, i18n));
register.addAction(WorkspaceEvents.DO_TRANSLATION, new DoTranslationAction(session, i18n));
register.addAction(WorkspaceEvents.GET_LEXICON, new GetLexiconAction(i18n));
- register.addAction(WorkspaceEvents.CREATE_NEW_GROUP, new CreateNewGroupAction(session));
register.addAction(WorkspaceEvents.RELOAD_CONTEXT, new ReloadContextAction(stateManager));
register.addAction(WorkspaceEvents.RECALCULATE_WORKSPACE_SIZE, new RecalculateWorkspaceAction(workspace));
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceEvents.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -21,18 +21,6 @@
package org.ourproject.kune.workspace.client;
public interface WorkspaceEvents {
- public static final String ONLY_CHECK_USER_SESSION = "ws_OnlyCheckUserSession";
- public static final String REQ_JOIN_GROUP = "ws.RequestJoinGroup";
- public static final String DEL_MEMBER = "ws.DeleteMember";
- public static final String DENY_JOIN_GROUP = "ws.DenyJoinGroup";
- public static final String ACCEPT_JOIN_GROUP = "ws.AcceptJoinGroup";
- public static final String SET_COLLAB_AS_ADMIN = "ws.SetMemberAsAsmin";
- public static final String SET_ADMIN_AS_COLLAB = "ws.SetMemberAsCollab";
- public static final String ADD_ADMIN_MEMBER = "ws.AddAdminMember";
- public static final String ADD_COLLAB_MEMBER = "ws.AddCollabMember";
- public static final String ADD_VIEWER_MEMBER = "ws.AddViewerMember";
- public static final String UNJOIN_GROUP = "ws.UnJoinGroup";
- public static final String CHANGE_GROUP_WSTHEME = "ws.ChangeGroupWsTheme";
public static final String RATE_CONTENT = "ws.RateContent";
public static final String ENABLE_RATEIT = "ws.EnableRateIt";
public static final String DISABLE_RATEIT = "ws.DisableRateIt";
@@ -43,7 +31,6 @@
public static final String SHOW_SEARCHER = "ws.ShowSearcher";
public static final String GET_TRANSLATION = "i18n.GetTranslation";
public static final String DO_TRANSLATION = "i18n.doTranslation";
- public static final String CREATE_NEW_GROUP = "ws.CreateNewGroup";
public static final String RELOAD_CONTEXT = "ws.ReoloadContext";
public static final String WS_SPLITTER_STARTRESIZING = "ws.SplitterStartResizing";
public static final String WS_SPLITTER_STOPRESIZING = "ws.SplitterStopResizing";
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -48,9 +48,6 @@
import org.ourproject.kune.workspace.client.socialnet.UserLiveSearchPresenter;
import org.ourproject.kune.workspace.client.socialnet.ui.GroupLiveSearchPanel;
import org.ourproject.kune.workspace.client.socialnet.ui.UserLiveSearchPanel;
-import org.ourproject.kune.workspace.client.theme.ThemeMenuPanel;
-import org.ourproject.kune.workspace.client.theme.ThemeMenuPresenter;
-import org.ourproject.kune.workspace.client.theme.ThemeMenuView;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsPanel;
import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItemsPresenter;
@@ -67,7 +64,6 @@
import org.ourproject.kune.workspace.client.workspace.ContentToolBarPresenter;
import org.ourproject.kune.workspace.client.workspace.ContentToolBarView;
import org.ourproject.kune.workspace.client.workspace.GroupLiveSearchComponent;
-import org.ourproject.kune.workspace.client.workspace.ThemeMenuComponent;
import org.ourproject.kune.workspace.client.workspace.UserLiveSearchComponent;
import org.ourproject.kune.workspace.client.workspace.Workspace;
import org.ourproject.kune.workspace.client.workspace.WorkspacePresenter;
@@ -82,7 +78,6 @@
private static Session session;
private static I18nTranslationService i18n;
- private static ColorTheme colorTheme;
private static KuneErrorHandler errorHandler;
public static ContentBottomToolBarComponent createContentBottomToolBarComponent() {
@@ -161,13 +156,6 @@
return presenter;
}
- public static ThemeMenuComponent createThemeMenuComponent() {
- final ThemeMenuPresenter presenter = new ThemeMenuPresenter();
- final ThemeMenuView view = new ThemeMenuPanel(presenter, i18n, colorTheme);
- presenter.init(view);
- return presenter;
- }
-
public static UserLiveSearchComponent createUserLiveSearchComponent() {
final UserLiveSearchPresenter presenter = new UserLiveSearchPresenter();
final EntityLiveSearchView view = new UserLiveSearchPanel(presenter, i18n);
@@ -180,7 +168,6 @@
final ColorTheme colorTheme, final KuneErrorHandler errorHandler) {
WorkspaceFactory.session = session;
WorkspaceFactory.i18n = i18n;
- WorkspaceFactory.colorTheme = colorTheme;
WorkspaceFactory.errorHandler = errorHandler;
final WorkspacePresenter workspace = new WorkspacePresenter(session);
final WorkspaceView view = new WorkspacePanel(workspace, i18n, colorTheme);
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ChangeGroupWsThemeAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ChangeGroupWsThemeAction.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ChangeGroupWsThemeAction.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,57 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.GroupService;
-import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
-public class ChangeGroupWsThemeAction implements Action<String> {
-
- private final Workspace workspace;
- private final Session session;
-
- public ChangeGroupWsThemeAction(final Session session, final Workspace workspace) {
- this.session = session;
- this.workspace = workspace;
- }
-
- public void execute(final String theme) {
- onChangeGroupWsTheme(theme);
- }
-
- private void onChangeGroupWsTheme(final String theme) {
- Site.showProgressProcessing();
- final GroupServiceAsync server = GroupService.App.getInstance();
- server.changeGroupWsTheme(session.getUserHash(), session.getCurrentState().getGroup().getShortName(), theme,
- new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
- workspace.setTheme(theme);
- Site.hideProgress();
- }
- });
-
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/CreateNewGroupAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/CreateNewGroupAction.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/CreateNewGroupAction.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,48 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.platf.client.rpc.GroupService;
-import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
-import org.ourproject.kune.platf.client.rpc.ParamCallback;
-import org.ourproject.kune.platf.client.state.Session;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public class CreateNewGroupAction implements Action<ParamCallback<GroupDTO, StateToken>> {
-
- private final Session session;
-
- public CreateNewGroupAction(final Session session) {
- this.session = session;
- }
-
- public void execute(final ParamCallback<GroupDTO, StateToken> paramCall) {
- onNewGroup(paramCall.getParam(), paramCall.getCallback());
- }
-
- private void onNewGroup(final GroupDTO group, final AsyncCallback<StateToken> callback) {
- GroupServiceAsync groupService = GroupService.App.getInstance();
- groupService.createNewGroup(session.getUserHash(), group, callback);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/OnlyCheckUserSessionAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/OnlyCheckUserSessionAction.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/OnlyCheckUserSessionAction.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,44 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.sitebar.rpc.UserService;
-import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
-
-import com.google.gwt.user.client.rpc.AsyncCallback;
-
-public class OnlyCheckUserSessionAction implements Action<AsyncCallback<Object>> {
- private final Session session;
-
- public OnlyCheckUserSessionAction(final Session session) {
- this.session = session;
- }
-
- public void execute(final AsyncCallback<Object> value) {
- onOnlyCheckUserSession(value);
- }
-
- private void onOnlyCheckUserSession(final AsyncCallback<Object> callback) {
- UserServiceAsync server = UserService.App.getInstance();
- server.onlyCheckSession(session.getUserHash(), callback);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AcceptJoinGroupAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AcceptJoinGroupAction.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AcceptJoinGroupAction.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,68 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions.sn;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-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.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
-public class AcceptJoinGroupAction implements Action<String> {
-
- private final StateManager stateManager;
- private final Workspace workspace;
- private final Session session;
- private final I18nTranslationService i18n;
-
- @Deprecated
- public AcceptJoinGroupAction(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nTranslationService i18n) {
- this.session = session;
- this.workspace = workspace;
- this.stateManager = stateManager;
- this.i18n = i18n;
- }
-
- public void execute(final String groupShortName) {
- onAcceptJoinGroup(groupShortName);
- }
-
- private void onAcceptJoinGroup(final String groupShortName) {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.AcceptJoinGroup(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- groupShortName, new AsyncCallbackSimple<SocialNetworkResultDTO>() {
- public void onSuccess(final SocialNetworkResultDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Member accepted"));
- stateManager.setSocialNetwork(result);
- // FIXME
- // workspace.getGroupMembersComponent().showCollabs();
- }
- });
-
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddAdminAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddAdminAction.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddAdminAction.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,67 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions.sn;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-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.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
- at Deprecated
-public class AddAdminAction implements Action<String> {
-
- private final Workspace workspace;
- private final StateManager stateManager;
- private final Session session;
- private final I18nTranslationService i18n;
-
- public AddAdminAction(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.workspace = workspace;
- this.i18n = i18n;
- }
-
- public void execute(final String groupShortName) {
- onAddAdmin(groupShortName);
- }
-
- private void onAddAdmin(final String groupShortName) {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.addAdminMember(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- groupShortName, new AsyncCallbackSimple<SocialNetworkResultDTO>() {
- public void onSuccess(final SocialNetworkResultDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Member added as admin"));
- stateManager.setSocialNetwork(result);
- // workspace.getGroupMembersComponent().showAdmins();
- }
- });
-
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddCollabAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddCollabAction.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddCollabAction.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions.sn;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-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.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
- at Deprecated
-public class AddCollabAction implements Action<String> {
-
- private final Session session;
- private final StateManager stateManager;
- private final Workspace workspace;
- private final I18nTranslationService i18n;
-
- public AddCollabAction(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.workspace = workspace;
- this.i18n = i18n;
- }
-
- public void execute(final String groupShortName) {
- onAddCollab(groupShortName);
- }
-
- private void onAddCollab(final String groupShortName) {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.addCollabMember(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- groupShortName, new AsyncCallbackSimple<SocialNetworkResultDTO>() {
- public void onSuccess(final SocialNetworkResultDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Member added as collaborator"));
- stateManager.setSocialNetwork(result);
- // workspace.getGroupMembersComponent().showCollabs();
- }
- });
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddViewerAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddViewerAction.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddViewerAction.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,61 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions.sn;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-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.sitebar.Site;
-
-public class AddViewerAction implements Action<String> {
-
- private final Session session;
- private final StateManager stateManager;
- private final I18nTranslationService i18n;
-
- public AddViewerAction(final Session session, final StateManager stateManager, final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- }
-
- public void execute(final String groupShortName) {
- onAddViewer(groupShortName);
- }
-
- private void onAddViewer(final String groupShortName) {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.addViewerMember(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- groupShortName, new AsyncCallbackSimple<SocialNetworkResultDTO>() {
- public void onSuccess(final SocialNetworkResultDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Member can now view this group contents"));
- stateManager.setSocialNetwork(result);
- }
- });
-
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/DeleteMemberAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/DeleteMemberAction.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/DeleteMemberAction.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,63 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions.sn;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-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.sitebar.Site;
-
-public class DeleteMemberAction implements Action<String> {
- private final Session session;
- private final StateManager stateManager;
- private final I18nTranslationService i18n;
-
- public DeleteMemberAction(final Session session, final StateManager stateManager, final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- }
-
- public void execute(final String value) {
- onDeleteMember(value);
- }
-
- private void onDeleteMember(final String groupShortName) {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.deleteMember(session.getUserHash(), session.getCurrentState().getGroup().getShortName(), groupShortName,
- new AsyncCallbackSimple<SocialNetworkResultDTO>() {
- public void onSuccess(final SocialNetworkResultDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Member removed"));
- stateManager.reload();
- // in the future, only if I cannot be affected:
- // services.stateManager.reloadSocialNetwork((SocialNetworkResultDTO)
- // result);
- }
- });
-
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/DenyJoinGroupAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/DenyJoinGroupAction.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/DenyJoinGroupAction.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,60 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions.sn;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-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.sitebar.Site;
-
-public class DenyJoinGroupAction implements Action<String> {
-
- private final Session session;
- private final StateManager stateManager;
- private final I18nTranslationService i18n;
-
- public DenyJoinGroupAction(final Session session, final StateManager stateManager, final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- }
-
- public void execute(final String value) {
- onDenyJoinGroup(value);
- }
-
- private void onDenyJoinGroup(final String groupShortName) {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.denyJoinGroup(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- groupShortName, new AsyncCallbackSimple<SocialNetworkResultDTO>() {
- public void onSuccess(final SocialNetworkResultDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Member rejected"));
- stateManager.setSocialNetwork(result);
- }
- });
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/RequestJoinGroupAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/RequestJoinGroupAction.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/RequestJoinGroupAction.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,72 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions.sn;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.SocialNetworkDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-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.sitebar.Site;
-
- at SuppressWarnings("unchecked")
-public class RequestJoinGroupAction implements Action {
-
- private final Session session;
- private final StateManager stateManager;
- private final I18nTranslationService i18n;
-
- public RequestJoinGroupAction(final Session session, final StateManager stateManager,
- final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- }
-
- public void execute(final Object value) {
- onRequestJoinGroup();
- }
-
- private void onRequestJoinGroup() {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.requestJoinGroup(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
- Site.hideProgress();
- final String resultType = (String) result;
- if (resultType == SocialNetworkDTO.REQ_JOIN_ACEPTED) {
- Site.info(i18n.t("You are now member of this group"));
- stateManager.reload();
- }
- if (resultType == SocialNetworkDTO.REQ_JOIN_DENIED) {
- Site.important(i18n.t("Sorry this is a closed group"));
- }
- if (resultType == SocialNetworkDTO.REQ_JOIN_WAITING_MODERATION) {
- Site.info(i18n.t("Requested. Waiting for admins decision"));
- }
- }
- });
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetAdminAsCollabAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetAdminAsCollabAction.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetAdminAsCollabAction.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,66 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions.sn;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-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.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
- at Deprecated
-public class SetAdminAsCollabAction implements Action<String> {
-
- private final Session session;
- private final StateManager stateManager;
- private final Workspace workspace;
- private final I18nTranslationService i18n;
-
- public SetAdminAsCollabAction(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.workspace = workspace;
- this.i18n = i18n;
- }
-
- public void execute(final String value) {
- onSetAdminAsCollab(value);
- }
-
- private void onSetAdminAsCollab(final String groupShortName) {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.setAdminAsCollab(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- groupShortName, new AsyncCallbackSimple<SocialNetworkResultDTO>() {
- public void onSuccess(final SocialNetworkResultDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Type of member changed"));
- stateManager.reload();
- // workspace.getGroupMembersComponent().showCollabs();
- }
- });
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetCollabAsAdminAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetCollabAsAdminAction.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetCollabAsAdminAction.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,68 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions.sn;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-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.sitebar.Site;
-import org.ourproject.kune.workspace.client.workspace.Workspace;
-
- at Deprecated
-public class SetCollabAsAdminAction implements Action<String> {
-
- private final Session session;
- private final StateManager stateManager;
- private final Workspace workspace;
- private final I18nTranslationService i18n;
-
- public SetCollabAsAdminAction(final Session session, final StateManager stateManager, final Workspace workspace,
- final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.workspace = workspace;
- this.i18n = i18n;
- }
-
- public void execute(final String value) {
- onSetCollabAsAdmin(value);
- }
-
- private void onSetCollabAsAdmin(final String groupShortName) {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.setCollabAsAdmin(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- groupShortName, new AsyncCallbackSimple<SocialNetworkResultDTO>() {
- public void onSuccess(final SocialNetworkResultDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Type of member changed"));
- stateManager.setSocialNetwork(result);
- // workspace.getGroupMembersComponent().showAdmins();
- // workspace.getGroupMembersComponent().showAdmins();
- }
- });
-
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/UnJoinGroupAction.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/UnJoinGroupAction.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/UnJoinGroupAction.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,62 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.actions.sn;
-
-import org.ourproject.kune.platf.client.dispatch.Action;
-import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
-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.sitebar.Site;
-
-public class UnJoinGroupAction implements Action<String> {
- private final Session session;
- private final StateManager stateManager;
- private final I18nTranslationService i18n;
-
- public UnJoinGroupAction(final Session session, final StateManager stateManager, final I18nTranslationService i18n) {
- this.session = session;
- this.stateManager = stateManager;
- this.i18n = i18n;
- }
-
- public void execute(final String value) {
- onUnJoinGroup(value);
- }
-
- private void onUnJoinGroup(final String groupShortName) {
- Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.unJoinGroup(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- new AsyncCallbackSimple<SocialNetworkResultDTO>() {
- public void onSuccess(final SocialNetworkResultDTO result) {
- Site.hideProgress();
- Site.info(i18n.t("Removed as member"));
- stateManager.reload();
- // in the future with user info:
- // services.stateManager.reloadSocialNetwork((SocialNetworkResultDTO)
- // result);
- }
- });
- }
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePanel.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePanel.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -57,171 +57,171 @@
private final RadioButton nonCommercialRB;
private final I18nTranslationService i18n;
- public LicenseChoosePanel(final List<LicenseDTO> nonCCLicenses, final LicenseChoosePresenter presenter,
- final I18nTranslationService i18n) {
- this.i18n = i18n;
- Images img = Images.App.getInstance();
+ public LicenseChoosePanel(final LicenseChoosePresenter presenter, final I18nTranslationService i18n) {
+ this.i18n = i18n;
+ final Images img = Images.App.getInstance();
- VerticalPanel generalVP = new VerticalPanel();
- initWidget(generalVP);
+ final VerticalPanel generalVP = new VerticalPanel();
+ initWidget(generalVP);
- VerticalPanel licenseTypesVP = new VerticalPanel();
- ccRB = new RadioButton("ccOrNot", i18n.t("Creative Commons"));
- RadioButton notCcRB = new RadioButton("ccOrNot", i18n.t("Others licenses"));
- options = new DeckPanel();
- ccIntro = new Label(
- i18n
- .t("With a Creative Commons license, you keep your copyright but allow people to copy and distribute your work provided they give you credit — and only on the conditions you specify here. What do you want to do?"));
+ final VerticalPanel licenseTypesVP = new VerticalPanel();
+ ccRB = new RadioButton("ccOrNot", i18n.t("Creative Commons"));
+ final RadioButton notCcRB = new RadioButton("ccOrNot", i18n.t("Others licenses"));
+ options = new DeckPanel();
+ ccIntro = new Label(
+ i18n
+ .t("With a Creative Commons license, you keep your copyright but allow people to copy and distribute your work provided they give you credit — and only on the conditions you specify here. What do you want to do?"));
- otherLicenses = new ListBox();
- VerticalPanel ccOptionsVP = new VerticalPanel();
- VerticalPanel nonCcOptionsVP = new VerticalPanel();
+ otherLicenses = new ListBox();
+ final VerticalPanel ccOptionsVP = new VerticalPanel();
+ final VerticalPanel nonCcOptionsVP = new VerticalPanel();
- Label comercialLabel = new Label(i18n.t("Allow commercial uses of your work?"));
- commercialRB = new RadioButton("comercial", i18n.t("Yes"));
- nonCommercialRB = new RadioButton("comercial", i18n.t("No"));
- Label allowModifLabel = new Label(i18n.t("Allow modifications of your work?"));
- allowModifRB = new RadioButton("allowModif", i18n.t("Yes"));
- allowModifShareAlikeRB = new RadioButton("allowModif", i18n.t("Yes, as long as others share alike"));
- noModifRB = new RadioButton("allowModif", i18n.t("No"));
- generalVP.add(licenseTypesVP);
- licenseTypesVP.add(ccRB);
- licenseTypesVP.add(notCcRB);
+ final Label comercialLabel = new Label(i18n.t("Allow commercial uses of your work?"));
+ commercialRB = new RadioButton("comercial", i18n.t("Yes"));
+ nonCommercialRB = new RadioButton("comercial", i18n.t("No"));
+ final Label allowModifLabel = new Label(i18n.t("Allow modifications of your work?"));
+ allowModifRB = new RadioButton("allowModif", i18n.t("Yes"));
+ allowModifShareAlikeRB = new RadioButton("allowModif", i18n.t("Yes, as long as others share alike"));
+ noModifRB = new RadioButton("allowModif", i18n.t("No"));
+ generalVP.add(licenseTypesVP);
+ licenseTypesVP.add(ccRB);
+ licenseTypesVP.add(notCcRB);
- copyleft = new IconLabel(img.copyleft(), i18n.t("This is a copyleft license"), false);
- nonCopyleft = new IconLabel(img.noCopyleft(), i18n.t("This is not a copyleft license"), false);
- nonCopyleft.setVisible(false);
+ copyleft = new IconLabel(img.copyleft(), i18n.t("This is a copyleft license"), false);
+ nonCopyleft = new IconLabel(img.noCopyleft(), i18n.t("This is not a copyleft license"), false);
+ nonCopyleft.setVisible(false);
- generalVP.add(options);
+ generalVP.add(options);
- // Options
+ // Options
- optionsBox = new TitledPanel(i18n.t("Options"), options);
- generalVP.add(optionsBox);
- generalVP.add(nonCopyleft);
- generalVP.add(copyleft);
+ optionsBox = new TitledPanel(i18n.t("Options"), options);
+ generalVP.add(optionsBox);
+ generalVP.add(nonCopyleft);
+ generalVP.add(copyleft);
- ccOptionsVP.add(ccIntro);
- ccOptionsVP.add(comercialLabel);
- ccOptionsVP.add(commercialRB);
- ccOptionsVP.add(nonCommercialRB);
- ccOptionsVP.add(new HorizontalLine());
- ccOptionsVP.add(allowModifLabel);
- ccOptionsVP.add(allowModifRB);
- ccOptionsVP.add(allowModifShareAlikeRB);
- ccOptionsVP.add(noModifRB);
+ ccOptionsVP.add(ccIntro);
+ ccOptionsVP.add(comercialLabel);
+ ccOptionsVP.add(commercialRB);
+ ccOptionsVP.add(nonCommercialRB);
+ ccOptionsVP.add(new HorizontalLine());
+ ccOptionsVP.add(allowModifLabel);
+ ccOptionsVP.add(allowModifRB);
+ ccOptionsVP.add(allowModifShareAlikeRB);
+ ccOptionsVP.add(noModifRB);
- nonCcOptionsVP.add(otherLicenses);
+ nonCcOptionsVP.add(otherLicenses);
- options.add(ccOptionsVP);
- options.add(nonCcOptionsVP);
- options.showWidget(0);
+ options.add(ccOptionsVP);
+ options.add(nonCcOptionsVP);
+ options.showWidget(0);
- comercialLabel.addStyleName("kune-License-CC-Header");
- allowModifLabel.addStyleName("kune-License-CC-Header");
- nonCommercialRB.addStyleName("kune-Margin-Large-lr");
- commercialRB.addStyleName("kune-Margin-Large-lr");
- allowModifRB.addStyleName("kune-Margin-Large-lr");
- allowModifShareAlikeRB.addStyleName("kune-Margin-Large-lr");
- noModifRB.addStyleName("kune-Margin-Large-lr");
- optionsBox.addStyleName("kune-Margin-Medium-t");
- otherLicenses.addStyleName("kune-Margin-Large-trbl");
- generalVP.addStyleName("kune-Default-Form");
- copyleft.addStyleName("kune-Margin-Medium-t");
- nonCopyleft.addStyleName("kune-Margin-Medium-t");
+ comercialLabel.addStyleName("kune-License-CC-Header");
+ allowModifLabel.addStyleName("kune-License-CC-Header");
+ nonCommercialRB.addStyleName("kune-Margin-Large-lr");
+ commercialRB.addStyleName("kune-Margin-Large-lr");
+ allowModifRB.addStyleName("kune-Margin-Large-lr");
+ allowModifShareAlikeRB.addStyleName("kune-Margin-Large-lr");
+ noModifRB.addStyleName("kune-Margin-Large-lr");
+ optionsBox.addStyleName("kune-Margin-Medium-t");
+ otherLicenses.addStyleName("kune-Margin-Large-trbl");
+ generalVP.addStyleName("kune-Default-Form");
+ copyleft.addStyleName("kune-Margin-Medium-t");
+ nonCopyleft.addStyleName("kune-Margin-Medium-t");
- ccRB.addClickListener(new ClickListener() {
- public void onClick(final Widget arg0) {
- showCCoptions();
- presenter.onChange();
- }
- });
+ ccRB.addClickListener(new ClickListener() {
+ public void onClick(final Widget arg0) {
+ showCCoptions();
+ presenter.onChange();
+ }
+ });
- notCcRB.addClickListener(new ClickListener() {
- public void onClick(final Widget arg0) {
- showNotCCoptions();
- presenter.onChange();
- }
- });
+ notCcRB.addClickListener(new ClickListener() {
+ public void onClick(final Widget arg0) {
+ showNotCCoptions();
+ presenter.onChange();
+ }
+ });
- for (int i = 0; i < nonCCLicenses.size(); i++) {
- String licenseDescrip = nonCCLicenses.get(i).getLongName();
- otherLicenses.addItem(licenseDescrip);
- }
- if (nonCCLicenses.size() > 0) {
- otherLicenses.setItemSelected(0, true);
- otherLicenses.setVisibleItemCount(1);
- }
+ final List<LicenseDTO> nonCCLicenses = presenter.getNonCCLicenses();
+ for (int i = 0; i < nonCCLicenses.size(); i++) {
+ final String licenseDescrip = nonCCLicenses.get(i).getLongName();
+ otherLicenses.addItem(licenseDescrip);
+ }
+ if (nonCCLicenses.size() > 0) {
+ otherLicenses.setItemSelected(0, true);
+ otherLicenses.setVisibleItemCount(1);
+ }
- configureListeners(presenter);
+ configureListeners(presenter);
}
public int getSelectedNonCCLicenseIndex() {
- return otherLicenses.getSelectedIndex();
+ return otherLicenses.getSelectedIndex();
}
public boolean isAllowModif() {
- return allowModifRB.isChecked();
+ return allowModifRB.isChecked();
}
public boolean isAllowModifShareAlike() {
- return allowModifShareAlikeRB.isChecked();
+ return allowModifShareAlikeRB.isChecked();
}
public boolean isCCselected() {
- return ccRB.isChecked();
+ return ccRB.isChecked();
}
public boolean permitComercial() {
- return commercialRB.isChecked();
+ return commercialRB.isChecked();
}
public void reset() {
- options.showWidget(0);
- ccRB.setChecked(true);
- commercialRB.setChecked(true);
- allowModifShareAlikeRB.setChecked(true);
+ options.showWidget(0);
+ ccRB.setChecked(true);
+ commercialRB.setChecked(true);
+ allowModifShareAlikeRB.setChecked(true);
}
public void showCCoptions() {
- options.showWidget(0);
- optionsBox.setTitle(i18n.t("Options"));
+ options.showWidget(0);
+ optionsBox.setTitle(i18n.t("Options"));
}
public void showIsCopyleft() {
- nonCopyleft.setVisible(false);
- copyleft.setVisible(true);
+ nonCopyleft.setVisible(false);
+ copyleft.setVisible(true);
}
public void showIsNotCopyleft() {
- nonCopyleft.setVisible(true);
- copyleft.setVisible(false);
+ nonCopyleft.setVisible(true);
+ copyleft.setVisible(false);
}
public void showNotCCoptions() {
- options.showWidget(1);
- optionsBox.setTitle(i18n.t("Select one of these licenses:"));
+ options.showWidget(1);
+ optionsBox.setTitle(i18n.t("Select one of these licenses:"));
}
private void configureListeners(final LicenseChoosePresenter presenter) {
- ChangeListener changeListener = new ChangeListener() {
- public void onChange(final Widget arg0) {
- presenter.onChange();
- }
- };
+ final ChangeListener changeListener = new ChangeListener() {
+ public void onChange(final Widget arg0) {
+ presenter.onChange();
+ }
+ };
- ClickListener clickListener = new ClickListener() {
- public void onClick(final Widget arg0) {
- presenter.onChange();
- }
- };
- otherLicenses.addChangeListener(changeListener);
- ccRB.addClickListener(clickListener);
- allowModifRB.addClickListener(clickListener);
- commercialRB.addClickListener(clickListener);
- nonCommercialRB.addClickListener(clickListener);
- allowModifShareAlikeRB.addClickListener(clickListener);
- noModifRB.addClickListener(clickListener);
+ final ClickListener clickListener = new ClickListener() {
+ public void onClick(final Widget arg0) {
+ presenter.onChange();
+ }
+ };
+ otherLicenses.addChangeListener(changeListener);
+ ccRB.addClickListener(clickListener);
+ allowModifRB.addClickListener(clickListener);
+ commercialRB.addClickListener(clickListener);
+ nonCommercialRB.addClickListener(clickListener);
+ allowModifShareAlikeRB.addClickListener(clickListener);
+ noModifRB.addClickListener(clickListener);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePresenter.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensechoose/LicenseChoosePresenter.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -19,10 +19,13 @@
*/
package org.ourproject.kune.workspace.client.licensechoose;
+import java.util.ArrayList;
+import java.util.Iterator;
import java.util.List;
import org.ourproject.kune.platf.client.View;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
+import org.ourproject.kune.platf.client.state.Session;
import com.allen_sauer.gwt.log.client.Log;
@@ -30,59 +33,68 @@
private LicenseChooseView view;
- private List<LicenseDTO> licenses;
+ private final List<LicenseDTO> licenses;
- private List<LicenseDTO> licensesNonCCList;
+ private final List<LicenseDTO> licensesNonCCList;
- public LicenseChoosePresenter() {
+ public LicenseChoosePresenter(final Session session) {
+ licensesNonCCList = new ArrayList<LicenseDTO>();
+ licenses = session.getLicenses();
+ for (final Iterator<LicenseDTO> iterator = licenses.iterator(); iterator.hasNext();) {
+ final LicenseDTO license = iterator.next();
+ if (!license.isCC()) {
+ licensesNonCCList.add(license);
+ }
+ }
}
- public void init(final LicenseChooseView view, final List<LicenseDTO> licenses,
- final List<LicenseDTO> licensesNonCCList) {
- this.view = view;
- this.licenses = licenses;
- this.licensesNonCCList = licensesNonCCList;
- this.view.reset();
- }
-
public LicenseDTO getLicense() {
- String licenseShortName;
+ String licenseShortName;
- if (view.isCCselected()) {
- if (view.permitComercial()) {
- licenseShortName = view.isAllowModif() ? "by" : view.isAllowModifShareAlike() ? "by-sa" : "by-nd";
- } else {
- licenseShortName = view.isAllowModif() ? "by-nc" : view.isAllowModifShareAlike() ? "by-nc-sa"
- : "by-nc-nd";
- }
- } else {
- licenseShortName = licensesNonCCList.get(view.getSelectedNonCCLicenseIndex()).getShortName();
- }
- return getLicenseFromShortName(licenseShortName);
+ if (view.isCCselected()) {
+ if (view.permitComercial()) {
+ licenseShortName = view.isAllowModif() ? "by" : view.isAllowModifShareAlike() ? "by-sa" : "by-nd";
+ } else {
+ licenseShortName = view.isAllowModif() ? "by-nc" : view.isAllowModifShareAlike() ? "by-nc-sa"
+ : "by-nc-nd";
+ }
+ } else {
+ licenseShortName = licensesNonCCList.get(view.getSelectedNonCCLicenseIndex()).getShortName();
+ }
+ return getLicenseFromShortName(licenseShortName);
}
- private LicenseDTO getLicenseFromShortName(final String shortName) {
- for (int i = 0; i < licenses.size(); i++) {
- LicenseDTO licenseDTO = licenses.get(i);
- if (licenseDTO.getShortName().equals(shortName)) {
- return licenseDTO;
- }
- }
- Log.error("Internal error: License not found");
- throw new IndexOutOfBoundsException("License not found");
+ public List<LicenseDTO> getNonCCLicenses() {
+ return licensesNonCCList;
}
public View getView() {
- return view;
+ return view;
}
+ public void init(final LicenseChooseView view) {
+ this.view = view;
+ this.view.reset();
+ }
+
public void onChange() {
- LicenseDTO licenseDTO = getLicense();
- if (licenseDTO.isCopyleft()) {
- view.showIsCopyleft();
- } else {
- view.showIsNotCopyleft();
- }
+ final LicenseDTO licenseDTO = getLicense();
+ if (licenseDTO.isCopyleft()) {
+ view.showIsCopyleft();
+ } else {
+ view.showIsNotCopyleft();
+ }
}
+ private LicenseDTO getLicenseFromShortName(final String shortName) {
+ for (int i = 0; i < licenses.size(); i++) {
+ final LicenseDTO licenseDTO = licenses.get(i);
+ if (licenseDTO.getShortName().equals(shortName)) {
+ return licenseDTO;
+ }
+ }
+ Log.error("Internal error: License not found");
+ throw new IndexOutOfBoundsException("License not found");
+ }
+
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroup.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroup.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -19,10 +19,10 @@
*/
package org.ourproject.kune.workspace.client.newgroup;
-import org.ourproject.kune.platf.client.View;
+import org.ourproject.kune.platf.client.dto.StateToken;
public interface NewGroup {
- public View getView();
+ void doNewGroup(StateToken previousToken);
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupListener.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupListener.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupListener.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,32 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.newgroup;
-
-import org.ourproject.kune.platf.client.dto.StateToken;
-
-public interface NewGroupListener {
-
- void onNewGroupCancel();
-
- void onNewGroupClose();
-
- void onNewGroupCreated(StateToken homePage);
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupPresenter.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -20,127 +20,142 @@
package org.ourproject.kune.workspace.client.newgroup;
import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.errors.GroupNameInUseException;
-import org.ourproject.kune.platf.client.rpc.ParamCallback;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.newgroup.ui.SiteErrorType;
+import org.ourproject.kune.workspace.client.sitebar.Site;
+import com.calclab.suco.client.container.Provider;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.AsyncCallback;
public class NewGroupPresenter implements NewGroup {
- private final NewGroupListener listener;
private NewGroupView view;
private final I18nTranslationService i18n;
+ private StateToken previousToken;
+ private final Session session;
+ private final StateManager stateManager;
+ private final Provider<GroupServiceAsync> groupServiceProvider;
- public NewGroupPresenter(final NewGroupListener listener, final I18nTranslationService i18n) {
- this.listener = listener;
- this.i18n = i18n;
+ public NewGroupPresenter(final I18nTranslationService i18n, final Session session, final StateManager stateManager,
+ final Provider<GroupServiceAsync> groupServiceProvider) {
+ this.i18n = i18n;
+ this.session = session;
+ this.stateManager = stateManager;
+ this.groupServiceProvider = groupServiceProvider;
}
+ public void doNewGroup(final StateToken previousTokenOrig) {
+ previousToken = previousTokenOrig;
+ session.check(new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ if (session.isLogged()) {
+ Site.showProgressProcessing();
+ view.show();
+ view.center();
+ } else {
+ stateManager.setState(previousTokenOrig);
+ Site.info(i18n.t("Sign in or register to create a group"));
+ }
+ }
+ });
+ }
+
public View getView() {
- return view;
+ return view;
}
public void init(final NewGroupView view) {
- this.view = view;
+ this.view = view;
}
public void onBack() {
- view.setEnabledBackButton(false);
- view.setEnabledFinishButton(false);
- view.setEnabledNextButton(true);
- view.showNewGroupInitialDataForm();
+ view.setEnabledBackButton(false);
+ view.setEnabledFinishButton(false);
+ view.setEnabledNextButton(true);
+ view.showNewGroupInitialDataForm();
}
public void onCancel() {
- listener.onNewGroupCancel();
- view.hide();
- reset();
+ view.hide();
+ reset();
+ stateManager.setState(previousToken);
}
- public void onChange() {
- // This doesn't work perfect (don't use now):
- // if (view.isFormValid()) {
- // view.setEnabledNextButton(true);
- // } else {
- // view.setEnabledNextButton(false);
- // }
- }
-
public void onClose() {
- listener.onNewGroupClose();
- reset();
+ reset();
+ stateManager.setState(previousToken);
}
public void onFinish() {
- view.maskProcessing();
- final String shortName = view.getShortName();
- final String longName = view.getLongName();
- final String publicDesc = view.getPublicDesc();
- final LicenseDTO license = view.getLicense();
- final GroupDTO group = new GroupDTO(shortName, longName, publicDesc, getTypeOfGroup());
- group.setDefaultLicense(license);
+ view.maskProcessing();
+ final String shortName = view.getShortName();
+ final String longName = view.getLongName();
+ final String publicDesc = view.getPublicDesc();
+ final LicenseDTO license = view.getLicense();
+ final GroupDTO group = new GroupDTO(shortName, longName, publicDesc, getTypeOfGroup());
+ group.setDefaultLicense(license);
- final AsyncCallback<StateToken> callback = new AsyncCallback<StateToken>() {
- public void onFailure(final Throwable caught) {
- try {
- throw caught;
- } catch (final GroupNameInUseException e) {
- onBack();
- view.unMask();
- setMessage(i18n.t("This name in already in use, try with a different name."), SiteErrorType.error);
- } catch (final Throwable e) {
- onBack(); // The messageP is in first page of wizard :-/
- view.unMask();
- setMessage(i18n.t("Error creating group"), SiteErrorType.error);
- GWT.log("Other kind of exception in group registration", null);
- throw new RuntimeException();
- }
- }
+ final AsyncCallback<StateToken> callback = new AsyncCallback<StateToken>() {
+ public void onFailure(final Throwable caught) {
+ try {
+ throw caught;
+ } catch (final GroupNameInUseException e) {
+ onBack();
+ view.unMask();
+ setMessage(i18n.t("This name in already in use, try with a different name."), SiteErrorType.error);
+ } catch (final Throwable e) {
+ onBack(); // The messageP is in first page of wizard :-/
+ view.unMask();
+ setMessage(i18n.t("Error creating group"), SiteErrorType.error);
+ GWT.log("Other kind of exception in group registration", null);
+ throw new RuntimeException();
+ }
+ }
- public void onSuccess(final StateToken token) {
- listener.onNewGroupCreated(token);
- view.hide();
- reset();
- view.unMask();
- }
- };
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.CREATE_NEW_GROUP,
- new ParamCallback<GroupDTO, StateToken>(group, callback));
+ public void onSuccess(final StateToken token) {
+ stateManager.setState(token);
+ view.hide();
+ reset();
+ view.unMask();
+ }
+ };
+ groupServiceProvider.get().createNewGroup(session.getUserHash(), group, callback);
}
public void onNext() {
- if (view.isFormValid()) {
- view.setEnabledBackButton(true);
- view.setEnabledFinishButton(true);
- view.setEnabledNextButton(false);
- view.showLicenseForm();
- }
+ if (view.isFormValid()) {
+ view.setEnabledBackButton(true);
+ view.setEnabledFinishButton(true);
+ view.setEnabledNextButton(false);
+ view.showLicenseForm();
+ }
}
public void setMessage(final String message, final SiteErrorType type) {
- view.setMessage(message, type);
+ view.setMessage(message, type);
}
private String getTypeOfGroup() {
- if (view.isProject()) {
- return GroupDTO.PROJECT;
- } else if (view.isOrphanedProject()) {
- return GroupDTO.ORPHANED_PROJECT;
- } else if (view.isOrganization()) {
- return GroupDTO.ORGANIZATION;
- } else {
- return GroupDTO.COMMUNITY;
- }
+ if (view.isProject()) {
+ return GroupDTO.PROJECT;
+ } else if (view.isOrphanedProject()) {
+ return GroupDTO.ORPHANED_PROJECT;
+ } else if (view.isOrganization()) {
+ return GroupDTO.ORGANIZATION;
+ } else {
+ return GroupDTO.COMMUNITY;
+ }
}
private void reset() {
- view.clearData();
+ view.clearData();
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/NewGroupView.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -25,6 +25,8 @@
public interface NewGroupView extends View {
+ void center();
+
void clearData();
LicenseDTO getLicense();
@@ -59,6 +61,8 @@
void setMessage(String message, SiteErrorType type);
+ void show();
+
void showLicenseForm();
void showNewGroupInitialDataForm();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/newgroup/ui/NewGroupPanel.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -30,9 +30,9 @@
import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePanel;
import org.ourproject.kune.workspace.client.newgroup.NewGroupPresenter;
import org.ourproject.kune.workspace.client.newgroup.NewGroupView;
-import org.ourproject.kune.workspace.client.sitebar.SiteBarFactory;
import org.ourproject.kune.workspace.client.sitebar.msg.SiteMessagePanel;
+import com.calclab.suco.client.container.Provider;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.DeckPanel;
import com.google.gwt.user.client.ui.HTML;
@@ -49,7 +49,6 @@
import com.gwtext.client.widgets.form.Radio;
import com.gwtext.client.widgets.form.TextArea;
import com.gwtext.client.widgets.form.TextField;
-import com.gwtext.client.widgets.form.event.TextFieldListenerAdapter;
import com.gwtext.client.widgets.layout.FitLayout;
public class NewGroupPanel extends WizardDialog implements NewGroupView {
@@ -70,12 +69,13 @@
private TextField longNameField;
private TextArea publicDescField;
private final DeckPanel deck;
- private LicenseChoose licenseChoosePanel;
+ private final LicenseChoose licenseChoosePanel;
private final SiteMessagePanel messagesPanel;
private final I18nUITranslationService i18n;
private TextField tags;
- public NewGroupPanel(final NewGroupPresenter presenter, final I18nUITranslationService i18n) {
+ public NewGroupPanel(final NewGroupPresenter presenter, final I18nUITranslationService i18n,
+ final Provider<LicenseChoose> licenseChooseProvider) {
super(i18n.t("Register a new Group"), true, false, 460, 480, new WizardListener() {
public void onBack() {
presenter.onBack();
@@ -103,7 +103,7 @@
centerPanel.setLayout(new FitLayout());
deck = new DeckPanel();
newGroupInitialDataForm = createNewGroupInitialDataForm(presenter);
- createChooseLicensePanel();
+ licenseChoosePanel = licenseChooseProvider.get();
final VerticalPanel newGroupInitialDataVP = new VerticalPanel();
final HorizontalPanel newGroupInitialDataHP = new HorizontalPanel();
final VerticalPanel chooseLicenseVP = new VerticalPanel();
@@ -212,10 +212,6 @@
deck.showWidget(0);
}
- private void createChooseLicensePanel() {
- licenseChoosePanel = SiteBarFactory.createLicenseChoose();
- }
-
private FormPanel createNewGroupInitialDataForm(final NewGroupPresenter presenter) {
final FormPanel form = new FormPanel();
form.setBorder(false);
@@ -302,24 +298,6 @@
groupTypeFieldSet.setCollapsible(false);
- shortNameField.addListener(new TextFieldListenerAdapter() {
- public void onChange(final Field field, final Object newVal, final Object oldVal) {
- presenter.onChange();
- }
- });
-
- longNameField.addListener(new TextFieldListenerAdapter() {
- public void onChange(final Field field, final Object newVal, final Object oldVal) {
- presenter.onChange();
- }
- });
-
- publicDescField.addListener(new TextFieldListenerAdapter() {
- public void onChange(final Field field, final Object newVal, final Object oldVal) {
- presenter.onChange();
- }
- });
-
return form;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/Site.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -34,11 +34,6 @@
private static SiteProgress progress;
private static Provider<SiteMessage> siteMessageProvider;
- @Deprecated
- public static void doNewGroup(final String returnToken) {
- // sitebar.doNewGroup(returnToken);
- }
-
public static void error(final String value) {
getSiteMessage().setMessage(value, SiteErrorType.error);
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,70 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.sitebar;
-
-import java.util.ArrayList;
-import java.util.Iterator;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.dto.LicenseDTO;
-import org.ourproject.kune.platf.client.state.Session;
-import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
-import org.ourproject.kune.workspace.client.licensechoose.LicenseChoose;
-import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePanel;
-import org.ourproject.kune.workspace.client.licensechoose.LicenseChoosePresenter;
-import org.ourproject.kune.workspace.client.newgroup.NewGroup;
-import org.ourproject.kune.workspace.client.newgroup.NewGroupListener;
-import org.ourproject.kune.workspace.client.newgroup.NewGroupPresenter;
-import org.ourproject.kune.workspace.client.newgroup.ui.NewGroupPanel;
-import org.ourproject.kune.workspace.client.sitebar.login.SignIn;
-
-public class SiteBarFactory {
- private static SignIn login;
- private static NewGroup newGroup;
- private static Session session;
- private static I18nUITranslationService i18n;
-
- public static LicenseChoose createLicenseChoose() {
- final List<LicenseDTO> licensesList = session.getLicenses();
- final List<LicenseDTO> licensesNonCCList = new ArrayList<LicenseDTO>();
-
- for (final Iterator<LicenseDTO> iterator = licensesList.iterator(); iterator.hasNext();) {
- final LicenseDTO license = iterator.next();
- if (!license.isCC()) {
- licensesNonCCList.add(license);
- }
- }
- final LicenseChoosePresenter presenter = new LicenseChoosePresenter();
- final LicenseChoosePanel view = new LicenseChoosePanel(licensesNonCCList, presenter, i18n);
- presenter.init(view, licensesList, licensesNonCCList);
- return presenter;
- }
-
- public static NewGroup getNewGroupForm(final NewGroupListener listener) {
- if (newGroup == null) {
- final NewGroupPresenter presenter = new NewGroupPresenter(listener, i18n);
- final NewGroupPanel view = new NewGroupPanel(presenter, i18n);
- presenter.init(view);
- newGroup = presenter;
- }
- return newGroup;
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -27,10 +27,8 @@
import org.ourproject.kune.platf.client.services.Images;
import org.ourproject.kune.platf.client.ui.IconLabel;
import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator;
-import org.ourproject.kune.workspace.client.newgroup.NewGroup;
import org.ourproject.kune.workspace.client.newgroup.ui.NewGroupPanel;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.sitebar.SiteBarFactory;
import org.ourproject.kune.workspace.client.sitebar.SiteToken;
import org.ourproject.kune.workspace.client.sitebar.login.SignInPanel;
@@ -315,10 +313,6 @@
}
public void showNewGroupDialog() {
- final NewGroup newGroupForm = SiteBarFactory.getNewGroupForm(presenter);
- newGroupPanel = (NewGroupPanel) newGroupForm.getView();
- newGroupPanel.show();
- Site.hideProgress();
}
public void showProgress(final String text) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -25,22 +25,13 @@
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
-import org.ourproject.kune.platf.client.errors.SessionExpiredException;
-import org.ourproject.kune.platf.client.errors.UserMustBeLoggedException;
-import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
import org.ourproject.kune.platf.client.state.Session;
import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.newgroup.NewGroupListener;
import org.ourproject.kune.workspace.client.sitebar.Site;
-import org.ourproject.kune.workspace.client.sitebar.rpc.UserService;
-import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
-import com.google.gwt.core.client.GWT;
-import com.google.gwt.user.client.rpc.AsyncCallback;
+public class SiteBarPresenter implements SiteBar {
-public class SiteBarPresenter implements SiteBar, NewGroupListener {
-
private SiteBarView view;
private final SiteBarListener listener;
private String previousToken;
@@ -66,51 +57,52 @@
}
public void doLogout() {
- final AsyncCallback<Object> callback = new AsyncCallback<Object>() {
- public void onFailure(final Throwable caught) {
- Site.hideProgress();
- try {
- throw caught;
- } catch (final SessionExpiredException e) {
- clientUILogout();
- } catch (final UserMustBeLoggedException e) {
- clientUILogout();
- } catch (final Throwable e) {
- GWT.log("Other kind of exception in doLogout", null);
- throw new RuntimeException();
- }
- }
-
- public void onSuccess(final Object arg0) {
- Site.hideProgress();
- clientUILogout();
- }
-
- private void clientUILogout() {
- view.restoreLoginLink();
- view.resetOptionsSubmenu();
- view.setLogoutLinkVisible(false);
- listener.onUserLoggedOut();
- }
- };
- UserService.App.getInstance().logout(session.getUserHash(), callback);
+ // final AsyncCallback<Object> callback = new AsyncCallback<Object>() {
+ // public void onFailure(final Throwable caught) {
+ // Site.hideProgress();
+ // try {
+ // throw caught;
+ // } catch (final SessionExpiredException e) {
+ // clientUILogout();
+ // } catch (final UserMustBeLoggedException e) {
+ // clientUILogout();
+ // } catch (final Throwable e) {
+ // GWT.log("Other kind of exception in doLogout", null);
+ // throw new RuntimeException();
+ // }
+ // }
+ //
+ // public void onSuccess(final Object arg0) {
+ // Site.hideProgress();
+ // clientUILogout();
+ // }
+ //
+ // private void clientUILogout() {
+ // view.restoreLoginLink();
+ // view.resetOptionsSubmenu();
+ // view.setLogoutLinkVisible(false);
+ // listener.onUserLoggedOut();
+ // }
+ // };
+ // UserService.App.getInstance().logout(session.getUserHash(),
+ // callback);
}
public void doNewGroup(final String previousTokenOrig) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.ONLY_CHECK_USER_SESSION,
- new AsyncCallbackSimple<Object>() {
- public void onSuccess(final Object result) {
- previousToken = previousTokenOrig;
- if (session.isLogged()) {
- Site.showProgressProcessing();
- view.showNewGroupDialog();
- view.centerNewGroupDialog();
- } else {
- returnToPreviousState();
- Site.info(i18n.t("Sign in or register to create a group"));
- }
- }
- });
+ // DefaultDispatcher.getInstance().fire(WorkspaceEvents.ONLY_CHECK_USER_SESSION,
+ // new AsyncCallbackSimple<Object>() {
+ // public void onSuccess(final Object result) {
+ // previousToken = previousTokenOrig;
+ // if (session.isLogged()) {
+ // Site.showProgressProcessing();
+ // view.showNewGroupDialog();
+ // view.centerNewGroupDialog();
+ // } else {
+ // returnToPreviousState();
+ // Site.info(i18n.t("Sign in or register to create a group"));
+ // }
+ // }
+ // });
}
public void doSearch(final String termToSearch) {
@@ -168,17 +160,19 @@
}
public void reloadUserInfo(final String userHash) {
- final UserServiceAsync siteBarService = UserService.App.getInstance();
- siteBarService.reloadUserInfo(userHash, new AsyncCallback<UserInfoDTO>() {
- public void onFailure(final Throwable arg0) {
- Site.hideProgress();
- }
-
- public void onSuccess(final UserInfoDTO response) {
- showLoggedUser(response);
- Site.hideProgress();
- }
- });
+ // //final UserServiceAsync siteBarService =
+ // UserService.App.getInstance();
+ // siteBarService.reloadUserInfo(userHash, new
+ // AsyncCallback<UserInfoDTO>() {
+ // public void onFailure(final Throwable arg0) {
+ // Site.hideProgress();
+ // }
+ //
+ // public void onSuccess(final UserInfoDTO response) {
+ // showLoggedUser(response);
+ // Site.hideProgress();
+ // }
+ // });
}
public void setState(final StateDTO state) {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/RegisterForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/RegisterForm.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/RegisterForm.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -34,6 +34,8 @@
private final ComboBox timezoneCombo;
public RegisterForm(final SignInPresenter presenter, final I18nUITranslationService i18n) {
+ super.addStyleName("kune-Margin-Large-l");
+
shortNameRegField = new TextField();
shortNameRegField.setFieldLabel(i18n.t("Nickname"));
shortNameRegField.setName(NICK_FIELD);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInForm.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInForm.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/login/SignInForm.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -13,6 +13,8 @@
private final TextField loginPassField;
public SignInForm(final I18nTranslationService i18n) {
+ super.addStyleName("kune-Margin-Large-trbl");
+
loginNickOrEmailField = new TextField();
loginNickOrEmailField.setFieldLabel(i18n.t("Nickname or email"));
loginNickOrEmailField.setName(NICKOREMAIL_FIELD);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/rpc/UserService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/rpc/UserService.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/rpc/UserService.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -24,28 +24,10 @@
import org.ourproject.kune.platf.client.dto.UserInfoDTO;
import org.ourproject.kune.platf.client.errors.DefaultException;
-import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.rpc.RemoteService;
-import com.google.gwt.user.client.rpc.ServiceDefTarget;
public interface UserService extends RemoteService {
- public class App {
- private static UserServiceAsync ourInstance = null;
-
- public static synchronized UserServiceAsync getInstance() {
- if (ourInstance == null) {
- ourInstance = (UserServiceAsync) GWT.create(UserService.class);
- ((ServiceDefTarget) ourInstance).setServiceEntryPoint(GWT.getModuleBaseURL() + "UserService");
- }
- return ourInstance;
- }
-
- public static void setMock(final UserServiceAsync mock) {
- ourInstance = mock;
- }
- }
-
UserInfoDTO createUser(UserDTO user) throws DefaultException;
UserInfoDTO login(String nickOrEmail, String passwd) throws DefaultException;
Deleted: 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-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,210 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.socialnet;
-
-import java.util.Iterator;
-import java.util.List;
-
-import org.ourproject.kune.platf.client.AbstractPresenter;
-import org.ourproject.kune.platf.client.PlatformEvents;
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.platf.client.dto.AccessListsDTO;
-import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
-import org.ourproject.kune.platf.client.dto.GroupDTO;
-import org.ourproject.kune.platf.client.dto.SocialNetworkDTO;
-import org.ourproject.kune.platf.client.dto.StateDTO;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.ui.gridmenu.GridMenuItem;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary;
-
-public class GroupMembersSummaryPresenter extends AbstractPresenter implements GroupMembersSummary,
- EntityLiveSearchListener {
-
- private GroupMembersSummaryView view;
- private final I18nTranslationService i18n;
- private final String adminCategory;
- private final String collabCategory;
- private final String pendigCategory;
- private final MemberAction gotoGroupCommand;
-
- public GroupMembersSummaryPresenter(final I18nTranslationService i18n) {
- this.i18n = i18n;
- adminCategory = i18n.t("Admins");
- collabCategory = i18n.t("Collaborators");
- pendigCategory = i18n.t("Pending");
- gotoGroupCommand = new MemberAction(i18n.t("Visit this member homepage"), PlatformEvents.GOTO);
- }
-
- public void addCollab(final String groupShortName) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.ADD_COLLAB_MEMBER, groupShortName);
- }
-
- public void addGroupOperation(final GridMenuItem<GroupDTO> operation, final boolean mustBeLogged) {
- // TODO Auto-generated method stub
-
- }
-
- public View getView() {
- return view;
- }
-
- public void hide() {
- view.hide();
- }
-
- public void init(final GroupMembersSummaryView view) {
- this.view = view;
- }
-
- public void onJoin() {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.REQ_JOIN_GROUP, null);
- }
-
- public void onSelection(final String groupShortName, final String groupLongName) {
- view.confirmAddCollab(groupShortName, groupLongName);
- }
-
- public void removeGroupOperation(final GridMenuItem<GroupDTO> operation, final boolean mustBeLogged) {
- // TODO Auto-generated method stub
-
- }
-
- public void setState(final StateDTO state) {
- if (state.getGroup().getType() == GroupDTO.PERSONAL) {
- hide();
- } else {
- setGroupMembers(state.getGroupMembers(), state.getGroupRights());
- }
- }
-
- public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) {
- view.setTheme(oldTheme, newTheme);
- }
-
- public void showAdmins() {
- view.showCategory(adminCategory);
- }
-
- public void showCollabs() {
- view.showCategory(collabCategory);
- }
-
- private void addMembers(final List<GroupDTO> adminsList, final List<GroupDTO> collabList,
- final List<GroupDTO> pendingCollabsList, final int numAdmins, final int numCollaborators,
- final int numPendingCollabs, final boolean isAdmin, final MemberAction[] adminsActions,
- final MemberAction[] collabActions, final MemberAction[] pendingsActions, final MemberAction[] viewerActions) {
- if (numAdmins > 0) {
- view.addCategory(adminCategory, i18n.t("People that can admin this group"));
- iteraList(adminCategory, adminsList, adminsActions);
- }
- if (numCollaborators > 0) {
- view.addCategory(collabCategory, i18n.t("Other people that collaborate with this group"));
- iteraList(collabCategory, collabList, collabActions);
- }
- if (isAdmin) {
- if (numPendingCollabs > 0) {
- view.addCategory(pendigCategory, i18n.t("People pending to be accepted in this group by the admins"),
- GroupMembersSummaryView.ICON_ALERT);
- iteraList(pendigCategory, pendingCollabsList, pendingsActions);
- }
- }
-
- }
-
- private boolean isMember(final boolean userIsAdmin, final boolean userIsCollab) {
- return userIsAdmin || userIsCollab;
- }
-
- private void iteraList(final String categoryName, final List<GroupDTO> groupList, final MemberAction[] actions) {
- final Iterator<GroupDTO> iter = groupList.iterator();
- while (iter.hasNext()) {
- final GroupDTO group = iter.next();
- view.addCategoryMember(categoryName, group.getShortName(), group.getLongName(), actions);
- }
- }
-
- private void setGroupMembers(final SocialNetworkDTO socialNetwork, final AccessRightsDTO rights) {
- final AccessListsDTO accessLists = socialNetwork.getAccessLists();
-
- final List<GroupDTO> adminsList = accessLists.getAdmins().getList();
- final List<GroupDTO> collabList = accessLists.getEditors().getList();
- final List<GroupDTO> pendingCollabsList = socialNetwork.getPendingCollaborators().getList();
-
- final int numAdmins = adminsList.size();
- final int numCollaborators = collabList.size();
- final int numPendingCollabs = pendingCollabsList.size();
-
- boolean userIsAdmin = rights.isAdministrable();
- final boolean userIsCollab = !userIsAdmin && rights.isEditable();
- final boolean userCanView = rights.isVisible();
- boolean userIsMember = isMember(userIsAdmin, userIsCollab);
-
- view.setDropDownContentVisible(false);
- view.clear();
-
- if (userIsAdmin) {
- view.addAddMemberLink();
- }
-
- if (!userIsMember) {
- view.addJoinLink();
- } else if (userIsAdmin && numAdmins > 1 || userIsCollab) {
- view.addUnjoinLink();
- }
-
- if (numAdmins == 0 && numCollaborators == 0) {
- view.addComment(i18n.t("This is an orphaned project, if you are interested "
- + "please request to join to work on it"));
- }
-
- if (userCanView) {
- if (rights.isAdministrable()) {
- final MemberAction[] adminsActions = {
- new MemberAction(i18n.t("Remove this member"), WorkspaceEvents.DEL_MEMBER),
- new MemberAction(i18n.t("Change to collaborator"), WorkspaceEvents.SET_ADMIN_AS_COLLAB),
- gotoGroupCommand };
- final MemberAction[] collabActions = {
- new MemberAction(i18n.t("Remove this member"), WorkspaceEvents.DEL_MEMBER),
- new MemberAction(i18n.t("Change to admin"), WorkspaceEvents.SET_COLLAB_AS_ADMIN),
- gotoGroupCommand };
- final MemberAction[] pendingsActions = {
- new MemberAction(i18n.t("Accept this member"), WorkspaceEvents.ACCEPT_JOIN_GROUP),
- new MemberAction(i18n.t("Don't accept this member"), WorkspaceEvents.DENY_JOIN_GROUP),
- gotoGroupCommand };
- final MemberAction[] viewerActions = { gotoGroupCommand };
- addMembers(adminsList, collabList, pendingCollabsList, numAdmins, numCollaborators, numPendingCollabs,
- userIsAdmin, adminsActions, collabActions, pendingsActions, viewerActions);
- } else if (rights.isEditable() || rights.isVisible()) {
- final MemberAction[] adminsActions = { gotoGroupCommand };
- final MemberAction[] collabActions = { gotoGroupCommand };
- final MemberAction[] pendingsActions = { gotoGroupCommand };
- final MemberAction[] viewerActions = { gotoGroupCommand };
- addMembers(adminsList, collabList, pendingCollabsList, numAdmins, numCollaborators, numPendingCollabs,
- userIsAdmin, adminsActions, collabActions, pendingsActions, viewerActions);
- }
- }
- view.setDropDownContentVisible(true);
- view.show();
- }
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenterNew.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenterNew.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenterNew.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -30,15 +30,15 @@
private final GridGroup collabCategory;
private final GridGroup pendigCategory;
private final Session session;
- private final SocialNetworkServiceAsync snService;
+ private final Provider<SocialNetworkServiceAsync> snServiceProvider;
public GroupMembersSummaryPresenterNew(final I18nUITranslationService i18n,
final Provider<StateManager> stateManagerProvider, final ImageUtils imageUtils, final Session session,
- final SocialNetworkServiceAsync snService) {
- super(i18n, stateManagerProvider, imageUtils, session, snService);
+ final Provider<SocialNetworkServiceAsync> snServiceProvider) {
+ super(i18n, stateManagerProvider, imageUtils, session, snServiceProvider);
this.i18n = i18n;
this.session = session;
- this.snService = snService;
+ this.snServiceProvider = snServiceProvider;
final String adminsTitle = i18n.t("Admins");
final String collabsTitle = i18n.t("Collaborators");
final String pendingTitle = i18n.t("Pending");
@@ -53,8 +53,9 @@
public void addCollab(final String groupShortName) {
Site.showProgressProcessing();
- snService.addCollabMember(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- groupShortName, new AsyncCallbackSimple<SocialNetworkResultDTO>() {
+ snServiceProvider.get().addCollabMember(session.getUserHash(),
+ session.getCurrentState().getGroup().getShortName(), groupShortName,
+ new AsyncCallbackSimple<SocialNetworkResultDTO>() {
public void onSuccess(final SocialNetworkResultDTO result) {
Site.hideProgress();
Site.info(i18n.t("Member added as collaborator"));
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,57 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.socialnet;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme;
-
-public interface GroupMembersSummaryView extends View {
-
- public static final String ICON_ALERT = "alert";
-
- void addAddMemberLink();
-
- void addCategory(String name, String title);
-
- void addCategory(String name, String title, String iconType);
-
- void addCategoryMember(String categoryName, String name, String title, MemberAction[] memberActions);
-
- void addComment(String comment);
-
- void addJoinLink();
-
- void addUnjoinLink();
-
- void clear();
-
- void confirmAddCollab(String groupShortName, String groupLongName);
-
- void hide();
-
- void setDropDownContentVisible(boolean visible);
-
- void setTheme(WsTheme oldTheme, WsTheme newTheme);
-
- void show();
-
- void showCategory(String name);
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -46,8 +46,8 @@
public ParticipationSummaryPresenter(final I18nUITranslationService i18n,
final Provider<StateManager> stateManagerProvider, final ImageUtils imageUtils, final Session session,
- final SocialNetworkServiceAsync snService) {
- super(i18n, stateManagerProvider, imageUtils, session, snService);
+ final Provider<SocialNetworkServiceAsync> snServiceProvider) {
+ super(i18n, stateManagerProvider, imageUtils, session, snServiceProvider);
adminCategory = new GridGroup("admin in:", " ", i18n.tWithNT("Administrate these groups",
"talking about a person"), false);
collabCategory = new GridGroup(i18n.t("and as collaborator in:"), " ", i18n.t("Collaborate in these groups"),
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-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/SocialNetworkPresenter.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -5,7 +5,6 @@
import org.ourproject.kune.platf.client.dto.SocialNetworkDTO;
import org.ourproject.kune.platf.client.dto.SocialNetworkResultDTO;
import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
-import org.ourproject.kune.platf.client.rpc.SocialNetworkService;
import org.ourproject.kune.platf.client.rpc.SocialNetworkServiceAsync;
import org.ourproject.kune.platf.client.services.ImageDescriptor;
import org.ourproject.kune.platf.client.services.ImageUtils;
@@ -38,7 +37,7 @@
protected GridMenuItem<GroupDTO> unJoinMenuItem;
private final I18nUITranslationService i18n;
private final Provider<StateManager> stateManagerProvider;
- private final SocialNetworkServiceAsync snService;
+ private final Provider<SocialNetworkServiceAsync> snServiceProvider;
private final Session session;
private final GridMenuItemCollection<GroupDTO> otherOperations;
private final GridMenuItemCollection<GroupDTO> otherLoggedOperations;
@@ -46,12 +45,12 @@
public SocialNetworkPresenter(final I18nUITranslationService i18n,
final Provider<StateManager> stateManagerProvider, final ImageUtils imageUtils, final Session session,
- final SocialNetworkServiceAsync snService) {
+ final Provider<SocialNetworkServiceAsync> snServiceProvider) {
this.i18n = i18n;
this.stateManagerProvider = stateManagerProvider;
this.imageUtils = imageUtils;
this.session = session;
- this.snService = snService;
+ this.snServiceProvider = snServiceProvider;
createButtons();
createMenuActions();
otherOperations = new GridMenuItemCollection<GroupDTO>();
@@ -102,8 +101,8 @@
.t("Request to participate in this group"), new Slot<String>() {
public void onEvent(final String parameter) {
Site.showProgressProcessing();
- snService.requestJoinGroup(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- new AsyncCallbackSimple<Object>() {
+ snServiceProvider.get().requestJoinGroup(session.getUserHash(),
+ session.getCurrentState().getGroup().getShortName(), new AsyncCallbackSimple<Object>() {
public void onSuccess(final Object result) {
Site.hideProgress();
final String resultType = (String) result;
@@ -168,8 +167,9 @@
.t("Change to collaborator"), new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
- snService.setCollabAsAdmin(session.getUserHash(), session.getCurrentState().getGroup().getShortName(),
- group.getShortName(), new AsyncCallbackSimple<SocialNetworkResultDTO>() {
+ 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("Type of member changed"));
@@ -182,8 +182,8 @@
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
- snService.deleteMember(session.getUserHash(), session.getCurrentState().getGroup()
- .getShortName(), group.getShortName(),
+ snServiceProvider.get().deleteMember(session.getUserHash(),
+ session.getCurrentState().getGroup().getShortName(), group.getShortName(),
new AsyncCallbackSimple<SocialNetworkResultDTO>() {
public void onSuccess(final SocialNetworkResultDTO result) {
Site.hideProgress();
@@ -201,9 +201,8 @@
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.addAdminMember(session.getUserHash(), session.getCurrentState().getGroup()
- .getShortName(), group.getShortName(),
+ snServiceProvider.get().addAdminMember(session.getUserHash(),
+ session.getCurrentState().getGroup().getShortName(), group.getShortName(),
new AsyncCallbackSimple<SocialNetworkResultDTO>() {
public void onSuccess(final SocialNetworkResultDTO result) {
Site.hideProgress();
@@ -217,8 +216,8 @@
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
- snService.AcceptJoinGroup(session.getUserHash(), session.getCurrentState().getGroup()
- .getShortName(), group.getShortName(),
+ snServiceProvider.get().AcceptJoinGroup(session.getUserHash(),
+ session.getCurrentState().getGroup().getShortName(), group.getShortName(),
new AsyncCallbackSimple<SocialNetworkResultDTO>() {
public void onSuccess(final SocialNetworkResultDTO result) {
Site.hideProgress();
@@ -232,8 +231,7 @@
new Slot<GroupDTO>() {
public void onEvent(final GroupDTO group) {
Site.showProgressProcessing();
- final SocialNetworkServiceAsync server = SocialNetworkService.App.getInstance();
- server.denyJoinGroup(session.getUserHash(),
+ snServiceProvider.get().denyJoinGroup(session.getUserHash(),
session.getCurrentState().getGroup().getShortName(), group.getShortName(),
new AsyncCallbackSimple<SocialNetworkResultDTO>() {
public void onSuccess(final SocialNetworkResultDTO result) {
@@ -252,7 +250,7 @@
private void removeMemberAction(final GroupDTO groupDTO) {
Site.showProgressProcessing();
- snService.unJoinGroup(session.getUserHash(), groupDTO.getShortName(),
+ snServiceProvider.get().unJoinGroup(session.getUserHash(), groupDTO.getShortName(),
new AsyncCallbackSimple<SocialNetworkResultDTO>() {
public void onSuccess(final SocialNetworkResultDTO result) {
Site.hideProgress();
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersSummaryPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersSummaryPanel.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersSummaryPanel.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,148 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-package org.ourproject.kune.workspace.client.socialnet.ui;
-
-import org.ourproject.kune.platf.client.PlatformEvents;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.platf.client.ui.UIConstants;
-import org.ourproject.kune.platf.client.ui.stacks.StackSubItemAction;
-import org.ourproject.kune.platf.client.ui.stacks.StackedDropDownPanel;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPresenter;
-import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryView;
-import org.ourproject.kune.workspace.client.socialnet.MemberAction;
-import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
-
-import com.google.gwt.user.client.ui.AbstractImagePrototype;
-import com.gwtext.client.widgets.MessageBox;
-
-public class GroupMembersSummaryPanel extends StackedDropDownPanel implements GroupMembersSummaryView {
- private static final boolean COUNTS_VISIBLE = true;
- private final Images img = Images.App.getInstance();
- private final GroupMembersSummaryPresenter presenter;
- private final I18nTranslationService i18n;
-
- public GroupMembersSummaryPanel(final GroupMembersSummaryPresenter initPresenter,
- final I18nTranslationService i18n, final WorkspaceSkeleton ws) {
- super(initPresenter, "#00D4AA", i18n.t("Group members"), i18n
- .t("People and groups collaborating in this group"), COUNTS_VISIBLE);
- presenter = initPresenter;
- this.i18n = i18n;
- ws.getEntitySummary().addInSummary(this);
- }
-
- public void addAddMemberLink() {
- super.addBottomLink(img.addGreen(), i18n.t("Add member"), i18n
- .t("Add a group or a person as member of this group"), WorkspaceEvents.ADD_MEMBER_GROUPLIVESEARCH,
- presenter);
- }
-
- public void addCategory(final String name, final String title) {
- super.addStackItem(name, title, COUNTS_VISIBLE);
- }
-
- public void addCategory(final String name, final String title, final String iconType) {
- super.addStackItem(name, title, getIcon(iconType), UIConstants.ICON_HORIZ_ALIGN_RIGHT, COUNTS_VISIBLE);
- }
-
- public void addCategoryMember(final String categoryName, final String name, final String title,
- final MemberAction[] memberActions) {
- final StackSubItemAction[] subItems = new StackSubItemAction[memberActions.length];
- for (int i = 0; i < memberActions.length; i++) {
- subItems[i] = new StackSubItemAction(getIconFronEvent(memberActions[i].getAction()), memberActions[i]
- .getText(), memberActions[i].getAction());
- }
-
- super.addStackSubItem(categoryName, img.groupDefIcon(), name, title, subItems);
- }
-
- public void addComment(final String comment) {
- super.addComment(comment);
- }
-
- public void addJoinLink() {
- super.addBottomLink(img.addGreen(), i18n.t("Request to join"), i18n.t("Request to participate in this group"),
- WorkspaceEvents.REQ_JOIN_GROUP);
- }
-
- public void addUnjoinLink() {
- super.addBottomLink(img.del(), i18n.t("Unjoin this group"), i18n
- .t("Don't participate more as a member in this group"), WorkspaceEvents.UNJOIN_GROUP);
- }
-
- public void clear() {
- super.clear();
- }
-
- public void confirmAddCollab(final String groupShortName, final String groupLongName) {
- final String groupName = groupLongName + " (" + groupShortName + ")";
- MessageBox.confirm(i18n.t("Confirm addition of member"), i18n.t("Add [%s] as member?", groupName),
- new MessageBox.ConfirmCallback() {
- public void execute(final String btnID) {
- if (btnID.equals("yes")) {
- presenter.addCollab(groupShortName);
- }
- }
- });
- }
-
- public void hide() {
- this.setVisible(false);
- }
-
- public void show() {
- this.setVisible(true);
- }
-
- public void showCategory(final String name) {
- super.showStackItem(name);
- }
-
- private AbstractImagePrototype getIcon(final String event) {
- if (event == GroupMembersSummaryView.ICON_ALERT) {
- return img.alert();
- }
- throw new IndexOutOfBoundsException("Icon unknown in GroupMemebersPanel");
- }
-
- private AbstractImagePrototype getIconFronEvent(final String event) {
- if (event == WorkspaceEvents.ACCEPT_JOIN_GROUP) {
- return img.accept();
- }
- if (event == WorkspaceEvents.DENY_JOIN_GROUP) {
- return img.cancel();
- }
- if (event == WorkspaceEvents.DEL_MEMBER) {
- return img.del();
- }
- if (event == PlatformEvents.GOTO) {
- return img.groupHome();
- }
- if (event == WorkspaceEvents.SET_ADMIN_AS_COLLAB) {
- return img.arrowDownGreen();
- }
- if (event == WorkspaceEvents.SET_COLLAB_AS_ADMIN) {
- return img.arrowUpGreen();
- }
- throw new IndexOutOfBoundsException("Event unknown in GroupMembersPanel");
- }
-
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuPanel.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuPanel.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,64 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.theme;
-
-import org.ourproject.kune.platf.client.services.ColorTheme;
-import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.platf.client.services.Images;
-import org.ourproject.kune.platf.client.ui.BottomTrayIcon;
-
-import com.google.gwt.user.client.Command;
-import com.google.gwt.user.client.ui.MenuBar;
-
-public class ThemeMenuPanel extends BottomTrayIcon implements ThemeMenuView {
-
- private final MenuBar themesMB;
- private final ThemeMenuPresenter presenter;
- private final ColorTheme colorTheme;
-
- public ThemeMenuPanel(final ThemeMenuPresenter presenter, final I18nTranslationService i18n,
- final ColorTheme colorTheme) {
- super(i18n.t("Select Workspace theme for this group"));
- this.presenter = presenter;
- this.colorTheme = colorTheme;
- themesMB = new MenuBar(true);
- themesMB.addStyleDependentName("bottomMenu");
- this.addItem(Images.App.getInstance().themeChoose().getHTML(), true, themesMB);
- }
-
- public void setThemes(final String[] themes) {
- for (int i = 0; i < themes.length; i++) {
- final String theme = themes[i];
- colorTheme.setTheme(theme);
- String themeName = colorTheme.getThemeName();
- String mainColor = colorTheme.getContentMainBorder();
- themesMB.addItem("<span style=\"color: " + mainColor + ";\">" + themeName + "</span>", true, new Command() {
- public void execute() {
- presenter.chooseTheme(theme);
- }
- });
- }
- }
-
- public void setVisible(final boolean visible) {
- super.setVisible(visible);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuPresenter.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuPresenter.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,51 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.theme;
-
-import org.ourproject.kune.platf.client.View;
-import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher;
-import org.ourproject.kune.workspace.client.WorkspaceEvents;
-import org.ourproject.kune.workspace.client.workspace.ThemeMenuComponent;
-
-public class ThemeMenuPresenter implements ThemeMenuComponent {
-
- private ThemeMenuView view;
-
- public void chooseTheme(final String theme) {
- DefaultDispatcher.getInstance().fire(WorkspaceEvents.CHANGE_GROUP_WSTHEME, theme);
- }
-
- public void init(final ThemeMenuView view) {
- this.view = view;
- }
-
- public void setThemes(final String[] themes) {
- view.setThemes(themes);
- }
-
- public View getView() {
- return view;
- }
-
- public void setVisible(final boolean visible) {
- view.setVisible(visible);
- }
-}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuView.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuView.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,31 +0,0 @@
-/*
- *
- * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
- * This file is part of kune.
- *
- * This program is free software: you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as
- * published by the Free Software Foundation, either version 3 of the
- * License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program. If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-package org.ourproject.kune.workspace.client.theme;
-
-import org.ourproject.kune.platf.client.View;
-
-public interface ThemeMenuView extends View {
-
- void setThemes(String[] themes);
-
- void setVisible(boolean visible);
-
-}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -74,9 +74,7 @@
setSocialNetwork(state);
groupSummaryProvider.get().setState(state);
tagsProvider.get().setState(state);
- // Only for probes:
- wsThemePresenter.setVisible(true);
- wsThemePresenter.setTheme(new WsTheme(group.getWorkspaceTheme()));
+ wsThemePresenter.setState(state);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitenewgroup/SiteNewGroupLinkPanel.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,14 +1,19 @@
package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitenewgroup;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.sitebar.SiteToken;
import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.Hyperlink;
public class SiteNewGroupLinkPanel implements SiteNewGroupLinkView {
- private final Hyperlink newGroupHyperlink;
-
- public SiteNewGroupLinkPanel(final SiteNewGroupLinkPresenter presenter, final WorkspaceSkeleton ws) {
- newGroupHyperlink = new Hyperlink();
+ public SiteNewGroupLinkPanel(final SiteNewGroupLinkPresenter presenter, final WorkspaceSkeleton ws,
+ final I18nUITranslationService i18n) {
+ final Hyperlink newGroupHyperlink = new Hyperlink();
+ newGroupHyperlink.setText(i18n.t("Create New Group"));
+ newGroupHyperlink.setTargetHistoryToken(SiteToken.newgroup.toString());
+ ws.getSiteBar().addSeparator();
+ ws.getSiteBar().add(newGroupHyperlink);
}
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesign/SiteSignOutLinkPresenter.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -11,6 +11,7 @@
import org.ourproject.kune.workspace.client.sitebar.Site;
import org.ourproject.kune.workspace.client.sitebar.rpc.UserServiceAsync;
+import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Slot;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Cookies;
@@ -20,12 +21,12 @@
private SiteSignOutLinkView view;
private final Session session;
- private final UserServiceAsync userService;
+ private final Provider<UserServiceAsync> userServiceProvider;
- public SiteSignOutLinkPresenter(final Session session, final UserServiceAsync userService,
- final KuneErrorHandler errorHandler) {
+ public SiteSignOutLinkPresenter(final Session session, final Provider<UserServiceAsync> userServiceProvider,
+ final Provider<KuneErrorHandler> kuneErrorHandlerProvider) {
this.session = session;
- this.userService = userService;
+ this.userServiceProvider = userServiceProvider;
session.onUserSignIn(new Slot<UserInfoDTO>() {
public void onEvent(final UserInfoDTO parameter) {
view.setVisible(true);
@@ -36,7 +37,7 @@
view.setVisible(false);
}
});
- errorHandler.onSessionExpired(new Slot<Object>() {
+ kuneErrorHandlerProvider.get().onSessionExpired(new Slot<Object>() {
public void onEvent(final Object parameter) {
clientUIsignOut();
}
@@ -65,7 +66,7 @@
}
};
- userService.logout(session.getUserHash(), callback);
+ userServiceProvider.get().logout(session.getUserHash(), callback);
}
public View getView() {
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePanel.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -42,7 +42,7 @@
item.addListener(new BaseItemListenerAdapter() {
@Override
public void onClick(final BaseItem item, final EventObject e) {
- presenter.setTheme(theme);
+ presenter.onChangeGroupWsTheme(theme);
}
});
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/themes/WsThemePresenter.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -1,8 +1,13 @@
package org.ourproject.kune.workspace.client.ui.newtmp.themes;
import org.ourproject.kune.platf.client.dto.InitDataDTO;
+import org.ourproject.kune.platf.client.dto.StateDTO;
+import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple;
+import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.workspace.client.sitebar.Site;
+import com.calclab.suco.client.container.Provider;
import com.calclab.suco.client.signal.Signal2;
import com.calclab.suco.client.signal.Slot;
import com.calclab.suco.client.signal.Slot2;
@@ -12,8 +17,12 @@
private WsThemeView view;
private WsTheme previousTheme;
private final Signal2<WsTheme, WsTheme> onThemeChanged;
+ private final Provider<GroupServiceAsync> groupServiceProvider;
+ private final Session session;
- public WsThemePresenter(final Session session) {
+ public WsThemePresenter(final Session session, final Provider<GroupServiceAsync> groupServiceProvider) {
+ this.session = session;
+ this.groupServiceProvider = groupServiceProvider;
this.onThemeChanged = new Signal2<WsTheme, WsTheme>("onThemeChanged");
session.onInitDataReceived(new Slot<InitDataDTO>() {
public void onEvent(final InitDataDTO initData) {
@@ -30,15 +39,32 @@
onThemeChanged.add(slot);
}
- public void setTheme(final WsTheme newTheme) {
+ public void setState(final StateDTO state) {
+ setTheme(new WsTheme(state.getGroup().getWorkspaceTheme()));
+ if (state.getGroupRights().isAdministrable()) {
+ view.setVisible(true);
+ } else {
+ view.setVisible(false);
+ }
+ }
+
+ protected void onChangeGroupWsTheme(final WsTheme newTheme) {
+ Site.showProgressProcessing();
+ groupServiceProvider.get().changeGroupWsTheme(session.getUserHash(),
+ session.getCurrentState().getGroup().getShortName(), newTheme.getName(),
+ new AsyncCallbackSimple<Object>() {
+ public void onSuccess(final Object result) {
+ setTheme(newTheme);
+ Site.hideProgress();
+ }
+ });
+ }
+
+ private void setTheme(final WsTheme newTheme) {
if (previousTheme == null || !previousTheme.equals(newTheme)) {
onThemeChanged.fire(previousTheme, newTheme);
}
previousTheme = newTheme;
}
- public void setVisible(final boolean visible) {
- view.setVisible(visible);
- }
-
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -61,8 +61,6 @@
public LicenseComponent getLicenseComponent();
- public ThemeMenuComponent getThemeMenuComponent();
-
public UserLiveSearchComponent getUserLiveSearchComponent();
public void setContent(WorkspaceComponent contentComponent);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -112,10 +112,6 @@
return components.getLicenseComponent();
}
- public ThemeMenuComponent getThemeMenuComponent() {
- return components.getThemeMenuComponent();
- }
-
public UserLiveSearchComponent getUserLiveSearchComponent() {
return components.getUserLiveSearchComponent();
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -90,13 +90,6 @@
return license;
}
- public ThemeMenuComponent getThemeMenuComponent() {
- if (themeMenu == null) {
- themeMenu = WorkspaceFactory.createThemeMenuComponent();
- }
- return themeMenu;
- }
-
public UserLiveSearchComponent getUserLiveSearchComponent() {
if (userLiveSearch == null) {
userLiveSearch = WorkspaceFactory.createUserLiveSearchComponent();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-23 04:36:14 UTC (rev 814)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-26 11:38:54 UTC (rev 815)
@@ -228,7 +228,7 @@
setContentToolBar(components.getContentToolBarComponent().getView());
setContentBottomToolBar(components.getContentBottomToolBarComponent().getView());
setBottom(components.getLicenseComponent().getView());
- addBottomIconComponent(components.getThemeMenuComponent().getView());
+ // addBottomIconComponent(components.getThemeMenuComponent().getView());
}
public void setContent(final View content) {
More information about the kune-commits
mailing list