[kune-commits] r1771 - in trunk: img/icons/custom-iconic src/main/java/cc/kune src/main/java/cc/kune/barters src/main/java/cc/kune/barters/client src/main/java/cc/kune/blogs src/main/java/cc/kune/blogs/client src/main/java/cc/kune/chat/client src/main/java/cc/kune/chat/client/actions src/main/java/cc/kune/client src/main/java/cc/kune/common/client/resources src/main/java/cc/kune/core/client/rpcservices src/main/java/cc/kune/core/server/content src/main/java/cc/kune/core/server/rpc src/main/java/cc/kune/core/server/tool src/main/java/cc/kune/docs src/main/java/cc/kune/docs/client src/main/java/cc/kune/events src/main/java/cc/kune/events/client src/main/java/cc/kune/events/client/actions src/main/java/cc/kune/gspace/client/actions src/main/java/cc/kune/gspace/client/tool src/main/java/cc/kune/gspace/client/tool/selector src/main/java/cc/kune/gspace/client/viewers src/main/java/cc/kune/lists/client src/main/java/cc/kune/tasks src/main/java/cc/kune/tasks/client src/main/java/cc/kune/trash src/main/java/cc/kune/trash/client src/main/java/cc/kune/trash/client/actions src/main/java/cc/kune/trash/server src/main/java/cc/kune/trash/shared src/main/java/cc/kune/wave/server/kspecific src/main/java/cc/kune/wiki src/main/java/cc/kune/wiki/client src/main/resources/icons
Vicente J. Ruiz Jurado
vjrj_ at ourproject.org
Sun Mar 18 23:25:32 CET 2012
Author: vjrj_
Date: 2012-03-18 23:25:32 +0100 (Sun, 18 Mar 2012)
New Revision: 1771
Added:
trunk/src/main/java/cc/kune/trash/KuneTrash.gwt.xml
trunk/src/main/java/cc/kune/trash/client/
trunk/src/main/java/cc/kune/trash/client/TrashClientTool.java
trunk/src/main/java/cc/kune/trash/client/TrashGinModule.java
trunk/src/main/java/cc/kune/trash/client/TrashGinjector.java
trunk/src/main/java/cc/kune/trash/client/TrashParts.java
trunk/src/main/java/cc/kune/trash/client/actions/
trunk/src/main/java/cc/kune/trash/client/actions/TrashClientActions.java
trunk/src/main/resources/icons/trash-black.png
trunk/src/main/resources/icons/trash-white.png
Modified:
trunk/img/icons/custom-iconic/trash.svg
trunk/src/main/java/cc/kune/Kune.gwt.xml
trunk/src/main/java/cc/kune/barters/KuneBarters.gwt.xml
trunk/src/main/java/cc/kune/barters/client/BartersClientTool.java
trunk/src/main/java/cc/kune/blogs/KuneBlogs.gwt.xml
trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java
trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java
trunk/src/main/java/cc/kune/chat/client/actions/ChatSitebarActions.java
trunk/src/main/java/cc/kune/client/KuneEntryPoint.java
trunk/src/main/java/cc/kune/client/KuneGinjector.java
trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java
trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceHelper.java
trunk/src/main/java/cc/kune/core/server/content/CreationService.java
trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java
trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
trunk/src/main/java/cc/kune/core/server/tool/ServerToolRegistry.java
trunk/src/main/java/cc/kune/docs/KuneDocs.gwt.xml
trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java
trunk/src/main/java/cc/kune/events/KuneEvents.gwt.xml
trunk/src/main/java/cc/kune/events/client/EventsClientTool.java
trunk/src/main/java/cc/kune/events/client/actions/EventRemoveMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/actions/DelContentMenuItem.java
trunk/src/main/java/cc/kune/gspace/client/tool/AbstractClientTool.java
trunk/src/main/java/cc/kune/gspace/client/tool/FoldableAbstractClientTool.java
trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItem.java
trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPresenter.java
trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java
trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java
trunk/src/main/java/cc/kune/lists/client/ListsClientTool.java
trunk/src/main/java/cc/kune/tasks/KuneTasks.gwt.xml
trunk/src/main/java/cc/kune/tasks/client/TasksClientTool.java
trunk/src/main/java/cc/kune/trash/server/TrashServerTool.java
trunk/src/main/java/cc/kune/trash/shared/TrashToolConstants.java
trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveServiceDefault.java
trunk/src/main/java/cc/kune/wiki/KuneWiki.gwt.xml
trunk/src/main/java/cc/kune/wiki/client/WikiClientTool.java
Log:
NEW - # 222: Create a trash folder icon and improve contents delete functionality
http://kune.ourproject.org/issues/ticket/222
Modified: trunk/img/icons/custom-iconic/trash.svg
===================================================================
--- trunk/img/icons/custom-iconic/trash.svg 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/img/icons/custom-iconic/trash.svg 2012-03-18 22:25:32 UTC (rev 1771)
@@ -62,7 +62,10 @@
d="M 1,0 C 0.44600003,0 0,0.446 0,1 l 0,2 c 0,0.554 0.44600003,1 1,1 1.3041959,0 1.6744253,0 3,0 l 0,22 c 0,3.312 2.688,6 6,6 l 12,0 c 3.312,0 6,-2.688 6,-6 l 0,-22 2,0 1,0 c 0.554,0 1,-0.446 1,-1 L 32,1 C 32,0.446 31.554,0 31,0 L 30,0 26,0 C 24.589979,0 24,0.5207576 24,2.03125 L 24,26 c 0,1.102 -0.898,2 -2,2 L 10,28 C 8.898,28 8,27.102 8,26 8.00153,18.235176 8.00126,7.8861416 8,1 8,0.43960056 7.5213789,0 7,0 5.3333333,0 2.6666667,0 1,0 z"
id="rect3871"
inkscape:connector-curvature="0"
- sodipodi:nodetypes="cssccssssccsssscssssscccc" />
+ sodipodi:nodetypes="cssccssssccsssscssssscccc"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/resources/icons/trash-black.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45" />
<rect
style="color:#000000;fill:#231f20;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect3086"
@@ -71,7 +74,10 @@
x="10"
y="4"
ry="0.99999994"
- rx="1" /><rect
+ rx="1"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/resources/icons/trash-black.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45" /><rect
style="color:#000000;fill:#231f20;fill-opacity:1;fill-rule:evenodd;stroke:none;stroke-width:1;marker:none;visibility:visible;display:inline;overflow:visible;enable-background:accumulate"
id="rect3860"
width="4"
@@ -79,4 +85,7 @@
x="18"
y="4"
ry="0.99999994"
- rx="1" /></svg>
\ No newline at end of file
+ rx="1"
+ inkscape:export-filename="/home/vjrj/proyectos/dev/kune/trunk/src/main/resources/icons/trash-black.png"
+ inkscape:export-xdpi="45"
+ inkscape:export-ydpi="45" /></svg>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/Kune.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/Kune.gwt.xml 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/Kune.gwt.xml 2012-03-18 22:25:32 UTC (rev 1771)
@@ -14,6 +14,7 @@
<inherits name="cc.kune.events.KuneEvents" />
<inherits name="cc.kune.tasks.KuneTasks" />
<inherits name="cc.kune.lists.KuneLists" />
+ <inherits name="cc.kune.trash.KuneTrash" />
<inherits name="cc.kune.pspace.PSpace" />
<inherits name="cc.kune.hspace.HSpace" />
<inherits name="com.calclab.suco.Suco" />
Modified: trunk/src/main/java/cc/kune/barters/KuneBarters.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/barters/KuneBarters.gwt.xml 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/barters/KuneBarters.gwt.xml 2012-03-18 22:25:32 UTC (rev 1771)
@@ -1,6 +1,6 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/src/gwt-module.dtd">
-<module>
- <inherits name="cc.kune.core.KuneCore" />
- <source path="client" />
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/src/gwt-module.dtd">
+<module>
+ <inherits name="cc.kune.core.KuneCore" />
+ <source path="client" />
<source path="shared" />
</module>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/barters/client/BartersClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/barters/client/BartersClientTool.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/barters/client/BartersClientTool.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -27,6 +27,7 @@
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.client.resources.iconic.IconicResources;
import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.gspace.client.tool.FoldableAbstractClientTool;
import cc.kune.gspace.client.tool.selector.ToolSelector;
@@ -45,7 +46,7 @@
NAME,
i18n.t("barters"),
i18n.t("A decentralized way to offer (or ask for) services and goods to your groups or to anyone. Bartering means the exchange of goods by the agreement of two people"),
- icons.barters(), toolSelector, cntCapRegistry, i18n, navResources);
+ icons.barters(), AccessRolDTO.Viewer, toolSelector, cntCapRegistry, i18n, navResources);
this.icons = icons;
// registerAclEditableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
Modified: trunk/src/main/java/cc/kune/blogs/KuneBlogs.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/blogs/KuneBlogs.gwt.xml 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/blogs/KuneBlogs.gwt.xml 2012-03-18 22:25:32 UTC (rev 1771)
@@ -1,6 +1,6 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/src/gwt-module.dtd">
-<module>
- <inherits name="cc.kune.core.KuneCore" />
- <source path="client" />
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/src/gwt-module.dtd">
+<module>
+ <inherits name="cc.kune.core.KuneCore" />
+ <source path="client" />
<source path="shared" />
</module>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/blogs/client/BlogsClientTool.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -29,6 +29,7 @@
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.client.resources.iconic.IconicResources;
import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.gspace.client.tool.FoldableAbstractClientTool;
import cc.kune.gspace.client.tool.selector.ToolSelector;
@@ -46,7 +47,7 @@
NAME,
i18n.t(BlogsToolConstants.ROOT_NAME),
i18n.t("Blogs are a chronological list of posts (ordered by date) about a specific topic. Each post can be commented by the visitors"),
- icons.blogs(), toolSelector, cntCapRegistry, i18n, navResources);
+ icons.blogs(), AccessRolDTO.Viewer, toolSelector, cntCapRegistry, i18n, navResources);
this.icons = icons;
// registerAclEditableTypes();
Modified: trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/chat/client/ChatClientTool.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -28,6 +28,7 @@
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.client.resources.iconic.IconicResources;
import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.gspace.client.tool.FoldableAbstractClientTool;
import cc.kune.gspace.client.tool.selector.ToolSelector;
@@ -48,7 +49,8 @@
i18n.t("chatrooms"),
i18n.t(
"A 'room' where you can have a group-chat with many users at once. Rooms can be public or private. Users can be from [%s] or other sites (compatible with gmail chat)",
- i18n.getSiteCommonName()), icons.chats(), toolSelector, cntCapRegistry, i18n, navResources);
+ i18n.getSiteCommonName()), icons.chats(), AccessRolDTO.Viewer, toolSelector, cntCapRegistry,
+ i18n, navResources);
this.res = res;
this.icons = icons;
registerIcons();
Modified: trunk/src/main/java/cc/kune/chat/client/actions/ChatSitebarActions.java
===================================================================
--- trunk/src/main/java/cc/kune/chat/client/actions/ChatSitebarActions.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/chat/client/actions/ChatSitebarActions.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -220,7 +220,7 @@
public void run() {
ChatSitebarActions.this.chatClient.loginIfNecessary();
}
- }.schedule(2000);
+ }.schedule(4000);
break;
case DISCONNECTED:
case RECONNECTING:
Modified: trunk/src/main/java/cc/kune/client/KuneEntryPoint.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneEntryPoint.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/client/KuneEntryPoint.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -87,6 +87,7 @@
ginjector.getListsParts();
ginjector.getChatParts();
ginjector.getBartersParts();
+ ginjector.getTrashParts();
ginjector.getSiteLogo();
ginjector.getChatClient();
Modified: trunk/src/main/java/cc/kune/client/KuneGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/client/KuneGinjector.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/client/KuneGinjector.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -69,6 +69,8 @@
import cc.kune.pspace.client.PSpacePresenter;
import cc.kune.tasks.client.TasksGinModule;
import cc.kune.tasks.client.TasksGinjector;
+import cc.kune.trash.client.TrashGinModule;
+import cc.kune.trash.client.TrashGinjector;
import cc.kune.wave.client.WaveGinModule;
import cc.kune.wave.client.WaveParts;
import cc.kune.wiki.client.WikiGinModule;
@@ -84,9 +86,10 @@
@GinModules({ KuneGinModule.class, CoreGinModule.class, WaveGinModule.class, PSpaceGinModule.class,
HSpaceGinModule.class, GSpaceGinModule.class, DocsGinModule.class, BlogsGinModule.class,
ChatGinModule.class, WikiGinModule.class, BartersGinModule.class, EventsGinModule.class,
- TasksGinModule.class, ListsGinModule.class })
+ TasksGinModule.class, ListsGinModule.class, TrashGinModule.class })
public interface KuneGinjector extends Ginjector, GSpaceGinjector, DocsGinjector, BlogsGinjector,
- WikiGinjector, BartersGinjector, EventsGinjector, ChatGinjector, TasksGinjector, ListsGinjector {
+ WikiGinjector, BartersGinjector, EventsGinjector, ChatGinjector, TasksGinjector, ListsGinjector,
+ TrashGinjector {
/*
* You have to add here all the GWTPresenters (as Provider or AsyncProvider)
Modified: trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java
===================================================================
--- trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/common/client/resources/CommonResources.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -131,4 +131,10 @@
@Source("icons/world-16.png")
ImageResource world16();
+
+ @Source("icons/trash-black.png")
+ ImageResource trashBlack();
+
+ @Source("icons/trash-white.png")
+ ImageResource trashWhite();
}
Modified: trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceHelper.java
===================================================================
--- trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceHelper.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/core/client/rpcservices/ContentServiceHelper.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -1,11 +1,16 @@
package cc.kune.core.client.rpcservices;
+import cc.kune.common.client.notify.ConfirmAskEvent;
import cc.kune.common.client.notify.NotifyUser;
+import cc.kune.common.client.utils.OnAcceptCallback;
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.SocialNetworkSubGroup;
+import cc.kune.core.shared.dto.StateContainerDTO;
+import com.google.gwt.event.shared.EventBus;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.inject.Inject;
import com.google.inject.Provider;
@@ -13,15 +18,20 @@
public class ContentServiceHelper {
private final Provider<ContentServiceAsync> contentService;
+ private final EventBus eventBus;
private final I18nTranslationService i18n;
private final Session session;
+ private final StateManager stateManager;
@Inject
public ContentServiceHelper(final Session session, final I18nTranslationService i18n,
- final Provider<ContentServiceAsync> contentService) {
+ final EventBus eventBus, final Provider<ContentServiceAsync> contentService,
+ final StateManager stateManager) {
this.session = session;
this.i18n = i18n;
+ this.eventBus = eventBus;
this.contentService = contentService;
+ this.stateManager = stateManager;
}
public void addParticipants(final StateToken token, final SocialNetworkSubGroup subGroup) {
@@ -40,4 +50,27 @@
}
});
}
+
+ public void delContent(final StateToken token) {
+ ConfirmAskEvent.fire(eventBus, i18n.t("Please confirm"), i18n.t("Are you sure?"), i18n.t("Yes"),
+ i18n.t("No"), null, null, new OnAcceptCallback() {
+ @Override
+ public void onSuccess() {
+ NotifyUser.showProgress();
+ contentService.get().delContent(session.getUserHash(), token,
+ new AsyncCallbackSimple<StateContainerDTO>() {
+ @Override
+ public void onSuccess(final StateContainerDTO state) {
+ final StateToken parentToken = state.getStateToken();
+ if (session.getCurrentStateToken().equals(parentToken)) {
+ stateManager.setRetrievedStateAndGo(state);
+ } else {
+ stateManager.gotoStateToken(parentToken, false);
+ }
+ NotifyUser.hideProgress();
+ }
+ });
+ }
+ });
+ }
}
Modified: trunk/src/main/java/cc/kune/core/server/content/CreationService.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/CreationService.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/core/server/content/CreationService.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -27,6 +27,8 @@
public interface CreationService {
+ Content copyContent(User user, Container container, Content contentToCopy);
+
Content createContent(String title, String body, User user, Container container, String typeId);
Container createFolder(Group group, Long parentFolderId, String name, I18nLanguage language,
Modified: trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/core/server/content/CreationServiceDefault.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -51,10 +51,17 @@
}
@Override
+ public Content copyContent(final User user, final Container container, final Content contentToCopy) {
+ final ServerTool tool = tools.get(container.getToolName());
+ final Content content = contentManager.copyContent(user, container, contentToCopy);
+ tool.onCreateContent(content, container);
+ return content;
+ }
+
+ @Override
public Content createContent(final String title, final String body, final User user,
final Container container, final String typeId) {
- final String toolName = container.getToolName();
- final ServerTool tool = tools.get(toolName);
+ final ServerTool tool = tools.get(container.getToolName());
tool.checkTypesBeforeContentCreation(container.getTypeId(), typeId);
final URL gagdetUrl = tool instanceof ServerWaveTool ? ((ServerWaveTool) tool).getGadgetUrl()
: KuneWaveService.WITHOUT_GADGET;
Modified: trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/core/server/rpc/ContentRPC.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -225,7 +225,7 @@
final Content contentToCopy = finderService.getContent(ContentUtils.parseId(token.getDocument()));
final Container container = finderService.getContainer(ContentUtils.parseId(parentToken.getFolder()));
if (rightsService.get(user, contentToCopy.getAccessLists()).isVisible()) {
- return mapper.map(contentManager.copyContent(user, container, contentToCopy),
+ return mapper.map(creationService.copyContent(user, container, contentToCopy),
StateContentDTO.class);
} else {
throw new AccessViolationException();
Modified: trunk/src/main/java/cc/kune/core/server/tool/ServerToolRegistry.java
===================================================================
--- trunk/src/main/java/cc/kune/core/server/tool/ServerToolRegistry.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/core/server/tool/ServerToolRegistry.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -87,12 +87,13 @@
}
public void register(final ServerTool tool) {
+ final String name = tool.getName();
+ final String rootName = tool.getRootName();
if (tool.getName().equals(TrashToolConstants.NAME)) {
- // Trash is a special tool but we don't register it
+ tools.put(name, tool);
+ // Trash is a special tool but we don't register it fully
return;
}
- final String name = tool.getName();
- final String rootName = tool.getRootName();
final boolean userAvailable = usersAvailableToolsInProp.contains(name);
final boolean groupAvailable = groupsAvailableToolsInProp.contains(name);
if (userAvailable && usersRegisEnabledToolsInProp.contains(name)) {
Modified: trunk/src/main/java/cc/kune/docs/KuneDocs.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/docs/KuneDocs.gwt.xml 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/docs/KuneDocs.gwt.xml 2012-03-18 22:25:32 UTC (rev 1771)
@@ -1,6 +1,6 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/src/gwt-module.dtd">
-<module>
- <inherits name="cc.kune.core.KuneCore" />
- <source path="client" />
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/src/gwt-module.dtd">
+<module>
+ <inherits name="cc.kune.core.KuneCore" />
+ <source path="client" />
<source path="shared" />
</module>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/docs/client/DocsClientTool.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -28,6 +28,7 @@
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.client.resources.iconic.IconicResources;
import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.docs.shared.DocsToolConstants;
import cc.kune.gspace.client.tool.FoldableAbstractClientTool;
import cc.kune.gspace.client.tool.selector.ToolSelector;
@@ -47,7 +48,7 @@
NAME,
i18n.t(DocsToolConstants.ROOT_NAME),
i18n.t("Here you can create or upload your personal, group or public documents. These documents can be edited and commented collaboratively and simultaneously. These docs can be static pages in your web page if you publish them"),
- icons.docs(), toolSelector, cntCapRegistry, i18n, navResources);
+ icons.docs(), AccessRolDTO.Viewer, toolSelector, cntCapRegistry, i18n, navResources);
this.icons = icons;
// registerAclEditableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
Modified: trunk/src/main/java/cc/kune/events/KuneEvents.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/events/KuneEvents.gwt.xml 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/events/KuneEvents.gwt.xml 2012-03-18 22:25:32 UTC (rev 1771)
@@ -1,13 +1,13 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/src/gwt-module.dtd">
-<module>
- <inherits name="cc.kune.core.KuneCore"/>
- <source path="client"/>
- <source path="shared"/>
- <inherits name='com.bradrydzewski.gwt.calendar.Calendar'/>
- <inherits name='com.bradrydzewski.gwt.calendar.theme.google.Google'/>
- <inherits name='com.allen_sauer.gwt.dnd.gwt-dnd'/>
- <source path='client'
- excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java" />
- <source path='shared'
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/src/gwt-module.dtd">
+<module>
+ <inherits name="cc.kune.core.KuneCore"/>
+ <source path="client"/>
+ <source path="shared"/>
+ <inherits name='com.bradrydzewski.gwt.calendar.Calendar'/>
+ <inherits name='com.bradrydzewski.gwt.calendar.theme.google.Google'/>
+ <inherits name='com.allen_sauer.gwt.dnd.gwt-dnd'/>
+ <source path='client'
excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java" />
+ <source path='shared'
+ excludes="**/*Test.java,**/*Tests.java,**/*MockProvider.java" />
</module>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/events/client/EventsClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/EventsClientTool.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/events/client/EventsClientTool.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -27,6 +27,7 @@
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.client.resources.iconic.IconicResources;
import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.gspace.client.tool.FoldableAbstractClientTool;
import cc.kune.gspace.client.tool.selector.ToolSelector;
@@ -41,7 +42,7 @@
final ContentCapabilitiesRegistry cntCapRegistry, final NavResources navResources,
final IconicResources icons) {
super(NAME, i18n.t(ROOT_NAME), i18n.t("A calendar to schedule activities and events"),
- icons.events(), toolSelector, cntCapRegistry, i18n, navResources);
+ icons.events(), AccessRolDTO.Viewer, toolSelector, cntCapRegistry, i18n, navResources);
this.icons = icons;
// registerAclEditableTypes(TYPE_DOCUMENT, TYPE_UPLOADEDFILE);
Modified: trunk/src/main/java/cc/kune/events/client/actions/EventRemoveMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/events/client/actions/EventRemoveMenuItem.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/events/client/actions/EventRemoveMenuItem.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -2,14 +2,12 @@
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.ui.dialogs.PromptTopDialog;
import cc.kune.common.shared.i18n.I18nTranslationService;
-import cc.kune.common.shared.utils.TextUtils;
import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.rpcservices.ContentServiceHelper;
import cc.kune.core.client.state.AccessRightsClientManager;
import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
+import cc.kune.core.shared.domain.utils.StateToken;
import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.events.client.viewer.CalendarViewer;
@@ -22,22 +20,21 @@
public class EventRemoveMenuItem extends MenuItemDescriptor {
public static class EventEditAction extends CalendarRolAction {
private final Provider<CalendarViewer> calendar;
- private PromptTopDialog dialog;
- private final I18nTranslationService i18n;
+ private final ContentServiceHelper contentService;
@Inject
- public EventEditAction(final CoreResources res, final I18nTranslationService i18n,
- final Provider<CalendarViewer> calendar, final EventBus eventBus, final Session session,
- final StateManager stateManager, final AccessRightsClientManager rightsMan) {
+ public EventEditAction(final CoreResources res, final Provider<CalendarViewer> calendar,
+ final EventBus eventBus, final Session session, final I18nTranslationService i18n,
+ final AccessRightsClientManager rightsMan, final ContentServiceHelper contentService) {
super(eventBus, session, calendar, AccessRolDTO.Administrator, true, true);
- this.i18n = i18n;
this.calendar = calendar;
+ this.contentService = contentService;
withText(i18n.t("Remove this appointment")).withIcon(res.cancel());
}
@Override
public void actionPerformed(final ActionEvent event) {
- NotifyUser.info(i18n.t(TextUtils.IN_DEVELOPMENT));
+ contentService.delContent(new StateToken(calendar.get().getAppToEdit().getId()));
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/actions/DelContentMenuItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/actions/DelContentMenuItem.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/gspace/client/actions/DelContentMenuItem.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -21,70 +21,31 @@
import cc.kune.common.client.actions.ActionEvent;
import cc.kune.common.client.actions.ui.descrip.MenuItemDescriptor;
-import cc.kune.common.client.notify.ConfirmAskEvent;
-import cc.kune.common.client.notify.NotifyUser;
-import cc.kune.common.client.utils.OnAcceptCallback;
import cc.kune.common.shared.i18n.I18nTranslationService;
import cc.kune.core.client.actions.RolAction;
import cc.kune.core.client.resources.CoreResources;
-import cc.kune.core.client.rpcservices.AsyncCallbackSimple;
-import cc.kune.core.client.rpcservices.ContentServiceAsync;
-import cc.kune.core.client.state.Session;
-import cc.kune.core.client.state.StateManager;
-import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.client.rpcservices.ContentServiceHelper;
import cc.kune.core.shared.dto.AbstractContentSimpleDTO;
import cc.kune.core.shared.dto.AccessRolDTO;
-import cc.kune.core.shared.dto.StateContainerDTO;
-import com.google.gwt.event.shared.EventBus;
import com.google.inject.Inject;
-import com.google.inject.Provider;
public class DelContentMenuItem extends MenuItemDescriptor {
public static class DelContentAction extends RolAction {
- private final Provider<ContentServiceAsync> contentService;
- private final EventBus eventBus;
- private final I18nTranslationService i18n;
- private final Session session;
- private final StateManager stateManager;
+ private final ContentServiceHelper contentService;
@Inject
- public DelContentAction(final EventBus eventBus, final StateManager stateManager,
- final Session session, final Provider<ContentServiceAsync> contentService,
- final I18nTranslationService i18n) {
+ public DelContentAction(final ContentServiceHelper contentService) {
super(AccessRolDTO.Administrator, true);
- this.eventBus = eventBus;
- this.stateManager = stateManager;
- this.session = session;
this.contentService = contentService;
- this.i18n = i18n;
+
}
@Override
public void actionPerformed(final ActionEvent event) {
- final StateToken token = ((AbstractContentSimpleDTO) event.getTarget()).getStateToken();
- ConfirmAskEvent.fire(eventBus, i18n.t("Please confirm"), i18n.t("Are you sure?"), i18n.t("Yes"),
- i18n.t("No"), null, null, new OnAcceptCallback() {
- @Override
- public void onSuccess() {
- NotifyUser.showProgress();
- contentService.get().delContent(session.getUserHash(), token,
- new AsyncCallbackSimple<StateContainerDTO>() {
- @Override
- public void onSuccess(final StateContainerDTO state) {
- final StateToken parentToken = state.getStateToken();
- if (session.getCurrentStateToken().equals(parentToken)) {
- stateManager.setRetrievedStateAndGo(state);
- } else {
- stateManager.gotoStateToken(parentToken, false);
- }
- NotifyUser.hideProgress();
- }
- });
- }
- });
+ contentService.delContent(((AbstractContentSimpleDTO) event.getTarget()).getStateToken());
}
}
Modified: trunk/src/main/java/cc/kune/gspace/client/tool/AbstractClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/AbstractClientTool.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/AbstractClientTool.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -19,6 +19,7 @@
*/
package cc.kune.gspace.client.tool;
+import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.gspace.client.tool.selector.ToolSelector;
import cc.kune.gspace.client.tool.selector.ToolSelectorItemPanel;
import cc.kune.gspace.client.tool.selector.ToolSelectorItemPresenter;
@@ -28,9 +29,9 @@
public abstract class AbstractClientTool {
public AbstractClientTool(final String shortName, final String longName, final String tooltip,
- final ImageResource icon, final ToolSelector toolSelector) {
+ final ImageResource icon, final AccessRolDTO visibleForRol, final ToolSelector toolSelector) {
final ToolSelectorItemPresenter presenter = new ToolSelectorItemPresenter(shortName, longName,
- tooltip, toolSelector);
+ tooltip, visibleForRol, toolSelector);
final ToolSelectorItemPanel panel = new ToolSelectorItemPanel(shortName, icon);
presenter.init(panel);
}
Modified: trunk/src/main/java/cc/kune/gspace/client/tool/FoldableAbstractClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/FoldableAbstractClientTool.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/FoldableAbstractClientTool.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -24,6 +24,7 @@
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.client.resources.nav.NavResources;
import cc.kune.core.shared.domain.ContentStatus;
+import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.core.shared.dto.BasicMimeTypeDTO;
import cc.kune.gspace.client.tool.selector.ToolSelector;
@@ -37,10 +38,10 @@
protected final NavResources navResources;
public FoldableAbstractClientTool(final String shortName, final String longName, final String tooltip,
- final ImageResource icon, final ToolSelector toolSelector,
+ final ImageResource icon, final AccessRolDTO visibleForRol, final ToolSelector toolSelector,
final ContentCapabilitiesRegistry contentCapabilitiesRegistry, final I18nTranslationService i18n,
final NavResources navResources) {
- super(shortName, longName, tooltip, icon, toolSelector);
+ super(shortName, longName, tooltip, icon, visibleForRol, toolSelector);
this.contentCapabilitiesRegistry = contentCapabilitiesRegistry;
this.i18n = i18n;
this.navResources = navResources;
Modified: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItem.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItem.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItem.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -20,10 +20,13 @@
package cc.kune.gspace.client.tool.selector;
import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.gspace.client.tool.selector.ToolSelectorItemPresenter.ToolSelectorItemView;
public interface ToolSelectorItem {
+ AccessRolDTO getVisibleForRol();
+
String getShortName();
ToolSelectorItemView getView();
Modified: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPresenter.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorItemPresenter.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -20,6 +20,7 @@
package cc.kune.gspace.client.tool.selector;
import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.AccessRolDTO;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
@@ -43,6 +44,7 @@
}
private final String longName;
+ private final AccessRolDTO visibleFoRol;
private final String shortName;
private StateToken token;
private final ToolSelector toolSelector;
@@ -50,14 +52,20 @@
private ToolSelectorItemView view;
public ToolSelectorItemPresenter(final String shortName, final String longName, final String tooltip,
- final ToolSelector toolSelector) {
+ final AccessRolDTO visibleForRol, final ToolSelector toolSelector) {
this.shortName = shortName;
this.longName = longName;
this.tooltip = tooltip;
+ this.visibleFoRol = visibleForRol;
this.toolSelector = toolSelector;
}
@Override
+ public AccessRolDTO getVisibleForRol() {
+ return visibleFoRol;
+ }
+
+ @Override
public String getShortName() {
return shortName;
}
Modified: trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/gspace/client/tool/selector/ToolSelectorPresenter.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -25,14 +25,16 @@
import cc.kune.common.client.errors.UIException;
import cc.kune.common.client.log.Log;
import cc.kune.common.shared.utils.TextUtils;
+import cc.kune.core.client.actions.RolComparator;
import cc.kune.core.client.events.GroupChangedEvent;
+import cc.kune.core.client.events.GroupChangedEvent.GroupChangedHandler;
import cc.kune.core.client.events.StateChangedEvent;
+import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
import cc.kune.core.client.events.ToolChangedEvent;
-import cc.kune.core.client.events.GroupChangedEvent.GroupChangedHandler;
-import cc.kune.core.client.events.StateChangedEvent.StateChangedHandler;
import cc.kune.core.client.events.ToolChangedEvent.ToolChangedHandler;
import cc.kune.core.client.state.StateManager;
import cc.kune.core.shared.domain.utils.StateToken;
+import cc.kune.core.shared.dto.StateAbstractDTO;
import cc.kune.gspace.client.tool.selector.ToolSelectorItemPresenter.ToolSelectorItemView;
import com.google.gwt.event.shared.EventBus;
@@ -65,12 +67,15 @@
stateManager.onStateChanged(true, new StateChangedHandler() {
@Override
public void onStateChanged(final StateChangedEvent event) {
- for (final String tool : tools.keySet()) {
- final List<String> enabledTools = event.getState().getEnabledTools();
- if (enabledTools != null && enabledTools.contains(tool)) {
- tools.get(tool).setVisible(true);
+ for (final String toolName : tools.keySet()) {
+ final StateAbstractDTO state = event.getState();
+ final List<String> enabledTools = state.getEnabledTools();
+ if (enabledTools != null && enabledTools.contains(toolName)) {
+ final ToolSelectorItem tool = tools.get(toolName);
+ // Set visible only when allowed
+ tool.setVisible(RolComparator.isEnabled(tool.getVisibleForRol(), state.getGroupRights()));
} else {
- tools.get(tool).setVisible(false);
+ tools.get(toolName).setVisible(false);
}
}
}
@@ -101,7 +106,9 @@
}
tools.put(name, item);
item.setSelected(false);
+ // if (!name.equals(TrashToolConstants.NAME)) {
getView().addItem(item.getView());
+ // }
}
private void checkTool(final ToolSelectorItem tool) {
Modified: trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java
===================================================================
--- trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/gspace/client/viewers/FolderViewerUtils.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -26,6 +26,7 @@
import cc.kune.gspace.client.actions.ShowHelpContainerEvent;
import cc.kune.gspace.client.viewers.FolderViewerPresenter.FolderViewerView;
import cc.kune.gspace.client.viewers.items.FolderItemDescriptor;
+import cc.kune.trash.shared.TrashToolConstants;
import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
@@ -83,10 +84,13 @@
typeId, status);
final String tooltip = getTooltip(stateToken, mimeType,
capabReg.isDragable(typeId) && rights.isAdministrable());
- if (status.equals(ContentStatus.inTheDustbin)
- && (!capabReg.showDeleted(typeId) && !session.getShowDeletedContent())) {
+ final boolean thisTypeShouldShowDelete = capabReg.showDeleted(typeId)
+ || parentStateToken.getTool().equals(TrashToolConstants.NAME);
+ final boolean showAllDeleted = session.getShowDeletedContent();
+ if (status.equals(ContentStatus.inTheDustbin) && !(thisTypeShouldShowDelete || showAllDeleted)) {
// Don't show
- // NotifyUser.info("Deleted, don't show");
+ // NotifyUser.info("Deleted, don't show: " + parentStateToken + " " +
+ // thisTypeShouldShowDelete);
} else {
final FolderItemDescriptor item = new FolderItemDescriptor(genId(stateToken),
genId(parentStateToken), icon, name, tooltip, status, stateToken, modifiedOn,
Modified: trunk/src/main/java/cc/kune/lists/client/ListsClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/lists/client/ListsClientTool.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/lists/client/ListsClientTool.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -28,6 +28,7 @@
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.client.resources.iconic.IconicResources;
import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.gspace.client.tool.FoldableAbstractClientTool;
import cc.kune.gspace.client.tool.selector.ToolSelector;
@@ -45,7 +46,7 @@
NAME,
i18n.t(ROOT_NAME),
i18n.t("Lists behave like a mailing list or a forum. You can subscribe and discuss about specific topics"),
- icons.lists(), toolSelector, cntCapRegistry, i18n, navResources);
+ icons.lists(), AccessRolDTO.Viewer, toolSelector, cntCapRegistry, i18n, navResources);
this.icons = icons;
// registerAclEditableTypes();
Modified: trunk/src/main/java/cc/kune/tasks/KuneTasks.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/tasks/KuneTasks.gwt.xml 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/tasks/KuneTasks.gwt.xml 2012-03-18 22:25:32 UTC (rev 1771)
@@ -1,6 +1,6 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/src/gwt-module.dtd">
-<module>
- <inherits name="cc.kune.core.KuneCore" />
- <source path="client" />
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/src/gwt-module.dtd">
+<module>
+ <inherits name="cc.kune.core.KuneCore" />
+ <source path="client" />
<source path="shared" />
</module>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/tasks/client/TasksClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/tasks/client/TasksClientTool.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/tasks/client/TasksClientTool.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -29,6 +29,7 @@
import cc.kune.core.client.resources.iconic.IconicResources;
import cc.kune.core.client.resources.nav.NavResources;
import cc.kune.core.shared.domain.ContentStatus;
+import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.gspace.client.tool.FoldableAbstractClientTool;
import cc.kune.gspace.client.tool.selector.ToolSelector;
@@ -47,7 +48,7 @@
NAME,
i18n.t(ROOT_NAME),
i18n.t("A collaborative TO-DO list for the group. Any group-member can participate in any proposed task, add others to a task, comment them, add info, etc"),
- icons.tasks(), toolSelector, cntCapRegistry, i18n, navResources);
+ icons.tasks(), AccessRolDTO.Viewer, toolSelector, cntCapRegistry, i18n, navResources);
this.icons = icons;
// registerAclEditableTypes();
Added: trunk/src/main/java/cc/kune/trash/KuneTrash.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/trash/KuneTrash.gwt.xml (rev 0)
+++ trunk/src/main/java/cc/kune/trash/KuneTrash.gwt.xml 2012-03-18 22:25:32 UTC (rev 1771)
@@ -0,0 +1,6 @@
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/src/gwt-module.dtd">
+<module>
+ <inherits name="cc.kune.core.KuneCore" />
+ <source path="client" />
+ <source path="shared" />
+</module>
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/trash/client/TrashClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/trash/client/TrashClientTool.java (rev 0)
+++ trunk/src/main/java/cc/kune/trash/client/TrashClientTool.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -0,0 +1,73 @@
+/*
+ *
+ * Copyright (C) 2007-2009 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 cc.kune.trash.client;
+
+import static cc.kune.trash.shared.TrashToolConstants.NAME;
+import static cc.kune.trash.shared.TrashToolConstants.ROOT_NAME;
+import static cc.kune.trash.shared.TrashToolConstants.TYPE_ROOT;
+import cc.kune.common.shared.i18n.I18nTranslationService;
+import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.dto.AccessRolDTO;
+import cc.kune.gspace.client.tool.FoldableAbstractClientTool;
+import cc.kune.gspace.client.tool.selector.ToolSelector;
+
+import com.google.inject.Inject;
+
+public class TrashClientTool extends FoldableAbstractClientTool {
+
+ private static final String EMPTY = "The trash is empty";
+ private final CoreResources res;
+
+ @Inject
+ public TrashClientTool(final I18nTranslationService i18n, final ToolSelector toolSelector,
+ final ContentCapabilitiesRegistry cntCapRegistry, final CoreResources res,
+ final NavResources navResources) {
+ super(NAME, i18n.t(ROOT_NAME), "", res.trashWhite(), AccessRolDTO.Administrator, toolSelector,
+ cntCapRegistry, i18n, navResources);
+ this.res = res;
+
+ // registerAclEditableTypes();
+ registerAuthorableTypes();
+ registerDragableTypes();
+ registerDropableTypes(TYPE_ROOT);
+ registerPublishModerableTypes();
+ registerRateableTypes();
+ registerRenamableTypes();
+ registerTageableTypes();
+ // registerTranslatableTypes();
+ registerIcons();
+ }
+
+ @Override
+ public String getName() {
+ return NAME;
+ }
+
+ private void registerIcons() {
+ registerContentTypeIcon(TYPE_ROOT, res.trashBlack());
+ final String trashEmpty = i18n.t(EMPTY);
+ registerEmptyMessages(TYPE_ROOT, trashEmpty);
+ registerEmptyMessagesNotLogged(TYPE_ROOT, trashEmpty);
+ registerShowDeleted(TYPE_ROOT);
+ }
+
+}
Added: trunk/src/main/java/cc/kune/trash/client/TrashGinModule.java
===================================================================
--- trunk/src/main/java/cc/kune/trash/client/TrashGinModule.java (rev 0)
+++ trunk/src/main/java/cc/kune/trash/client/TrashGinModule.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -0,0 +1,33 @@
+/*
+ *
+ * Copyright (C) 2007-2011 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 cc.kune.trash.client;
+
+import cc.kune.core.client.ExtendedGinModule;
+import cc.kune.trash.client.actions.TrashClientActions;
+
+public class TrashGinModule extends ExtendedGinModule {
+
+ @Override
+ protected void configure() {
+ s(TrashClientTool.class);
+ s(TrashClientActions.class);
+ }
+
+}
Added: trunk/src/main/java/cc/kune/trash/client/TrashGinjector.java
===================================================================
--- trunk/src/main/java/cc/kune/trash/client/TrashGinjector.java (rev 0)
+++ trunk/src/main/java/cc/kune/trash/client/TrashGinjector.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -0,0 +1,28 @@
+/*
+ *
+ * Copyright (C) 2007-2011 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 cc.kune.trash.client;
+
+import com.google.gwt.inject.client.Ginjector;
+
+public interface TrashGinjector extends Ginjector {
+
+ TrashParts getTrashParts();
+
+}
Added: trunk/src/main/java/cc/kune/trash/client/TrashParts.java
===================================================================
--- trunk/src/main/java/cc/kune/trash/client/TrashParts.java (rev 0)
+++ trunk/src/main/java/cc/kune/trash/client/TrashParts.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -0,0 +1,41 @@
+/*
+ *
+ * Copyright (C) 2007-2011 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 cc.kune.trash.client;
+
+import cc.kune.core.shared.SessionConstants;
+import cc.kune.gspace.client.tool.ContentViewerSelector;
+import cc.kune.gspace.client.viewers.ContentViewerPresenter;
+import cc.kune.gspace.client.viewers.FolderViewerPresenter;
+import cc.kune.trash.client.actions.TrashClientActions;
+import cc.kune.trash.shared.TrashToolConstants;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class TrashParts {
+
+ @Inject
+ public TrashParts(final SessionConstants session, final Provider<TrashClientTool> clientTool,
+ final ContentViewerSelector viewerSelector, final TrashClientActions trashActions,
+ final ContentViewerPresenter contentViewer, final FolderViewerPresenter folderViewer) {
+ clientTool.get();
+ viewerSelector.register(folderViewer, true, TrashToolConstants.TYPE_ROOT);
+ }
+}
\ No newline at end of file
Added: trunk/src/main/java/cc/kune/trash/client/actions/TrashClientActions.java
===================================================================
--- trunk/src/main/java/cc/kune/trash/client/actions/TrashClientActions.java (rev 0)
+++ trunk/src/main/java/cc/kune/trash/client/actions/TrashClientActions.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -0,0 +1,42 @@
+package cc.kune.trash.client.actions;
+
+import static cc.kune.trash.shared.TrashToolConstants.TYPE_ROOT;
+import cc.kune.chat.client.actions.GoParentChatBtn;
+import cc.kune.core.client.actions.ActionRegistryByType;
+import cc.kune.core.client.i18n.I18nUITranslationService;
+import cc.kune.core.client.resources.CoreResources;
+import cc.kune.core.client.state.Session;
+import cc.kune.core.client.state.StateManager;
+import cc.kune.gspace.client.actions.AbstractFoldableToolActions;
+import cc.kune.gspace.client.actions.ActionGroups;
+import cc.kune.gspace.client.actions.ContentViewerOptionsMenu;
+import cc.kune.gspace.client.actions.RefreshContentMenuItem;
+
+import com.google.inject.Inject;
+import com.google.inject.Provider;
+
+public class TrashClientActions extends AbstractFoldableToolActions {
+
+ final String[] all = { TYPE_ROOT };
+ final String[] containers = { TYPE_ROOT };
+ final String[] containersNoRoot = {};
+ final String[] contents = {};
+
+ @Inject
+ public TrashClientActions(final I18nUITranslationService i18n, final Session session,
+ final StateManager stateManager, final ActionRegistryByType registry, final CoreResources res,
+ final Provider<RefreshContentMenuItem> refresh, final Provider<GoParentChatBtn> folderGoUp,
+ final Provider<ContentViewerOptionsMenu> optionsMenuContent) {
+ super(session, stateManager, i18n, registry);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, optionsMenuContent, all);
+ actionsRegistry.addAction(ActionGroups.TOOLBAR, refresh, all);
+ // actionsRegistry.addAction(ActionGroups.TOOLBAR, folderGoUp,
+ // DocsToolConstants.TYPE_DOCUMENT);
+ // actionsRegistry.addAction(ActionGroups.ITEM_MENU, action,
+ // containersNoRoot);
+ }
+
+ @Override
+ protected void createPostSessionInitActions() {
+ }
+}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/trash/server/TrashServerTool.java
===================================================================
--- trunk/src/main/java/cc/kune/trash/server/TrashServerTool.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/trash/server/TrashServerTool.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -14,6 +14,11 @@
import cc.kune.core.server.content.CreationService;
import cc.kune.core.server.manager.ToolConfigurationManager;
import cc.kune.core.server.tool.ServerToolTarget;
+import cc.kune.core.shared.domain.ContentStatus;
+import cc.kune.core.shared.domain.GroupListMode;
+import cc.kune.domain.AccessLists;
+import cc.kune.domain.Container;
+import cc.kune.domain.Content;
import cc.kune.domain.Group;
import cc.kune.domain.User;
@@ -39,4 +44,20 @@
createRoot(group);
return group;
}
+
+ @Override
+ public void onCreateContent(final Content content, final Container parent) {
+ content.setStatus(ContentStatus.inTheDustbin);
+ super.onCreateContent(content, parent);
+ }
+
+ @Override
+ protected void setContainerAcl(final Container container) {
+ final AccessLists wikiAcl = new AccessLists();
+ wikiAcl.getAdmins().setMode(GroupListMode.NORMAL);
+ wikiAcl.getAdmins().add(container.getOwner());
+ wikiAcl.getEditors().setMode(GroupListMode.NORMAL);
+ wikiAcl.getViewers().setMode(GroupListMode.NORMAL);
+ setAccessList(container, wikiAcl);
+ }
}
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/trash/shared/TrashToolConstants.java
===================================================================
--- trunk/src/main/java/cc/kune/trash/shared/TrashToolConstants.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/trash/shared/TrashToolConstants.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -1,17 +1,11 @@
package cc.kune.trash.shared;
-
public final class TrashToolConstants {
public static final String NAME = "trash";
public static final String ROOT_NAME = "trash";
public static final String TYPE_ROOT = NAME + "." + "root";
- // public static final String[] ALLOWED_CONTENTS =
- // {DocsToolConstants.TYPE_FOLDER,
- // DocsToolConstants.TYPE_DOCUMENT, BlogsToolConstants.TYPE_BLOG,
- // BlogsToolConstants.TYPE_POST, ETC
- // };
private TrashToolConstants() {
}
}
Modified: trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveServiceDefault.java
===================================================================
--- trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveServiceDefault.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/wave/server/kspecific/KuneWaveServiceDefault.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -66,7 +66,6 @@
import com.google.wave.api.BlipThread;
import com.google.wave.api.Element;
import com.google.wave.api.ElementType;
-import com.google.wave.api.FormElement;
import com.google.wave.api.Gadget;
import com.google.wave.api.JsonRpcConstant.ParamsProperty;
import com.google.wave.api.JsonRpcResponse;
@@ -127,9 +126,11 @@
for (final Entry<Integer, Element> entry : fromBlip.getElements().entrySet()) {
final ElementType type = entry.getValue().getType();
Element result = null;
- if (FormElement.getFormElementTypes().contains(type)) {
- result = new FormElement(type, entry.getValue().getProperties());
- } else if (type == ElementType.GADGET) {
+ // if (FormElement.getFormElementTypes().contains(type)) {
+ // result = new FormElement(type, entry.getValue().getProperties());
+ // } else
+
+ if (type == ElementType.GADGET) {
result = new Gadget(entry.getValue().getProperties());
// } else if (type == ElementType.IMAGE) {
// result = new Image(entry.getValue().getProperties());
@@ -271,7 +272,7 @@
participantsArray[0].toString());
if (waveletToCopy != null) {
copyWavelet(waveletToCopy.getRootBlip(), rootBlip);
- copyWaveletElements(waveletToCopy.getRootBlip(), rootBlip);
+ // copyWaveletElements(waveletToCopy.getRootBlip(), rootBlip);
}
} catch (final DefaultException e2) {
LOG.error("Error copying wave content", e2);
Modified: trunk/src/main/java/cc/kune/wiki/KuneWiki.gwt.xml
===================================================================
--- trunk/src/main/java/cc/kune/wiki/KuneWiki.gwt.xml 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/wiki/KuneWiki.gwt.xml 2012-03-18 22:25:32 UTC (rev 1771)
@@ -1,6 +1,6 @@
-<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/src/gwt-module.dtd">
-<module>
- <inherits name="cc.kune.core.KuneCore" />
- <source path="client" />
+<!DOCTYPE module PUBLIC "-//Google Inc.//DTD Google Web Toolkit 2.1.0//EN" "http://google-web-toolkit.googlecode.com/svn/tags/2.1.0/distro-source/core/src/gwt-module.dtd">
+<module>
+ <inherits name="cc.kune.core.KuneCore" />
+ <source path="client" />
<source path="shared" />
</module>
\ No newline at end of file
Modified: trunk/src/main/java/cc/kune/wiki/client/WikiClientTool.java
===================================================================
--- trunk/src/main/java/cc/kune/wiki/client/WikiClientTool.java 2012-03-18 20:18:29 UTC (rev 1770)
+++ trunk/src/main/java/cc/kune/wiki/client/WikiClientTool.java 2012-03-18 22:25:32 UTC (rev 1771)
@@ -28,6 +28,7 @@
import cc.kune.core.client.registry.ContentCapabilitiesRegistry;
import cc.kune.core.client.resources.iconic.IconicResources;
import cc.kune.core.client.resources.nav.NavResources;
+import cc.kune.core.shared.dto.AccessRolDTO;
import cc.kune.gspace.client.tool.FoldableAbstractClientTool;
import cc.kune.gspace.client.tool.selector.ToolSelector;
@@ -47,7 +48,8 @@
i18n.t("wiki"),
i18n.t(
"Wiki-pages are Documents that can be edited by any visitor (in [%s]), instead of only by the group. This accelerates updating and construction",
- i18n.getSiteCommonName()), icons.wikis(), toolSelector, cntCapRegistry, i18n, navResources);
+ i18n.getSiteCommonName()), icons.wikis(), AccessRolDTO.Viewer, toolSelector, cntCapRegistry,
+ i18n, navResources);
this.icons = icons;
registerAuthorableTypes(TYPE_WIKIPAGE, TYPE_UPLOADEDFILE);
Added: trunk/src/main/resources/icons/trash-black.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/trash-black.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
Added: trunk/src/main/resources/icons/trash-white.png
===================================================================
(Binary files differ)
Property changes on: trunk/src/main/resources/icons/trash-white.png
___________________________________________________________________
Name: svn:mime-type
+ application/octet-stream
More information about the kune-commits
mailing list