[kune-commits] r890 - in trunk: .
src/main/java/org/ourproject/kune/chat/client
src/main/java/org/ourproject/kune/docs/client
src/main/java/org/ourproject/kune/docs/client/cnt
src/main/java/org/ourproject/kune/platf/client/actions/toolbar
src/main/java/org/ourproject/kune/platf/client/app
src/main/java/org/ourproject/kune/platf/client/dto
src/main/java/org/ourproject/kune/platf/client/rpc
src/main/java/org/ourproject/kune/platf/client/services
src/main/java/org/ourproject/kune/platf/public/images
src/main/java/org/ourproject/kune/platf/server/domain
src/main/java/org/ourproject/kune/platf/server/manager/impl
src/main/java/org/ourproject/kune/platf/server/rpc
src/main/java/org/ourproject/kune/workspace/client/ctxnav
src/main/java/org/ourproject/kune/workspace/client/licensefoot
src/main/java/org/ourproject/kune/workspace/client/skel
src/main/java/org/ourproject/kune/workspace/client/title
src/main/resources
src/test/java/org/ourproject/kune/platf/integration/content
src/test/java/org/ourproject/kune/platf/server/manager/impl
src/test/java/org/ourproject/kune/platf/server/mapper
vjrj
vjrj at ourproject.org
Sat Sep 27 22:04:19 CEST 2008
Author: vjrj
Date: 2008-09-27 22:03:56 +0200 (Sat, 27 Sep 2008)
New Revision: 890
Added:
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentSimpleDTO.java
trunk/src/main/java/org/ourproject/kune/platf/public/images/emite-room.png
trunk/src/main/java/org/ourproject/kune/platf/public/images/new-chat.gif
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java
Removed:
trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentDTO.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/TitleBar.java
Modified:
trunk/pom.xml
trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngine.java
trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java
trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationComponentGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/app/ToolGroup.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java
trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java
trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneCoreModule.java
trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileDownloadManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUploadManager.java
trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUtils.java
trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java
trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java
trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SiteBar.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePanel.java
trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
trunk/src/main/resources/dozerBeanMapping.xml
trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceAddTest.java
trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/FileUtilsTest.java
trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java
Log:
Up/Download refactor and db adjusts. ActionToolbar attach/detach and bug fixes. New "chat about" ;) action:
chatAbout.setIconUrl("images/emite-room.png");
chatAbout.setToolTip("Chat online about this");
chatAbout.setLeftSeparator(ActionButtonSeparator.fill);
contentActionRegistry.addAction(DocumentClientTool.TYPE_DOCUMENT, chatAbout);
contentActionRegistry.addAction(DocumentClientTool.TYPE_GALLERY, chatAbout);
contentActionRegistry.addAction(DocumentClientTool.TYPE_WIKIPAGE, chatAbout);
contentActionRegistry.addAction(DocumentClientTool.TYPE_POST, chatAbout);
contentActionRegistry.addAction(DocumentClientTool.TYPE_UPLOADEDFILE, chatAbout);
Modified: trunk/pom.xml
===================================================================
--- trunk/pom.xml 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/pom.xml 2008-09-27 20:03:56 UTC (rev 890)
@@ -83,7 +83,7 @@
<dependency>
<groupId>com.calclab</groupId>
<artifactId>suco</artifactId>
- <version>0.5.02</version>
+ <version>0.5.06</version>
</dependency>
<!-- xmpp -->
Added: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientActions.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -0,0 +1,54 @@
+package org.ourproject.kune.chat.client;
+
+import org.ourproject.kune.docs.client.DocumentClientTool;
+import org.ourproject.kune.platf.client.actions.ActionButtonDescriptor;
+import org.ourproject.kune.platf.client.actions.ActionButtonSeparator;
+import org.ourproject.kune.platf.client.actions.ActionPosition;
+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.StateToken;
+import org.ourproject.kune.platf.client.state.Session;
+import org.ourproject.kune.workspace.client.i18n.I18nUITranslationService;
+
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.listener.Listener;
+
+public class ChatClientActions {
+
+ private final I18nUITranslationService i18n;
+ private final Session session;
+ private final Provider<ChatClientTool> chatClientToolProvider;
+ private final ContentActionRegistry contentActionRegistry;
+
+ public ChatClientActions(final I18nUITranslationService i18n, final Session session,
+ final ContentActionRegistry contentActionRegistry, final ContextActionRegistry contextActionRegistry,
+ final Provider<ChatClientTool> chatClientToolProvider) {
+ this.i18n = i18n;
+ this.session = session;
+ this.contentActionRegistry = contentActionRegistry;
+ this.chatClientToolProvider = chatClientToolProvider;
+ createActions();
+ }
+
+ private void createActions() {
+ final ActionButtonDescriptor<StateToken> chatAbout = new ActionButtonDescriptor<StateToken>(
+ AccessRolDTO.Viewer, ActionPosition.topbar, new Listener<StateToken>() {
+ public void onEvent(final StateToken token) {
+ chatClientToolProvider.get().getChat().joinRoom(token.toString().replaceAll("\\.", "-"),
+ session.getCurrentUserInfo().getShortName());
+ chatClientToolProvider.get().getChat().show();
+ }
+ });
+ // chatAbout.setTextDescription(i18n.t("Chat about"));
+ chatAbout.setIconUrl("images/emite-room.png");
+ chatAbout.setToolTip("Chat online about this");
+ chatAbout.setLeftSeparator(ActionButtonSeparator.fill);
+
+ contentActionRegistry.addAction(DocumentClientTool.TYPE_DOCUMENT, chatAbout);
+ contentActionRegistry.addAction(DocumentClientTool.TYPE_GALLERY, chatAbout);
+ contentActionRegistry.addAction(DocumentClientTool.TYPE_WIKIPAGE, chatAbout);
+ contentActionRegistry.addAction(DocumentClientTool.TYPE_POST, chatAbout);
+ contentActionRegistry.addAction(DocumentClientTool.TYPE_UPLOADEDFILE, chatAbout);
+ }
+}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatClientModule.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -14,6 +14,8 @@
import org.ourproject.kune.chat.client.ctx.ChatContextPresenter;
import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdmin;
import org.ourproject.kune.chat.client.ctx.rooms.RoomsAdminPresenter;
+import org.ourproject.kune.platf.client.actions.ContentActionRegistry;
+import org.ourproject.kune.platf.client.actions.ContextActionRegistry;
import org.ourproject.kune.platf.client.app.Application;
import org.ourproject.kune.platf.client.app.ToolGroup;
import org.ourproject.kune.platf.client.rpc.ContentServiceAsync;
@@ -46,6 +48,13 @@
}
});
+ register(ToolGroup.class, new Factory<ChatClientActions>(ChatClientActions.class) {
+ public ChatClientActions create() {
+ return new ChatClientActions($(I18nUITranslationService.class), $(Session.class),
+ $(ContentActionRegistry.class), $(ContextActionRegistry.class), $$(ChatClientTool.class));
+ }
+ });
+
register(Singleton.class, new Factory<ChatContent>(ChatContent.class) {
public ChatContent create() {
final WorkspaceDeckPanel panel = new WorkspaceDeckPanel();
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngine.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngine.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngine.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -28,5 +28,7 @@
void logout();
+ void show();
+
void stop();
}
Modified: trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/chat/client/ChatEngineXmpp.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -82,7 +82,6 @@
} else {
emiteDialog.setEnableStatusUI(true);
emiteDialog.refreshUserInfo(chatOptions.userOptions);
-
}
emiteDialog.show(OwnStatus.online);
if (traybarButton == null) {
@@ -134,8 +133,12 @@
}
}
+ public void show() {
+ emiteDialog.show();
+ }
+
public void stop() {
- // emiteDialog.destroy();
+ emiteDialog.destroy();
emiteDialog.getSession().logout();
}
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/DocumentClientActions.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -16,7 +16,7 @@
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.ContentDTO;
+import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.InitDataDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
@@ -172,8 +172,8 @@
public void onEvent(final StateToken token) {
Site.showProgressProcessing();
contentServiceProvider.get().setAsDefaultContent(session.getUserHash(), token,
- new AsyncCallbackSimple<ContentDTO>() {
- public void onSuccess(final ContentDTO defContent) {
+ new AsyncCallbackSimple<ContentSimpleDTO>() {
+ public void onSuccess(final ContentSimpleDTO defContent) {
session.getCurrentState().getGroup().setDefaultContent(defContent);
Site.hideProgress();
Site.info(i18n.t("Document selected as the group homepage"));
Modified: trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/docs/client/cnt/DocumentContentPresenter.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -87,6 +87,7 @@
public void onEvent(final StateDTO state) {
if (state.getToolName().equals(DocumentClientTool.NAME)) {
setState(state);
+ toolbar.attach();
}
}
});
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbar.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -5,8 +5,12 @@
public interface ActionToolbar {
+ void attach();
+
void clear();
+ void detach();
+
void disableMenusAndClearButtons();
void showActions(ActionItemCollection<StateToken> actionItemCollection, boolean isItemSelected);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPanel.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -10,7 +10,7 @@
import org.ourproject.kune.platf.client.actions.ActionMenuDescriptor;
import org.ourproject.kune.platf.client.actions.ActionPosition;
import org.ourproject.kune.platf.client.dto.StateToken;
-import org.ourproject.kune.workspace.client.skel.Toolbar;
+import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.calclab.suco.client.ioc.Provider;
@@ -34,19 +34,23 @@
private final HashMap<String, Menu> toolbarMenus;
private final ArrayList<Widget> removableToolbarItems;
private final HashMap<String, Item> menuItems;
- private final WorkspaceSkeleton ws;
private final Provider<ActionManager> actionManagerProvider;
private final Position position;
+ private final SimpleToolbar topbar;
+ private final SimpleToolbar bottombar;
+ private final WorkspaceSkeleton ws;
public ActionToolbarPanel(final Position position, final Provider<ActionManager> actionManagerProvider,
final WorkspaceSkeleton ws) {
+ this.ws = ws;
+ topbar = new SimpleToolbar();
+ bottombar = new SimpleToolbar();
this.position = position;
this.actionManagerProvider = actionManagerProvider;
- this.ws = ws;
+
toolbarMenus = new HashMap<String, Menu>();
removableToolbarItems = new ArrayList<Widget>();
menuItems = new HashMap<String, Item>();
-
}
public void addButtonAction(final ActionItem<StateToken> actionItem) {
@@ -69,7 +73,7 @@
}
button.setTooltip(action.getToolTip());
- final Toolbar toolbar = getToolbar(pos);
+ final SimpleToolbar toolbar = getToolbar(pos);
if (action.hasLeftSeparator()) {
removableToolbarItems.add(add(toolbar, action.getLeftSeparator()));
}
@@ -96,13 +100,29 @@
} else {
item.disable();
}
- doLayoutIfNeeded(pos);
}
+ public void attach() {
+ if (!topbar.isAttached()) {
+ switch (position) {
+ case content:
+ ws.getEntityWorkspace().getContentTopBar().add(topbar);
+ ws.getEntityWorkspace().getContentBottomBar().add(bottombar);
+ break;
+ case context:
+ default:
+ ws.getEntityWorkspace().getContextTopBar().add(topbar);
+ ws.getEntityWorkspace().getContextBottomBar().add(bottombar);
+ }
+ }
+ }
+
public void clear() {
toolbarMenus.clear();
menuItems.clear();
removableToolbarItems.clear();
+ topbar.removeAll();
+ bottombar.removeAll();
getToolbar(ActionPosition.topbar).removeAll();
getToolbar(ActionPosition.bottombar).removeAll();
}
@@ -112,21 +132,34 @@
widget.removeFromParent();
}
removableToolbarItems.clear();
- doLayoutIfNeeded();
}
+ public void detach() {
+ if (topbar.isAttached()) {
+ switch (position) {
+ case content:
+ ws.getEntityWorkspace().getContentTopBar().remove(topbar);
+ ws.getEntityWorkspace().getContentBottomBar().remove(bottombar);
+ break;
+ case context:
+ default:
+ ws.getEntityWorkspace().getContextTopBar().remove(topbar);
+ ws.getEntityWorkspace().getContextBottomBar().remove(bottombar);
+ }
+ }
+ }
+
public void disableAllMenuItems() {
for (final Item item : menuItems.values()) {
item.disable();
}
- doLayoutIfNeeded();
}
private void add(final ActionPosition toolbar, final Widget widget) {
getToolbar(toolbar).add(widget);
}
- private Widget add(final Toolbar toolbar, final ActionButtonSeparator separator) {
+ private Widget add(final SimpleToolbar toolbar, final ActionButtonSeparator separator) {
switch (separator) {
case fill:
return toolbar.addFill();
@@ -172,7 +205,6 @@
}
menu.addItem(item);
}
- doLayoutIfNeeded(toolBarPos);
return item;
}
@@ -189,15 +221,6 @@
return menu;
}
- private void doLayoutIfNeeded() {
- doLayoutIfNeeded(ActionPosition.topbar);
- doLayoutIfNeeded(ActionPosition.bottombar);
- }
-
- private void doLayoutIfNeeded(final ActionPosition pos) {
- getToolbar(pos).doLayoutIfNeeded();
- }
-
private String genMenuKey(final ActionPosition pos, final String menuTitle, final String menuSubTitle,
final String actionText) {
@@ -207,27 +230,15 @@
return basePart + subMenuPart + itemPart;
}
- private Toolbar getToolbar(final ActionPosition pos) {
+ private SimpleToolbar getToolbar(final ActionPosition pos) {
switch (pos) {
case bootombarAndItemMenu:
case bottombar:
- switch (position) {
- case content:
- return ws.getEntityWorkspace().getContentBottomBar();
- case context:
- default:
- return ws.getEntityWorkspace().getContextBottomBar();
- }
+ return bottombar;
case topbar:
case topbarAndItemMenu:
default:
- switch (position) {
- case content:
- return ws.getEntityWorkspace().getContentTopBar();
- case context:
- default:
- return ws.getEntityWorkspace().getContextTopBar();
- }
+ return topbar;
}
}
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarPresenter.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -19,10 +19,18 @@
this.actionRegistry = actionRegistry;
}
+ public void attach() {
+ toolbar.attach();
+ }
+
public void clear() {
toolbar.clear();
}
+ public void detach() {
+ toolbar.detach();
+ }
+
public void disableMenusAndClearButtons() {
toolbar.clear();
// With action-item, this must be redesigned
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/actions/toolbar/ActionToolbarView.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -9,10 +9,14 @@
void addMenuAction(ActionItem<StateToken> action, boolean enable);
+ void attach();
+
void clear();
void clearRemovableActions();
+ void detach();
+
void disableAllMenuItems();
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationComponentGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationComponentGroup.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ApplicationComponentGroup.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -1,7 +1,19 @@
package org.ourproject.kune.platf.client.app;
-import com.calclab.suco.client.ioc.decorator.GroupedSingleton;
+import com.calclab.suco.client.ioc.Container;
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.ioc.decorator.ProviderCollection;
+import com.calclab.suco.client.ioc.decorator.Singleton;
-public class ApplicationComponentGroup extends GroupedSingleton {
+public class ApplicationComponentGroup extends ProviderCollection {
+ public ApplicationComponentGroup(final Container container) {
+ super(container, Singleton.instance);
+ }
+
+ public void createAll() {
+ for (final Provider<?> p : getProviders()) {
+ p.get();
+ }
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/app/ToolGroup.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/app/ToolGroup.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/app/ToolGroup.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -1,6 +1,19 @@
package org.ourproject.kune.platf.client.app;
-import com.calclab.suco.client.ioc.decorator.GroupedSingleton;
+import com.calclab.suco.client.ioc.Container;
+import com.calclab.suco.client.ioc.Provider;
+import com.calclab.suco.client.ioc.decorator.ProviderCollection;
+import com.calclab.suco.client.ioc.decorator.Singleton;
-public class ToolGroup extends GroupedSingleton {
+public class ToolGroup extends ProviderCollection {
+
+ public ToolGroup(final Container container) {
+ super(container, Singleton.instance);
+ }
+
+ public void createAll() {
+ for (final Provider<?> p : getProviders()) {
+ p.get();
+ }
+ }
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerDTO.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContainerDTO.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -32,7 +32,7 @@
private Long parentFolderId;
private ContainerSimpleDTO[] absolutePath;
private List<ContainerSimpleDTO> childs;
- private List<ContentDTO> contents;
+ private List<ContentSimpleDTO> contents;
public ContainerDTO() {
}
@@ -45,7 +45,7 @@
return childs;
}
- public List<ContentDTO> getContents() {
+ public List<ContentSimpleDTO> getContents() {
return contents;
}
@@ -77,7 +77,7 @@
this.childs = childs;
}
- public void setContents(final List<ContentDTO> contents) {
+ public void setContents(final List<ContentSimpleDTO> contents) {
this.contents = contents;
}
Deleted: trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentDTO.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentDTO.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -1,92 +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.platf.client.dto;
-
-
-import com.google.gwt.user.client.rpc.IsSerializable;
-
-public class ContentDTO implements IsSerializable {
-
- private Long id;
- private String title;
- private String typeId;
- private StateToken stateToken;
- private ContentStatusDTO status;
- private AccessRightsDTO rights;
- private BasicMimeTypeDTO mimeType;
-
- public Long getId() {
- return id;
- }
-
- public BasicMimeTypeDTO getMimeType() {
- return mimeType;
- }
-
- public AccessRightsDTO getRights() {
- return rights;
- }
-
- public StateToken getStateToken() {
- return stateToken;
- }
-
- public ContentStatusDTO getStatus() {
- return status;
- }
-
- public String getTitle() {
- return title;
- }
-
- public String getTypeId() {
- return typeId;
- }
-
- public void setId(final Long id) {
- this.id = id;
- }
-
- public void setMimeType(final BasicMimeTypeDTO mimeType) {
- this.mimeType = mimeType;
- }
-
- public void setRights(final AccessRightsDTO rights) {
- this.rights = rights;
- }
-
- public void setStateToken(final StateToken stateToken) {
- this.stateToken = stateToken;
- }
-
- public void setStatus(final ContentStatusDTO status) {
- this.status = status;
- }
-
- public void setTitle(final String title) {
- this.title = title;
- }
-
- public void setTypeId(final String typeId) {
- this.typeId = typeId;
- }
-
-}
Copied: trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentSimpleDTO.java (from rev 885, trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentDTO.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentDTO.java 2008-09-26 01:40:25 UTC (rev 885)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/ContentSimpleDTO.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -0,0 +1,91 @@
+/*
+ *
+ * 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.platf.client.dto;
+
+import com.google.gwt.user.client.rpc.IsSerializable;
+
+public class ContentSimpleDTO implements IsSerializable {
+
+ private Long id;
+ private String title;
+ private String typeId;
+ private StateToken stateToken;
+ private ContentStatusDTO status;
+ private AccessRightsDTO rights;
+ private BasicMimeTypeDTO mimeType;
+
+ public Long getId() {
+ return id;
+ }
+
+ public BasicMimeTypeDTO getMimeType() {
+ return mimeType;
+ }
+
+ public AccessRightsDTO getRights() {
+ return rights;
+ }
+
+ public StateToken getStateToken() {
+ return stateToken;
+ }
+
+ public ContentStatusDTO getStatus() {
+ return status;
+ }
+
+ public String getTitle() {
+ return title;
+ }
+
+ public String getTypeId() {
+ return typeId;
+ }
+
+ public void setId(final Long id) {
+ this.id = id;
+ }
+
+ public void setMimeType(final BasicMimeTypeDTO mimeType) {
+ this.mimeType = mimeType;
+ }
+
+ public void setRights(final AccessRightsDTO rights) {
+ this.rights = rights;
+ }
+
+ public void setStateToken(final StateToken stateToken) {
+ this.stateToken = stateToken;
+ }
+
+ public void setStatus(final ContentStatusDTO status) {
+ this.status = status;
+ }
+
+ public void setTitle(final String title) {
+ this.title = title;
+ }
+
+ public void setTypeId(final String typeId) {
+ this.typeId = typeId;
+ }
+
+}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/dto/GroupDTO.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -29,7 +29,7 @@
private String longName;
private String publicDesc;
private GroupType type;
- private ContentDTO defaultContent;
+ private ContentSimpleDTO defaultContent;
private LicenseDTO defaultLicense;
private String workspaceTheme;
private String tags;
@@ -94,7 +94,7 @@
return true;
}
- public ContentDTO getDefaultContent() {
+ public ContentSimpleDTO getDefaultContent() {
return defaultContent;
}
@@ -142,7 +142,7 @@
return result;
}
- public void setDefaultContent(final ContentDTO defaultContent) {
+ public void setDefaultContent(final ContentSimpleDTO defaultContent) {
this.defaultContent = defaultContent;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentService.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -24,7 +24,7 @@
import java.util.List;
import org.ourproject.kune.platf.client.dto.CommentDTO;
-import org.ourproject.kune.platf.client.dto.ContentDTO;
+import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
@@ -67,7 +67,7 @@
Integer save(String user, StateToken token, String content) throws DefaultException;
- ContentDTO setAsDefaultContent(String userHash, StateToken token);
+ ContentSimpleDTO setAsDefaultContent(String userHash, StateToken token);
I18nLanguageDTO setLanguage(String userHash, StateToken token, String languageCode) throws DefaultException;
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/rpc/ContentServiceAsync.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -24,7 +24,7 @@
import java.util.List;
import org.ourproject.kune.platf.client.dto.CommentDTO;
-import org.ourproject.kune.platf.client.dto.ContentDTO;
+import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
@@ -66,7 +66,7 @@
void save(String user, StateToken token, String content, AsyncCallback<Integer> asyncCallback);
- void setAsDefaultContent(String userHash, StateToken token, AsyncCallback<ContentDTO> asyncCallback);
+ void setAsDefaultContent(String userHash, StateToken token, AsyncCallback<ContentSimpleDTO> asyncCallback);
void setLanguage(String userHash, StateToken token, String languageCode,
AsyncCallback<I18nLanguageDTO> asyncCallback);
Modified: trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneCoreModule.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneCoreModule.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/client/services/KuneCoreModule.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -9,7 +9,7 @@
@Override
public void onLoad() {
- registerDecorator(ApplicationComponentGroup.class, new ApplicationComponentGroup());
- registerDecorator(ToolGroup.class, new ToolGroup());
+ registerDecorator(ApplicationComponentGroup.class, new ApplicationComponentGroup(container));
+ registerDecorator(ToolGroup.class, new ToolGroup(container));
}
}
Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/emite-room.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/emite-room.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/java/org/ourproject/kune/platf/public/images/new-chat.gif
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/java/org/ourproject/kune/platf/public/images/new-chat.gif
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/domain/Content.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -122,6 +122,11 @@
@Embedded
private BasicMimeType mimeType;
+ /**
+ * filename if is an uploaded content
+ */
+ private String filename;
+
public Content() {
translations = new ArrayList<ContentTranslation>();
authors = new ArrayList<User>();
@@ -179,6 +184,10 @@
return deletedOn;
}
+ public String getFilename() {
+ return filename;
+ }
+
public Long getId() {
return id;
}
@@ -285,6 +294,10 @@
this.deletedOn = date;
}
+ public void setFilename(final String filename) {
+ this.filename = filename;
+ }
+
public void setId(final Long id) {
this.id = id;
}
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileDownloadManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileDownloadManager.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileDownloadManager.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -68,7 +68,7 @@
final Content cnt = getContentForDownload(userHash, stateToken);
final String absDir = kuneProperties.get(KuneProperties.UPLOAD_LOCATION) + FileUtils.toDir(stateToken);
- final String filename = new String(cnt.getLastRevision().getBody());
+ final String filename = cnt.getFilename();
final String absFilename = absDir + filename;
doBuildResp(resp, absFilename, cnt.getTitle(), cnt.getMimeType(), FileUtils
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUploadManager.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUploadManager.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUploadManager.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -148,10 +148,12 @@
final User user = userSession.getUser();
final Container container = accessService.accessToContainer(ContentUtils.parseId(stateToken.getFolder()),
user, AccessRol.Editor);
+ final String preview = "Preview of this file (in development)";
final Content content = contentManager.createContent(FileUtils.getFileNameWithoutExtension(file.getName(),
- extension), filenameUTF8, user, container);
+ extension), preview, user, container);
content.setTypeId(DocumentServerTool.TYPE_UPLOADEDFILE);
content.setMimeType(new BasicMimeType(mimetype));
+ content.setFilename(filenameUTF8);
return content;
} catch (final Exception e) {
if (file != null && file.exists()) {
Modified: trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUtils.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUtils.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/manager/impl/FileUtils.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -12,20 +12,23 @@
* For filename extension info see:
* http://en.wikipedia.org/wiki/File_name_extension
*
- * @param fileName
+ * @param filename
* @return
*/
- public static String getFileNameExtension(final String fileName, final boolean withDot) {
+ public static String getFileNameExtension(final String filename, final boolean withDot) {
// also we can use FilenameUtils
- final int dotIndex = fileName.lastIndexOf(".");
+ if (filename == null) {
+ return "";
+ }
+ final int dotIndex = filename.lastIndexOf(".");
if (dotIndex == -1 || dotIndex == 0) {
return "";
} else {
if (withDot) {
- final String ext = fileName.substring(dotIndex);
+ final String ext = filename.substring(dotIndex);
return ext.length() == 1 ? "" : ext;
} else {
- return fileName.substring(dotIndex + 1);
+ return filename.substring(dotIndex + 1);
}
}
}
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-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/platf/server/rpc/ContentRPC.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -30,7 +30,7 @@
import org.ourproject.kune.chat.server.managers.XmppManager;
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.CommentDTO;
-import org.ourproject.kune.platf.client.dto.ContentDTO;
+import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.I18nLanguageDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
@@ -337,10 +337,10 @@
@Authenticated
@Authorizated(accessRolRequired = AccessRol.Administrator)
@Transactional(type = TransactionType.READ_WRITE)
- public ContentDTO setAsDefaultContent(final String userHash, final StateToken token) {
+ public ContentSimpleDTO setAsDefaultContent(final String userHash, final StateToken token) {
final Content content = contentManager.find(ContentUtils.parseId(token.getDocument()));
groupManager.setDefaultContent(token.getGroup(), content);
- return mapper.map(content, ContentDTO.class);
+ return mapper.map(content, ContentSimpleDTO.class);
}
@Authenticated
@@ -446,7 +446,7 @@
return userSessionProvider.get();
}
- private void mapContentRightsInstate(final User user, final AccessLists groupAccessList, final ContentDTO siblingDTO) {
+ private void mapContentRightsInstate(final User user, final AccessLists groupAccessList, final ContentSimpleDTO siblingDTO) {
final Content sibling = contentManager.find(siblingDTO.getId());
final AccessLists lists = sibling.hasAccessList() ? sibling.getAccessLists() : groupAccessList;
siblingDTO.setRights(mapper.map(rightsService.get(user, lists), AccessRightsDTO.class));
@@ -455,10 +455,10 @@
private StateDTO mapState(final State state, final User user, final Group group) {
final StateDTO stateDTO = mapper.map(state, StateDTO.class);
final AccessLists groupAccessList = group.getSocialNetwork().getAccessLists();
- for (final ContentDTO siblingDTO : stateDTO.getRootContainer().getContents()) {
+ for (final ContentSimpleDTO siblingDTO : stateDTO.getRootContainer().getContents()) {
mapContentRightsInstate(user, groupAccessList, siblingDTO);
}
- for (final ContentDTO siblingDTO : stateDTO.getContainer().getContents()) {
+ for (final ContentSimpleDTO siblingDTO : stateDTO.getContainer().getContents()) {
mapContentRightsInstate(user, groupAccessList, siblingDTO);
}
return stateDTO;
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/ctxnav/ContextNavigatorPresenter.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -34,7 +34,7 @@
import org.ourproject.kune.platf.client.dto.BasicMimeTypeDTO;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
import org.ourproject.kune.platf.client.dto.ContainerSimpleDTO;
-import org.ourproject.kune.platf.client.dto.ContentDTO;
+import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.ContentStatusDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
@@ -232,6 +232,7 @@
selectItem(stateToken);
}
}
+ toolbar.attach();
}
protected void clear() {
@@ -258,7 +259,7 @@
}
private void createChildItems(final ContainerDTO container, final AccessRightsDTO containerRights) {
- for (final ContentDTO content : container.getContents()) {
+ for (final ContentSimpleDTO content : container.getContents()) {
addItem(content.getTitle(), content.getTypeId(), content.getMimeType(), content.getStatus(), content
.getStateToken(), content.getStateToken().clone().clearDocument(), content.getRights(), false);
}
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/licensefoot/EntityLicensePanel.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -21,7 +21,7 @@
import org.ourproject.kune.platf.client.dto.LicenseDTO;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.skel.TitleBar;
+import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.Window;
@@ -42,7 +42,7 @@
copyright = new Label();
image = new Image();
license = new Label();
- final TitleBar bottomTitle = ws.getEntityWorkspace().getBottomTitle();
+ final SimpleToolbar bottomTitle = ws.getEntityWorkspace().getBottomTitle();
bottomTitle.add(copyright);
bottomTitle.add(license);
bottomTitle.addSpacer();
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/EntityWorkspace.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -17,9 +17,9 @@
private static final String ENTITY_CONTEXT = "k-entity-context";
private final Panel content;
private final Panel context;
- private final TitleBar title;
- private final TitleBar subTitle;
- private final TitleBar bottom;
+ private final SimpleToolbar title;
+ private final SimpleToolbar subTitle;
+ private final SimpleToolbar bottom;
private final Toolbar contentTopBar;
private final Toolbar contentBottomBar;
private final Toolbar contextTopBar;
@@ -36,14 +36,14 @@
bottomPanel.setBorder(false);
bottomPanel.setLayout(new AnchorLayout());
- title = new TitleBar();
+ title = new SimpleToolbar();
title.setHeight("" + (DEF_TOOLBAR_HEIGHT - 2));
title.setStylePrimaryName(ENTITY_TITLE);
title.ensureDebugId(ENTITY_TITLE);
- subTitle = new TitleBar();
+ subTitle = new SimpleToolbar();
subTitle.setStylePrimaryName(ENTITY_SUBTITLE);
subTitle.ensureDebugId(ENTITY_SUBTITLE);
- bottom = new TitleBar();
+ bottom = new SimpleToolbar();
bottom.setHeight("" + (DEF_TOOLBAR_HEIGHT - 2));
bottom.setStylePrimaryName(ENTITY_BOTTOM);
bottom.ensureDebugId(ENTITY_BOTTOM);
@@ -91,7 +91,7 @@
add(bottomPanel, DefaultBorderLayout.Position.SOUTH, DEF_TOOLBAR_HEIGHT + 2);
}
- public TitleBar getBottomTitle() {
+ public SimpleToolbar getBottomTitle() {
return bottom;
}
@@ -111,11 +111,11 @@
return contextTopBar;
}
- public TitleBar getSubTitle() {
+ public SimpleToolbar getSubTitle() {
return subTitle;
}
- public TitleBar getTitle() {
+ public SimpleToolbar getTitle() {
return title;
}
Copied: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java (from rev 878, trunk/src/main/java/org/ourproject/kune/workspace/client/skel/TitleBar.java)
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/TitleBar.java 2008-09-22 11:53:01 UTC (rev 878)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SimpleToolbar.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -0,0 +1,52 @@
+package org.ourproject.kune.workspace.client.skel;
+
+import com.google.gwt.user.client.ui.Composite;
+import com.google.gwt.user.client.ui.HorizontalPanel;
+import com.google.gwt.user.client.ui.Label;
+import com.google.gwt.user.client.ui.VerticalPanel;
+import com.google.gwt.user.client.ui.Widget;
+
+public class SimpleToolbar extends Composite {
+
+ private final HorizontalPanel childPanel;
+ private final HorizontalPanel mainPanel;
+
+ public SimpleToolbar() {
+ mainPanel = new HorizontalPanel();
+ childPanel = new HorizontalPanel();
+ mainPanel.add(childPanel);
+ initWidget(mainPanel);
+ mainPanel.setWidth("100%");
+ }
+
+ public void add(final Widget widget) {
+ childPanel.add(widget);
+ childPanel.setCellVerticalAlignment(widget, VerticalPanel.ALIGN_MIDDLE);
+ }
+
+ public Widget addFill() {
+ final Label emptyLabel = new Label("");
+ this.add(emptyLabel);
+ childPanel.setCellWidth(emptyLabel, "100%");
+ return emptyLabel;
+ }
+
+ public Widget addSeparator() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-sep");
+ emptyLabel.addStyleName("k-toolbar-sep");
+ this.add(emptyLabel);
+ return emptyLabel;
+ }
+
+ public Widget addSpacer() {
+ final Label emptyLabel = new Label("");
+ emptyLabel.setStyleName("ytb-spacer");
+ this.add(emptyLabel);
+ return emptyLabel;
+ }
+
+ public void removeAll() {
+ childPanel.clear();
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SiteBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SiteBar.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/SiteBar.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -5,29 +5,29 @@
public class SiteBar extends Panel {
- private final TitleBar titleBar;
+ private final SimpleToolbar simpleToolbar;
public SiteBar() {
super.setBorder(false);
- titleBar = new TitleBar();
- titleBar.setStyleName("k-sitebar");
- super.add(titleBar);
+ simpleToolbar = new SimpleToolbar();
+ simpleToolbar.setStyleName("k-sitebar");
+ super.add(simpleToolbar);
}
public void add(final Widget widget) {
- titleBar.add(widget);
+ simpleToolbar.add(widget);
}
public Widget addFill() {
- return titleBar.addFill();
+ return simpleToolbar.addFill();
}
public Widget addSeparator() {
- return titleBar.addSeparator();
+ return simpleToolbar.addSeparator();
}
public Widget addSpacer() {
- return titleBar.addSpacer();
+ return simpleToolbar.addSpacer();
}
}
Deleted: trunk/src/main/java/org/ourproject/kune/workspace/client/skel/TitleBar.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/skel/TitleBar.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/skel/TitleBar.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -1,48 +0,0 @@
-package org.ourproject.kune.workspace.client.skel;
-
-import com.google.gwt.user.client.ui.Composite;
-import com.google.gwt.user.client.ui.HorizontalPanel;
-import com.google.gwt.user.client.ui.Label;
-import com.google.gwt.user.client.ui.VerticalPanel;
-import com.google.gwt.user.client.ui.Widget;
-
-public class TitleBar extends Composite {
-
- private final HorizontalPanel childPanel;
- private final HorizontalPanel mainPanel;
-
- public TitleBar() {
- mainPanel = new HorizontalPanel();
- childPanel = new HorizontalPanel();
- mainPanel.add(childPanel);
- initWidget(mainPanel);
- mainPanel.setWidth("100%");
- }
-
- public void add(final Widget widget) {
- childPanel.add(widget);
- childPanel.setCellVerticalAlignment(widget, VerticalPanel.ALIGN_MIDDLE);
- }
-
- public Widget addFill() {
- final Label emptyLabel = new Label("");
- this.add(emptyLabel);
- childPanel.setCellWidth(emptyLabel, "100%");
- return emptyLabel;
- }
-
- public Widget addSeparator() {
- final Label emptyLabel = new Label("");
- emptyLabel.setStyleName("ytb-sep");
- emptyLabel.addStyleName("k-toolbar-sep");
- this.add(emptyLabel);
- return emptyLabel;
- }
-
- public Widget addSpacer() {
- final Label emptyLabel = new Label("");
- emptyLabel.setStyleName("ytb-spacer");
- this.add(emptyLabel);
- return emptyLabel;
- }
-}
\ No newline at end of file
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePanel.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntitySubTitlePanel.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -21,7 +21,7 @@
package org.ourproject.kune.workspace.client.title;
import org.ourproject.kune.platf.client.services.I18nTranslationService;
-import org.ourproject.kune.workspace.client.skel.TitleBar;
+import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.Label;
@@ -35,7 +35,7 @@
subTitleLeftLabel = new Label();
subTitleRightLabel = new Label();
- final TitleBar wsSubTitle = ws.getEntityWorkspace().getSubTitle();
+ final SimpleToolbar wsSubTitle = ws.getEntityWorkspace().getSubTitle();
wsSubTitle.add(subTitleLeftLabel);
wsSubTitle.addFill();
wsSubTitle.add(subTitleRightLabel);
Modified: trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java
===================================================================
--- trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/java/org/ourproject/kune/workspace/client/title/EntityTitlePanel.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -22,7 +22,7 @@
import org.ourproject.kune.platf.client.ui.EditableClickListener;
import org.ourproject.kune.platf.client.ui.EditableIconLabel;
-import org.ourproject.kune.workspace.client.skel.TitleBar;
+import org.ourproject.kune.workspace.client.skel.SimpleToolbar;
import org.ourproject.kune.workspace.client.skel.WorkspaceSkeleton;
import com.google.gwt.user.client.ui.Image;
@@ -42,7 +42,7 @@
});
dateLabel = new Label();
- final TitleBar wsTitle = ws.getEntityWorkspace().getTitle();
+ final SimpleToolbar wsTitle = ws.getEntityWorkspace().getTitle();
wsTitle.add(icon);
wsTitle.add(titleLabel);
wsTitle.addFill();
Modified: trunk/src/main/resources/dozerBeanMapping.xml
===================================================================
--- trunk/src/main/resources/dozerBeanMapping.xml 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/main/resources/dozerBeanMapping.xml 2008-09-27 20:03:56 UTC (rev 890)
@@ -193,7 +193,7 @@
<mapping>
<class-a>
- org.ourproject.kune.platf.client.dto.ContentDTO
+ org.ourproject.kune.platf.client.dto.ContentSimpleDTO
</class-a>
<class-b>
org.ourproject.kune.platf.server.domain.Content
@@ -238,7 +238,7 @@
<a>contents</a>
<b>contents</b>
<a-hint>
- org.ourproject.kune.platf.client.dto.ContentDTO
+ org.ourproject.kune.platf.client.dto.ContentSimpleDTO
</a-hint>
<b-hint>
org.ourproject.kune.platf.server.domain.Content
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceAddTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceAddTest.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceAddTest.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -11,7 +11,7 @@
import org.ourproject.kune.platf.client.dto.AccessRightsDTO;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
import org.ourproject.kune.platf.client.dto.ContainerSimpleDTO;
-import org.ourproject.kune.platf.client.dto.ContentDTO;
+import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.errors.ContentNotFoundException;
@@ -48,7 +48,7 @@
final StateDTO added = contentService.addContent(session.getHash(), defaultContent.getContainer()
.getStateToken(), title);
assertNotNull(added);
- final List<ContentDTO> contents = added.getContainer().getContents();
+ final List<ContentSimpleDTO> contents = added.getContainer().getContents();
assertEquals(title, added.getTitle());
assertEquals(2, contents.size());
assertEquals(cntRights, added.getContentRights());
Modified: trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/test/java/org/ourproject/kune/platf/integration/content/ContentServiceVariousTest.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -10,7 +10,7 @@
import org.junit.Test;
import org.ourproject.kune.docs.client.DocumentClientTool;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
-import org.ourproject.kune.platf.client.dto.ContentDTO;
+import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.StateDTO;
import org.ourproject.kune.platf.client.dto.StateToken;
import org.ourproject.kune.platf.client.dto.TagResultDTO;
@@ -173,7 +173,7 @@
"New Content Title");
assertNotNull(added);
- final ContentDTO newDefContent = contentService.setAsDefaultContent(session.getHash(), added.getStateToken());
+ final ContentSimpleDTO newDefContent = contentService.setAsDefaultContent(session.getHash(), added.getStateToken());
assertTrue(!defaultContent.getStateToken().equals(newDefContent.getStateToken()));
assertTrue(added.getStateToken().equals(newDefContent.getStateToken()));
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/FileUtilsTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/FileUtilsTest.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/manager/impl/FileUtilsTest.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -60,6 +60,11 @@
}
@Test
+ public void testGetFilenameExtNull() {
+ assertEquals("", FileUtils.getFileNameExtension(null, true));
+ }
+
+ @Test
public void testIfSeq101return102() {
assertEquals(SIMPLE_FILE_NAME + " 102", FileUtils.getNextSequentialFileName(SIMPLE_FILE_NAME + " 101"));
}
Modified: trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java
===================================================================
--- trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java 2008-09-27 13:01:41 UTC (rev 889)
+++ trunk/src/test/java/org/ourproject/kune/platf/server/mapper/MapperTest.java 2008-09-27 20:03:56 UTC (rev 890)
@@ -13,7 +13,7 @@
import org.ourproject.kune.platf.client.dto.CommentDTO;
import org.ourproject.kune.platf.client.dto.ContainerDTO;
import org.ourproject.kune.platf.client.dto.ContainerSimpleDTO;
-import org.ourproject.kune.platf.client.dto.ContentDTO;
+import org.ourproject.kune.platf.client.dto.ContentSimpleDTO;
import org.ourproject.kune.platf.client.dto.GroupDTO;
import org.ourproject.kune.platf.client.dto.GroupListDTO;
import org.ourproject.kune.platf.client.dto.LicenseDTO;
@@ -92,7 +92,7 @@
final StateToken expectedToken = new StateToken(TESTGROUPSHORTNAME, TESTTOOL, "1", "1");
assertEquals(expectedToken, d.getStateToken());
- final ContentDTO dto = mapper.map(d, ContentDTO.class);
+ final ContentSimpleDTO dto = mapper.map(d, ContentSimpleDTO.class);
assertEquals(1, (long) dto.getId());
assertEquals("title", dto.getTitle());
assertEquals(expectedToken, dto.getStateToken());
@@ -151,7 +151,7 @@
final ContainerDTO dto = mapper.map(container, ContainerDTO.class);
assertEquals(3, dto.getChilds().size());
assertEquals(3, dto.getContents().size());
- assertTrue(dto.getContents().get(0) instanceof ContentDTO);
+ assertTrue(dto.getContents().get(0) instanceof ContentSimpleDTO);
assertTrue(dto.getChilds().get(0) instanceof ContainerSimpleDTO);
assertEquals(new StateToken(TESTGROUPSHORTNAME, TESTTOOL), dto.getChilds().get(0).getStateToken().clone()
.clearFolder());
@@ -212,8 +212,8 @@
public void testMimeMapping() {
final Content d = createDefContent();
d.setMimeType(new BasicMimeType("application/pdf"));
- final ContentDTO contentDTO = mapper.map(d, ContentDTO.class);
- assertEquals("application/pdf", contentDTO.getMimeType().toString());
+ final ContentSimpleDTO contentSimpleDTO = mapper.map(d, ContentSimpleDTO.class);
+ assertEquals("application/pdf", contentSimpleDTO.getMimeType().toString());
}
@Test
More information about the kune-commits
mailing list