r800 - in trunk/src/main/java/org/ourproject/kune: docs/client docs/client/ctx/admin docs/client/ui platf/client/services platf/client/state workspace/client workspace/client/actions/sn workspace/client/presence/ui workspace/client/socialnet workspace/client/socialnet/ui workspace/client/summary workspace/client/tags workspace/client/tags/ui workspace/client/theme workspace/client/theme/ui workspace/client/ui/newtmp workspace/client/workspace workspace/client/workspace/ui
Author: vjrj Date: 2008-07-12 15:46:02 +0200 (Sat, 12 Jul 2008) New Revision: 800 Added: 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/ParticipationSummaryPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryView.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersSummaryPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationSummaryPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java Removed: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersView.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationView.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ui/ThemeMenuPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersComponent.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummaryComponent.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationComponent.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.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/SetAdminAsCollabAction.java trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetCollabAsAdminAction.java trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/MemberAction.java trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryView.java trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.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: Workspace refactorization Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-07-12 13:46:02 UTC (rev 800) @@ -6,7 +6,7 @@ import org.ourproject.kune.platf.client.state.Session; import org.ourproject.kune.platf.client.state.StateManager; import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; -import org.ourproject.kune.workspace.client.workspace.Tags; +import org.ourproject.kune.workspace.client.workspace.TagsSummary; import com.calclab.suco.client.container.Container; import com.calclab.suco.client.container.Provider; @@ -27,7 +27,7 @@ builder.registerProvider(DocumentFactory.class, new Provider<DocumentFactory>() { public DocumentFactory get() { return new DocumentFactory(builder.getInstance(I18nUITranslationService.class), builder - .getInstance(Session.class), builder.getInstance(Tags.class)); + .getInstance(Session.class), builder.getInstance(TagsSummary.class)); } }, SingletonScope.class); Modified: trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-07-12 13:46:02 UTC (rev 800) @@ -37,15 +37,15 @@ import org.ourproject.kune.platf.client.rpc.ContentServiceAsync; import org.ourproject.kune.platf.client.state.Session; import org.ourproject.kune.workspace.client.sitebar.Site; -import org.ourproject.kune.workspace.client.workspace.Tags; +import org.ourproject.kune.workspace.client.workspace.TagsSummary; public class AdminContextPresenter extends AbstractPresenter implements AdminContext { private AdminContextView view; private final Session session; - private final Tags tags; + private final TagsSummary tags; - public AdminContextPresenter(final Session session, final Tags tags) { + public AdminContextPresenter(final Session session, final TagsSummary tags) { this.session = session; this.tags = tags; } 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-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java 2008-07-12 13:46:02 UTC (rev 800) @@ -52,15 +52,15 @@ import org.ourproject.kune.workspace.client.WorkspaceFactory; import org.ourproject.kune.workspace.client.component.WorkspaceDeckPanel; import org.ourproject.kune.workspace.client.ui.ctx.items.ContextItems; -import org.ourproject.kune.workspace.client.workspace.Tags; +import org.ourproject.kune.workspace.client.workspace.TagsSummary; public class DocumentFactory { private final I18nTranslationService i18n; private final Session session; - private final Tags tags; + private final TagsSummary tags; - public DocumentFactory(final I18nTranslationService i18n, final Session session, final Tags tags) { + public DocumentFactory(final I18nTranslationService i18n, final Session session, final TagsSummary tags) { this.i18n = i18n; this.session = session; this.tags = tags; 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-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-12 13:46:02 UTC (rev 800) @@ -17,13 +17,22 @@ 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.presence.ui.GroupSummaryPanel; import org.ourproject.kune.workspace.client.search.SiteSearcher; import org.ourproject.kune.workspace.client.search.SiteSearcherPanel; import org.ourproject.kune.workspace.client.search.SiteSearcherPresenter; import org.ourproject.kune.workspace.client.search.SiteSearcherView; import org.ourproject.kune.workspace.client.sitebar.Site; -import org.ourproject.kune.workspace.client.tags.TagsPresenter; -import org.ourproject.kune.workspace.client.tags.ui.TagsPanel; +import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryPresenter; +import org.ourproject.kune.workspace.client.socialnet.GroupMembersSummaryView; +import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryPresenter; +import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryView; +import org.ourproject.kune.workspace.client.socialnet.ui.GroupMembersSummaryPanel; +import org.ourproject.kune.workspace.client.socialnet.ui.ParticipationSummaryPanel; +import org.ourproject.kune.workspace.client.summary.GroupSummaryPresenter; +import org.ourproject.kune.workspace.client.summary.GroupSummaryView; +import org.ourproject.kune.workspace.client.tags.TagsSummaryPanel; +import org.ourproject.kune.workspace.client.tags.TagsSummaryPresenter; import org.ourproject.kune.workspace.client.ui.newtmp.WorkspaceManager; import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePanel; import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter; @@ -40,7 +49,10 @@ import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter; import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePanel; import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter; -import org.ourproject.kune.workspace.client.workspace.Tags; +import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary; +import org.ourproject.kune.workspace.client.workspace.GroupSummary; +import org.ourproject.kune.workspace.client.workspace.ParticipationSummary; +import org.ourproject.kune.workspace.client.workspace.TagsSummary; import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo; import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPanel; @@ -211,16 +223,45 @@ final WorkspaceManager presenter = new WorkspaceManager(builder.getInstance(EntityLogo.class), builder .getInstance(EntityTitlePresenter.class), builder.getInstance(EntitySubTitlePresenter.class), builder.getInstance(WsThemePresenter.class), builder.getInstance(EntityLicensePresenter.class), - builder.getInstance(Tags.class)); + builder.getInstance(GroupMembersSummary.class), + builder.getInstance(ParticipationSummary.class), builder.getInstance(TagsSummary.class), + builder.getInstance(GroupSummary.class)); return presenter; } }, SingletonScope.class); - builder.registerProvider(Tags.class, new Provider<Tags>() { - public Tags get() { - final TagsPresenter presenter = new TagsPresenter(builder.getProvider(Session.class), builder - .getProvider(SiteSearcher.class)); - final TagsPanel panel = new TagsPanel(presenter, i18n, ws); + builder.registerProvider(GroupMembersSummary.class, new Provider<GroupMembersSummary>() { + public GroupMembersSummary get() { + final GroupMembersSummaryPresenter presenter = new GroupMembersSummaryPresenter(i18n); + final GroupMembersSummaryView view = new GroupMembersSummaryPanel(presenter, i18n, ws); + presenter.init(view); + return presenter; + } + }, SingletonScope.class); + + builder.registerProvider(GroupSummary.class, new Provider<GroupSummary>() { + public GroupSummary get() { + final GroupSummaryPresenter presenter = new GroupSummaryPresenter(); + final GroupSummaryView view = new GroupSummaryPanel(presenter, i18n, ws); + presenter.init(view); + return presenter; + } + }, SingletonScope.class); + + builder.registerProvider(ParticipationSummary.class, new Provider<ParticipationSummary>() { + public ParticipationSummary get() { + final ParticipationSummaryPresenter presenter = new ParticipationSummaryPresenter(i18n); + final ParticipationSummaryView view = new ParticipationSummaryPanel(presenter, i18n, ws); + presenter.init(view); + return presenter; + } + }, SingletonScope.class); + + builder.registerProvider(TagsSummary.class, new Provider<TagsSummary>() { + public TagsSummary get() { + final TagsSummaryPresenter presenter = new TagsSummaryPresenter(builder.getProvider(Session.class), + builder.getProvider(SiteSearcher.class)); + final TagsSummaryPanel panel = new TagsSummaryPanel(presenter, i18n, ws); presenter.init(panel); return presenter; } Modified: trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-12 13:46:02 UTC (rev 800) @@ -116,7 +116,7 @@ final ParticipationDataDTO userParticipation = socialNet.getUserParticipation(); state.setGroupMembers(groupMembers); state.setParticipation(userParticipation); - setSocialNetwork(state); + ws.setSocialNetwork(state); } } @@ -150,8 +150,6 @@ workspace.setContent(clientTool.getContent()); workspace.setContext(clientTool.getContext()); workspace.getLicenseComponent().setLicense(state); - setSocialNetwork(state); - workspace.getGroupSummaryComponent().setGroupSummary(state); Site.hideProgress(); } @@ -171,10 +169,4 @@ } }); } - - private void setSocialNetwork(final StateDTO state) { - workspace.getGroupMembersComponent().setGroupMembers(state); - workspace.getParticipationComponent().setParticipation(state); - } - } 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-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-07-12 13:46:02 UTC (rev 800) @@ -42,24 +42,15 @@ import org.ourproject.kune.workspace.client.licensefoot.LicensePresenter; import org.ourproject.kune.workspace.client.licensefoot.LicenseView; import org.ourproject.kune.workspace.client.licensefoot.ui.LicensePanel; -import org.ourproject.kune.workspace.client.presence.ui.GroupSummaryPanel; import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarListener; import org.ourproject.kune.workspace.client.socialnet.EntityLiveSearchView; import org.ourproject.kune.workspace.client.socialnet.GroupLiveSearchPresenter; -import org.ourproject.kune.workspace.client.socialnet.GroupMembersPresenter; -import org.ourproject.kune.workspace.client.socialnet.GroupMembersView; -import org.ourproject.kune.workspace.client.socialnet.ParticipationPresenter; -import org.ourproject.kune.workspace.client.socialnet.ParticipationView; 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.GroupMembersPanel; -import org.ourproject.kune.workspace.client.socialnet.ui.ParticipationPanel; import org.ourproject.kune.workspace.client.socialnet.ui.UserLiveSearchPanel; -import org.ourproject.kune.workspace.client.summary.GroupSummaryPresenter; -import org.ourproject.kune.workspace.client.summary.GroupSummaryView; +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.theme.ui.ThemeMenuPanel; 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; @@ -76,9 +67,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.GroupMembersComponent; -import org.ourproject.kune.workspace.client.workspace.GroupSummaryComponent; -import org.ourproject.kune.workspace.client.workspace.ParticipationComponent; import org.ourproject.kune.workspace.client.workspace.ThemeMenuComponent; import org.ourproject.kune.workspace.client.workspace.UserLiveSearchComponent; import org.ourproject.kune.workspace.client.workspace.Workspace; @@ -151,20 +139,6 @@ return presenter; } - public static GroupMembersComponent createGroupMembersComponent() { - final GroupMembersPresenter presenter = new GroupMembersPresenter(i18n); - final GroupMembersView view = new GroupMembersPanel(presenter, i18n); - presenter.init(view); - return presenter; - } - - public static GroupSummaryComponent createGroupSummaryComponent() { - final GroupSummaryPresenter presenter = new GroupSummaryPresenter(); - final GroupSummaryView view = new GroupSummaryPanel(presenter, i18n, colorTheme); - presenter.init(view); - return presenter; - } - public static I18nTranslatorComponent createI18nTranslatorComponent() { final I18nTranslatorPresenter presenter = new I18nTranslatorPresenter(session); final I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n); @@ -186,13 +160,6 @@ return presenter; } - public static ParticipationComponent createParticipationComponent() { - final ParticipationPresenter presenter = new ParticipationPresenter(i18n); - final ParticipationView view = new ParticipationPanel(presenter, i18n); - presenter.init(view); - return presenter; - } - public static ThemeMenuComponent createThemeMenuComponent() { final ThemeMenuPresenter presenter = new ThemeMenuPresenter(); final ThemeMenuView view = new ThemeMenuPanel(presenter, i18n, colorTheme); Modified: 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-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AcceptJoinGroupAction.java 2008-07-12 13:46:02 UTC (rev 800) @@ -37,30 +37,32 @@ 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; + final I18nTranslationService i18n) { + this.session = session; + this.workspace = workspace; + this.stateManager = stateManager; + this.i18n = i18n; } public void execute(final String groupShortName) { - onAcceptJoinGroup(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); - workspace.getGroupMembersComponent().showCollabs(); - } - }); + 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(); + } + }); } } Modified: 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-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddAdminAction.java 2008-07-12 13:46:02 UTC (rev 800) @@ -30,6 +30,7 @@ import org.ourproject.kune.workspace.client.sitebar.Site; import org.ourproject.kune.workspace.client.workspace.Workspace; +@Deprecated public class AddAdminAction implements Action<String> { private final Workspace workspace; @@ -38,29 +39,29 @@ 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; + final I18nTranslationService i18n) { + this.session = session; + this.stateManager = stateManager; + this.workspace = workspace; + this.i18n = i18n; } public void execute(final String groupShortName) { - onAddAdmin(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(); - } - }); + 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(); + } + }); } } Modified: 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-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/AddCollabAction.java 2008-07-12 13:46:02 UTC (rev 800) @@ -30,6 +30,7 @@ import org.ourproject.kune.workspace.client.sitebar.Site; import org.ourproject.kune.workspace.client.workspace.Workspace; +@Deprecated public class AddCollabAction implements Action<String> { private final Session session; @@ -38,28 +39,28 @@ 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; + final I18nTranslationService i18n) { + this.session = session; + this.stateManager = stateManager; + this.workspace = workspace; + this.i18n = i18n; } public void execute(final String groupShortName) { - onAddCollab(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(); - } - }); + 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(); + } + }); } } Modified: 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-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetAdminAsCollabAction.java 2008-07-12 13:46:02 UTC (rev 800) @@ -30,6 +30,7 @@ import org.ourproject.kune.workspace.client.sitebar.Site; import org.ourproject.kune.workspace.client.workspace.Workspace; +@Deprecated public class SetAdminAsCollabAction implements Action<String> { private final Session session; @@ -38,28 +39,28 @@ 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; + final I18nTranslationService i18n) { + this.session = session; + this.stateManager = stateManager; + this.workspace = workspace; + this.i18n = i18n; } public void execute(final String value) { - onSetAdminAsCollab(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(); - } - }); + 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(); + } + }); } } Modified: 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-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/sn/SetCollabAsAdminAction.java 2008-07-12 13:46:02 UTC (rev 800) @@ -30,6 +30,7 @@ import org.ourproject.kune.workspace.client.sitebar.Site; import org.ourproject.kune.workspace.client.workspace.Workspace; +@Deprecated public class SetCollabAsAdminAction implements Action<String> { private final Session session; @@ -38,30 +39,30 @@ 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; + final I18nTranslationService i18n) { + this.session = session; + this.stateManager = stateManager; + this.workspace = workspace; + this.i18n = i18n; } public void execute(final String value) { - onSetCollabAsAdmin(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(); - } - }); + 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(); + } + }); } } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/presence/ui/GroupSummaryPanel.java 2008-07-12 13:46:02 UTC (rev 800) @@ -20,26 +20,27 @@ package org.ourproject.kune.workspace.client.presence.ui; import org.ourproject.kune.platf.client.AbstractPresenter; -import org.ourproject.kune.platf.client.services.ColorTheme; import org.ourproject.kune.platf.client.services.I18nTranslationService; import org.ourproject.kune.platf.client.ui.stacks.StackedDropDownPanel; import org.ourproject.kune.workspace.client.sitebar.Site; import org.ourproject.kune.workspace.client.summary.GroupSummaryView; +import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton; public class GroupSummaryPanel extends StackedDropDownPanel implements GroupSummaryView { public GroupSummaryPanel(final AbstractPresenter presenter, final I18nTranslationService i18n, - final ColorTheme colorTheme) { - // FIXME - super(presenter, colorTheme.getSummaryDD(), i18n.t("Group Summary"), i18n - .t("Some summarized information about current project" + Site.IN_DEVELOPMENT), false); - setDropDownContentVisible(true); - setVisible(true); + final WorkspaceSkeleton ws) { + // FIXME + super(presenter, "red", i18n.t("Group Summary"), i18n.t("Some summarized information about current project" + + Site.IN_DEVELOPMENT), false); + setDropDownContentVisible(true); + setVisible(true); + ws.getEntitySummary().addInSummary(this); } public void setComment(final String comment) { - super.clear(); - super.addComment(comment); + super.clear(); + super.addComment(comment); } } Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersPresenter.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersPresenter.java 2008-07-12 13:46:02 UTC (rev 800) @@ -1,194 +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.workspace.client.WorkspaceEvents; -import org.ourproject.kune.workspace.client.workspace.GroupMembersComponent; - -public class GroupMembersPresenter extends AbstractPresenter implements GroupMembersComponent, EntityLiveSearchListener { - - private GroupMembersView view; - private final I18nTranslationService i18n; - private final String adminCategory; - private final String collabCategory; - private final String pendigCategory; - private final MemberAction gotoGroupCommand; - - public GroupMembersPresenter(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 View getView() { - return view; - } - - public void hide() { - view.hide(); - } - - public void init(final GroupMembersView 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 setGroupMembers(final StateDTO state) { - if (state.getGroup().getType() == GroupDTO.PERSONAL) { - hide(); - } else { - setGroupMembers(state.getGroupMembers(), state.getGroupRights()); - } - } - - 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"), - GroupMembersView.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(); - - List<GroupDTO> adminsList = accessLists.getAdmins().getList(); - List<GroupDTO> collabList = accessLists.getEditors().getList(); - List<GroupDTO> pendingCollabsList = socialNetwork.getPendingCollaborators().getList(); - - int numAdmins = adminsList.size(); - int numCollaborators = collabList.size(); - int numPendingCollabs = pendingCollabsList.size(); - - boolean userIsAdmin = rights.isAdministrable(); - boolean userIsCollab = !userIsAdmin && rights.isEditable(); - 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()) { - 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 }; - 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 }; - 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 }; - MemberAction[] viewerActions = { gotoGroupCommand }; - addMembers(adminsList, collabList, pendingCollabsList, numAdmins, numCollaborators, numPendingCollabs, - userIsAdmin, adminsActions, collabActions, pendingsActions, viewerActions); - } else if (rights.isEditable() || rights.isVisible()) { - MemberAction[] adminsActions = { gotoGroupCommand }; - MemberAction[] collabActions = { gotoGroupCommand }; - MemberAction[] pendingsActions = { gotoGroupCommand }; - MemberAction[] viewerActions = { gotoGroupCommand }; - addMembers(adminsList, collabList, pendingCollabsList, numAdmins, numCollaborators, numPendingCollabs, - userIsAdmin, adminsActions, collabActions, pendingsActions, viewerActions); - } - } - view.setDropDownContentVisible(true); - view.show(); - } - -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersPresenter.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersPresenter.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryPresenter.java 2008-07-12 13:46:02 UTC (rev 800) @@ -0,0 +1,204 @@ +/* + * + * 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.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 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 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()) { + new MenuItem("", i18n.t("Remove this member"), new MenuItem.MenuItemListener() { + public void onClick() { + + } + }); + 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(); + } + +} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersView.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersView.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersSummaryView.java 2008-07-12 13:46:02 UTC (rev 800) @@ -0,0 +1,57 @@ +/* + * + * 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); + +} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersView.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersView.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/GroupMembersView.java 2008-07-12 13:46:02 UTC (rev 800) @@ -1,54 +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; - -public interface GroupMembersView extends View { - - public static final String ICON_ALERT = "alert"; - - void clear(); - - void setDropDownContentVisible(boolean visible); - - 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 addJoinLink(); - - void addAddMemberLink(); - - void show(); - - void hide(); - - void addUnjoinLink(); - - void showCategory(String name); - - void confirmAddCollab(String groupShortName, String groupLongName); - - void addComment(String comment); - -} Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/MemberAction.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/MemberAction.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/MemberAction.java 2008-07-12 13:46:02 UTC (rev 800) @@ -19,22 +19,21 @@ */ package org.ourproject.kune.workspace.client.socialnet; - public class MemberAction { private final String text; private final String action; public MemberAction(final String text, final String action) { - this.text = text; - this.action = action; + this.text = text; + this.action = action; } public String getAction() { - return action; + return action; } public String getText() { - return text; + return text; } } \ No newline at end of file Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationPresenter.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationPresenter.java 2008-07-12 13:46:02 UTC (rev 800) @@ -1,132 +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.dto.AccessRightsDTO; -import org.ourproject.kune.platf.client.dto.LinkDTO; -import org.ourproject.kune.platf.client.dto.ParticipationDataDTO; -import org.ourproject.kune.platf.client.dto.StateDTO; -import org.ourproject.kune.platf.client.services.I18nTranslationService; -import org.ourproject.kune.workspace.client.WorkspaceEvents; -import org.ourproject.kune.workspace.client.workspace.ParticipationComponent; - -public class ParticipationPresenter extends AbstractPresenter implements ParticipationComponent { - - private ParticipationView view; - - private final I18nTranslationService i18n; - - private final String admin_subtitle; - - private final MemberAction goto_group_command; - - public ParticipationPresenter(final I18nTranslationService i18n) { - this.i18n = i18n; - admin_subtitle = i18n.t("admin in:"); - goto_group_command = new MemberAction(i18n.t("Visit this group homepage"), PlatformEvents.GOTO); - } - - public View getView() { - return view; - } - - public void init(final ParticipationView view) { - this.view = view; - } - - public void setParticipation(final StateDTO state) { - ParticipationDataDTO participation = state.getParticipation(); - AccessRightsDTO rights = state.getGroupRights(); - view.setDropDownContentVisible(false); - view.clear(); - MemberAction[] adminsActions = { - new MemberAction(i18n.t("Don't participate more in this group"), WorkspaceEvents.UNJOIN_GROUP), - goto_group_command }; - MemberAction[] collabActions = adminsActions; - MemberAction[] viewerActions = { goto_group_command }; - List<LinkDTO> groupsIsAdmin = participation.getGroupsIsAdmin(); - List<LinkDTO> groupsIsCollab = participation.getGroupsIsCollab(); - boolean userIsAdmin = rights.isAdministrable(); - boolean userIsCollab = !userIsAdmin && rights.isEditable(); - boolean userIsMember = isMember(userIsAdmin, userIsCollab); - int numAdmins = groupsIsAdmin.size(); - int numCollaborators = groupsIsCollab.size(); - if (numAdmins > 0 || numCollaborators > 0) { - addParticipants(groupsIsAdmin, groupsIsCollab, numAdmins, numCollaborators, userIsAdmin, userIsMember, - adminsActions, collabActions, viewerActions); - view.setDropDownContentVisible(true); - view.show(); - } else { - hide(); - } - - } - - private void addParticipants(final List<LinkDTO> groupsIsAdmin, final List<LinkDTO> groupsIsCollab, - final int numAdmins, final int numCollaborators, final boolean userIsAdmin, boolean userIsMember, - final MemberAction[] adminsActions, final MemberAction[] collabActions, final MemberAction[] viewerActions) { - MemberAction[] actions; - String collabTitle; - - if (!userIsMember) { - actions = viewerActions; - } else { - if (userIsAdmin) { - actions = adminsActions; - } else { - actions = collabActions; - } - } - if (numAdmins > 0) { - view.addCategory(admin_subtitle, i18n.tWithNT("Administrate these groups", "talking about a person")); - iteraList(admin_subtitle, groupsIsAdmin, actions); - collabTitle = i18n.t("and as collaborator in:"); - } else { - collabTitle = i18n.t("collaborator in:"); - } - if (numCollaborators > 0) { - view.addCategory(collabTitle, i18n.t("Collaborate in these groups")); - iteraList(collabTitle, groupsIsCollab, actions); - } - - } - - private void hide() { - view.hide(); - } - - private boolean isMember(final boolean userIsAdmin, final boolean userIsCollab) { - return userIsAdmin || userIsCollab; - } - - private void iteraList(final String categoryName, final List<LinkDTO> groupList, final MemberAction[] actions) { - final Iterator<LinkDTO> iter = groupList.iterator(); - while (iter.hasNext()) { - final LinkDTO group = iter.next(); - view.addCategoryMember(categoryName, group.getShortName(), group.getLongName(), actions); - } - } -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationPresenter.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationPresenter.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryPresenter.java 2008-07-12 13:46:02 UTC (rev 800) @@ -0,0 +1,137 @@ +/* + * + * 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.dto.AccessRightsDTO; +import org.ourproject.kune.platf.client.dto.LinkDTO; +import org.ourproject.kune.platf.client.dto.ParticipationDataDTO; +import org.ourproject.kune.platf.client.dto.StateDTO; +import org.ourproject.kune.platf.client.services.I18nTranslationService; +import org.ourproject.kune.workspace.client.WorkspaceEvents; +import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; +import org.ourproject.kune.workspace.client.workspace.ParticipationSummary; + +public class ParticipationSummaryPresenter extends AbstractPresenter implements ParticipationSummary { + + private ParticipationSummaryView view; + + private final I18nTranslationService i18n; + + private final String admin_subtitle; + + private final MemberAction goto_group_command; + + public ParticipationSummaryPresenter(final I18nTranslationService i18n) { + this.i18n = i18n; + admin_subtitle = i18n.t("admin in:"); + goto_group_command = new MemberAction(i18n.t("Visit this group homepage"), PlatformEvents.GOTO); + } + + public View getView() { + return view; + } + + public void init(final ParticipationSummaryView view) { + this.view = view; + } + + public void setState(final StateDTO state) { + final ParticipationDataDTO participation = state.getParticipation(); + final AccessRightsDTO rights = state.getGroupRights(); + view.setDropDownContentVisible(false); + view.clear(); + final MemberAction[] adminsActions = { + new MemberAction(i18n.t("Don't participate more in this group"), WorkspaceEvents.UNJOIN_GROUP), + goto_group_command }; + final MemberAction[] collabActions = adminsActions; + final MemberAction[] viewerActions = { goto_group_command }; + final List<LinkDTO> groupsIsAdmin = participation.getGroupsIsAdmin(); + final List<LinkDTO> groupsIsCollab = participation.getGroupsIsCollab(); + boolean userIsAdmin = rights.isAdministrable(); + final boolean userIsCollab = !userIsAdmin && rights.isEditable(); + final boolean userIsMember = isMember(userIsAdmin, userIsCollab); + final int numAdmins = groupsIsAdmin.size(); + final int numCollaborators = groupsIsCollab.size(); + if (numAdmins > 0 || numCollaborators > 0) { + addParticipants(groupsIsAdmin, groupsIsCollab, numAdmins, numCollaborators, userIsAdmin, userIsMember, + adminsActions, collabActions, viewerActions); + view.setDropDownContentVisible(true); + view.show(); + } else { + hide(); + } + + } + + public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) { + view.setTheme(oldTheme, newTheme); + } + + private void addParticipants(final List<LinkDTO> groupsIsAdmin, final List<LinkDTO> groupsIsCollab, + final int numAdmins, final int numCollaborators, final boolean userIsAdmin, boolean userIsMember, + final MemberAction[] adminsActions, final MemberAction[] collabActions, final MemberAction[] viewerActions) { + MemberAction[] actions; + String collabTitle; + + if (!userIsMember) { + actions = viewerActions; + } else { + if (userIsAdmin) { + actions = adminsActions; + } else { + actions = collabActions; + } + } + if (numAdmins > 0) { + view.addCategory(admin_subtitle, i18n.tWithNT("Administrate these groups", "talking about a person")); + iteraList(admin_subtitle, groupsIsAdmin, actions); + collabTitle = i18n.t("and as collaborator in:"); + } else { + collabTitle = i18n.t("collaborator in:"); + } + if (numCollaborators > 0) { + view.addCategory(collabTitle, i18n.t("Collaborate in these groups")); + iteraList(collabTitle, groupsIsCollab, actions); + } + + } + + private void hide() { + view.hide(); + } + + private boolean isMember(final boolean userIsAdmin, final boolean userIsCollab) { + return userIsAdmin || userIsCollab; + } + + private void iteraList(final String categoryName, final List<LinkDTO> groupList, final MemberAction[] actions) { + final Iterator<LinkDTO> iter = groupList.iterator(); + while (iter.hasNext()) { + final LinkDTO group = iter.next(); + view.addCategoryMember(categoryName, group.getShortName(), group.getLongName(), actions); + } + } +} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryView.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationView.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationView.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationSummaryView.java 2008-07-12 13:46:02 UTC (rev 800) @@ -0,0 +1,41 @@ +/* + * + * 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 ParticipationSummaryView extends View { + + void addCategory(String name, String title); + + void addCategoryMember(String categoryName, String name, String title, MemberAction[] memberActions); + + void clear(); + + void hide(); + + void setDropDownContentVisible(boolean visible); + + void setTheme(WsTheme oldTheme, WsTheme newTheme); + + void show(); + +} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationView.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationView.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ParticipationView.java 2008-07-12 13:46:02 UTC (rev 800) @@ -1,38 +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; - -public interface ParticipationView extends View { - - void hide(); - - void addCategory(String name, String title); - - void addCategoryMember(String categoryName, String name, String title, MemberAction[] memberActions); - - void show(); - - void setDropDownContentVisible(boolean visible); - - void clear(); - -} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersPanel.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersPanel.java 2008-07-12 13:46:02 UTC (rev 800) @@ -1,145 +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.GroupMembersPresenter; -import org.ourproject.kune.workspace.client.socialnet.GroupMembersView; -import org.ourproject.kune.workspace.client.socialnet.MemberAction; - -import com.google.gwt.user.client.ui.AbstractImagePrototype; -import com.gwtext.client.widgets.MessageBox; - -public class GroupMembersPanel extends StackedDropDownPanel implements GroupMembersView { - private static final boolean COUNTS_VISIBLE = true; - private final Images img = Images.App.getInstance(); - private final GroupMembersPresenter presenter; - private final I18nTranslationService i18n; - - public GroupMembersPanel(final GroupMembersPresenter initPresenter, final I18nTranslationService i18n) { - super(initPresenter, "#00D4AA", i18n.t("Group members"), i18n - .t("People and groups collaborating in this group"), COUNTS_VISIBLE); - presenter = initPresenter; - this.i18n = i18n; - } - - 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) { - 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) { - 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 == GroupMembersView.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"); - } - -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersSummaryPanel.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersPanel.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersPanel.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/GroupMembersSummaryPanel.java 2008-07-12 13:46:02 UTC (rev 800) @@ -0,0 +1,148 @@ +/* + * + * 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/socialnet/ui/ParticipationPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationPanel.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationPanel.java 2008-07-12 13:46:02 UTC (rev 800) @@ -1,94 +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.AbstractPresenter; -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.GroupMembersView; -import org.ourproject.kune.workspace.client.socialnet.MemberAction; -import org.ourproject.kune.workspace.client.socialnet.ParticipationView; - -import com.google.gwt.user.client.ui.AbstractImagePrototype; - -public class ParticipationPanel extends StackedDropDownPanel implements ParticipationView { - - private static final boolean COUNTS_VISIBLE = false; - private final Images img = Images.App.getInstance(); - - public ParticipationPanel(final AbstractPresenter presenter, final I18nTranslationService i18n) { - super(presenter, "#00D4AA", i18n.t("Participates as..."), i18n.t("Groups in which participates"), - COUNTS_VISIBLE); - } - - 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) { - 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 clear() { - super.clear(); - } - - public void hide() { - this.setVisible(false); - } - - public void show() { - this.setVisible(true); - } - - private AbstractImagePrototype getIcon(final String event) { - if (event == GroupMembersView.ICON_ALERT) { - return img.alert(); - } - throw new IndexOutOfBoundsException("Icon unknown in ParticipationPanelk"); - } - - private AbstractImagePrototype getIconFronEvent(final String event) { - if (event == WorkspaceEvents.UNJOIN_GROUP) { - return img.del(); - } - if (event == PlatformEvents.GOTO) { - return img.groupHome(); - } - throw new IndexOutOfBoundsException("Event unknown in ParticipationPanel"); - } - -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationSummaryPanel.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationPanel.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationPanel.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/socialnet/ui/ParticipationSummaryPanel.java 2008-07-12 13:46:02 UTC (rev 800) @@ -0,0 +1,97 @@ +/* + * + * 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.AbstractPresenter; +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.GroupMembersSummaryView; +import org.ourproject.kune.workspace.client.socialnet.MemberAction; +import org.ourproject.kune.workspace.client.socialnet.ParticipationSummaryView; +import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton; + +import com.google.gwt.user.client.ui.AbstractImagePrototype; + +public class ParticipationSummaryPanel extends StackedDropDownPanel implements ParticipationSummaryView { + + private static final boolean COUNTS_VISIBLE = false; + private final Images img = Images.App.getInstance(); + + public ParticipationSummaryPanel(final AbstractPresenter presenter, final I18nTranslationService i18n, + final WorkspaceSkeleton ws) { + super(presenter, "#00D4AA", i18n.t("Participates as..."), i18n.t("Groups in which participates"), + COUNTS_VISIBLE); + ws.getEntitySummary().addInSummary(this); + } + + 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 clear() { + super.clear(); + } + + public void hide() { + this.setVisible(false); + } + + public void show() { + this.setVisible(true); + } + + private AbstractImagePrototype getIcon(final String event) { + if (event == GroupMembersSummaryView.ICON_ALERT) { + return img.alert(); + } + throw new IndexOutOfBoundsException("Icon unknown in ParticipationPanelk"); + } + + private AbstractImagePrototype getIconFronEvent(final String event) { + if (event == WorkspaceEvents.UNJOIN_GROUP) { + return img.del(); + } + if (event == PlatformEvents.GOTO) { + return img.groupHome(); + } + throw new IndexOutOfBoundsException("Event unknown in ParticipationPanel"); + } + +} Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryPresenter.java 2008-07-12 13:46:02 UTC (rev 800) @@ -22,22 +22,27 @@ import org.ourproject.kune.platf.client.AbstractPresenter; import org.ourproject.kune.platf.client.View; import org.ourproject.kune.platf.client.dto.StateDTO; -import org.ourproject.kune.workspace.client.workspace.GroupSummaryComponent; +import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; +import org.ourproject.kune.workspace.client.workspace.GroupSummary; -public class GroupSummaryPresenter extends AbstractPresenter implements GroupSummaryComponent { +public class GroupSummaryPresenter extends AbstractPresenter implements GroupSummary { private GroupSummaryView view; - public void setGroupSummary(final StateDTO state) { - view.setComment("Summary about this group (in development)"); - } - public View getView() { - return view; + return view; } public void init(final GroupSummaryView view) { - this.view = view; + this.view = view; } + public void setState(final StateDTO state) { + view.setComment("Summary about this group (in development)"); + } + + public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) { + view.setTheme(oldTheme, newTheme); + } + } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryView.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryView.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/summary/GroupSummaryView.java 2008-07-12 13:46:02 UTC (rev 800) @@ -20,9 +20,12 @@ package org.ourproject.kune.workspace.client.summary; import org.ourproject.kune.platf.client.View; +import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; public interface GroupSummaryView extends View { void setComment(String comment); + void setTheme(WsTheme oldTheme, WsTheme newTheme); + } Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java 2008-07-12 13:46:02 UTC (rev 800) @@ -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.tags; - -import java.util.List; - -import org.ourproject.kune.platf.client.View; -import org.ourproject.kune.platf.client.dto.StateDTO; -import org.ourproject.kune.platf.client.dto.TagResultDTO; -import org.ourproject.kune.platf.client.state.Session; -import org.ourproject.kune.workspace.client.search.SiteSearcher; -import org.ourproject.kune.workspace.client.search.SiteSearcherType; -import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; -import org.ourproject.kune.workspace.client.workspace.Tags; - -import com.calclab.suco.client.container.Provider; - -public class TagsPresenter implements Tags { - - private TagsView view; - private final Provider<SiteSearcher> searcherProvider; - private final Provider<Session> sessionProvider; - - public TagsPresenter(final Provider<Session> sessionProvider, final Provider<SiteSearcher> searcherProvider) { - this.sessionProvider = sessionProvider; - this.searcherProvider = searcherProvider; - } - - public void doSearchTag(final String name) { - searcherProvider.get().doSearchOfType( - "group:" + sessionProvider.get().getCurrentState().getGroup().getShortName() + " tag:" + name, - SiteSearcherType.content); - } - - public View getView() { - return view; - } - - public void init(final TagsView view) { - this.view = view; - } - - public void setGroupTags(final List<TagResultDTO> groupTags) { - view.setTags(groupTags); - } - - public void setState(final StateDTO state) { - view.setTags(state.getGroupTags()); - } - - public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) { - view.setTheme(oldTheme, newTheme); - } -} Added: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPanel.java 2008-07-12 13:46:02 UTC (rev 800) @@ -0,0 +1,85 @@ +/* + * + * 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.tags; + +import java.util.Iterator; +import java.util.List; + +import org.ourproject.kune.platf.client.dto.TagResultDTO; +import org.ourproject.kune.platf.client.services.I18nTranslationService; +import org.ourproject.kune.platf.client.ui.DropDownPanel; +import org.ourproject.kune.platf.client.ui.KuneUiUtils; +import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton; + +import com.google.gwt.user.client.ui.ClickListener; +import com.google.gwt.user.client.ui.FlowPanel; +import com.google.gwt.user.client.ui.Label; +import com.google.gwt.user.client.ui.VerticalPanel; +import com.google.gwt.user.client.ui.Widget; + +public class TagsSummaryPanel extends DropDownPanel implements TagsSummaryView { + + private final FlowPanel flowPanel; + private final TagsSummaryPresenter presenter; + private final Label noTagsLabel; + private final I18nTranslationService i18n; + + public TagsSummaryPanel(final TagsSummaryPresenter presenter, final I18nTranslationService i18n, final WorkspaceSkeleton ws) { + super(i18n.t("Tags"), true); + this.i18n = i18n; + setHeaderTitle(i18n.t("Keywords or terms associated with this group")); + this.presenter = presenter; + addStyleName("kune-Margin-Medium-t"); + flowPanel = new FlowPanel(); + final VerticalPanel vp = new VerticalPanel(); + vp.add(flowPanel); + vp.setWidth("100%"); + vp.setCellWidth(flowPanel, "100%"); + super.setContent(vp); + noTagsLabel = new Label(i18n.t("The contents of this group don't have any tag")); + ws.getEntitySummary().addInSummary(this); + } + + public void setTags(final List<TagResultDTO> groupTags) { + flowPanel.clear(); + if (groupTags.size() == 0) { + flowPanel.add(noTagsLabel); + } else { + for (final Iterator<TagResultDTO> iterator = groupTags.iterator(); iterator.hasNext();) { + final TagResultDTO tagResult = iterator.next(); + final Label label = new Label(tagResult.getName()); + // i18n pluralization + if (tagResult.getCount().intValue() > 1) { + KuneUiUtils.setQuickTip(label, i18n.t("[%d] items with this tag", tagResult.getCount())); + } else { + KuneUiUtils.setQuickTip(label, i18n.t("[%d] item with this tag", tagResult.getCount())); + } + label.addClickListener(new ClickListener() { + public void onClick(final Widget sender) { + presenter.doSearchTag(tagResult.getName()); + } + }); + label.addStyleName("kune-TagsPanel-tag"); + flowPanel.add(label); + } + } + } +} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java (from rev 798, trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java 2008-07-11 10:36:49 UTC (rev 798) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryPresenter.java 2008-07-12 13:46:02 UTC (rev 800) @@ -0,0 +1,72 @@ +/* + * + * 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.tags; + +import java.util.List; + +import org.ourproject.kune.platf.client.View; +import org.ourproject.kune.platf.client.dto.StateDTO; +import org.ourproject.kune.platf.client.dto.TagResultDTO; +import org.ourproject.kune.platf.client.state.Session; +import org.ourproject.kune.workspace.client.search.SiteSearcher; +import org.ourproject.kune.workspace.client.search.SiteSearcherType; +import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; +import org.ourproject.kune.workspace.client.workspace.TagsSummary; + +import com.calclab.suco.client.container.Provider; + +public class TagsSummaryPresenter implements TagsSummary { + + private TagsSummaryView view; + private final Provider<SiteSearcher> searcherProvider; + private final Provider<Session> sessionProvider; + + public TagsSummaryPresenter(final Provider<Session> sessionProvider, final Provider<SiteSearcher> searcherProvider) { + this.sessionProvider = sessionProvider; + this.searcherProvider = searcherProvider; + } + + public void doSearchTag(final String name) { + searcherProvider.get().doSearchOfType( + "group:" + sessionProvider.get().getCurrentState().getGroup().getShortName() + " tag:" + name, + SiteSearcherType.content); + } + + public View getView() { + return view; + } + + public void init(final TagsSummaryView view) { + this.view = view; + } + + public void setGroupTags(final List<TagResultDTO> groupTags) { + view.setTags(groupTags); + } + + public void setState(final StateDTO state) { + view.setTags(state.getGroupTags()); + } + + public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) { + view.setTheme(oldTheme, newTheme); + } +} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java (from rev 798, trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java 2008-07-11 10:36:49 UTC (rev 798) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsSummaryView.java 2008-07-12 13:46:02 UTC (rev 800) @@ -0,0 +1,35 @@ +/* + * + * 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.tags; + +import java.util.List; + +import org.ourproject.kune.platf.client.View; +import org.ourproject.kune.platf.client.dto.TagResultDTO; +import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; + +public interface TagsSummaryView extends View { + + void setTags(List<TagResultDTO> groupTags); + + void setTheme(WsTheme oldTheme, WsTheme newTheme); + +} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java 2008-07-12 13:46:02 UTC (rev 800) @@ -1,35 +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.tags; - -import java.util.List; - -import org.ourproject.kune.platf.client.View; -import org.ourproject.kune.platf.client.dto.TagResultDTO; -import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; - -public interface TagsView extends View { - - void setTags(List<TagResultDTO> groupTags); - - void setTheme(WsTheme oldTheme, WsTheme newTheme); - -} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java 2008-07-12 13:46:02 UTC (rev 800) @@ -1,87 +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.tags.ui; - -import java.util.Iterator; -import java.util.List; - -import org.ourproject.kune.platf.client.dto.TagResultDTO; -import org.ourproject.kune.platf.client.services.I18nTranslationService; -import org.ourproject.kune.platf.client.ui.DropDownPanel; -import org.ourproject.kune.platf.client.ui.KuneUiUtils; -import org.ourproject.kune.workspace.client.tags.TagsPresenter; -import org.ourproject.kune.workspace.client.tags.TagsView; -import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton; - -import com.google.gwt.user.client.ui.ClickListener; -import com.google.gwt.user.client.ui.FlowPanel; -import com.google.gwt.user.client.ui.Label; -import com.google.gwt.user.client.ui.VerticalPanel; -import com.google.gwt.user.client.ui.Widget; - -public class TagsPanel extends DropDownPanel implements TagsView { - - private final FlowPanel flowPanel; - private final TagsPresenter presenter; - private final Label noTagsLabel; - private final I18nTranslationService i18n; - - public TagsPanel(final TagsPresenter presenter, final I18nTranslationService i18n, final WorkspaceSkeleton ws) { - super(i18n.t("Tags"), true); - this.i18n = i18n; - setHeaderTitle(i18n.t("Keywords or terms associated with this group")); - this.presenter = presenter; - addStyleName("kune-Margin-Medium-t"); - flowPanel = new FlowPanel(); - final VerticalPanel vp = new VerticalPanel(); - vp.add(flowPanel); - vp.setWidth("100%"); - vp.setCellWidth(flowPanel, "100%"); - super.setContent(vp); - noTagsLabel = new Label(i18n.t("The contents of this group don't have any tag")); - ws.getEntitySummary().addInSummary(this); - } - - public void setTags(final List<TagResultDTO> groupTags) { - flowPanel.clear(); - if (groupTags.size() == 0) { - flowPanel.add(noTagsLabel); - } else { - for (final Iterator<TagResultDTO> iterator = groupTags.iterator(); iterator.hasNext();) { - final TagResultDTO tagResult = iterator.next(); - final Label label = new Label(tagResult.getName()); - // i18n pluralization - if (tagResult.getCount().intValue() > 1) { - KuneUiUtils.setQuickTip(label, i18n.t("[%d] items with this tag", tagResult.getCount())); - } else { - KuneUiUtils.setQuickTip(label, i18n.t("[%d] item with this tag", tagResult.getCount())); - } - label.addClickListener(new ClickListener() { - public void onClick(final Widget sender) { - presenter.doSearchTag(tagResult.getName()); - } - }); - label.addStyleName("kune-TagsPanel-tag"); - flowPanel.add(label); - } - } - } -} Added: 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-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ThemeMenuPanel.java 2008-07-12 13:46:02 UTC (rev 800) @@ -0,0 +1,64 @@ +/* + * + * 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/ui/ThemeMenuPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ui/ThemeMenuPanel.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/theme/ui/ThemeMenuPanel.java 2008-07-12 13:46:02 UTC (rev 800) @@ -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.theme.ui; - -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 org.ourproject.kune.workspace.client.theme.ThemeMenuPresenter; -import org.ourproject.kune.workspace.client.theme.ThemeMenuView; - -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); - } -} 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-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-12 13:46:02 UTC (rev 800) @@ -7,7 +7,10 @@ import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsThemePresenter; import org.ourproject.kune.workspace.client.ui.newtmp.title.EntitySubTitlePresenter; import org.ourproject.kune.workspace.client.ui.newtmp.title.EntityTitlePresenter; -import org.ourproject.kune.workspace.client.workspace.Tags; +import org.ourproject.kune.workspace.client.workspace.GroupMembersSummary; +import org.ourproject.kune.workspace.client.workspace.GroupSummary; +import org.ourproject.kune.workspace.client.workspace.ParticipationSummary; +import org.ourproject.kune.workspace.client.workspace.TagsSummary; import org.ourproject.kune.workspace.client.workspace.ui.EntityLogo; import com.calclab.suco.client.signal.Slot2; @@ -19,25 +22,40 @@ private final WsThemePresenter wsThemePresenter; private final EntityLicensePresenter entityLicensePresenter; private final EntitySubTitlePresenter entitySubTitlePresenter; - private final Tags tags; + private final TagsSummary tags; + private final GroupMembersSummary groupMembersSummary; + private final ParticipationSummary participationSummary; + private final GroupSummary groupSummary; public WorkspaceManager(final EntityLogo entityLogo, final EntityTitlePresenter entityTitlePresenter, final EntitySubTitlePresenter entitySubTitlePresenter, final WsThemePresenter wsThemePresenter, - final EntityLicensePresenter entityLicensePresenter, final Tags tags) { + final EntityLicensePresenter entityLicensePresenter, final GroupMembersSummary groupMembersSummary, + final ParticipationSummary participationSummary, final TagsSummary tags, final GroupSummary groupSummary) { this.entityLogo = entityLogo; this.entityTitlePresenter = entityTitlePresenter; this.entitySubTitlePresenter = entitySubTitlePresenter; this.entityLicensePresenter = entityLicensePresenter; this.wsThemePresenter = wsThemePresenter; + this.groupMembersSummary = groupMembersSummary; + this.participationSummary = participationSummary; this.tags = tags; + this.groupSummary = groupSummary; wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() { public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) { entityLogo.setTheme(oldTheme, newTheme); + groupMembersSummary.setTheme(oldTheme, newTheme); + participationSummary.setTheme(oldTheme, newTheme); + groupSummary.setTheme(oldTheme, newTheme); tags.setTheme(oldTheme, newTheme); } }); } + public void setSocialNetwork(final StateDTO state) { + groupMembersSummary.setState(state); + participationSummary.setState(state); + } + public void setState(final StateDTO state) { final GroupDTO group = state.getGroup(); final boolean isAdmin = state.getGroupRights().isAdministrable(); @@ -46,6 +64,8 @@ entityTitlePresenter.setState(state); entitySubTitlePresenter.setState(state); entityLicensePresenter.setLicense(state); + setSocialNetwork(state); + groupSummary.setState(state); tags.setState(state); // Only for probes: wsThemePresenter.setVisible(true); Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersComponent.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersComponent.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersComponent.java 2008-07-12 13:46:02 UTC (rev 800) @@ -1,34 +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.workspace; - -import org.ourproject.kune.platf.client.Component; -import org.ourproject.kune.platf.client.dto.StateDTO; - -public interface GroupMembersComponent extends Component { - - public void showCollabs(); - - public void showAdmins(); - - public void setGroupMembers(StateDTO state); - -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersComponent.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersComponent.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupMembersSummary.java 2008-07-12 13:46:02 UTC (rev 800) @@ -0,0 +1,36 @@ +/* + * + * 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.workspace; + +import org.ourproject.kune.platf.client.dto.StateDTO; +import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; + +public interface GroupMembersSummary { + + public void setState(StateDTO state); + + public void setTheme(WsTheme oldTheme, WsTheme newTheme); + + public void showAdmins(); + + public void showCollabs(); + +} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummaryComponent.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummaryComponent.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummary.java 2008-07-12 13:46:02 UTC (rev 800) @@ -0,0 +1,32 @@ +/* + * + * 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.workspace; + +import org.ourproject.kune.platf.client.dto.StateDTO; +import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; + +public interface GroupSummary { + + void setState(StateDTO state); + + void setTheme(WsTheme oldTheme, WsTheme newTheme); + +} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummaryComponent.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummaryComponent.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/GroupSummaryComponent.java 2008-07-12 13:46:02 UTC (rev 800) @@ -1,30 +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.workspace; - -import org.ourproject.kune.platf.client.Component; -import org.ourproject.kune.platf.client.dto.StateDTO; - -public interface GroupSummaryComponent extends Component { - - void setGroupSummary(StateDTO state); - -} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationComponent.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationComponent.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationComponent.java 2008-07-12 13:46:02 UTC (rev 800) @@ -1,30 +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.workspace; - -import org.ourproject.kune.platf.client.Component; -import org.ourproject.kune.platf.client.dto.StateDTO; - -public interface ParticipationComponent extends Component { - - void setParticipation(StateDTO state); - -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationComponent.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationComponent.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ParticipationSummary.java 2008-07-12 13:46:02 UTC (rev 800) @@ -0,0 +1,32 @@ +/* + * + * 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.workspace; + +import org.ourproject.kune.platf.client.dto.StateDTO; +import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; + +public interface ParticipationSummary { + + void setState(StateDTO state); + + void setTheme(WsTheme oldTheme, WsTheme newTheme); + +} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java 2008-07-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java 2008-07-12 13:46:02 UTC (rev 800) @@ -1,37 +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.workspace; - -import java.util.List; - -import org.ourproject.kune.platf.client.dto.StateDTO; -import org.ourproject.kune.platf.client.dto.TagResultDTO; -import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; - -public interface Tags { - - void setGroupTags(List<TagResultDTO> result); - - void setState(StateDTO state); - - void setTheme(WsTheme oldTheme, WsTheme newTheme); - -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java (from rev 798, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java 2008-07-11 10:36:49 UTC (rev 798) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsSummary.java 2008-07-12 13:46:02 UTC (rev 800) @@ -0,0 +1,37 @@ +/* + * + * Copyright (C) 2007-2008 The kune development team (see CREDITS for details) + * This file is part of kune. + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU Affero General Public License as + * published by the Free Software Foundation, either version 3 of the + * License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU Affero General Public License for more details. + * + * You should have received a copy of the GNU Affero General Public License + * along with this program. If not, see <http://www.gnu.org/licenses/>. + * + */ + +package org.ourproject.kune.workspace.client.workspace; + +import java.util.List; + +import org.ourproject.kune.platf.client.dto.StateDTO; +import org.ourproject.kune.platf.client.dto.TagResultDTO; +import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; + +public interface TagsSummary { + + void setGroupTags(List<TagResultDTO> result); + + void setState(StateDTO state); + + void setTheme(WsTheme oldTheme, WsTheme newTheme); + +} 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-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-12 13:46:02 UTC (rev 800) @@ -57,16 +57,10 @@ public GroupLiveSearchComponent getGroupLiveSearchComponent(); - public GroupMembersComponent getGroupMembersComponent(); - - public GroupSummaryComponent getGroupSummaryComponent(); - public I18nTranslatorComponent getI18nTranslatorComponent(); public LicenseComponent getLicenseComponent(); - public ParticipationComponent getParticipationComponent(); - public ThemeMenuComponent getThemeMenuComponent(); public UserLiveSearchComponent getUserLiveSearchComponent(); 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-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-07-12 13:46:02 UTC (rev 800) @@ -104,14 +104,6 @@ return components.getGroupLiveSearchComponent(); } - public GroupMembersComponent getGroupMembersComponent() { - return components.getGroupMembersComponent(); - } - - public GroupSummaryComponent getGroupSummaryComponent() { - return components.getGroupSummaryComponent(); - } - public I18nTranslatorComponent getI18nTranslatorComponent() { return components.getI18nTranslatorComponent(); } @@ -120,10 +112,6 @@ return components.getLicenseComponent(); } - public ParticipationComponent getParticipationComponent() { - return components.getParticipationComponent(); - } - public ThemeMenuComponent getThemeMenuComponent() { return components.getThemeMenuComponent(); } 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-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-07-12 13:46:02 UTC (rev 800) @@ -27,9 +27,9 @@ public class WorkspaceUIComponents { private LicenseComponent license; private ContentTitleComponent contentTitle; - private GroupMembersComponent groupMembers; - private ParticipationComponent participatesInGroups; - private GroupSummaryComponent groupSummary; + private GroupMembersSummary groupMembers; + private ParticipationSummary participatesInGroups; + private GroupSummary groupSummary; private ContentSubTitleComponent contentSubTitle; private ContentBottomToolBarComponent contentBottomToolBar; private ThemeMenuComponent themeMenu; @@ -76,20 +76,6 @@ return groupLiveSearch; } - public GroupMembersComponent getGroupMembersComponent() { - if (groupMembers == null) { - groupMembers = WorkspaceFactory.createGroupMembersComponent(); - } - return groupMembers; - } - - public GroupSummaryComponent getGroupSummaryComponent() { - if (groupSummary == null) { - groupSummary = WorkspaceFactory.createGroupSummaryComponent(); - } - return groupSummary; - } - public I18nTranslatorComponent getI18nTranslatorComponent() { if (i18nTranslatorSearch == null) { i18nTranslatorSearch = WorkspaceFactory.createI18nTranslatorComponent(); @@ -104,13 +90,6 @@ return license; } - public ParticipationComponent getParticipationComponent() { - if (participatesInGroups == null) { - participatesInGroups = WorkspaceFactory.createParticipationComponent(); - } - return participatesInGroups; - } - public ThemeMenuComponent getThemeMenuComponent() { if (themeMenu == null) { themeMenu = WorkspaceFactory.createThemeMenuComponent(); 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-11 11:18:26 UTC (rev 799) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-12 13:46:02 UTC (rev 800) @@ -228,9 +228,6 @@ setContentToolBar(components.getContentToolBarComponent().getView()); setContentBottomToolBar(components.getContentBottomToolBarComponent().getView()); setBottom(components.getLicenseComponent().getView()); - setGroupMembers(components.getGroupMembersComponent().getView()); - setParticipation(components.getParticipationComponent().getView()); - setSummary(components.getGroupSummaryComponent().getView()); addBottomIconComponent(components.getThemeMenuComponent().getView()); }
participants (1)
-
vjrj