[kune-commits] r966 - in trunk/src/main/java/org/ourproject/kune: .
app app/client app/server blogs blogs/client blogs/client/cnt
blogs/client/ctx blogs/server chat/client chat/client/cnt
docs/client docs/server platf/client/tool
platf/server/manager platf/server/rpc workspace/client
workspace/client/cnt workspace/client/skel
vjrj
vjrj at ourproject.org
Mon Nov 24 21:24:08 CET 2008
Author: vjrj
Date: 2008-11-24 21:24:03 +0100 (Mon, 24 Nov 2008)
New Revision: 966
Added:
trunk/src/main/java/org/ourproject/kune/blogs/
trunk/src/main/java/org/ourproject/kune/blogs/Kune-Blogs.gwt.xml
trunk/src/main/java/org/ourproject/kune/blogs/client/
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContent.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPanel.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentView.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewer.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPanel.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java
trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerView.java
trunk/src/main/java/org/ourproject/kune/blogs/client/ctx/
trunk/src/main/java/org/ourproject/kune/blogs/client/ctx/BlogContext.java
trunk/src/main/java/org/ourproject/kune/blogs/client/ctx/BlogContextPresenter.java
trunk/src/main/java/org/ourproject/kune/blogs/public/
trunk/src/main/java/org/ourproject/kune/blogs/server/
trunk/src/main/java/org/ourproject/kune/blogs/server/BlogServerModule.java
trunk/src/main/java/org/ourproject/kune/blogs/server/BlogServerTool.java
Modified:
trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java
trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPanel.java
trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java
trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/GroupManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java
trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java
Log:
New blog tool.
Incomplete - task UI tools & workspace refactorization
Modified: trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/app/Kune.gwt.xml 2008-11-24 20:24:03 UTC (rev 966)
@@ -13,6 +13,7 @@
<inherits name='org.ourproject.kune.platf.Kune-Platform' />
<inherits name='org.ourproject.kune.docs.Kune-Docs' />
+ <inherits name='org.ourproject.kune.blogs.Kune-Blogs' />
<inherits name='org.ourproject.kune.chat.Kune-Chat' />
<!-- gwt-ext -->
Modified: trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/app/client/KuneEntryPoint.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -19,6 +19,7 @@
*/
package org.ourproject.kune.app.client;
+import org.ourproject.kune.blogs.client.BlogClientModule;
import org.ourproject.kune.chat.client.ChatClientModule;
import org.ourproject.kune.docs.client.DocumentClientModule;
import org.ourproject.kune.platf.client.services.KuneCoreModule;
@@ -54,7 +55,7 @@
public void onModuleLoadCont() {
Suco.install(new KuneCoreModule(), new KuneRegistryModule(), new KunePlatformModule(),
- new KuneWorkspaceModule(), new EmiteUIModule(), new DocumentClientModule(), new ChatClientModule(),
- new KuneModule());
+ new KuneWorkspaceModule(), new EmiteUIModule(), new DocumentClientModule(), new BlogClientModule(),
+ new ChatClientModule(), new KuneModule());
}
}
Modified: trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/app/server/KuneRackModule.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -19,6 +19,7 @@
*/
package org.ourproject.kune.app.server;
+import org.ourproject.kune.blogs.server.BlogServerModule;
import org.ourproject.kune.chat.server.ChatServerModule;
import org.ourproject.kune.docs.server.DocumentServerModule;
import org.ourproject.kune.platf.client.rpc.ContentService;
@@ -109,6 +110,7 @@
builder.use(new ServletModule());
builder.use(new PlatformServerModule());
builder.use(new DocumentServerModule());
+ builder.use(new BlogServerModule());
builder.use(new ChatServerModule());
builder.use(new RESTServicesModule());
builder.use(configModule);
Added: trunk/src/main/java/org/ourproject/kune/blogs/Kune-Blogs.gwt.xml
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/Kune-Blogs.gwt.xml 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/Kune-Blogs.gwt.xml 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,5 @@
+<!DOCTYPE document SYSTEM "src/main/java/gwt-module.dtd">
+<module>
+ <inherits name='org.ourproject.kune.platf.Kune-Platform' />
+ <inherits name='org.ourproject.kune.workspace.Kune-Workspace' />
+</module>
Added: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientActions.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,151 @@
+/*
+ *
+ * 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.blogs.client;
+
+import static org.ourproject.kune.blogs.client.BlogClientTool.TYPE_BLOG;
+import static org.ourproject.kune.blogs.client.BlogClientTool.TYPE_POST;
+import static org.ourproject.kune.blogs.client.BlogClientTool.TYPE_ROOT;
+import static org.ourproject.kune.blogs.client.BlogClientTool.TYPE_UPLOADEDFILE;
+
+import org.ourproject.kune.blogs.client.cnt.BlogViewer;
+import org.ourproject.kune.platf.client.actions.ActionToolbarButtonAndItemDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuAndItemDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionToolbarMenuDescriptor;
+import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
+import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
+import org.ourproject.kune.platf.client.dto.AccessRolDTO;
+import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+import org.ourproject.kune.platf.client.services.KuneErrorHandler;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.upload.FileUploader;
+import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import org.ourproject.kune.workspace.client.AbstractFoldableContentActions;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
+import org.ourproject.kune.workspace.client.editor.TextEditor;
+import org.ourproject.kune.workspace.client.entitylogo.EntityLogo;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+
+import com.calclab.suco.client.ioc.Provider;
+
+public class BlogClientActions extends AbstractFoldableContentActions {
+ public BlogClientActions(final I18nUITranslationService i18n, final ContextNavigator contextNavigator,
+ final Session session, final StateManager stateManager,
+ final DeferredCommandWrapper deferredCommandWrapper,
+ final Provider<ContentServiceAsync> contentServiceProvider,
+ final Provider<GroupServiceAsync> groupServiceProvider, final Provider<FileUploader> fileUploaderProvider,
+ final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
+ final Provider<FileDownloadUtils> fileDownloadProvider, final EntityLogo entityLogo,
+ final Provider<TextEditor> textEditorProvider, final KuneErrorHandler errorHandler,
+ final BlogViewer documentViewer, final Provider<ContextPropEditor> contextProvEditorProvider) {
+ super(session, stateManager, i18n, errorHandler, deferredCommandWrapper, groupServiceProvider,
+ contentServiceProvider, fileUploaderProvider, contextNavigator, contentActionRegistry,
+ contextActionRegistry, fileDownloadProvider, textEditorProvider, contextProvEditorProvider,
+ documentViewer, entityLogo);
+ }
+
+ @Override
+ protected void createActions() {
+ String parentMenuTitle = i18n.t("Post");
+ String parentMenuTitleCtx = i18n.t("Blog");
+
+ final ActionToolbarMenuAndItemDescriptor<StateToken> addBlog = createContainerAction(TYPE_BLOG,
+ "images/nav/blog_add.png", i18n.t("New blog"), parentMenuTitleCtx, i18n.t("New"), i18n.t("New blog"));
+ final ActionToolbarMenuAndItemDescriptor<StateToken> addPost = createContentAction("images/nav/post_add.png",
+ i18n.t("New post"), parentMenuTitleCtx, TYPE_POST);
+
+ final ActionToolbarMenuAndItemDescriptor<StateToken> delContainer = createDelContainerAction("Delete blog",
+ parentMenuTitleCtx);
+
+ final ActionToolbarMenuAndItemDescriptor<StateToken> delContent = createDelContentAction(parentMenuTitle,
+ i18n.t("Delete"));
+
+ final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtn = createContentRenameAction(parentMenuTitle,
+ i18n.t("Rename"));
+
+ final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtx = createRenameContentInCtxAction(
+ parentMenuTitleCtx, i18n.t("Rename"));
+
+ final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCnt = createSetAsDefContent(parentMenuTitle);
+
+ // final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt =
+ // createSetAsDefContent(parentMenuTitleCtx);
+
+ final ActionToolbarMenuDescriptor<StateToken> refreshCnt = createRefreshCntAction(parentMenuTitle);
+
+ final ActionToolbarMenuDescriptor<StateToken> refreshCtx = createRefreshCxtAction(parentMenuTitleCtx);
+
+ final ActionToolbarButtonAndItemDescriptor<StateToken> uploadFile = createUploadAction(i18n.t("Upload file"),
+ "images/nav/upload.png", i18n.t("Upload some files (images, PDFs, ...)"), null);
+
+ final ActionToolbarMenuDescriptor<StateToken> setPublishStatus = createSetStatusAction(
+ AccessRolDTO.Administrator, i18n.t("Published online"), parentMenuTitle,
+ ContentStatusDTO.publishedOnline);
+ final ActionToolbarMenuDescriptor<StateToken> setEditionInProgressStatus = createSetStatusAction(
+ AccessRolDTO.Administrator, i18n.t("Editing in progress"), parentMenuTitle,
+ ContentStatusDTO.editingInProgress);
+ final ActionToolbarMenuDescriptor<StateToken> setRejectStatus = createSetStatusAction(
+ AccessRolDTO.Administrator, i18n.t("Rejected"), parentMenuTitle, ContentStatusDTO.rejected);
+ final ActionToolbarMenuDescriptor<StateToken> setSubmittedForPublishStatus = createSetStatusAction(
+ AccessRolDTO.Administrator, i18n.t("Submitted for publish"), parentMenuTitle,
+ ContentStatusDTO.publishedOnline);
+ final ActionToolbarMenuDescriptor<StateToken> setInTheDustBinStatus = createSetStatusAction(
+ AccessRolDTO.Administrator, i18n.t("In the dustbin"), parentMenuTitle, ContentStatusDTO.inTheDustbin);
+
+ final String[] all = { TYPE_ROOT, TYPE_BLOG, TYPE_POST, TYPE_UPLOADEDFILE };
+ final String[] containersNoRoot = { TYPE_BLOG };
+ final String[] containers = { TYPE_ROOT, TYPE_BLOG };
+ final String[] contents = { TYPE_POST, TYPE_UPLOADEDFILE };
+ final String[] contentsModerated = { TYPE_POST, TYPE_UPLOADEDFILE };
+
+ contentActionRegistry.addAction(setPublishStatus, contentsModerated);
+ contentActionRegistry.addAction(setEditionInProgressStatus, contentsModerated);
+ contentActionRegistry.addAction(setRejectStatus, contentsModerated);
+ contentActionRegistry.addAction(setSubmittedForPublishStatus, contentsModerated);
+ contentActionRegistry.addAction(setInTheDustBinStatus, contentsModerated);
+ contextActionRegistry.addAction(addBlog, TYPE_ROOT);
+ contextActionRegistry.addAction(addPost, TYPE_BLOG);
+ contextActionRegistry.addAction(go, all);
+ contentActionRegistry.addAction(renameCtn, contents);
+ contextActionRegistry.addAction(renameCtx, containersNoRoot);
+ contextActionRegistry.addAction(refreshCtx, containers);
+ contentActionRegistry.addAction(refreshCnt, contents);
+ contextActionRegistry.addAction(uploadFile, TYPE_BLOG);
+ contentActionRegistry.addAction(download, TYPE_UPLOADEDFILE);
+ contentActionRegistry.addAction(delContent, contents);
+ contextActionRegistry.addAction(delContainer, containersNoRoot);
+ contentActionRegistry.addAction(setAsDefGroupCnt, TYPE_POST, TYPE_UPLOADEDFILE);
+ // ContentRPC Authorized must permit folders
+ // contentActionRegistry.addAction(setAsDefGroupCxt, TYPE_BLOG);
+ contextActionRegistry.addAction(goGroupHome, containers);
+ contextActionRegistry.addAction(downloadCtx, TYPE_UPLOADEDFILE);
+ contentActionRegistry.addAction(editContent, TYPE_POST);
+ // contentActionRegistry.addAction(translateContent, );
+ }
+
+ @Override
+ protected void createPostSessionInitActions() {
+ // contextActionRegistry.addAction(uploadMedia, TYPE_GALLERY);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientModule.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,119 @@
+/*
+ *
+ * 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.blogs.client;
+
+import org.ourproject.kune.blogs.client.cnt.BlogFolderContent;
+import org.ourproject.kune.blogs.client.cnt.BlogFolderContentPanel;
+import org.ourproject.kune.blogs.client.cnt.BlogFolderContentPresenter;
+import org.ourproject.kune.blogs.client.cnt.BlogFolderContentView;
+import org.ourproject.kune.blogs.client.cnt.BlogViewer;
+import org.ourproject.kune.blogs.client.cnt.BlogViewerPanel;
+import org.ourproject.kune.blogs.client.cnt.BlogViewerPresenter;
+import org.ourproject.kune.blogs.client.cnt.BlogViewerView;
+import org.ourproject.kune.blogs.client.ctx.BlogContext;
+import org.ourproject.kune.blogs.client.ctx.BlogContextPresenter;
+import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
+import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
+import org.ourproject.kune.platf.client.app.ToolGroup;
+import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
+import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
+import org.ourproject.kune.platf.client.rpc.GroupServiceAsync;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.services.KuneErrorHandler;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
+import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.upload.FileUploader;
+import org.ourproject.kune.platf.client.utils.DeferredCommandWrapper;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
+import org.ourproject.kune.workspace.client.editor.TextEditor;
+import org.ourproject.kune.workspace.client.entitylogo.EntityLogo;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+
+import com.calclab.suco.client.ioc.decorator.Singleton;
+import com.calclab.suco.client.ioc.module.AbstractModule;
+import com.calclab.suco.client.ioc.module.Factory;
+
+public class BlogClientModule extends AbstractModule {
+
+ @Override
+ public void onInstall() {
+
+ register(ToolGroup.class, new Factory<BlogClientTool>(BlogClientTool.class) {
+ @Override
+ public BlogClientTool create() {
+ $(BlogClientActions.class);
+ return new BlogClientTool($(I18nUITranslationService.class), $(ToolSelector.class),
+ $(WsThemePresenter.class), $(WorkspaceSkeleton.class), $(ContentCapabilitiesRegistry.class));
+ }
+ });
+
+ register(ToolGroup.class, new Factory<BlogClientActions>(BlogClientActions.class) {
+ @Override
+ public BlogClientActions create() {
+ return new BlogClientActions($(I18nUITranslationService.class), $(ContextNavigator.class),
+ $(Session.class), $(StateManager.class), $(DeferredCommandWrapper.class),
+ $$(ContentServiceAsync.class), $$(GroupServiceAsync.class), $$(FileUploader.class),
+ $(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(FileDownloadUtils.class),
+ $(EntityLogo.class), $$(TextEditor.class), $(KuneErrorHandler.class), $(BlogViewer.class),
+ $$(ContextPropEditor.class));
+ }
+ });
+
+ register(ToolGroup.class, new Factory<BlogContext>(BlogContext.class) {
+ @Override
+ public BlogContext create() {
+ final BlogContextPresenter presenter = new BlogContextPresenter($(StateManager.class),
+ $$(ContextNavigator.class), $$(ContextPropEditor.class));
+ return presenter;
+ }
+ });
+
+ register(Singleton.class, new Factory<BlogViewer>(BlogViewer.class) {
+ @Override
+ public BlogViewer create() {
+ final BlogViewerPresenter presenter = new BlogViewerPresenter($(StateManager.class), $(Session.class),
+ $(I18nUITranslationService.class), $(ActionContentToolbar.class),
+ $(ContentActionRegistry.class), $$(FileDownloadUtils.class));
+ final BlogViewerView view = new BlogViewerPanel($(WorkspaceSkeleton.class),
+ $(I18nTranslationService.class));
+ presenter.init(view);
+ return presenter;
+ }
+ });
+
+ register(ToolGroup.class, new Factory<BlogFolderContent>(BlogFolderContent.class) {
+ @Override
+ public BlogFolderContent create() {
+ final BlogFolderContentPresenter presenter = new BlogFolderContentPresenter($(StateManager.class),
+ $(Session.class), $(ActionContentToolbar.class), $(ContentActionRegistry.class),
+ $(I18nTranslationService.class));
+ final BlogFolderContentView view = new BlogFolderContentPanel($(WorkspaceSkeleton.class),
+ $(I18nTranslationService.class));
+ presenter.init(view);
+ return presenter;
+ }
+ });
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/BlogClientTool.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,62 @@
+/*
+ *
+ * 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.blogs.client;
+
+import org.ourproject.kune.platf.client.registry.ContentCapabilitiesRegistry;
+import org.ourproject.kune.platf.client.tool.FoldableAbstractClientTool;
+import org.ourproject.kune.platf.client.tool.ToolSelector;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+
+public class BlogClientTool extends FoldableAbstractClientTool {
+ public static final String TYPE_ROOT = "blogs.root";
+ public static final String TYPE_BLOG = "blogs.blog";
+ public static final String TYPE_POST = "blogs.post";
+ public static final String TYPE_UPLOADEDFILE = "blogs.uploaded";
+ public static final String NAME = "blogs";
+
+ public BlogClientTool(final I18nUITranslationService i18n, final ToolSelector toolSelector,
+ final WsThemePresenter wsThemePresenter, final WorkspaceSkeleton ws,
+ ContentCapabilitiesRegistry contentCapabilitiesRegistry) {
+ super(NAME, i18n.t("blogs"), toolSelector, wsThemePresenter, ws, contentCapabilitiesRegistry);
+
+ // registerAclEditableTypes();
+ registerAuthorableTypes(TYPE_POST, TYPE_UPLOADEDFILE);
+ registerDragableTypes(TYPE_UPLOADEDFILE);
+ registerDropableTypes(TYPE_ROOT);
+ registerPublishModerableTypes(TYPE_POST, TYPE_UPLOADEDFILE);
+ registerRateableTypes(TYPE_POST, TYPE_UPLOADEDFILE);
+ registerRenamableTypes(TYPE_BLOG, TYPE_POST, TYPE_UPLOADEDFILE);
+ registerTageableTypes(TYPE_BLOG, TYPE_UPLOADEDFILE, TYPE_POST);
+ // registerTranslatableTypes();
+
+ registerIcons();
+ }
+
+ public String getName() {
+ return NAME;
+ }
+
+ protected void registerIcons() {
+ registerContentTypeIcon(TYPE_BLOG, "images/nav/blog.png");
+ registerContentTypeIcon(TYPE_POST, "images/nav/post.png");
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContent.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContent.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContent.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,23 @@
+/*
+ *
+ * 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.blogs.client.cnt;
+
+public interface BlogFolderContent {
+}
Added: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPanel.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPanel.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,31 @@
+/*
+ *
+ * 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.blogs.client.cnt;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+public class BlogFolderContentPanel extends FoldableContentPanel implements BlogFolderContentView {
+
+ public BlogFolderContentPanel(WorkspaceSkeleton ws, I18nTranslationService i18n) {
+ super(ws, i18n);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentPresenter.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,62 @@
+/*
+ *
+ * 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.blogs.client.cnt;
+
+import org.ourproject.kune.blogs.client.BlogClientTool;
+import org.ourproject.kune.chat.client.ChatClientTool;
+import org.ourproject.kune.platf.client.actions.ActionRegistry;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
+import org.ourproject.kune.platf.client.dto.StateContainerDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
+
+public class BlogFolderContentPresenter extends FoldableContentPresenter implements BlogFolderContent {
+
+ private BlogFolderContentView view;
+ private final I18nTranslationService i18n;
+
+ public BlogFolderContentPresenter(StateManager stateManager, Session session, ActionContentToolbar toolbar,
+ final ActionRegistry<StateToken> actionRegistry, I18nTranslationService i18n) {
+ super(BlogClientTool.NAME, stateManager, session, toolbar, actionRegistry);
+ this.i18n = i18n;
+ }
+
+ public void init(final BlogFolderContentView view) {
+ super.init(view);
+ this.view = view;
+ }
+
+ @Override
+ protected void setState(StateContainerDTO state) {
+ if (state.getTypeId().equals(ChatClientTool.TYPE_ROOT)) {
+ if (state.getRootContainer().getChilds().size() == 0) {
+ view.setInfo(i18n.t("This group has no blogs."));
+ } else {
+ view.setInfo("");
+ }
+ } else {
+ view.setInfo("");
+ }
+ super.setState(state);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentView.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogFolderContentView.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,27 @@
+/*
+ *
+ * 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.blogs.client.cnt;
+
+import org.ourproject.kune.workspace.client.cnt.AbstractContentView;
+
+public interface BlogFolderContentView extends AbstractContentView {
+
+ void setInfo(String info);
+}
Added: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewer.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewer.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewer.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,25 @@
+/*
+ *
+ * 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.blogs.client.cnt;
+
+import org.ourproject.kune.workspace.client.cnt.FoldableContent;
+
+public interface BlogViewer extends FoldableContent {
+}
Added: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPanel.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPanel.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,30 @@
+/*
+ *
+ * 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.blogs.client.cnt;
+
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.workspace.client.cnt.FoldableContentPanel;
+import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
+
+public class BlogViewerPanel extends FoldableContentPanel implements BlogViewerView {
+ public BlogViewerPanel(final WorkspaceSkeleton ws, I18nTranslationService i18n) {
+ super(ws, i18n);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerPresenter.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,83 @@
+/*
+ *
+ * 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.blogs.client.cnt;
+
+import org.ourproject.kune.blogs.client.BlogClientTool;
+import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
+import org.ourproject.kune.platf.client.actions.toolbar.ActionContentToolbar;
+import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
+import org.ourproject.kune.platf.client.dto.StateContentDTO;
+import org.ourproject.kune.platf.client.dto.StateToken;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.platf.client.ui.download.FileDownloadUtils;
+import org.ourproject.kune.platf.client.ui.download.ImageSize;
+import org.ourproject.kune.workspace.client.cnt.FoldableContentPresenter;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+
+import com.calclab.suco.client.ioc.Provider;
+
+public class BlogViewerPresenter extends FoldableContentPresenter implements BlogViewer {
+ private BlogViewerView view;
+ private final Provider<FileDownloadUtils> downloadProvider;
+
+ public BlogViewerPresenter(StateManager stateManager, Session session, I18nUITranslationService i18n,
+ ActionContentToolbar toolbar, ContentActionRegistry actionRegistry,
+ Provider<FileDownloadUtils> downloadProvider) {
+ super(BlogClientTool.NAME, stateManager, session, toolbar, actionRegistry);
+ this.downloadProvider = downloadProvider;
+ }
+
+ public void init(BlogViewerView view) {
+ super.init(view);
+ this.view = view;
+ }
+
+ @Override
+ protected void setState(StateContentDTO state) {
+ super.setState(state);
+ setContent(state, BlogClientTool.TYPE_UPLOADEDFILE);
+ }
+
+ private void setContent(StateContentDTO state, String uploadedfileType) {
+ String typeId = state.getTypeId();
+ String contentBody = state.getContent();
+ StateToken token = state.getStateToken();
+ BasicMimeTypeDTO mimeType = state.getMimeType();
+ if (typeId.equals(uploadedfileType)) {
+ if (mimeType != null) {
+ FileDownloadUtils fileDownloadUtils = downloadProvider.get();
+ if (mimeType.getType().equals("image")) {
+ view.showImage(fileDownloadUtils.getImageUrl(token), fileDownloadUtils.getImageResizedUrl(token,
+ ImageSize.sized));
+ } else if (mimeType.toString().equals("text/plain") || mimeType.toString().equals("application/pdf")) {
+ view.setContent(contentBody);
+ } else {
+ view.setContent("");
+ }
+ } else {
+ view.setContent("");
+ }
+ } else {
+ view.setContent(contentBody);
+ }
+ view.attach();
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerView.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/cnt/BlogViewerView.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,30 @@
+/*
+ *
+ * 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.blogs.client.cnt;
+
+import org.ourproject.kune.workspace.client.cnt.AbstractContentView;
+
+public interface BlogViewerView extends AbstractContentView {
+
+ void setContent(String content);
+
+ void showImage(String imageUrl, String imageResizedUrl);
+
+}
Added: trunk/src/main/java/org/ourproject/kune/blogs/client/ctx/BlogContext.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/ctx/BlogContext.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/ctx/BlogContext.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,24 @@
+/*
+ *
+ * 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.blogs.client.ctx;
+
+public interface BlogContext {
+
+}
Added: trunk/src/main/java/org/ourproject/kune/blogs/client/ctx/BlogContextPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/client/ctx/BlogContextPresenter.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/client/ctx/BlogContextPresenter.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,36 @@
+/*
+ *
+ * Copyright (C) 2007-2008 The kune development team (see CREDITS for details)
+ * This file is part of kune.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as
+ * published by the Free Software Foundation, either version 3 of the
+ * License, or (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ *
+ */
+package org.ourproject.kune.blogs.client.ctx;
+
+import org.ourproject.kune.blogs.client.BlogClientTool;
+import org.ourproject.kune.platf.client.state.StateManager;
+import org.ourproject.kune.workspace.client.ctxnav.ContextNavigator;
+import org.ourproject.kune.workspace.client.cxt.ContextPropEditor;
+import org.ourproject.kune.workspace.client.cxt.FoldableContextPresenter;
+
+import com.calclab.suco.client.ioc.Provider;
+
+public class BlogContextPresenter extends FoldableContextPresenter implements BlogContext {
+ public BlogContextPresenter(final StateManager stateManager,
+ final Provider<ContextNavigator> contextNavigatorProvider,
+ final Provider<ContextPropEditor> contextPropEditorProvider) {
+ super(BlogClientTool.NAME, stateManager, contextNavigatorProvider, contextPropEditorProvider);
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/blogs/server/BlogServerModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/server/BlogServerModule.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/server/BlogServerModule.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,29 @@
+/*
+ *
+ * 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.blogs.server;
+
+import com.google.inject.Binder;
+import com.google.inject.Module;
+
+public class BlogServerModule implements Module {
+ public void configure(final Binder binder) {
+ binder.bind(BlogServerTool.class).asEagerSingleton();
+ }
+}
Added: trunk/src/main/java/org/ourproject/kune/blogs/server/BlogServerTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/blogs/server/BlogServerTool.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/blogs/server/BlogServerTool.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -0,0 +1,145 @@
+/*
+ *
+ * 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.blogs.server;
+
+import org.ourproject.kune.platf.client.errors.ContainerNotPermittedException;
+import org.ourproject.kune.platf.client.errors.ContentNotPermittedException;
+import org.ourproject.kune.platf.client.services.I18nTranslationService;
+import org.ourproject.kune.platf.server.content.ContainerManager;
+import org.ourproject.kune.platf.server.content.ContentManager;
+import org.ourproject.kune.platf.server.domain.Container;
+import org.ourproject.kune.platf.server.domain.Content;
+import org.ourproject.kune.platf.server.domain.ContentStatus;
+import org.ourproject.kune.platf.server.domain.Group;
+import org.ourproject.kune.platf.server.domain.I18nLanguage;
+import org.ourproject.kune.platf.server.domain.ToolConfiguration;
+import org.ourproject.kune.platf.server.domain.User;
+import org.ourproject.kune.platf.server.manager.ToolConfigurationManager;
+import org.ourproject.kune.platf.server.tool.ServerTool;
+import org.ourproject.kune.platf.server.tool.ServerToolRegistry;
+import org.ourproject.kune.platf.server.tool.ServerToolTarget;
+
+import com.google.inject.Inject;
+
+public class BlogServerTool implements ServerTool {
+ public static final String TYPE_ROOT = "blogs.root";
+ public static final String TYPE_BLOG = "blogs.blog";
+ public static final String TYPE_POST = "blogs.post";
+ public static final String TYPE_UPLOADEDFILE = "blogs.uploaded";
+
+ public static final String NAME = "blogs";
+ public static final String ROOT_NAME = "blogs";
+
+ private final ContentManager contentManager;
+ private final ToolConfigurationManager configurationManager;
+ private final ContainerManager containerManager;
+ private final I18nTranslationService i18n;
+
+ @Inject
+ public BlogServerTool(final ContentManager contentManager, final ContainerManager containerManager,
+ final ToolConfigurationManager configurationManager, final I18nTranslationService translationService) {
+ this.contentManager = contentManager;
+ this.containerManager = containerManager;
+ this.configurationManager = configurationManager;
+ this.i18n = translationService;
+ }
+
+ public void checkTypesBeforeContainerCreation(String parentTypeId, String typeId) {
+ checkContainerTypeId(parentTypeId, typeId);
+ }
+
+ public void checkTypesBeforeContentCreation(String parentTypeId, String typeId) {
+ checkContentTypeId(parentTypeId, typeId);
+ }
+
+ public String getName() {
+ return NAME;
+ }
+
+ public String getRootName() {
+ return ROOT_NAME;
+ }
+
+ public ServerToolTarget getTarget() {
+ return ServerToolTarget.forBoth;
+ }
+
+ public Group initGroup(final User user, final Group group) {
+ final ToolConfiguration config = new ToolConfiguration();
+ final Container rootFolder = containerManager.createRootFolder(group, NAME, ROOT_NAME, TYPE_ROOT);
+ config.setRoot(rootFolder);
+ group.setToolConfig(NAME, config);
+ configurationManager.persist(config);
+
+ I18nLanguage language = user.getLanguage();
+ final Container blog = containerManager.createFolder(group, rootFolder, i18n.t("Blog sample"), language,
+ TYPE_BLOG);
+
+ final Content descriptor = contentManager.createContent(i18n.t("A post sample"), "", user, blog,
+ BlogServerTool.TYPE_POST);
+ descriptor.addAuthor(user);
+ descriptor.setLanguage(language);
+ descriptor.setTypeId(TYPE_POST);
+ descriptor.setStatus(ContentStatus.publishedOnline);
+
+ contentManager.save(user, descriptor,
+ i18n.t("This is only a post sample. You can edit it, and rename this post and this blog"));
+ return group;
+ }
+
+ public void onCreateContainer(final Container container, final Container parent) {
+ }
+
+ public void onCreateContent(final Content content, final Container parent) {
+ }
+
+ @Inject
+ public void register(final ServerToolRegistry registry) {
+ registry.register(this);
+ }
+
+ void checkContainerTypeId(final String parentTypeId, final String typeId) {
+ if (typeId.equals(TYPE_BLOG)) {
+ // ok valid container
+ if ((typeId.equals(TYPE_BLOG) && parentTypeId.equals(TYPE_ROOT))) {
+ // ok
+ } else {
+ throw new ContainerNotPermittedException();
+ }
+ } else {
+ throw new ContainerNotPermittedException();
+ }
+ }
+
+ void checkContentTypeId(final String parentTypeId, final String typeId) {
+ if (typeId.equals(TYPE_UPLOADEDFILE) || typeId.equals(TYPE_POST)) {
+ // ok valid content
+ if ((typeId.equals(TYPE_UPLOADEDFILE) && parentTypeId.equals(TYPE_BLOG))
+ || (typeId.equals(TYPE_POST) && parentTypeId.equals(TYPE_BLOG))) {
+ // ok
+ } else {
+ throw new ContentNotPermittedException();
+ }
+
+ } else {
+ throw new ContentNotPermittedException();
+ }
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -18,6 +18,7 @@
*
*/package org.ourproject.kune.chat.client;
+import org.ourproject.kune.blogs.client.BlogClientTool;
import org.ourproject.kune.chat.client.ctx.room.AddRoom;
import org.ourproject.kune.docs.client.DocumentClientTool;
import org.ourproject.kune.platf.client.actions.ActionToolbarButtonDescriptor;
@@ -94,7 +95,7 @@
contentActionRegistry.addAction(chatAbout, DocumentClientTool.TYPE_DOCUMENT);
contentActionRegistry.addAction(chatAbout, DocumentClientTool.TYPE_GALLERY);
contentActionRegistry.addAction(chatAbout, DocumentClientTool.TYPE_WIKIPAGE);
- contentActionRegistry.addAction(chatAbout, DocumentClientTool.TYPE_POST);
+ contentActionRegistry.addAction(chatAbout, BlogClientTool.TYPE_POST);
contentActionRegistry.addAction(chatAbout, DocumentClientTool.TYPE_UPLOADEDFILE);
contextActionRegistry.addAction(addRoom, ChatClientTool.TYPE_ROOT, ChatClientTool.TYPE_ROOM);
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPanel.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPanel.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -28,8 +28,4 @@
public ChatRoomPanel(final WorkspaceSkeleton ws, I18nTranslationService i18n) {
super(ws, i18n);
}
-
- public void setInfo(String info) {
- setLabel(info);
- }
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/cnt/ChatRoomPresenter.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -52,7 +52,7 @@
if (state.getRootContainer().getChilds().size() == 0) {
view.setInfo(i18n.t("This group has no chat rooms."));
} else {
- view.setInfo("");
+ view.setInfo(i18n.t("Select a chat room"));
}
} else {
view.setInfo("History of room conversations ..." + Site.IN_DEVELOPMENT);
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -18,11 +18,9 @@
*
*/package org.ourproject.kune.docs.client;
-import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_BLOG;
import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_DOCUMENT;
import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_FOLDER;
import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_GALLERY;
-import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_POST;
import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_ROOT;
import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_UPLOADEDFILE;
import static org.ourproject.kune.docs.client.DocumentClientTool.TYPE_WIKI;
@@ -75,23 +73,19 @@
String parentMenuTitle = i18n.t("File");
String parentMenuTitleCtx = i18n.t("Folder");
- final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder = createFolderAction(TYPE_FOLDER,
+ final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder = createContainerAction(TYPE_FOLDER,
"images/nav/folder_add.png", i18n.t("New folder"), parentMenuTitleCtx, i18n.t("New"),
i18n.t("New folder"));
- final ActionToolbarMenuAndItemDescriptor<StateToken> addGallery = createFolderAction(TYPE_GALLERY,
+ final ActionToolbarMenuAndItemDescriptor<StateToken> addGallery = createContainerAction(TYPE_GALLERY,
"images/nav/gallery_add.png", i18n.t("New gallery"), parentMenuTitleCtx, i18n.t("New"),
i18n.t("New gallery"));
- final ActionToolbarMenuAndItemDescriptor<StateToken> addWiki = createFolderAction(TYPE_WIKI,
+ final ActionToolbarMenuAndItemDescriptor<StateToken> addWiki = createContainerAction(TYPE_WIKI,
"images/nav/wiki_add.png", i18n.t("New wiki"), parentMenuTitleCtx, i18n.t("New"), i18n.t("wiki"));
- final ActionToolbarMenuAndItemDescriptor<StateToken> addBlog = createFolderAction(TYPE_BLOG,
- "images/nav/blog_add.png", i18n.t("New blog"), parentMenuTitleCtx, i18n.t("New"), i18n.t("New blog"));
- final ActionToolbarMenuAndItemDescriptor<StateToken> addDoc = createDocAction("images/nav/page_add.png",
- i18n.t("New document"), TYPE_DOCUMENT);
- final ActionToolbarMenuAndItemDescriptor<StateToken> addWikiPage = createDocAction(
- "images/nav/wikipage_add.png", i18n.t("New wikipage"), TYPE_WIKIPAGE);
- final ActionToolbarMenuAndItemDescriptor<StateToken> addPost = createDocAction("images/nav/post_add.png",
- i18n.t("New post"), TYPE_POST);
+ final ActionToolbarMenuAndItemDescriptor<StateToken> addDoc = createContentAction("images/nav/page_add.png",
+ i18n.t("New document"), parentMenuTitleCtx, TYPE_DOCUMENT);
+ final ActionToolbarMenuAndItemDescriptor<StateToken> addWikiPage = createContentAction(
+ "images/nav/wikipage_add.png", parentMenuTitleCtx, i18n.t("New wikipage"), TYPE_WIKIPAGE);
final ActionToolbarMenuAndItemDescriptor<StateToken> delContainer = createDelContainerAction("Delete folder",
parentMenuTitleCtx);
@@ -107,7 +101,8 @@
final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCnt = createSetAsDefContent(parentMenuTitle);
- final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt = createSetAsDefContent(parentMenuTitleCtx);
+ // final ActionToolbarMenuDescriptor<StateToken> setAsDefGroupCxt =
+ // createSetAsDefContent(parentMenuTitleCtx);
final ActionToolbarMenuDescriptor<StateToken> refreshCnt = createRefreshCntAction(parentMenuTitle);
@@ -117,22 +112,25 @@
"images/nav/upload.png", i18n.t("Upload some files (images, PDFs, ...)"), null);
final ActionToolbarMenuDescriptor<StateToken> setPublishStatus = createSetStatusAction(
- AccessRolDTO.Administrator, i18n.t("Published online"), ContentStatusDTO.publishedOnline);
+ AccessRolDTO.Administrator, i18n.t("Published online"), parentMenuTitle,
+ ContentStatusDTO.publishedOnline);
final ActionToolbarMenuDescriptor<StateToken> setEditionInProgressStatus = createSetStatusAction(
- AccessRolDTO.Administrator, i18n.t("Editing in progress"), ContentStatusDTO.editingInProgress);
+ AccessRolDTO.Administrator, i18n.t("Editing in progress"), parentMenuTitle,
+ ContentStatusDTO.editingInProgress);
final ActionToolbarMenuDescriptor<StateToken> setRejectStatus = createSetStatusAction(
- AccessRolDTO.Administrator, i18n.t("Rejected"), ContentStatusDTO.rejected);
+ AccessRolDTO.Administrator, i18n.t("Rejected"), parentMenuTitle, ContentStatusDTO.rejected);
final ActionToolbarMenuDescriptor<StateToken> setSubmittedForPublishStatus = createSetStatusAction(
- AccessRolDTO.Administrator, i18n.t("Submitted for publish"), ContentStatusDTO.publishedOnline);
+ AccessRolDTO.Administrator, i18n.t("Submitted for publish"), parentMenuTitle,
+ ContentStatusDTO.publishedOnline);
final ActionToolbarMenuDescriptor<StateToken> setInTheDustBinStatus = createSetStatusAction(
- AccessRolDTO.Administrator, i18n.t("In the dustbin"), ContentStatusDTO.inTheDustbin);
+ AccessRolDTO.Administrator, i18n.t("In the dustbin"), parentMenuTitle, ContentStatusDTO.inTheDustbin);
- final String[] all = { TYPE_ROOT, TYPE_FOLDER, TYPE_DOCUMENT, TYPE_GALLERY, TYPE_BLOG, TYPE_POST, TYPE_WIKI,
- TYPE_WIKIPAGE, TYPE_UPLOADEDFILE };
- final String[] containersNoRoot = { TYPE_FOLDER, TYPE_GALLERY, TYPE_BLOG, TYPE_WIKI };
- final String[] containers = { TYPE_ROOT, TYPE_FOLDER, TYPE_GALLERY, TYPE_BLOG, TYPE_WIKI };
- final String[] contents = { TYPE_DOCUMENT, TYPE_POST, TYPE_WIKIPAGE, TYPE_UPLOADEDFILE };
- final String[] contentsModerated = { TYPE_DOCUMENT, TYPE_POST, TYPE_UPLOADEDFILE };
+ final String[] all = { TYPE_ROOT, TYPE_FOLDER, TYPE_DOCUMENT, TYPE_GALLERY, TYPE_WIKI, TYPE_WIKIPAGE,
+ TYPE_UPLOADEDFILE };
+ final String[] containersNoRoot = { TYPE_FOLDER, TYPE_GALLERY, TYPE_WIKI };
+ final String[] containers = { TYPE_ROOT, TYPE_FOLDER, TYPE_GALLERY, TYPE_WIKI };
+ final String[] contents = { TYPE_DOCUMENT, TYPE_WIKIPAGE, TYPE_UPLOADEDFILE };
+ final String[] contentsModerated = { TYPE_DOCUMENT, TYPE_UPLOADEDFILE };
contentActionRegistry.addAction(setPublishStatus, contentsModerated);
contentActionRegistry.addAction(setEditionInProgressStatus, contentsModerated);
@@ -140,10 +138,8 @@
contentActionRegistry.addAction(setSubmittedForPublishStatus, contentsModerated);
contentActionRegistry.addAction(setInTheDustBinStatus, contentsModerated);
contextActionRegistry.addAction(addDoc, TYPE_ROOT, TYPE_FOLDER);
- contextActionRegistry.addAction(addPost, TYPE_BLOG);
contextActionRegistry.addAction(addWikiPage, TYPE_WIKI);
contextActionRegistry.addAction(addFolder, TYPE_ROOT, TYPE_FOLDER);
- contextActionRegistry.addAction(addBlog, TYPE_ROOT);
contextActionRegistry.addAction(addWiki, TYPE_ROOT);
contextActionRegistry.addAction(addGallery, TYPE_ROOT);
contextActionRegistry.addAction(go, all);
@@ -151,15 +147,15 @@
contextActionRegistry.addAction(renameCtx, containersNoRoot);
contextActionRegistry.addAction(refreshCtx, containers);
contentActionRegistry.addAction(refreshCnt, contents);
- contextActionRegistry.addAction(uploadFile, TYPE_ROOT, TYPE_FOLDER, TYPE_BLOG);
+ contextActionRegistry.addAction(uploadFile, TYPE_ROOT, TYPE_FOLDER);
contentActionRegistry.addAction(download, TYPE_UPLOADEDFILE);
contentActionRegistry.addAction(delContent, contents);
contextActionRegistry.addAction(delContainer, containersNoRoot);
contentActionRegistry.addAction(setAsDefGroupCnt, TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
- contentActionRegistry.addAction(setAsDefGroupCxt, TYPE_BLOG);
+ // contentActionRegistry.addAction(setAsDefGroupCxt,);
contextActionRegistry.addAction(goGroupHome, containers);
contextActionRegistry.addAction(downloadCtx, TYPE_UPLOADEDFILE);
- contentActionRegistry.addAction(editContent, TYPE_DOCUMENT, TYPE_POST, TYPE_WIKIPAGE);
+ contentActionRegistry.addAction(editContent, TYPE_DOCUMENT, TYPE_WIKIPAGE);
contentActionRegistry.addAction(translateContent, TYPE_DOCUMENT, TYPE_FOLDER, TYPE_GALLERY, TYPE_UPLOADEDFILE,
TYPE_WIKI, TYPE_WIKIPAGE);
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientTool.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -32,8 +32,6 @@
public static final String TYPE_FOLDER = "docs.folder";
public static final String TYPE_DOCUMENT = "docs.doc";
public static final String TYPE_GALLERY = "docs.gallery";
- public static final String TYPE_BLOG = "docs.blog";
- public static final String TYPE_POST = "docs.post";
public static final String TYPE_WIKI = "docs.wiki";
public static final String TYPE_WIKIPAGE = "docs.wikipage";
public static final String TYPE_UPLOADEDFILE = "docs.uploaded";
@@ -49,10 +47,9 @@
registerDragableTypes(TYPE_DOCUMENT, TYPE_FOLDER, TYPE_UPLOADEDFILE);
registerDropableTypes(TYPE_ROOT, TYPE_FOLDER, TYPE_GALLERY);
registerPublishModerableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
- registerRateableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE, TYPE_WIKIPAGE, TYPE_POST);
- registerRenamableTypes(TYPE_DOCUMENT, TYPE_FOLDER, TYPE_BLOG, TYPE_GALLERY, TYPE_POST, TYPE_UPLOADEDFILE,
- TYPE_WIKI, TYPE_WIKIPAGE);
- registerTageableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE, TYPE_WIKIPAGE, TYPE_POST);
+ registerRateableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE, TYPE_WIKIPAGE);
+ registerRenamableTypes(TYPE_DOCUMENT, TYPE_FOLDER, TYPE_GALLERY, TYPE_UPLOADEDFILE, TYPE_WIKI, TYPE_WIKIPAGE);
+ registerTageableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE, TYPE_WIKIPAGE);
registerTranslatableTypes(TYPE_DOCUMENT, TYPE_FOLDER, TYPE_UPLOADEDFILE, TYPE_WIKIPAGE);
registerIcons();
@@ -64,10 +61,8 @@
protected void registerIcons() {
registerContentTypeIcon(TYPE_FOLDER, "images/nav/folder.png");
- registerContentTypeIcon(TYPE_BLOG, "images/nav/blog.png");
registerContentTypeIcon(TYPE_GALLERY, "images/nav/gallery.png");
registerContentTypeIcon(TYPE_DOCUMENT, "images/nav/page.png");
- registerContentTypeIcon(TYPE_POST, "images/nav/post.png");
registerContentTypeIcon(TYPE_WIKI, "images/nav/wiki.png");
registerContentTypeIcon(TYPE_WIKIPAGE, "images/nav/wikipage.png");
registerContentTypeIcon(TYPE_UPLOADEDFILE, new BasicMimeTypeDTO("image"), "images/nav/picture.png");
Modified: trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/docs/server/DocumentServerTool.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -89,12 +89,12 @@
public Group initGroup(final User user, final Group group) {
final ToolConfiguration config = new ToolConfiguration();
- final Container container = containerManager.createRootFolder(group, NAME, ROOT_NAME, TYPE_ROOT);
- config.setRoot(container);
+ final Container rootFolder = containerManager.createRootFolder(group, NAME, ROOT_NAME, TYPE_ROOT);
+ config.setRoot(rootFolder);
group.setToolConfig(NAME, config);
configurationManager.persist(config);
final String longName = group.getLongName();
- final Content descriptor = contentManager.createContent(i18n.t("About [%s]", longName), "", user, container,
+ final Content descriptor = contentManager.createContent(i18n.t("About [%s]", longName), "", user, rootFolder,
DocumentServerTool.TYPE_DOCUMENT);
descriptor.addAuthor(user);
descriptor.setLanguage(user.getLanguage());
@@ -105,9 +105,7 @@
}
public void onCreateContainer(final Container container, final Container parent) {
- String typeId = container.getTypeId();
- container.setTypeId(typeId);
- if (typeId.equals(TYPE_WIKI)) {
+ if (container.getTypeId().equals(TYPE_WIKI)) {
AccessLists wikiAcl = new AccessLists();
wikiAcl.getAdmins().setMode(GroupListMode.NORMAL);
wikiAcl.getAdmins().add(container.getOwner());
@@ -145,7 +143,7 @@
void checkContentTypeId(final String parentTypeId, final String typeId) {
if (typeId.equals(TYPE_DOCUMENT) || typeId.equals(TYPE_WIKIPAGE) || typeId.equals(TYPE_UPLOADEDFILE)
|| typeId.equals(TYPE_POST)) {
- // ok valid container
+ // ok valid content
if ((typeId.equals(TYPE_DOCUMENT) && (parentTypeId.equals(TYPE_ROOT) || parentTypeId.equals(TYPE_FOLDER)))
|| (typeId.equals(TYPE_UPLOADEDFILE) && (parentTypeId.equals(TYPE_ROOT)
|| parentTypeId.equals(TYPE_FOLDER) || parentTypeId.equals(TYPE_GALLERY)))
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/tool/ToolSelectorPresenter.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -25,6 +25,7 @@
import org.ourproject.kune.platf.client.state.StateManager;
import org.ourproject.kune.workspace.client.themes.WsThemePresenter;
+import com.allen_sauer.gwt.log.client.Log;
import com.calclab.suco.client.listener.Listener;
import com.calclab.suco.client.listener.Listener2;
@@ -77,6 +78,7 @@
}
void onToolChanged(final String oldTool, final String newTool) {
+ Log.debug("Registered tools: " + tools.keySet().toString());
if (!oldTool.equals("")) {
tools.get(oldTool).setSelected(false);
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/GroupManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/GroupManager.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/GroupManager.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -49,8 +49,6 @@
List<String> findEnabledTools(Long id);
- Group getSiteDefaultGroup();
-
/**
* IMPORTANT: returns null if userId is null
*
@@ -59,6 +57,8 @@
*/
Group getGroupOfUserWithId(Long userId);
+ Group getSiteDefaultGroup();
+
void reIndex();
SearchResult<Group> search(String search);
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -344,6 +344,18 @@
return mapper.map(content, ContentSimpleDTO.class);
}
+ // @Authenticated
+ // @Authorizated(accessRolRequired = AccessRol.Administrator,
+ // actionLevel=ActionLevel.container)
+ // @Transactional(type = TransactionType.READ_WRITE)
+ // public ContentSimpleDTO setFolderAsDefaultContent(final String userHash,
+ // final StateToken token) {
+ // Container container =
+ // containerManager.find(ContentUtils.parseId(token.getFolder()));
+ // groupManager.setDefaultContent(token.getGroup(), container);
+ // return mapper.map(content, ContentSimpleDTO.class);
+ // }
+
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Editor)
@Transactional(type = TransactionType.READ_WRITE)
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/AbstractFoldableContentActions.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -105,6 +105,53 @@
protected void createActions() {
}
+ protected ActionToolbarMenuAndItemDescriptor<StateToken> createContainerAction(final String contentTypeId,
+ final String iconUrl, final String textDescription, final String parentMenuTitle,
+ final String parentMenuSubtitle, final String defaultName) {
+ final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder;
+ addFolder = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor,
+ ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ public void onEvent(final StateToken stateToken) {
+ Site.showProgressProcessing();
+ contentServiceProvider.get().addFolder(session.getUserHash(), stateToken, defaultName,
+ contentTypeId, new AsyncCallbackSimple<StateContainerDTO>() {
+ public void onSuccess(final StateContainerDTO state) {
+ contextNavigator.setEditOnNextStateChange(true);
+ stateManager.setRetrievedState(state);
+ }
+ });
+ }
+ });
+ addFolder.setTextDescription(textDescription);
+ addFolder.setParentMenuTitle(parentMenuTitle);
+ addFolder.setParentSubMenuTitle(parentMenuSubtitle);
+ addFolder.setIconUrl(iconUrl);
+ return addFolder;
+ }
+
+ protected ActionToolbarMenuAndItemDescriptor<StateToken> createContentAction(String iconUrl,
+ final String description, final String parentMenuTitle, final String typeId) {
+ final ActionToolbarMenuAndItemDescriptor<StateToken> addDoc = new ActionToolbarMenuAndItemDescriptor<StateToken>(
+ AccessRolDTO.Editor, ActionToolbarPosition.topbar, new Listener<StateToken>() {
+ public void onEvent(final StateToken token) {
+ Site.showProgressProcessing();
+ contentServiceProvider.get().addContent(session.getUserHash(),
+ session.getCurrentState().getStateToken(), description, typeId,
+ new AsyncCallbackSimple<StateContentDTO>() {
+ public void onSuccess(final StateContentDTO state) {
+ contextNavigator.setEditOnNextStateChange(true);
+ stateManager.setRetrievedState(state);
+ }
+ });
+ }
+ });
+ addDoc.setTextDescription(description);
+ addDoc.setParentMenuTitle(parentMenuTitle);
+ addDoc.setParentSubMenuTitle(i18n.t("New"));
+ addDoc.setIconUrl(iconUrl);
+ return addDoc;
+ }
+
protected ActionToolbarMenuAndItemDescriptor<StateToken> createContentRenameAction(String parentMenuTitle,
String textDescription) {
final ActionToolbarMenuAndItemDescriptor<StateToken> renameCtn = new ActionToolbarMenuAndItemDescriptor<StateToken>(
@@ -162,53 +209,6 @@
return delContent;
}
- protected ActionToolbarMenuAndItemDescriptor<StateToken> createDocAction(String iconUrl, final String description,
- final String typeId) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> addDoc = new ActionToolbarMenuAndItemDescriptor<StateToken>(
- AccessRolDTO.Editor, ActionToolbarPosition.topbar, new Listener<StateToken>() {
- public void onEvent(final StateToken token) {
- Site.showProgressProcessing();
- contentServiceProvider.get().addContent(session.getUserHash(),
- session.getCurrentState().getStateToken(), description, typeId,
- new AsyncCallbackSimple<StateContentDTO>() {
- public void onSuccess(final StateContentDTO state) {
- contextNavigator.setEditOnNextStateChange(true);
- stateManager.setRetrievedState(state);
- }
- });
- }
- });
- addDoc.setTextDescription(description);
- addDoc.setParentMenuTitle(i18n.t("Folder"));
- addDoc.setParentSubMenuTitle(i18n.t("New"));
- addDoc.setIconUrl(iconUrl);
- return addDoc;
- }
-
- protected ActionToolbarMenuAndItemDescriptor<StateToken> createFolderAction(final String contentTypeId,
- final String iconUrl, final String textDescription, final String parentMenuTitle,
- final String parentMenuSubtitle, final String defaultName) {
- final ActionToolbarMenuAndItemDescriptor<StateToken> addFolder;
- addFolder = new ActionToolbarMenuAndItemDescriptor<StateToken>(AccessRolDTO.Editor,
- ActionToolbarPosition.topbar, new Listener<StateToken>() {
- public void onEvent(final StateToken stateToken) {
- Site.showProgressProcessing();
- contentServiceProvider.get().addFolder(session.getUserHash(), stateToken, defaultName,
- contentTypeId, new AsyncCallbackSimple<StateContainerDTO>() {
- public void onSuccess(final StateContainerDTO state) {
- contextNavigator.setEditOnNextStateChange(true);
- stateManager.setRetrievedState(state);
- }
- });
- }
- });
- addFolder.setTextDescription(textDescription);
- addFolder.setParentMenuTitle(parentMenuTitle);
- addFolder.setParentSubMenuTitle(parentMenuSubtitle);
- addFolder.setIconUrl(iconUrl);
- return addFolder;
- }
-
protected void createPostSessionInitActions() {
}
@@ -266,7 +266,7 @@
public void onSuccess(final ContentSimpleDTO defContent) {
session.getCurrentState().getGroup().setDefaultContent(defContent);
Site.hideProgress();
- Site.info(i18n.t("Document selected as the group homepage"));
+ Site.info(i18n.t("Content selected as the group homepage"));
}
});
}
@@ -284,7 +284,7 @@
}
protected ActionToolbarMenuAndItemDescriptor<StateToken> createSetStatusAction(final AccessRolDTO rol,
- final String textDescription, final ContentStatusDTO status) {
+ final String textDescription, String parentMenuTitle, final ContentStatusDTO status) {
final ActionToolbarMenuAndItemDescriptor<StateToken> action = new ActionToolbarMenuAndItemDescriptor<StateToken>(
rol, ActionToolbarPosition.topbar, new Listener<StateToken>() {
public void onEvent(final StateToken stateToken) {
@@ -303,7 +303,7 @@
}
});
action.setTextDescription(textDescription);
- action.setParentMenuTitle(i18n.t("File"));
+ action.setParentMenuTitle(parentMenuTitle);
action.setParentSubMenuTitle(i18n.t("Change the status"));
return action;
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/cnt/FoldableContentPanel.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -26,6 +26,10 @@
attach();
}
+ public void setInfo(String info) {
+ setLabel(info);
+ }
+
public void setLabel(String text) {
Label label = new Label(text);
setDefStyle(label);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java 2008-11-24 18:14:39 UTC (rev 965)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntitySummary.java 2008-11-24 20:24:03 UTC (rev 966)
@@ -78,7 +78,9 @@
mainFitPanel.setBottomToolbar(trayBar);
anchorLayoutPanel.add(entityTools, new AnchorLayoutData("100%"));
- anchorLayoutPanel.add(entitySummary, new AnchorLayoutData("100% -50"));
+ // height: is 25 * number of tools :-( finding a way to make this
+ // automatic
+ anchorLayoutPanel.add(entitySummary, new AnchorLayoutData("100% -75"));
mainFitPanel.add(anchorLayoutPanel);
}
More information about the kune-commits
mailing list