Author: vjrj Date: 2008-07-11 12:36:49 +0200 (Fri, 11 Jul 2008) New Revision: 798 Added: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcher.java trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherType.java trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherView.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java Removed: trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetTagsAction.java trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ShowSearcherAction.java trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java trunk/src/main/java/org/ourproject/kune/workspace/client/search/ui/ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java Modified: trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java trunk/src/main/java/org/ourproject/kune/docs/client/actions/DocsEvents.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/docs/server/DocumentServerTool.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/platf/client/ui/DropDownPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarView.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/ui/newtmp/WorkspaceManager.java trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.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/app/public/css/kune-new.css =================================================================== --- trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/app/public/css/kune-new.css 2008-07-11 10:36:49 UTC (rev 798) @@ -249,3 +249,38 @@ .ytb-spacer { width: 2px; } + +/* Drop down */ + +.k-dropdownouter { +} + +.k-dropdownouter-def { + background-color: #87501E; +} + +.k-dropdownouter-green { + background-color: #00D400; +} + +.k-dropdowninner { + margin: 0 3px 1px 3px; + background: green; + background-color: #FFF; + padding: 3px; +} + +.k-dropdownlabel { + color: #FFF; + cursor: pointer; +} + +.k-dropdownlabel .gwt-Label { + margin: 0 5px 0 0; + width: 100%; +} + +.k-dropdownlabel img { + margin: 0 3px 0 1px; +} + Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/docs/client/DocsClientModule.java 2008-07-11 10:36:49 UTC (rev 798) @@ -28,7 +28,6 @@ import org.ourproject.kune.docs.client.actions.ContentRenameAction; import org.ourproject.kune.docs.client.actions.ContentSetLanguageAction; import org.ourproject.kune.docs.client.actions.ContentSetPublishedOnAction; -import org.ourproject.kune.docs.client.actions.ContentSetTagsAction; import org.ourproject.kune.docs.client.actions.DocsEvents; import org.ourproject.kune.docs.client.actions.GoParentFolderAction; import org.ourproject.kune.docs.client.actions.RenameTokenAction; @@ -51,27 +50,26 @@ private final I18nTranslationService i18n; public DocsClientModule(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 configure(final Register register) { - register.addAction(DocsEvents.SAVE_DOCUMENT, new SaveDocumentAction(session, i18n)); - register.addAction(DocsEvents.ADD_DOCUMENT, new AddDocumentAction(stateManager, session, i18n)); - register.addAction(DocsEvents.ADD_FOLDER, new AddFolderAction(stateManager, session, i18n)); - register.addAction(DocsEvents.GO_PARENT_FOLDER, new GoParentFolderAction(stateManager, session)); - register.addAction(DocsEvents.ADD_AUTHOR, new ContentAddAuthorAction(stateManager, session)); - register.addAction(DocsEvents.REMOVE_AUTHOR, new ContentRemoveAuthorAction(stateManager, session)); - register.addAction(DocsEvents.SET_LANGUAGE, new ContentSetLanguageAction(session, workspace)); - register.addAction(DocsEvents.SET_PUBLISHED_ON, new ContentSetPublishedOnAction(session, workspace)); - register.addAction(DocsEvents.SET_TAGS, new ContentSetTagsAction(session, workspace)); - register.addAction(DocsEvents.RENAME_CONTENT, new ContentRenameAction(session)); - register.addAction(DocsEvents.DEL_CONTENT, new ContentDelContentAction(stateManager, session)); - register.addAction(DocsEvents.RENAME_TOKEN, new RenameTokenAction(session, stateManager)); - register.addAction(WorkspaceEvents.WS_SPLITTER_STARTRESIZING, new WSSplitterStartResizingAction()); - register.addAction(WorkspaceEvents.WS_SPLITTER_STOPRESIZING, new WSSplitterStopResizingAction()); + register.addAction(DocsEvents.SAVE_DOCUMENT, new SaveDocumentAction(session, i18n)); + register.addAction(DocsEvents.ADD_DOCUMENT, new AddDocumentAction(stateManager, session, i18n)); + register.addAction(DocsEvents.ADD_FOLDER, new AddFolderAction(stateManager, session, i18n)); + register.addAction(DocsEvents.GO_PARENT_FOLDER, new GoParentFolderAction(stateManager, session)); + register.addAction(DocsEvents.ADD_AUTHOR, new ContentAddAuthorAction(stateManager, session)); + register.addAction(DocsEvents.REMOVE_AUTHOR, new ContentRemoveAuthorAction(stateManager, session)); + register.addAction(DocsEvents.SET_LANGUAGE, new ContentSetLanguageAction(session, workspace)); + register.addAction(DocsEvents.SET_PUBLISHED_ON, new ContentSetPublishedOnAction(session, workspace)); + register.addAction(DocsEvents.RENAME_CONTENT, new ContentRenameAction(session)); + register.addAction(DocsEvents.DEL_CONTENT, new ContentDelContentAction(stateManager, session)); + register.addAction(DocsEvents.RENAME_TOKEN, new RenameTokenAction(session, stateManager)); + register.addAction(WorkspaceEvents.WS_SPLITTER_STARTRESIZING, new WSSplitterStartResizingAction()); + register.addAction(WorkspaceEvents.WS_SPLITTER_STOPRESIZING, new WSSplitterStopResizingAction()); } } 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-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientNewModule.java 2008-07-11 10:36:49 UTC (rev 798) @@ -6,6 +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 com.calclab.suco.client.container.Container; import com.calclab.suco.client.container.Provider; @@ -25,7 +26,8 @@ public void onLoad(final ModuleBuilder builder) { builder.registerProvider(DocumentFactory.class, new Provider<DocumentFactory>() { public DocumentFactory get() { - return new DocumentFactory(builder.getInstance(I18nUITranslationService.class)); + return new DocumentFactory(builder.getInstance(I18nUITranslationService.class), builder + .getInstance(Session.class), builder.getInstance(Tags.class)); } }, SingletonScope.class); Deleted: trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetTagsAction.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetTagsAction.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/docs/client/actions/ContentSetTagsAction.java 2008-07-11 10:36:49 UTC (rev 798) @@ -1,60 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 The kune development team (see CREDITS for details) - * This file is part of kune. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -package org.ourproject.kune.docs.client.actions; - -import java.util.List; - -import org.ourproject.kune.platf.client.dispatch.Action; -import org.ourproject.kune.platf.client.dto.StateDTO; -import org.ourproject.kune.platf.client.dto.TagResultDTO; -import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple; -import org.ourproject.kune.platf.client.rpc.ContentService; -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.Workspace; - -public class ContentSetTagsAction implements Action<String> { - - private final Session session; - private final Workspace workspace; - - public ContentSetTagsAction(final Session session, final Workspace workspace) { - this.session = session; - this.workspace = workspace; - } - - public void execute(final String value) { - onContentsetTags(value); - } - - private void onContentsetTags(final String tags) { - Site.showProgressProcessing(); - ContentServiceAsync server = ContentService.App.getInstance(); - StateDTO currentState = session.getCurrentState(); - server.setTags(session.getUserHash(), currentState.getGroup().getShortName(), currentState.getDocumentId(), - tags, new AsyncCallbackSimple<List<TagResultDTO>>() { - public void onSuccess(final List<TagResultDTO> result) { - workspace.getTagsComponent().setGroupTags(result); - Site.hideProgress(); - } - }); - } -} Modified: trunk/src/main/java/org/ourproject/kune/docs/client/actions/DocsEvents.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/docs/client/actions/DocsEvents.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/docs/client/actions/DocsEvents.java 2008-07-11 10:36:49 UTC (rev 798) @@ -28,7 +28,6 @@ public static final String REMOVE_AUTHOR = "docs.removeAuthor"; public static final String SET_LANGUAGE = "docs.setLanguage"; public static final String SET_PUBLISHED_ON = "docs.setPublishedOn"; - public static final String SET_TAGS = "docs.setTags"; public static final String RENAME_CONTENT = "docs.setTitle"; public static final String RENAME_TOKEN = "docs.RenameToken"; public static final String DEL_CONTENT = "docs.delContent"; 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-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/docs/client/ctx/admin/AdminContextPresenter.java 2008-07-11 10:36:49 UTC (rev 798) @@ -30,70 +30,90 @@ import org.ourproject.kune.platf.client.dto.AccessListsDTO; import org.ourproject.kune.platf.client.dto.I18nLanguageDTO; import org.ourproject.kune.platf.client.dto.StateDTO; +import org.ourproject.kune.platf.client.dto.TagResultDTO; import org.ourproject.kune.platf.client.dto.UserSimpleDTO; +import org.ourproject.kune.platf.client.rpc.AsyncCallbackSimple; +import org.ourproject.kune.platf.client.rpc.ContentService; +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; public class AdminContextPresenter extends AbstractPresenter implements AdminContext { private AdminContextView view; + private final Session session; + private final Tags tags; - public AdminContextPresenter() { + public AdminContextPresenter(final Session session, final Tags tags) { + this.session = session; + this.tags = tags; } - public void init(final AdminContextView view) { - this.view = view; + public void doChangeLanguage(final String langCode) { + DefaultDispatcher.getInstance().fire(DocsEvents.SET_LANGUAGE, langCode); } - public void setState(final StateDTO content) { - // In the future check the use of these components by each tool - I18nLanguageDTO language = content.getLanguage(); - AccessListsDTO accessLists = content.getAccessLists(); - Date publishedOn = content.getPublishedOn(); - String tags = content.getTags(); - List<UserSimpleDTO> authors = content.getAuthors(); - - if (content.hasDocument()) { - if (tags != null) { - view.setTags(tags); - } else { - view.removeTagsComponent(); - } - if (language != null) { - view.setLanguage(language); - } else { - view.removeLangComponent(); - } - if (authors != null) { - view.setAuthors(authors); - } else { - view.removeAuthorsComponent(); - } - if (publishedOn != null) { - view.setPublishedOn(publishedOn); - } else { - view.removePublishedOnComponent(); - } - if (accessLists != null) { - view.setAccessLists(accessLists); - } else { - view.removeAccessListComponent(); - } - } + public View getView() { + return view; } - public View getView() { - return view; + public void init(final AdminContextView view) { + this.view = view; } public void setPublishedOn(final Date date) { - DefaultDispatcher.getInstance().fire(DocsEvents.SET_PUBLISHED_ON, date); + DefaultDispatcher.getInstance().fire(DocsEvents.SET_PUBLISHED_ON, date); } - public void setTags(final String tags) { - DefaultDispatcher.getInstance().fire(DocsEvents.SET_TAGS, tags); + public void setState(final StateDTO content) { + // In the future check the use of these components by each tool + final I18nLanguageDTO language = content.getLanguage(); + final AccessListsDTO accessLists = content.getAccessLists(); + final Date publishedOn = content.getPublishedOn(); + final String tags = content.getTags(); + final List<UserSimpleDTO> authors = content.getAuthors(); + + if (content.hasDocument()) { + if (tags != null) { + view.setTags(tags); + } else { + view.removeTagsComponent(); + } + if (language != null) { + view.setLanguage(language); + } else { + view.removeLangComponent(); + } + if (authors != null) { + view.setAuthors(authors); + } else { + view.removeAuthorsComponent(); + } + if (publishedOn != null) { + view.setPublishedOn(publishedOn); + } else { + view.removePublishedOnComponent(); + } + if (accessLists != null) { + view.setAccessLists(accessLists); + } else { + view.removeAccessListComponent(); + } + } } - public void doChangeLanguage(final String langCode) { - DefaultDispatcher.getInstance().fire(DocsEvents.SET_LANGUAGE, langCode); + public void setTags(final String tagsString) { + Site.showProgressProcessing(); + final ContentServiceAsync server = ContentService.App.getInstance(); + final StateDTO currentState = session.getCurrentState(); + server.setTags(session.getUserHash(), currentState.getGroup().getShortName(), currentState.getDocumentId(), + tagsString, new AsyncCallbackSimple<List<TagResultDTO>>() { + public void onSuccess(final List<TagResultDTO> result) { + tags.setGroupTags(result); + Site.hideProgress(); + } + }); } } 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-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/docs/client/ui/DocumentFactory.java 2008-07-11 10:36:49 UTC (rev 798) @@ -48,65 +48,71 @@ import org.ourproject.kune.docs.client.ctx.folder.FolderContext; import org.ourproject.kune.docs.client.ctx.folder.FolderContextPresenter; import org.ourproject.kune.platf.client.services.I18nTranslationService; +import org.ourproject.kune.platf.client.state.Session; 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; public class DocumentFactory { private final I18nTranslationService i18n; + private final Session session; + private final Tags tags; - public DocumentFactory(final I18nTranslationService i18n) { - this.i18n = i18n; + public DocumentFactory(final I18nTranslationService i18n, final Session session, final Tags tags) { + this.i18n = i18n; + this.session = session; + this.tags = tags; } public AdminContext createAdminContext() { - AdminContextPresenter presenter = new AdminContextPresenter(); - AdminContextView view = new AdminContextPanel(presenter, i18n); - presenter.init(view); - return presenter; + final AdminContextPresenter presenter = new AdminContextPresenter(session, tags); + final AdminContextView view = new AdminContextPanel(presenter, i18n); + presenter.init(view); + return presenter; } public DocumentContent createDocumentContent(final DocumentContentListener listener) { - WorkspaceDeckPanel panel = new WorkspaceDeckPanel(); - DocumentContentPresenter presenter = new DocumentContentPresenter(this, listener, panel); - return presenter; + final WorkspaceDeckPanel panel = new WorkspaceDeckPanel(); + final DocumentContentPresenter presenter = new DocumentContentPresenter(this, listener, panel); + return presenter; } public DocumentContext createDocumentContext() { - WorkspaceDeckPanel view = new WorkspaceDeckPanel(); - DocumentContextPresenter presenter = new DocumentContextPresenter(this, view); - return presenter; + final WorkspaceDeckPanel view = new WorkspaceDeckPanel(); + final DocumentContextPresenter presenter = new DocumentContextPresenter(this, view); + return presenter; } public DocumentReader createDocumentReader(final DocumentReaderListener listener) { - DocumentReaderView view = new DocumentReaderPanel(); - DocumentReaderPresenter presenter = new DocumentReaderPresenter(view); - return presenter; + final DocumentReaderView view = new DocumentReaderPanel(); + final DocumentReaderPresenter presenter = new DocumentReaderPresenter(view); + return presenter; } public DocumentReaderControl createDocumentReaderControl(final DocumentReaderListener listener) { - DocumentReaderControlView view = new DocumentReaderControlPanel(listener, i18n); - DocumentReaderControlPresenter presenter = new DocumentReaderControlPresenter(view); - return presenter; + final DocumentReaderControlView view = new DocumentReaderControlPanel(listener, i18n); + final DocumentReaderControlPresenter presenter = new DocumentReaderControlPresenter(view); + return presenter; } public FolderContext createFolderContext() { - ContextItems contextItems = WorkspaceFactory.createContextItems(); - FolderContextPresenter presenter = new FolderContextPresenter(contextItems, i18n); - return presenter; + final ContextItems contextItems = WorkspaceFactory.createContextItems(); + final FolderContextPresenter presenter = new FolderContextPresenter(contextItems, i18n); + return presenter; } public FolderEditor createFolderEditor() { - FolderEditorPanel view = new FolderEditorPanel(); - FolderEditorPresenter presenter = new FolderEditorPresenter(view); - return presenter; + final FolderEditorPanel view = new FolderEditorPanel(); + final FolderEditorPresenter presenter = new FolderEditorPresenter(view); + return presenter; } public FolderViewer createFolderViewer() { - FolderViewerView view = new FolderViewerPanel(); - FolderViewerPresenter presenter = new FolderViewerPresenter(view); - return presenter; + final FolderViewerView view = new FolderViewerPanel(); + final FolderViewerPresenter presenter = new FolderViewerPresenter(view); + return presenter; } } Modified: trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java 2008-07-11 10:36:49 UTC (rev 798) @@ -67,7 +67,7 @@ configurationManager.persist(config); final String longName = group.getLongName(); final String publicDesc = group.getPublicDesc(); - final Content descriptor = contentManager.createContent(i18n.t("About") + longName, publicDesc == null ? "" + final Content descriptor = contentManager.createContent(i18n.t("About [%s]", longName), publicDesc == null ? "" : publicDesc, user, container); descriptor.addAuthor(user); descriptor.setLanguage(user.getLanguage()); 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-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneModule.java 2008-07-11 10:36:49 UTC (rev 798) @@ -17,12 +17,16 @@ 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.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.ui.newtmp.WorkspaceManager; import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePanel; import org.ourproject.kune.workspace.client.ui.newtmp.licensefoot.EntityLicensePresenter; -import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPanel; -import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.SiteBarPresenter; import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogo; import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPanel; import org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitelogo.SiteLogoPresenter; @@ -36,6 +40,7 @@ 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.ui.EntityLogo; import org.ourproject.kune.workspace.client.workspace.ui.EntityLogoPanel; @@ -137,9 +142,18 @@ } }, SingletonScope.class); + builder.registerProvider(SiteSearcher.class, new Provider<SiteSearcher>() { + public SiteSearcher get() { + final SiteSearcherPresenter presenter = new SiteSearcherPresenter(); + final SiteSearcherView view = new SiteSearcherPanel(presenter, i18n, ws); + presenter.init(view); + return presenter; + } + }, SingletonScope.class); + builder.registerProvider(SiteSearch.class, new Provider<SiteSearch>() { public SiteSearch get() { - final SiteSearchPresenter presenter = new SiteSearchPresenter(); + final SiteSearchPresenter presenter = new SiteSearchPresenter(builder.getProvider(SiteSearcher.class)); final SiteSearchPanel panel = new SiteSearchPanel(presenter, ws, i18n); presenter.init(panel); return presenter; @@ -192,24 +206,29 @@ } }, SingletonScope.class); - builder.registerProvider(SiteBarPresenter.class, new Provider<SiteBarPresenter>() { - public SiteBarPresenter get() { - final SiteBarPresenter presenter = new SiteBarPresenter(); - final SiteBarPanel panel = new SiteBarPanel(presenter, i18n, ws); - presenter.init(panel); - return presenter; - } - }, SingletonScope.class); - builder.registerProvider(WorkspaceManager.class, new Provider<WorkspaceManager>() { public WorkspaceManager get() { 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(WsThemePresenter.class), builder.getInstance(EntityLicensePresenter.class), + builder.getInstance(Tags.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); + presenter.init(panel); + return presenter; + } + }, SingletonScope.class); + + // builder.registerProvider(type, new Provider<>() {}, + // SingletonScope.class); + builder.registerProvider(StateManager.class, new Provider<StateManager>() { public StateManager get() { final Session session = builder.getInstance(Session.class); 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-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/platf/client/state/StateManagerDefault.java 2008-07-11 10:36:49 UTC (rev 798) @@ -150,7 +150,6 @@ workspace.setContent(clientTool.getContent()); workspace.setContext(clientTool.getContext()); workspace.getLicenseComponent().setLicense(state); - workspace.getTagsComponent().setState(state); setSocialNetwork(state); workspace.getGroupSummaryComponent().setGroupSummary(state); Site.hideProgress(); Modified: trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/platf/client/ui/DropDownPanel.java 2008-07-11 10:36:49 UTC (rev 798) @@ -20,8 +20,8 @@ package org.ourproject.kune.platf.client.ui; import org.ourproject.kune.platf.client.services.Images; +import org.ourproject.kune.workspace.client.ui.newtmp.themes.WsTheme; -import com.google.gwt.user.client.DOM; import com.google.gwt.user.client.ui.ClickListener; import com.google.gwt.user.client.ui.Composite; import com.google.gwt.user.client.ui.HorizontalPanel; @@ -37,129 +37,127 @@ * </p> * */ -public class DropDownPanel extends Composite implements ClickListener, HasColor { - private VerticalPanel vp; - private HorizontalPanel titleHP; - private Label titleLabel; - private SimplePanel contentPanel; - private Images img; - private Image arrowImage; - private RoundedBorderDecorator outerBorder; +public class DropDownPanel extends Composite implements ClickListener { + private final VerticalPanel vp; + private final HorizontalPanel titleHP; + private final Label titleLabel; + private final SimplePanel contentPanel; + private final Images img; + private final Image arrowImage; + private final RoundedBorderDecorator outerBorder; public DropDownPanel() { - initialize(); - layout(); - setProperties(); - setContentVisible(false); - arrowImage.addClickListener(this); - titleLabel.addClickListener(this); + vp = new VerticalPanel(); + outerBorder = new RoundedBorderDecorator(vp, RoundedBorderDecorator.ALL); + titleHP = new HorizontalPanel(); + arrowImage = new Image(); + titleLabel = new Label(); + contentPanel = new SimplePanel(); + + initWidget(outerBorder); + vp.add(titleHP); + vp.add(contentPanel); + titleHP.add(arrowImage); + titleHP.add(titleLabel); + + outerBorder.setCornerStyleName("k-dropdownouter"); + vp.setStylePrimaryName("k-dropdownouter"); + vp.setWidth("100%"); + vp.setCellWidth(contentPanel, "100%"); + vp.setCellWidth(titleHP, "100%"); + titleHP.setStylePrimaryName("k-dropdownlabel"); + img = Images.App.getInstance(); + img.arrowDownWhite().applyTo(arrowImage); + titleLabel.setText(""); + contentPanel.setStylePrimaryName("k-dropdowninner"); + + setContentVisible(false); + arrowImage.addClickListener(this); + titleLabel.addClickListener(this); } public DropDownPanel(final boolean visible) { - this(); - setContentVisible(visible); + this(); + setContentVisible(visible); } public DropDownPanel(final String headerText, final boolean visible) { - this(); - setContentVisible(visible); - setHeaderText(headerText); + this(); + setContentVisible(visible); + setHeaderText(headerText); } - public void setContent(final Widget widget) { - contentPanel.setWidget(widget); - // refresh panel - setContentVisible(isContentVisible()); - } - - public void setContentVisible(final boolean visible) { - if (visible) { - img.arrowDownWhite().applyTo(arrowImage); - contentPanel.setVisible(true); - - } else { - img.arrowRightWhite().applyTo(arrowImage); - contentPanel.setVisible(false); - } - } - public boolean isContentVisible() { - return contentPanel.isVisible(); + return contentPanel.isVisible(); } - public void setHeaderText(final String text) { - titleLabel.setText(text); + public void onClick(final Widget sender) { + if (sender == titleHP | sender == arrowImage | sender == titleLabel) { + setContentVisible(!isContentVisible()); + } } - public void setHeaderTitle(final String title) { - // QuickTips size problems with images - // KuneUiUtils.setQuickTip(arrowImage, title); - KuneUiUtils.setQuickTip(titleLabel, title); + @Deprecated + public void setColor(final String color) { + // outerBorder.setColor(color); + // DOM.setStyleAttribute(arrowImage.getElement(), "backgroundColor", + // color); + // DOM.setStyleAttribute(vp.getElement(), "backgroundColor", color); + // DOM.setStyleAttribute(titleLabel.getElement(), "backgroundColor", + // color); } - public void onClick(final Widget sender) { - if (sender == titleHP | sender == arrowImage | sender == titleLabel) { - setContentVisible(!isContentVisible()); - } + public void setContent(final Widget widget) { + contentPanel.setWidget(widget); + // refresh panel + setContentVisible(isContentVisible()); } - public void setColor(final String color) { - outerBorder.setColor(color); - DOM.setStyleAttribute(arrowImage.getElement(), "backgroundColor", color); - DOM.setStyleAttribute(vp.getElement(), "backgroundColor", color); - DOM.setStyleAttribute(titleLabel.getElement(), "backgroundColor", color); - } + public void setContentVisible(final boolean visible) { + if (visible) { + img.arrowDownWhite().applyTo(arrowImage); + contentPanel.setVisible(true); - public void setBackgroundColor(final String color) { - DOM.setStyleAttribute(contentPanel.getElement(), "backgroundColor", color); + } else { + img.arrowRightWhite().applyTo(arrowImage); + contentPanel.setVisible(false); + } } - public String getColor() { - return outerBorder.getColor(); + public void setHeaderText(final String text) { + titleLabel.setText(text); } - public void setWidth(final String width) { - super.setWidth(width); - outerBorder.setWidth(width); + public void setHeaderTitle(final String title) { + // QuickTips size problems with images + KuneUiUtils.setQuickTip(arrowImage, title); + KuneUiUtils.setQuickTip(titleLabel, title); } public void setHeight(final String height) { - super.setHeight(height); - outerBorder.setHeight(height); + super.setHeight(height); + outerBorder.setHeight(height); } - private void initialize() { - vp = new VerticalPanel(); - outerBorder = new RoundedBorderDecorator(vp, RoundedBorderDecorator.ALL); - titleHP = new HorizontalPanel(); - arrowImage = new Image(); - titleLabel = new Label(); - contentPanel = new SimplePanel(); + public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) { + if (oldTheme != null) { + final String oldThemeS = oldTheme.toString(); + outerBorder.removeStyleDependentName(oldThemeS); + vp.removeStyleDependentName(oldThemeS); + titleHP.removeStyleDependentName(oldThemeS); + contentPanel.removeStyleDependentName(oldThemeS); + } + final String newThemeS = newTheme.toString(); + outerBorder.setCornerStyleName("k-dropdownouter-" + newThemeS); + outerBorder.addStyleDependentName(newThemeS); + vp.addStyleDependentName(newThemeS); + titleHP.addStyleDependentName(newThemeS); + contentPanel.addStyleDependentName(newThemeS); } - private void layout() { - initWidget(outerBorder); - vp.add(titleHP); - vp.add(contentPanel); - titleHP.add(arrowImage); - titleHP.add(titleLabel); + public void setWidth(final String width) { + super.setWidth(width); + outerBorder.setWidth(width); } - private void setProperties() { - outerBorder.setCornerStyleName("kune-DropDownOuter"); - - vp.addStyleName("kune-DropDownOuter"); - vp.setWidth("100%"); - vp.setCellWidth(contentPanel, "100%"); - vp.setCellWidth(titleHP, "100%"); - - titleHP.addStyleName("kune-DropDownLabel"); - - img = Images.App.getInstance(); - img.arrowDownWhite().applyTo(arrowImage); - - titleLabel.setText(""); - - contentPanel.addStyleName("kune-DropDownInner"); - } } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceClientModule.java 2008-07-11 10:36:49 UTC (rev 798) @@ -42,7 +42,6 @@ import org.ourproject.kune.workspace.client.actions.RateContentAction; import org.ourproject.kune.workspace.client.actions.RecalculateWorkspaceAction; import org.ourproject.kune.workspace.client.actions.ReloadContextAction; -import org.ourproject.kune.workspace.client.actions.ShowSearcherAction; import org.ourproject.kune.workspace.client.actions.StopAction; import org.ourproject.kune.workspace.client.actions.UserLoginAction; import org.ourproject.kune.workspace.client.actions.UserLogoutAction; @@ -114,7 +113,6 @@ register.addAction(WorkspaceEvents.ADD_MEMBER_GROUPLIVESEARCH, new AddGroupLiveSearchAction(workspace)); register.addAction(WorkspaceEvents.ADD_USERLIVESEARCH, new AddUserLiveSearchAction(workspace)); register.addAction(WorkspaceEvents.SHOW_TRANSLATOR, new ShowTranslatorAction(session, workspace, i18n)); - register.addAction(WorkspaceEvents.SHOW_SEARCHER, new ShowSearcherAction()); register.addAction(WorkspaceEvents.DO_TRANSLATION, new DoTranslationAction(session, i18n)); register.addAction(WorkspaceEvents.GET_LEXICON, new GetLexiconAction(i18n)); register.addAction(WorkspaceEvents.USER_LOGIN, new UserLoginAction()); 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-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/WorkspaceFactory.java 2008-07-11 10:36:49 UTC (rev 798) @@ -57,9 +57,6 @@ 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.tags.TagsPresenter; -import org.ourproject.kune.workspace.client.tags.TagsView; -import org.ourproject.kune.workspace.client.tags.ui.TagsPanel; 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; @@ -82,7 +79,6 @@ 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.TagsComponent; import org.ourproject.kune.workspace.client.workspace.ThemeMenuComponent; import org.ourproject.kune.workspace.client.workspace.UserLiveSearchComponent; import org.ourproject.kune.workspace.client.workspace.Workspace; @@ -102,133 +98,126 @@ private static KuneErrorHandler errorHandler; public static ContentBottomToolBarComponent createContentBottomToolBarComponent() { - ContentBottomToolBarPresenter presenter = new ContentBottomToolBarPresenter(); - ContentBottomToolBarView view = new ContentBottomToolBarPanel(presenter, i18n); - presenter.init(view); - return presenter; + final ContentBottomToolBarPresenter presenter = new ContentBottomToolBarPresenter(); + final ContentBottomToolBarView view = new ContentBottomToolBarPanel(presenter, i18n); + presenter.init(view); + return presenter; } public static ContentSubTitleComponent createContentSubTitleComponent() { - ContentSubTitlePresenter presenter = new ContentSubTitlePresenter(i18n); - ContentSubTitleView view = new ContentSubTitlePanel(presenter, i18n); - presenter.init(view); - return presenter; + final ContentSubTitlePresenter presenter = new ContentSubTitlePresenter(i18n); + final ContentSubTitleView view = new ContentSubTitlePanel(presenter, i18n); + presenter.init(view); + return presenter; } public static ContentTitleComponent createContentTitleComponent() { - ContentTitlePresenter presenter = new ContentTitlePresenter(i18n, errorHandler); - ContentTitleView view = new ContentTitlePanel(presenter); - presenter.init(view); - return presenter; + final ContentTitlePresenter presenter = new ContentTitlePresenter(i18n, errorHandler); + final ContentTitleView view = new ContentTitlePanel(presenter); + presenter.init(view); + return presenter; } public static ContentToolBarComponent createContentToolBarComponent() { - ContentToolBarPresenter presenter = new ContentToolBarPresenter(); - ContentToolBarView view = new ContentToolBarPanel(presenter); - presenter.init(view); - return presenter; + final ContentToolBarPresenter presenter = new ContentToolBarPresenter(); + final ContentToolBarView view = new ContentToolBarPanel(presenter); + presenter.init(view); + return presenter; } public static ContextItems createContextItems() { - ContextItemsPresenter presenter = new ContextItemsPresenter(i18n); - ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n); - presenter.init(panel); - return presenter; + final ContextItemsPresenter presenter = new ContextItemsPresenter(i18n); + final ContextItemsPanel panel = new ContextItemsPanel(presenter, i18n); + presenter.init(panel); + return presenter; } public static DesktopView createDesktop(final Workspace workspace, final SiteBarListener listener, - final Session session) { - return new DesktopPanel(workspace, listener, session, i18n); + final Session session) { + return new DesktopPanel(workspace, listener, session, i18n); } public static TextEditor createDocumentEditor(final TextEditorListener listener) { - TextEditorPresenter presenter = new TextEditorPresenter(listener, true); - TextEditorPanel panel = new TextEditorPanel(presenter, i18n); - presenter.init(panel); - return presenter; + final TextEditorPresenter presenter = new TextEditorPresenter(listener, true); + final TextEditorPanel panel = new TextEditorPanel(presenter, i18n); + presenter.init(panel); + return presenter; } public static GroupLiveSearchComponent createGroupLiveSearchComponent() { - GroupLiveSearchPresenter presenter = new GroupLiveSearchPresenter(); - EntityLiveSearchView view = new GroupLiveSearchPanel(presenter, i18n); - presenter.init(view); - return presenter; + final GroupLiveSearchPresenter presenter = new GroupLiveSearchPresenter(); + final EntityLiveSearchView view = new GroupLiveSearchPanel(presenter, i18n); + presenter.init(view); + return presenter; } public static GroupMembersComponent createGroupMembersComponent() { - GroupMembersPresenter presenter = new GroupMembersPresenter(i18n); - GroupMembersView view = new GroupMembersPanel(presenter, i18n); - presenter.init(view); - return presenter; + final GroupMembersPresenter presenter = new GroupMembersPresenter(i18n); + final GroupMembersView view = new GroupMembersPanel(presenter, i18n); + presenter.init(view); + return presenter; } public static GroupSummaryComponent createGroupSummaryComponent() { - GroupSummaryPresenter presenter = new GroupSummaryPresenter(); - GroupSummaryView view = new GroupSummaryPanel(presenter, i18n, colorTheme); - presenter.init(view); - return presenter; + final GroupSummaryPresenter presenter = new GroupSummaryPresenter(); + final GroupSummaryView view = new GroupSummaryPanel(presenter, i18n, colorTheme); + presenter.init(view); + return presenter; } public static I18nTranslatorComponent createI18nTranslatorComponent() { - I18nTranslatorPresenter presenter = new I18nTranslatorPresenter(session); - I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n); - presenter.init(view); - return presenter; + final I18nTranslatorPresenter presenter = new I18nTranslatorPresenter(session); + final I18nTranslatorView view = new I18nTranslatorPanel(presenter, i18n); + presenter.init(view); + return presenter; } public static LanguageSelectorComponent createLanguageSelectorComponent() { - LanguageSelectorPresenter presenter = new LanguageSelectorPresenter(session); - LanguageSelectorView view = new LanguageSelectorPanel(presenter, i18n); - presenter.init(view); - return presenter; + final LanguageSelectorPresenter presenter = new LanguageSelectorPresenter(session); + final LanguageSelectorView view = new LanguageSelectorPanel(presenter, i18n); + presenter.init(view); + return presenter; } public static LicenseComponent createLicenseComponent() { - LicensePresenter presenter = new LicensePresenter(); - LicenseView view = new LicensePanel(presenter, i18n); - presenter.init(view); - return presenter; + final LicensePresenter presenter = new LicensePresenter(); + final LicenseView view = new LicensePanel(presenter, i18n); + presenter.init(view); + return presenter; } public static ParticipationComponent createParticipationComponent() { - ParticipationPresenter presenter = new ParticipationPresenter(i18n); - ParticipationView view = new ParticipationPanel(presenter, i18n); - presenter.init(view); - return presenter; + final ParticipationPresenter presenter = new ParticipationPresenter(i18n); + final ParticipationView view = new ParticipationPanel(presenter, i18n); + presenter.init(view); + return presenter; } - public static TagsComponent createTagsComponent() { - TagsPresenter presenter = new TagsPresenter(session); - TagsView view = new TagsPanel(presenter, i18n); - presenter.init(view); - return presenter; - } - public static ThemeMenuComponent createThemeMenuComponent() { - ThemeMenuPresenter presenter = new ThemeMenuPresenter(); - ThemeMenuView view = new ThemeMenuPanel(presenter, i18n, colorTheme); - presenter.init(view); - return presenter; + final ThemeMenuPresenter presenter = new ThemeMenuPresenter(); + final ThemeMenuView view = new ThemeMenuPanel(presenter, i18n, colorTheme); + presenter.init(view); + return presenter; } public static UserLiveSearchComponent createUserLiveSearchComponent() { - UserLiveSearchPresenter presenter = new UserLiveSearchPresenter(); - EntityLiveSearchView view = new UserLiveSearchPanel(presenter, i18n); - presenter.init(view); - return presenter; + final UserLiveSearchPresenter presenter = new UserLiveSearchPresenter(); + final EntityLiveSearchView view = new UserLiveSearchPanel(presenter, i18n); + presenter.init(view); + return presenter; } public static Workspace createWorkspace(final Session session, - final ExtensibleWidgetsManager extensionPointManager, final I18nTranslationService i18n, - final ColorTheme colorTheme, final KuneErrorHandler errorHandler) { - WorkspaceFactory.session = session; - WorkspaceFactory.i18n = i18n; - WorkspaceFactory.colorTheme = colorTheme; - WorkspaceFactory.errorHandler = errorHandler; - WorkspacePresenter workspace = new WorkspacePresenter(session); - WorkspaceView view = new WorkspacePanel(workspace, i18n, colorTheme); - workspace.init(view, extensionPointManager); - return workspace; + final ExtensibleWidgetsManager extensionPointManager, final I18nTranslationService i18n, + final ColorTheme colorTheme, final KuneErrorHandler errorHandler) { + WorkspaceFactory.session = session; + WorkspaceFactory.i18n = i18n; + WorkspaceFactory.colorTheme = colorTheme; + WorkspaceFactory.errorHandler = errorHandler; + final WorkspacePresenter workspace = new WorkspacePresenter(session); + final WorkspaceView view = new WorkspacePanel(workspace, i18n, colorTheme); + workspace.init(view, extensionPointManager); + return workspace; } } Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ShowSearcherAction.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ShowSearcherAction.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/actions/ShowSearcherAction.java 2008-07-11 10:36:49 UTC (rev 798) @@ -1,49 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 The kune development team (see CREDITS for details) - * This file is part of kune. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -package org.ourproject.kune.workspace.client.actions; - -import org.ourproject.kune.platf.client.dispatch.Action; -import org.ourproject.kune.platf.client.dto.ShowSearcherActionParams; -import org.ourproject.kune.workspace.client.search.SearchSite; -import org.ourproject.kune.workspace.client.search.ui.SearchSitePanel; -import org.ourproject.kune.workspace.client.sitebar.Site; -import org.ourproject.kune.workspace.client.sitebar.SiteBarFactory; - -public class ShowSearcherAction implements Action<ShowSearcherActionParams> { - - public void execute(final ShowSearcherActionParams params) { - onShowSearcherAction(params.getTermToSearch(), params.getTypeOfSearch()); - } - - private void onShowSearcherAction(final String termToSearch, final Integer typeOfSearch) { - Site.showProgressLoading(); - final SearchSite search = SiteBarFactory.getSearch(); - if (termToSearch != null) { - if (typeOfSearch != null) { - search.doSearchOfType(termToSearch, typeOfSearch.intValue()); - } else { - search.doSearch(termToSearch); - } - } - SearchSitePanel searchPanel = (SearchSitePanel) search.getView(); - searchPanel.show(); - Site.hideProgress(); - } -} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java 2008-07-11 10:36:49 UTC (rev 798) @@ -1,32 +0,0 @@ -/* - * - * Copyright (C) 2007-2008 The kune development team (see CREDITS for details) - * This file is part of kune. - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU Affero General Public License as - * published by the Free Software Foundation, either version 3 of the - * License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU Affero General Public License for more details. - * - * You should have received a copy of the GNU Affero General Public License - * along with this program. If not, see <http://www.gnu.org/licenses/>. - * - */ -package org.ourproject.kune.workspace.client.search; - -import org.ourproject.kune.platf.client.View; - -public interface SearchSite { - - public View getView(); - - public void doSearch(String termToSearch); - - public void doSearchOfType(String termToSearch, int type); - -} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java 2008-07-11 10:36:49 UTC (rev 798) @@ -1,88 +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.search; - -import java.util.HashMap; -import java.util.Iterator; - -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.extend.ExtensibleWidgetChild; -import org.ourproject.kune.platf.client.extend.ExtensibleWidgetId; - -import com.allen_sauer.gwt.log.client.Log; - -public class SearchSitePresenter extends AbstractPresenter implements SearchSite { - - private SearchSiteView view; - private int currentSearch; - private final HashMap<String, Integer> searchHistory; - - public SearchSitePresenter() { - searchHistory = new HashMap<String, Integer>(); - currentSearch = SearchSiteView.GROUP_USER_SEARCH; - } - - public void init(final SearchSiteView view) { - this.view = view; - } - - public View getView() { - return view; - } - - public void doClose() { - view.hide(); - } - - public void doSearch(final int typeOfSearch) { - doSearchOfType(view.getComboTextToSearch(), typeOfSearch); - } - - public void doSearchOfType(final String text, final int typeOfSearch) { - this.currentSearch = typeOfSearch; - doSearch(text); - } - - public void doSearch(final String text) { - searchHistory.put(text, null); - Log.debug("Search History: " + searchHistory.toString()); - view.search(text, currentSearch); - } - - public Object[][] getSearchHistory() { - Object[][] objs = new Object[searchHistory.size()][1]; - int i = 0; - for (Iterator<String> iterator = searchHistory.keySet().iterator(); iterator.hasNext();) { - String search = iterator.next(); - Object[] obj = new Object[] { search }; - objs[i++] = obj; - } - return objs; - } - - public void attachIconToBottomBar(final View view) { - DefaultDispatcher.getInstance().fire(PlatformEvents.ATTACH_TO_EXTENSIBLE_WIDGET, - new ExtensibleWidgetChild(ExtensibleWidgetId.CONTENT_BOTTOM_ICONBAR, view)); - } - -} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java 2008-07-11 10:36:49 UTC (rev 798) @@ -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.search; - -import org.ourproject.kune.platf.client.View; - -public interface SearchSiteView extends View { - - public static final int GROUP_USER_SEARCH = 1; - public static final int CONTENT_SEARCH = 2; - - void search(String text, int currentSearch); - - String getComboTextToSearch(); - - void hide(); - -} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcher.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSite.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcher.java 2008-07-11 10:36:49 UTC (rev 798) @@ -0,0 +1,28 @@ +/* + * + * 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.search; + +public interface SiteSearcher { + + public void doSearch(String termToSearch); + + public void doSearchOfType(String termToSearch, SiteSearcherType type); + +} Added: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPanel.java 2008-07-11 10:36:49 UTC (rev 798) @@ -0,0 +1,315 @@ +/* + * + * 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.search; + +import org.ourproject.kune.platf.client.services.I18nTranslationService; +import org.ourproject.kune.platf.client.ui.AbstractSearcherPanel; +import org.ourproject.kune.platf.client.ui.dialogs.BasicDialog; +import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton; + +import com.allen_sauer.gwt.log.client.Log; +import com.google.gwt.user.client.ui.HorizontalPanel; +import com.google.gwt.user.client.ui.KeyboardListener; +import com.gwtext.client.core.EventObject; +import com.gwtext.client.core.RegionPosition; +import com.gwtext.client.data.FieldDef; +import com.gwtext.client.data.Record; +import com.gwtext.client.data.SimpleStore; +import com.gwtext.client.data.Store; +import com.gwtext.client.data.StringFieldDef; +import com.gwtext.client.widgets.Button; +import com.gwtext.client.widgets.Component; +import com.gwtext.client.widgets.Panel; +import com.gwtext.client.widgets.TabPanel; +import com.gwtext.client.widgets.ToolbarButton; +import com.gwtext.client.widgets.Window; +import com.gwtext.client.widgets.event.ButtonListenerAdapter; +import com.gwtext.client.widgets.event.PanelListenerAdapter; +import com.gwtext.client.widgets.event.WindowListenerAdapter; +import com.gwtext.client.widgets.form.ComboBox; +import com.gwtext.client.widgets.form.Field; +import com.gwtext.client.widgets.form.FormPanel; +import com.gwtext.client.widgets.form.event.ComboBoxListenerAdapter; +import com.gwtext.client.widgets.form.event.FieldListenerAdapter; +import com.gwtext.client.widgets.grid.ColumnConfig; +import com.gwtext.client.widgets.grid.ColumnModel; +import com.gwtext.client.widgets.grid.GridPanel; +import com.gwtext.client.widgets.grid.event.GridCellListenerAdapter; +import com.gwtext.client.widgets.layout.BorderLayoutData; +import com.gwtext.client.widgets.layout.FitLayout; + +public class SiteSearcherPanel extends AbstractSearcherPanel implements SiteSearcherView { + + private final Window dialog; + private final SiteSearcherPresenter presenter; + private Store groupStore; + private ComboBox searchCombo; + private Store historyStore; + private Store contentStore; + private GridPanel groupsGrid; + private GridPanel contentGrid; + private final WorkspaceSkeleton ws; + + public SiteSearcherPanel(final SiteSearcherPresenter initPresenter, final I18nTranslationService i18n, + final WorkspaceSkeleton ws) { + super(i18n); + this.presenter = initPresenter; + this.ws = ws; + dialog = createDialog(); + } + + public String getComboTextToSearch() { + return searchCombo.getValue(); + } + + public void hide() { + dialog.hide(); + } + + public void search(final String text, final SiteSearcherType type) { + searchCombo.setValue(text); + switch (type) { + case group_user: + query(groupStore, groupsGrid, text); + break; + case content: + query(contentStore, contentGrid, text); + break; + default: + break; + } + } + + public void show() { + dialog.show(); + dialog.expand(); + dialog.center(); + final ToolbarButton toolbarButton = new ToolbarButton(); + toolbarButton.setTooltip(i18n.t("Show/hide searcher")); + toolbarButton.setIcon("images/kune-search-ico-push.gif"); + toolbarButton.addListener(new ButtonListenerAdapter() { + @Override + public void onClick(final Button button, final EventObject e) { + if (dialog.isVisible()) { + dialog.hide(); + } else { + dialog.show(); + } + } + + }); + ws.getSiteTraybar().addButton(toolbarButton); + } + + private Window createDialog() { + final Panel north = new Panel(); + north.setHeight(50); + north.setBorder(false); + + final TabPanel centerPanel = new TabPanel(); + centerPanel.setActiveTab(0); + centerPanel.setAutoScroll(true); + centerPanel.setClosable(false); + centerPanel.setBorder(false); + + final BasicDialog dialog = new BasicDialog(i18n.t("Search"), false, false, 500, 400); + // dialog.setResizable(false); + dialog.setIconCls("search-icon"); + final Button closeButton = new Button(i18n.tWithNT("Close", "used in button")); + closeButton.addListener(new ButtonListenerAdapter() { + public void onClick(final Button button, final EventObject e) { + presenter.doClose(); + } + }); + dialog.addButton(closeButton); + + final Panel searchPanel = createSearchForm(presenter); + final Panel groupsPanel = new Panel("Groups & Users"); + final Panel contentPanel = new Panel("Content"); + groupsPanel.setLayout(new FitLayout()); + contentPanel.setLayout(new FitLayout()); + + groupsGrid = createSearchPanel(SiteSearcherType.group_user); + contentGrid = createSearchPanel(SiteSearcherType.content); + groupsPanel.add(groupsGrid); + contentPanel.add(contentGrid); + centerPanel.add(groupsPanel); + centerPanel.add(contentPanel); + dialog.add(searchPanel, new BorderLayoutData(RegionPosition.NORTH)); + dialog.add(centerPanel, new BorderLayoutData(RegionPosition.CENTER)); + + groupsPanel.addListener(new PanelListenerAdapter() { + public void onActivate(final Panel panel) { + dialog.setTitle(i18n.t("Search users & groups")); + presenter.doSearch(SiteSearcherType.group_user); + } + }); + + contentPanel.addListener(new PanelListenerAdapter() { + public void onActivate(final Panel panel) { + dialog.setTitle(i18n.t("Search contents")); + presenter.doSearch(SiteSearcherType.content); + } + }); + + final String panelId = groupsPanel.getId(); + centerPanel.setActiveItemID(panelId); + + dialog.setCloseAction(Window.HIDE); + + dialog.addListener(new WindowListenerAdapter() { + public void onCollapse(final Panel panel) { + // dialog.hide(); + } + }); + + return dialog; + } + + private Panel createSearchForm(final SiteSearcherPresenter presenter) { + final Panel searchPanel = new Panel(); + searchPanel.setBorder(false); + + final HorizontalPanel hp = new HorizontalPanel(); + + final FormPanel form = new FormPanel(); + form.setBorder(false); + form.setWidth(330); + form.setHideLabels(true); + + historyStore = new SimpleStore(new String[] { "term" }, presenter.getSearchHistory()); + + searchCombo = new ComboBox(); + searchCombo.setStore(historyStore); + searchCombo.setDisplayField("term"); + searchCombo.setTypeAhead(false); + searchCombo.setLoadingText(i18n.t("Searching...")); + searchCombo.setWidth(300); + searchCombo.setPageSize(10); + searchCombo.setMode(ComboBox.LOCAL); + searchCombo.setMinChars(1); + searchCombo.setValueField("term"); + searchCombo.setForceSelection(false); + searchCombo.setEditable(true); + historyStore.load(); + searchCombo.addListener(new ComboBoxListenerAdapter() { + public void onSelect(final ComboBox comboBox, final Record record, final int index) { + presenter.doSearch(getComboTextToSearch()); + historyStore = new SimpleStore(new String[] { "term" }, presenter.getSearchHistory()); + searchCombo.setStore(historyStore); + historyStore.load(); + } + }); + searchCombo.addListener(new FieldListenerAdapter() { + public void onChange(final Field field, final Object newVal, final Object oldVal) { + // Maybe we use... + } + + public void onSpecialKey(final Field field, final EventObject e) { + switch (e.getKey()) { + case KeyboardListener.KEY_ENTER: + Log.debug("Enter pressed"); + Log.debug("field: " + field.getValueAsString()); + Log.debug("field2: " + getComboTextToSearch()); + presenter.doSearch(field.getValueAsString()); + historyStore = new SimpleStore(new String[] { "term" }, presenter.getSearchHistory()); + historyStore.load(); + searchCombo.setStore(historyStore); + break; + } + e.stopEvent(); + } + + }); + form.add(searchCombo); + + final Button searchBtn = new Button(i18n.tWithNT("Search", "used in button")); + searchBtn.addListener(new ButtonListenerAdapter() { + public void onClick(final Button button, final EventObject e) { + presenter.doSearch(getComboTextToSearch()); + } + }); + hp.add(form); + hp.add(searchBtn); + hp.setSpacing(7); + hp.addStyleName("kune-Margin-Large-trbl"); + searchPanel.add(hp); + return searchPanel; + } + + private GridPanel createSearchPanel(final SiteSearcherType type) { + final String id = "shortName"; + final FieldDef[] fieldDefs = new FieldDef[] { new StringFieldDef(id), new StringFieldDef("longName"), + new StringFieldDef("link"), new StringFieldDef("iconUrl") }; + final Store store; + + switch (type) { + case group_user: + store = groupStore = createStore(fieldDefs, "/kune/json/GroupJSONService/search", id); + break; + case content: + store = contentStore = createStore(fieldDefs, "/kune/json/ContentJSONService/search", id); + break; + default: + throw new RuntimeException("Unknown type of search"); + } + + final ColumnModel columnModel = new ColumnModel(new ColumnConfig[] { new ColumnConfig() { + { + setDataIndex(id); + setWidth(100); + } + }, new ColumnConfig() { + { + setDataIndex("longName"); + setWidth(350); + } + } }); + + // columnModel.setDefaultSortable(true); + + final String gridName = type == SiteSearcherType.group_user ? "group-search" : "content-search"; + + final GridPanel grid = new GridPanel(gridName, 474, 250, store, columnModel); + createPagingToolbar(store, grid); + grid.setHideColumnHeader(true); + // final GridView view = new GridView(); + // view.setForceFit(true); + // // view.setEnableRowBody(true); + // grid.setView(view); + + grid.addListener(new PanelListenerAdapter() { + public void onRender(final Component component) { + Log.debug("Loading store"); + store.load(0, PAGINATION_SIZE); + } + }); + + grid.addGridCellListener(new GridCellListenerAdapter() { + public void onCellClick(final GridPanel grid, final int rowIndex, final int colindex, final EventObject e) { + final Record record = store.getRecordAt(rowIndex); + final String groupShortName = record.getAsString(id); + presenter.doGoto(groupShortName); + } + }); + + return grid; + } +} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSitePresenter.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherPresenter.java 2008-07-11 10:36:49 UTC (rev 798) @@ -0,0 +1,82 @@ +/* + * + * 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.search; + +import java.util.HashMap; +import java.util.Iterator; + +import org.ourproject.kune.platf.client.AbstractPresenter; +import org.ourproject.kune.platf.client.View; +import org.ourproject.kune.workspace.client.sitebar.Site; + +import com.allen_sauer.gwt.log.client.Log; + +public class SiteSearcherPresenter extends AbstractPresenter implements SiteSearcher { + + private SiteSearcherView view; + private SiteSearcherType currentSearch; + private final HashMap<String, Integer> searchHistory; + + public SiteSearcherPresenter() { + searchHistory = new HashMap<String, Integer>(); + currentSearch = SiteSearcherType.group_user; + } + + public void doClose() { + view.hide(); + } + + public void doSearch(final SiteSearcherType typeOfSearch) { + doSearchOfType(view.getComboTextToSearch(), typeOfSearch); + } + + public void doSearch(final String text) { + searchHistory.put(text, null); + Log.debug("Search History: " + searchHistory.toString()); + Site.hideProgress(); + view.search(text, currentSearch); + view.show(); + } + + public void doSearchOfType(final String text, final SiteSearcherType typeOfSearch) { + this.currentSearch = typeOfSearch; + doSearch(text); + } + + public Object[][] getSearchHistory() { + final Object[][] objs = new Object[searchHistory.size()][1]; + int i = 0; + for (final Iterator<String> iterator = searchHistory.keySet().iterator(); iterator.hasNext();) { + final String search = iterator.next(); + final Object[] obj = new Object[] { search }; + objs[i++] = obj; + } + return objs; + } + + public View getView() { + return view; + } + + public void init(final SiteSearcherView view) { + this.view = view; + } + +} Added: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherType.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherType.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherType.java 2008-07-11 10:36:49 UTC (rev 798) @@ -0,0 +1,5 @@ +package org.ourproject.kune.workspace.client.search; + +public enum SiteSearcherType { + group_user, content +} Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherView.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/search/SearchSiteView.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/search/SiteSearcherView.java 2008-07-11 10:36:49 UTC (rev 798) @@ -0,0 +1,34 @@ +/* + * + * 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.search; + +import org.ourproject.kune.platf.client.View; + +public interface SiteSearcherView extends View { + + String getComboTextToSearch(); + + void hide(); + + void search(String text, SiteSearcherType currentSearch); + + void show(); + +} Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/SiteBarFactory.java 2008-07-11 10:36:49 UTC (rev 798) @@ -33,10 +33,6 @@ import org.ourproject.kune.workspace.client.newgroup.NewGroupListener; import org.ourproject.kune.workspace.client.newgroup.NewGroupPresenter; import org.ourproject.kune.workspace.client.newgroup.ui.NewGroupPanel; -import org.ourproject.kune.workspace.client.search.SearchSite; -import org.ourproject.kune.workspace.client.search.SearchSitePresenter; -import org.ourproject.kune.workspace.client.search.SearchSiteView; -import org.ourproject.kune.workspace.client.search.ui.SearchSitePanel; import org.ourproject.kune.workspace.client.sitebar.bar.SiteBar; import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarListener; import org.ourproject.kune.workspace.client.sitebar.bar.SiteBarPanel; @@ -54,75 +50,64 @@ private static SiteMessage siteMessage; private static Login login; private static NewGroup newGroup; - private static SearchSite search; private static Session session; private static I18nTranslationService i18n; public static LicenseChoose createLicenseChoose() { - List<LicenseDTO> licensesList = session.getLicenses(); - List<LicenseDTO> licensesNonCCList = new ArrayList<LicenseDTO>(); + final List<LicenseDTO> licensesList = session.getLicenses(); + final List<LicenseDTO> licensesNonCCList = new ArrayList<LicenseDTO>(); - for (Iterator<LicenseDTO> iterator = licensesList.iterator(); iterator.hasNext();) { - LicenseDTO license = iterator.next(); - if (!license.isCC()) { - licensesNonCCList.add(license); - } - } - LicenseChoosePresenter presenter = new LicenseChoosePresenter(); - LicenseChoosePanel view = new LicenseChoosePanel(licensesNonCCList, presenter, i18n); - presenter.init(view, licensesList, licensesNonCCList); - return presenter; + for (final Iterator<LicenseDTO> iterator = licensesList.iterator(); iterator.hasNext();) { + final LicenseDTO license = iterator.next(); + if (!license.isCC()) { + licensesNonCCList.add(license); + } + } + final LicenseChoosePresenter presenter = new LicenseChoosePresenter(); + final LicenseChoosePanel view = new LicenseChoosePanel(licensesNonCCList, presenter, i18n); + presenter.init(view, licensesList, licensesNonCCList); + return presenter; } public static SiteBar createSiteBar(final SiteBarListener listener, final Session session, - final I18nTranslationService i18n) { - SiteBarFactory.session = session; - SiteBarFactory.i18n = i18n; - SiteBarPresenter siteBarPresenter = new SiteBarPresenter(listener, session, i18n); - SiteBarPanel siteBarView = new SiteBarPanel(siteBarPresenter, i18n); - siteBarPresenter.init(siteBarView); - Site.sitebar = siteBarPresenter; - return siteBarPresenter; + final I18nTranslationService i18n) { + SiteBarFactory.session = session; + SiteBarFactory.i18n = i18n; + final SiteBarPresenter siteBarPresenter = new SiteBarPresenter(listener, session, i18n); + final SiteBarPanel siteBarView = new SiteBarPanel(siteBarPresenter, i18n); + siteBarPresenter.init(siteBarView); + Site.sitebar = siteBarPresenter; + return siteBarPresenter; } public static Login getLoginForm(final LoginListener listener) { - if (login == null) { - LoginPresenter presenter = new LoginPresenter(session, listener, i18n); - LoginPanel view = new LoginPanel(presenter, i18n); - presenter.init(view); - login = presenter; - } - return login; + if (login == null) { + final LoginPresenter presenter = new LoginPresenter(session, listener, i18n); + final LoginPanel view = new LoginPanel(presenter, i18n); + presenter.init(view); + login = presenter; + } + return login; } public static NewGroup getNewGroupForm(final NewGroupListener listener) { - if (newGroup == null) { - NewGroupPresenter presenter = new NewGroupPresenter(listener, i18n); - NewGroupPanel view = new NewGroupPanel(presenter, i18n); - presenter.init(view); - newGroup = presenter; - } - return newGroup; + if (newGroup == null) { + final NewGroupPresenter presenter = new NewGroupPresenter(listener, i18n); + final NewGroupPanel view = new NewGroupPanel(presenter, i18n); + presenter.init(view); + newGroup = presenter; + } + return newGroup; } - public static SearchSite getSearch() { - if (search == null) { - SearchSitePresenter presenter = new SearchSitePresenter(); - SearchSiteView view = new SearchSitePanel(presenter, i18n); - presenter.init(view); - search = presenter; - } - return search; - } - public static SiteMessage getSiteMessage() { - if (siteMessage == null) { - SiteMessagePresenter siteMessagePresenter = new SiteMessagePresenter(); - SiteMessageView siteMessageView = new SiteMessagePanel(siteMessagePresenter, true); - siteMessagePresenter.init(siteMessageView); - siteMessage = siteMessagePresenter; - Site.siteUserMessage = siteMessagePresenter; - } - return siteMessage; + if (siteMessage == null) { + final SiteMessagePresenter siteMessagePresenter = new SiteMessagePresenter(); + final SiteMessageView siteMessageView = new SiteMessagePanel(siteMessagePresenter, true); + siteMessagePresenter.init(siteMessageView); + siteMessage = siteMessagePresenter; + Site.siteUserMessage = siteMessagePresenter; + } + return siteMessage; } } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPanel.java 2008-07-11 10:36:49 UTC (rev 798) @@ -29,8 +29,6 @@ import org.ourproject.kune.platf.client.ui.RoundedBorderDecorator; import org.ourproject.kune.workspace.client.newgroup.NewGroup; import org.ourproject.kune.workspace.client.newgroup.ui.NewGroupPanel; -import org.ourproject.kune.workspace.client.search.SearchSite; -import org.ourproject.kune.workspace.client.search.ui.SearchSitePanel; import org.ourproject.kune.workspace.client.sitebar.Site; import org.ourproject.kune.workspace.client.sitebar.SiteBarFactory; import org.ourproject.kune.workspace.client.sitebar.login.Login; @@ -88,7 +86,6 @@ private final Widget progressPanel; private final Widget progressText; private final HorizontalPanel publicHP; - private SearchSitePanel searchPanel; private final ExtElement extRootBody; private String publicUrl; private Timer timeProgressMaxTime; @@ -338,14 +335,6 @@ DOM.setInnerText(progressText.getElement(), text); } - public void showSearchPanel(final String termToSearch) { - final SearchSite search = SiteBarFactory.getSearch(); - search.doSearch(termToSearch); - searchPanel = (SearchSitePanel) search.getView(); - searchPanel.show(); - Site.hideProgress(); - } - public void unMask() { extRootBody.unmask(); } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarPresenter.java 2008-07-11 10:36:49 UTC (rev 798) @@ -49,198 +49,198 @@ private final I18nTranslationService i18n; public SiteBarPresenter(final SiteBarListener listener, final Session session, final I18nTranslationService i18n) { - this.listener = listener; - this.session = session; - this.i18n = i18n; + this.listener = listener; + this.session = session; + this.i18n = i18n; } public void changeState(final StateToken token) { - listener.onChangeState(token); + listener.onChangeState(token); } public void doLogin(final String previousToken) { - this.previousToken = previousToken; - Site.showProgressProcessing(); - view.showLoginDialog(); - view.centerLoginDialog(); - Site.hideProgress(); + this.previousToken = previousToken; + Site.showProgressProcessing(); + view.showLoginDialog(); + view.centerLoginDialog(); + Site.hideProgress(); } public void doLogout() { - AsyncCallback<Object> callback = new AsyncCallback<Object>() { - public void onFailure(final Throwable caught) { - Site.hideProgress(); - try { - throw caught; - } catch (final SessionExpiredException e) { - clientUILogout(); - } catch (final UserMustBeLoggedException e) { - clientUILogout(); - } catch (final Throwable e) { - GWT.log("Other kind of exception in doLogout", null); - throw new RuntimeException(); - } - } + final AsyncCallback<Object> callback = new AsyncCallback<Object>() { + public void onFailure(final Throwable caught) { + Site.hideProgress(); + try { + throw caught; + } catch (final SessionExpiredException e) { + clientUILogout(); + } catch (final UserMustBeLoggedException e) { + clientUILogout(); + } catch (final Throwable e) { + GWT.log("Other kind of exception in doLogout", null); + throw new RuntimeException(); + } + } - public void onSuccess(final Object arg0) { - Site.hideProgress(); - clientUILogout(); - } + public void onSuccess(final Object arg0) { + Site.hideProgress(); + clientUILogout(); + } - private void clientUILogout() { - view.restoreLoginLink(); - view.resetOptionsSubmenu(); - view.setLogoutLinkVisible(false); - listener.onUserLoggedOut(); - } - }; + private void clientUILogout() { + view.restoreLoginLink(); + view.resetOptionsSubmenu(); + view.setLogoutLinkVisible(false); + listener.onUserLoggedOut(); + } + }; - DefaultDispatcher.getInstance().fire(WorkspaceEvents.USER_LOGOUT, callback); + DefaultDispatcher.getInstance().fire(WorkspaceEvents.USER_LOGOUT, callback); } public void doNewGroup(final String previousTokenOrig) { - DefaultDispatcher.getInstance().fire(WorkspaceEvents.ONLY_CHECK_USER_SESSION, - new AsyncCallbackSimple<Object>() { - public void onSuccess(final Object result) { - previousToken = previousTokenOrig; - if (session.isLogged()) { - Site.showProgressProcessing(); - view.showNewGroupDialog(); - view.centerNewGroupDialog(); - } else { - returnToPreviousState(); - Site.info(i18n.t("Sign in or register to create a group")); - } - } - }); + DefaultDispatcher.getInstance().fire(WorkspaceEvents.ONLY_CHECK_USER_SESSION, + new AsyncCallbackSimple<Object>() { + public void onSuccess(final Object result) { + previousToken = previousTokenOrig; + if (session.isLogged()) { + Site.showProgressProcessing(); + view.showNewGroupDialog(); + view.centerNewGroupDialog(); + } else { + returnToPreviousState(); + Site.info(i18n.t("Sign in or register to create a group")); + } + } + }); } public void doSearch(final String termToSearch) { - view.showSearchPanel(termToSearch); + // view.showSearchPanel(termToSearch); } public View getView() { - return view; + return view; } public void hideProgress() { - view.hideProgress(); + view.hideProgress(); } public void init(final SiteBarView view) { - this.view = view; - view.setLogoutLinkVisible(false); + this.view = view; + view.setLogoutLinkVisible(false); } public void mask() { - view.mask(); + view.mask(); } public void mask(final String message) { - view.mask(message); + view.mask(message); } public void onHelpInTranslation() { - DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null); + DefaultDispatcher.getInstance().fire(WorkspaceEvents.SHOW_TRANSLATOR, null); } public void onLoginCancelled() { - view.hideLoginDialog(); - returnToPreviousState(); + view.hideLoginDialog(); + returnToPreviousState(); } public void onLoginClose() { - if (!session.isLogged()) { - returnToPreviousState(); - } + if (!session.isLogged()) { + returnToPreviousState(); + } } public void onNewGroupCancel() { - view.hideNewGroupDialog(); - returnToPreviousState(); + view.hideNewGroupDialog(); + returnToPreviousState(); } public void onNewGroupClose() { - returnToPreviousState(); + returnToPreviousState(); } public void onNewGroupCreated(final StateToken homePage) { - view.hideNewGroupDialog(); - changeState(homePage); + view.hideNewGroupDialog(); + changeState(homePage); } public void reloadUserInfo(final String userHash) { - UserServiceAsync siteBarService = UserService.App.getInstance(); - siteBarService.reloadUserInfo(userHash, new AsyncCallback<UserInfoDTO>() { - public void onFailure(final Throwable arg0) { - Site.hideProgress(); - } + final UserServiceAsync siteBarService = UserService.App.getInstance(); + siteBarService.reloadUserInfo(userHash, new AsyncCallback<UserInfoDTO>() { + public void onFailure(final Throwable arg0) { + Site.hideProgress(); + } - public void onSuccess(final UserInfoDTO response) { - showLoggedUser(response); - Site.hideProgress(); - } - }); + public void onSuccess(final UserInfoDTO response) { + showLoggedUser(response); + Site.hideProgress(); + } + }); } public void setState(final StateDTO state) { - StateToken token = state.getStateToken(); - if (state.getAccessLists().getViewers().getMode().equals(GroupListDTO.EVERYONE)) { - String publicUrl = token.getPublicUrl(); - view.setContentGotoPublicUrl(publicUrl); - view.setContentPublic(true); - } else { - view.setContentPublic(false); - } + final StateToken token = state.getStateToken(); + if (state.getAccessLists().getViewers().getMode().equals(GroupListDTO.EVERYONE)) { + final String publicUrl = token.getPublicUrl(); + view.setContentGotoPublicUrl(publicUrl); + view.setContentPublic(true); + } else { + view.setContentPublic(false); + } } public void showAlertMessage(final String message) { - view.showAlertMessage(message); + view.showAlertMessage(message); } public void showLoggedUser(final UserInfoDTO user) { - if (user == null) { - view.restoreLoginLink(); - view.setLogoutLinkVisible(false); - } else { - view.showLoggedUserName(user.getShortName(), user.getHomePage()); - view.setLogoutLinkVisible(true); - view.setGroupsIsMember(user.getGroupsIsAdmin(), user.getGroupsIsCollab()); - } + if (user == null) { + view.restoreLoginLink(); + view.setLogoutLinkVisible(false); + } else { + view.showLoggedUserName(user.getShortName(), user.getHomePage()); + view.setLogoutLinkVisible(true); + view.setGroupsIsMember(user.getGroupsIsAdmin(), user.getGroupsIsCollab()); + } } public void showProgress(final String text) { - view.showProgress(text); + view.showProgress(text); } public void unMask() { - view.unMask(); + view.unMask(); } public void userLoggedIn(final UserInfoDTO userInfoDTO) { - DefaultDispatcher.getInstance().fire(WorkspaceEvents.USER_LOGGED_IN, userInfoDTO); - view.hideLoginDialog(); - returnToPreviousState(); + DefaultDispatcher.getInstance().fire(WorkspaceEvents.USER_LOGGED_IN, userInfoDTO); + view.hideLoginDialog(); + returnToPreviousState(); } protected void onSearchFocus() { - view.setTextSearchBig(); - view.clearSearchText(); + view.setTextSearchBig(); + view.clearSearchText(); } protected void onSearchLostFocus(final String search) { - if (search.length() == 0) { - view.setDefaultTextSearch(); - view.setTextSearchSmall(); - } + if (search.length() == 0) { + view.setDefaultTextSearch(); + view.setTextSearchSmall(); + } } private void returnToPreviousState() { - if (this.previousToken != null) { - listener.onChangeState(new StateToken(this.previousToken)); - this.previousToken = null; - } + if (this.previousToken != null) { + listener.onChangeState(new StateToken(this.previousToken)); + this.previousToken = null; + } } } Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarView.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarView.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/sitebar/bar/SiteBarView.java 2008-07-11 10:36:49 UTC (rev 798) @@ -28,58 +28,56 @@ public interface SiteBarView extends View { - void showLoggedUserName(String name, String homePage); + public void hideLoginDialog(); - void clearUserName(); + void centerLoginDialog(); - void setLogo(Image logo); + void centerNewGroupDialog(); - void showProgress(String text); + void clearSearchText(); - void hideProgress(); + void clearUserName(); - void clearSearchText(); + void hideNewGroupDialog(); - void setSearchText(String text); + void hideProgress(); - void showLoginDialog(); + void mask(); - void setLogoutLinkVisible(boolean visible); + void mask(String message); - public void hideLoginDialog(); + void resetOptionsSubmenu(); void restoreLoginLink(); - void showNewGroupDialog(); + void setContentGotoPublicUrl(String publicUrl); - void hideNewGroupDialog(); + void setContentPublic(boolean visible); void setDefaultTextSearch(); void setGroupsIsMember(List<LinkDTO> groupsIsAdmin, List<LinkDTO> groupsIsCollab); - void resetOptionsSubmenu(); + void setLogo(Image logo); - void setTextSearchSmall(); + void setLogoutLinkVisible(boolean visible); + void setSearchText(String text); + void setTextSearchBig(); - void showSearchPanel(String termToSearch); + void setTextSearchSmall(); - void centerLoginDialog(); + void showAlertMessage(String message); - void centerNewGroupDialog(); + void showLoggedUserName(String name, String homePage); - void showAlertMessage(String message); + void showLoginDialog(); - void mask(); + void showNewGroupDialog(); - void mask(String message); + void showProgress(String text); void unMask(); - void setContentGotoPublicUrl(String publicUrl); - - void setContentPublic(boolean visible); - } Modified: 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-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsPresenter.java 2008-07-11 10:36:49 UTC (rev 798) @@ -23,44 +23,50 @@ import java.util.List; import org.ourproject.kune.platf.client.View; -import org.ourproject.kune.platf.client.dispatch.DefaultDispatcher; -import org.ourproject.kune.platf.client.dto.ShowSearcherActionParams; 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.WorkspaceEvents; -import org.ourproject.kune.workspace.client.search.SearchSiteView; -import org.ourproject.kune.workspace.client.workspace.TagsComponent; +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; -public class TagsPresenter implements TagsComponent { +import com.calclab.suco.client.container.Provider; +public class TagsPresenter implements Tags { + private TagsView view; - private final Session session; + private final Provider<SiteSearcher> searcherProvider; + private final Provider<Session> sessionProvider; - public TagsPresenter(final Session session) { - this.session = session; + public TagsPresenter(final Provider<Session> sessionProvider, final Provider<SiteSearcher> searcherProvider) { + this.sessionProvider = sessionProvider; + this.searcherProvider = searcherProvider; } - public void setState(final StateDTO state) { - view.setTags(state.getGroupTags()); + public void doSearchTag(final String name) { + searcherProvider.get().doSearchOfType( + "group:" + sessionProvider.get().getCurrentState().getGroup().getShortName() + " tag:" + name, + SiteSearcherType.content); } - public void setGroupTags(final List<TagResultDTO> groupTags) { - view.setTags(groupTags); + public View getView() { + return view; } public void init(final TagsView view) { - this.view = view; + this.view = view; } - public View getView() { - return view; + public void setGroupTags(final List<TagResultDTO> groupTags) { + view.setTags(groupTags); } - public void doSearchTag(final String name) { - DefaultDispatcher.getInstance().fire( - WorkspaceEvents.SHOW_SEARCHER, - new ShowSearcherActionParams("group:" + session.getCurrentState().getGroup().getShortName() + " tag:" - + name, SearchSiteView.CONTENT_SEARCH)); + public void setState(final StateDTO state) { + view.setTags(state.getGroupTags()); } + + public void setTheme(final WsTheme oldTheme, final WsTheme newTheme) { + view.setTheme(oldTheme, newTheme); + } } Modified: 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-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/TagsView.java 2008-07-11 10:36:49 UTC (rev 798) @@ -24,9 +24,12 @@ 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); + } Modified: 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-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/tags/ui/TagsPanel.java 2008-07-11 10:36:49 UTC (rev 798) @@ -29,6 +29,7 @@ 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; @@ -43,43 +44,44 @@ private final Label noTagsLabel; private final I18nTranslationService i18n; - public TagsPanel(final TagsPresenter presenter, final I18nTranslationService i18n) { - 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(); - 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")); + 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 (Iterator<TagResultDTO> iterator = groupTags.iterator(); iterator.hasNext();) { - final TagResultDTO tagResult = iterator.next(); - 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); - } - } + 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); + } + } } } 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-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/WorkspaceManager.java 2008-07-11 10:36:49 UTC (rev 798) @@ -7,6 +7,7 @@ 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.ui.EntityLogo; import com.calclab.suco.client.signal.Slot2; @@ -18,18 +19,21 @@ private final WsThemePresenter wsThemePresenter; private final EntityLicensePresenter entityLicensePresenter; private final EntitySubTitlePresenter entitySubTitlePresenter; + private final Tags tags; public WorkspaceManager(final EntityLogo entityLogo, final EntityTitlePresenter entityTitlePresenter, final EntitySubTitlePresenter entitySubTitlePresenter, final WsThemePresenter wsThemePresenter, - final EntityLicensePresenter entityLicensePresenter) { + final EntityLicensePresenter entityLicensePresenter, final Tags tags) { this.entityLogo = entityLogo; this.entityTitlePresenter = entityTitlePresenter; this.entitySubTitlePresenter = entitySubTitlePresenter; this.entityLicensePresenter = entityLicensePresenter; this.wsThemePresenter = wsThemePresenter; + this.tags = tags; wsThemePresenter.onThemeChanged(new Slot2<WsTheme, WsTheme>() { public void onEvent(final WsTheme oldTheme, final WsTheme newTheme) { entityLogo.setTheme(oldTheme, newTheme); + tags.setTheme(oldTheme, newTheme); } }); } @@ -42,11 +46,10 @@ entityTitlePresenter.setState(state); entitySubTitlePresenter.setState(state); entityLicensePresenter.setLicense(state); + tags.setState(state); // Only for probes: wsThemePresenter.setVisible(true); wsThemePresenter.setTheme(new WsTheme(group.getWorkspaceTheme())); } - public void setTheme(final WsTheme theme) { - } } Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPanel.java 2008-07-11 10:36:49 UTC (rev 798) @@ -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.ui.newtmp.sitebar; - -import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService; -import org.ourproject.kune.workspace.client.ui.newtmp.skel.WorkspaceSkeleton; - -public class SiteBarPanel implements SiteBarView { - - public SiteBarPanel(final SiteBarPresenter presenter, final I18nUITranslationService i18n, - final WorkspaceSkeleton ws) { - } -} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarPresenter.java 2008-07-11 10:36:49 UTC (rev 798) @@ -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.ui.newtmp.sitebar; - -public class SiteBarPresenter { - - private SiteBarView view; - - public void init(final SiteBarView view) { - this.view = view; - } - -} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/SiteBarView.java 2008-07-11 10:36:49 UTC (rev 798) @@ -1,26 +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.ui.newtmp.sitebar; - -import org.ourproject.kune.platf.client.View; - -public interface SiteBarView extends View { - -} Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/ui/newtmp/sitebar/sitesearch/SiteSearchPresenter.java 2008-07-11 10:36:49 UTC (rev 798) @@ -1,16 +1,21 @@ package org.ourproject.kune.workspace.client.ui.newtmp.sitebar.sitesearch; import org.ourproject.kune.platf.client.View; +import org.ourproject.kune.workspace.client.search.SiteSearcher; +import com.calclab.suco.client.container.Provider; + public class SiteSearchPresenter implements SiteSearch { private SiteSearchView view; + private final Provider<SiteSearcher> provider; - public SiteSearchPresenter() { + public SiteSearchPresenter(final Provider<SiteSearcher> provider) { + this.provider = provider; } public void doSearch(final String termToSearch) { - // TODO + provider.get().doSearch(termToSearch); } public View getView() { Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java (from rev 792, trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java) =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java 2008-07-06 13:51:18 UTC (rev 792) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Tags.java 2008-07-11 10:36:49 UTC (rev 798) @@ -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 Tags { + + void setGroupTags(List<TagResultDTO> result); + + void setState(StateDTO state); + + void setTheme(WsTheme oldTheme, WsTheme newTheme); + +} Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java =================================================================== --- trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java 2008-07-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/TagsComponent.java 2008-07-11 10:36:49 UTC (rev 798) @@ -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.workspace; - -import java.util.List; - -import org.ourproject.kune.platf.client.Component; -import org.ourproject.kune.platf.client.dto.StateDTO; -import org.ourproject.kune.platf.client.dto.TagResultDTO; - -public interface TagsComponent extends Component { - - void setState(StateDTO state); - - void setGroupTags(List<TagResultDTO> result); - -} 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-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/Workspace.java 2008-07-11 10:36:49 UTC (rev 798) @@ -67,8 +67,6 @@ public ParticipationComponent getParticipationComponent(); - public TagsComponent getTagsComponent(); - 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-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspacePresenter.java 2008-07-11 10:36:49 UTC (rev 798) @@ -124,10 +124,6 @@ return components.getParticipationComponent(); } - public TagsComponent getTagsComponent() { - return components.getTagsComponent(); - } - 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-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/WorkspaceUIComponents.java 2008-07-11 10:36:49 UTC (rev 798) @@ -33,7 +33,6 @@ private ContentSubTitleComponent contentSubTitle; private ContentBottomToolBarComponent contentBottomToolBar; private ThemeMenuComponent themeMenu; - private TagsComponent tags; private ContentToolBarComponent contentToolBar; private GroupLiveSearchComponent groupLiveSearch; private I18nTranslatorComponent i18nTranslatorSearch; @@ -42,95 +41,88 @@ public WorkspaceUIComponents(final WorkspacePresenter presenter) { } - public LicenseComponent getLicenseComponent() { - if (license == null) { - license = WorkspaceFactory.createLicenseComponent(); - } - return license; + public ContentBottomToolBarComponent getContentBottomToolBarComponent() { + if (contentBottomToolBar == null) { + contentBottomToolBar = WorkspaceFactory.createContentBottomToolBarComponent(); + } + return contentBottomToolBar; } - public ContentTitleComponent getContentTitleComponent() { - if (contentTitle == null) { - contentTitle = WorkspaceFactory.createContentTitleComponent(); - } - return contentTitle; + public ContentSubTitleComponent getContentSubTitleComponent() { + if (contentSubTitle == null) { + contentSubTitle = WorkspaceFactory.createContentSubTitleComponent(); + } + return contentSubTitle; } - public ContentSubTitleComponent getContentSubTitleComponent() { - if (contentSubTitle == null) { - contentSubTitle = WorkspaceFactory.createContentSubTitleComponent(); - } - return contentSubTitle; + public ContentTitleComponent getContentTitleComponent() { + if (contentTitle == null) { + contentTitle = WorkspaceFactory.createContentTitleComponent(); + } + return contentTitle; } - public GroupMembersComponent getGroupMembersComponent() { - if (groupMembers == null) { - groupMembers = WorkspaceFactory.createGroupMembersComponent(); - } - return groupMembers; + public ContentToolBarComponent getContentToolBarComponent() { + if (contentToolBar == null) { + contentToolBar = WorkspaceFactory.createContentToolBarComponent(); + } + return contentToolBar; } - public GroupSummaryComponent getGroupSummaryComponent() { - if (groupSummary == null) { - groupSummary = WorkspaceFactory.createGroupSummaryComponent(); - } - return groupSummary; + public GroupLiveSearchComponent getGroupLiveSearchComponent() { + if (groupLiveSearch == null) { + groupLiveSearch = WorkspaceFactory.createGroupLiveSearchComponent(); + } + return groupLiveSearch; } - public ParticipationComponent getParticipationComponent() { - if (participatesInGroups == null) { - participatesInGroups = WorkspaceFactory.createParticipationComponent(); - } - return participatesInGroups; + public GroupMembersComponent getGroupMembersComponent() { + if (groupMembers == null) { + groupMembers = WorkspaceFactory.createGroupMembersComponent(); + } + return groupMembers; } - public ThemeMenuComponent getThemeMenuComponent() { - if (themeMenu == null) { - themeMenu = WorkspaceFactory.createThemeMenuComponent(); - } - return themeMenu; + public GroupSummaryComponent getGroupSummaryComponent() { + if (groupSummary == null) { + groupSummary = WorkspaceFactory.createGroupSummaryComponent(); + } + return groupSummary; } - public TagsComponent getTagsComponent() { - if (tags == null) { - tags = WorkspaceFactory.createTagsComponent(); - } - return tags; + public I18nTranslatorComponent getI18nTranslatorComponent() { + if (i18nTranslatorSearch == null) { + i18nTranslatorSearch = WorkspaceFactory.createI18nTranslatorComponent(); + } + return i18nTranslatorSearch; } - public ContentBottomToolBarComponent getContentBottomToolBarComponent() { - if (contentBottomToolBar == null) { - contentBottomToolBar = WorkspaceFactory.createContentBottomToolBarComponent(); - } - return contentBottomToolBar; + public LicenseComponent getLicenseComponent() { + if (license == null) { + license = WorkspaceFactory.createLicenseComponent(); + } + return license; } - public ContentToolBarComponent getContentToolBarComponent() { - if (contentToolBar == null) { - contentToolBar = WorkspaceFactory.createContentToolBarComponent(); - } - return contentToolBar; + public ParticipationComponent getParticipationComponent() { + if (participatesInGroups == null) { + participatesInGroups = WorkspaceFactory.createParticipationComponent(); + } + return participatesInGroups; } - public GroupLiveSearchComponent getGroupLiveSearchComponent() { - if (groupLiveSearch == null) { - groupLiveSearch = WorkspaceFactory.createGroupLiveSearchComponent(); - } - return groupLiveSearch; + public ThemeMenuComponent getThemeMenuComponent() { + if (themeMenu == null) { + themeMenu = WorkspaceFactory.createThemeMenuComponent(); + } + return themeMenu; } public UserLiveSearchComponent getUserLiveSearchComponent() { - if (userLiveSearch == null) { - userLiveSearch = WorkspaceFactory.createUserLiveSearchComponent(); - } - return userLiveSearch; + if (userLiveSearch == null) { + userLiveSearch = WorkspaceFactory.createUserLiveSearchComponent(); + } + return userLiveSearch; } - public I18nTranslatorComponent getI18nTranslatorComponent() { - if (i18nTranslatorSearch == null) { - i18nTranslatorSearch = WorkspaceFactory.createI18nTranslatorComponent(); - } - return i18nTranslatorSearch; - } - } 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-10 21:06:19 UTC (rev 797) +++ trunk/src/main/java/org/ourproject/kune/workspace/client/workspace/ui/WorkspacePanel.java 2008-07-11 10:36:49 UTC (rev 798) @@ -230,7 +230,6 @@ setBottom(components.getLicenseComponent().getView()); setGroupMembers(components.getGroupMembersComponent().getView()); setParticipation(components.getParticipationComponent().getView()); - setTags(components.getTagsComponent().getView()); setSummary(components.getGroupSummaryComponent().getView()); addBottomIconComponent(components.getThemeMenuComponent().getView()); } @@ -354,7 +353,7 @@ private void AddDropDown(final DropDownPanel panel, final String color) { groupDropDownsVP.add(panel); panel.setWidth("145px"); - panel.setColor(color); + // panel.setColor(color); } private void adjustSizeContentSP() {